Create a new ViewersGrid inside the HTML element with the given
HTML element or string 'id' of the element where viewer should live
EnvironmentIndexer used to translate indexes from environments index to structure/atom indexes
list of structure to display
list of atom-centered environments in the structures, used to highlight the selected environment
maximum number of allowed structure viewers
Callback fired when the playback delay for structure/atom playback changed
the new delay value
Callback used when a new structure should be loaded
By default, this assumes that the loaded dataset contains Structure directly, and returns the data from there. If the loaded dataset contains UserStructure instead, this callback should be set to transform from data in data to a Structure.
The callback gets two parameter: the structure index (0-based); and the full UserStructure.
Set a callback to get the initial positioning of the settings modal of the viewers. The same callback is used for all viewers in the grid.
The callback gets the current placement of the settings as a
should return top and left positions in pixels, used with
position: fixed. The callback is called once, the first time the settings are
Apply the given saved setting to all viewers in the grid.
The settings must be in viewer creation order.
settings for all viewers in the grid
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.
Get the current list of environments showed inside the different viewer
Remove all HTML added by this ViewersGrid in the current document
Removes the viewer with the given
guid from the viewer grid.
GUID of the viewer to remove
Function to set the active widget for communicating with the map
Show a new structure, as identified by
indexes in the active viewer.
This will switch to the structure at index
indexes.structure, and if
environments where passed to the constructor and the current display
'atom', highlight the atom-centered environment corresponding
structure / atom pair to display