Class DefaultVisualizer

The default visualization state of chemiscope: three panels (map, structure, info) updating one another when the user interact with any of them.

Properties

structure: ViewersGrid

Methods

  • Apply the given settings to all panels in the visualizer

    Parameters

    • settings: Partial<Settings>

      settings for all panels

    Returns void

  • Get the dataset used to create the current visualization

    If the dataset is using user-specified structures and a loading callback DefaultConfig.loadStructure; you can request all structure to be fully resolved and placed inside the dataset.

    Parameters

    • getStructures: boolean = false

      should all UserStructure resolved and placed inside the dataset?

    Returns Dataset

    the dataset currently visualized

  • 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

  • Removes all the chemiscope widgets from the DOM

    Returns void

  • Load a dataset and create a visualizer.

    This function returns a Promise<DefaultVisualizer> to prevent blocking the browser while everything is loading.

    Parameters

    • config: DefaultConfig

      configuration of the visualizer

    • dataset: Dataset

      visualizer input, containing a dataset and optional visualization settings

    Returns Promise<DefaultVisualizer>

    Promise that resolves to a DefaultVisualizer