Class PropertiesMap

The PropertiesMap class displays a 2D or 3D map (scatter plot) of properties in the dataset, using plotly.js for rendering.

Properties can be used as x, y, or z values, as well as points color and size. Additionally, string properties can be used as symbols for the scatter plot markers.

Constructors

  • Create a new PropertiesMap inside the DOM element with the given HTML id

    Parameters

    • element: string | HTMLElement

      HTML element or string 'id' of the element where the map should live

    • settings: Settings

      settings for all panels

    • indexer: EnvironmentIndexer

      EnvironmentIndexer used to translate indexes from environments index to structure/atom indexes

    • target: DisplayTarget

      widget display target, either stucture or atom

    • properties: {
          [name: string]: Property;
      }

      properties to be displayed

    Returns PropertiesMap

Properties

activeChanged: ((guid: GUID, indexes: Indexes) => void)

Callback fired when the active marker is changed by clicking on the map

Type declaration

    • (guid, indexes): void
    • Parameters

      • guid: GUID

        GUID of the new active marker

      • indexes: Indexes

        index of the environment the new active marker is showing

      Returns void

onselect: ((indexes: Indexes) => void)

Callback fired when the plot is clicked and the position of the active marker changes

positionSettingsModal: PositioningCallback

Callback to get the initial positioning of the settings modal.

The callback gets the current placement of the settings as a DOMRect, and should return top and left positions in pixels, used with position: fixed. The callback is called once, the first time the settings are opened.

Methods

  • Add a new marker to the map. The new marker is set as the active one

    Parameters

    • guid: GUID

      GUID of the new marker

    • color: string

      GUID of the marker indicating the new viewer

    • indexes: Indexes

      indexes of the environment that the new marker should show

    Returns void

  • Apply saved settings to the map.

    Parameters

    Returns void

  • 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: string[], value: unknown) => void)
        • (keys, value): void
        • Parameters

          • keys: string[]
          • value: unknown

          Returns void

    Returns void

  • Removes a marker from the map.

    Parameters

    • guid: GUID

      GUID of the marker to remove

    Returns void

  • Change the environment indicated by the currently active marker to the one with the given indexes

    Parameters

    Returns void

  • Set the marker with given GUID as the active marker.

    Parameters

    • guid: GUID

      the GUID of the new active viewer

    Returns void

  • Change display target and adapt the element to the new target

    Parameters

    Returns Promise<void>