Class StructureOptions

Hierarchy

  • OptionsGroup
    • StructureOptions

Constructors

Properties

atomLabels: HTMLOption<"boolean">
atoms: HTMLOption<"boolean">
axes: HTMLOption<"string">
bonds: HTMLOption<"boolean">
color: {
    max: HTMLOption<"number">;
    min: HTMLOption<"number">;
    palette: HTMLOption<"string">;
    property: HTMLOption<"string">;
    transform: HTMLOption<"string">;
}

Type declaration

  • max: HTMLOption<"number">
  • min: HTMLOption<"number">
  • palette: HTMLOption<"string">
  • property: HTMLOption<"string">
  • transform: HTMLOption<"string">
environments: {
    activated: HTMLOption<"boolean">;
    bgColor: HTMLOption<"string">;
    bgStyle: HTMLOption<"string">;
    center: HTMLOption<"boolean">;
    cutoff: HTMLOption<"number">;
}

Type declaration

  • activated: HTMLOption<"boolean">
  • bgColor: HTMLOption<"string">
  • bgStyle: HTMLOption<"string">
  • center: HTMLOption<"boolean">
  • cutoff: HTMLOption<"number">
keepOrientation: HTMLOption<"boolean">
playbackDelay: HTMLOption<"number">
rotation: HTMLOption<"boolean">
shape: HTMLOption<"string">
spaceFilling: HTMLOption<"boolean">
supercell: [HTMLOption<"int">, HTMLOption<"int">, HTMLOption<"int">]
unitCell: HTMLOption<"boolean">

Accessors

Methods

  • Applies saved settings, possibly filling in with default values

    Parameters

    Returns void

  • Call the given callback on each setting inside the given SettingGroup.

    Keys starting with an underscore character are ignored.

    Parameters

    • callback: OptionsCallback

      callback operating on a single setting

    Returns void

  • Get in a element in the modal from its id

    Type Parameters

    • T extends HTMLElement = HTMLElement

    Parameters

    • id: string

    Returns T

  • Add the given callback to be called whenever a setting changes. The callback will be given the path to the settings as a list of keys; and the new value of the setting.

    There is currently no way to remove a callback.

    Parameters

    • callback: ((keys, value) => void)
        • (keys, value): void
        • Parameters

          • keys: string[]
          • value: unknown

          Returns void

    Returns void

  • Remove all HTML added by this StructureSettings in the current document

    Returns void

  • Save the current values of all HTMLOption properties of the class, including nested ones.

    Properties which name starts with an underscore are ignored.

    Returns Settings

    An object with the same structure as this class containing the values of all settings.