cgexplore.utilities.write_chemiscope_json¶
- cgexplore.utilities.write_chemiscope_json(json_file, structures, properties, bonds_as_shapes, meta_dict, x_axis_dict, y_axis_dict, z_axis_dict, color_dict, bond_hex_colour='#fc5500')[source]¶
Write the chemiscope json.
- Parameters:
json_file (Path | str) – File to save to, this can be loaded into the chemiscope interface.
structures (Sequence[Molecule]) – Sequence of structures to include. If they do not have the same number of properties, they may not all be added.
properties (dict[str, Sequence[float | str | int]]) – Properties with name as key and list of property values ordered by structure as values.
bonds_as_shapes (bool) – True if you want to show the bonds as shapes, rather than bonds.
meta_dict (dict[str, str | list]) – Dictionary of meta information. See chemiscope for details, can include: name, description, authors, references.
x_axis_dict (dict[str, str]) – Dictionary of {“property”: “name-of-property”}. Value can be “” to be unused.
y_axis_dict (dict[str, str]) – Dictionary of {“property”: “name-of-property”}. Value can be “” to be unused.
z_axis_dict (dict[str, str]) – Dictionary of {“property”: “name-of-property”}. Value can be “” to be unused.
color_dict (dict[str, str | int | float]) – Dictionary of {“property”: “name-of-property”, “min”: float, “max”: float} to set the colour of data plot.
bond_hex_colour (str) – Colour for bonds made from shapes. Does not work if bonds_as_shapes=False.
- Return type:
None