Chemiscope JSON file format¶
This page documents the JSON file format used by chemiscope. These are the fields that
appear in the final JSON output file generated by Python functions like
chemiscope.write_input() or when manually constructing JSON data.
For instructions on how to create these JSON files using Python, see the Input creation with Python page.
The chemiscope JSON file consists of these top-level entries:
Key |
Description |
Required? |
|---|---|---|
|
Dataset metadata (name, authors, etc.) |
No |
|
List of atomic structures (coordinates, cell, bonds) |
Yes |
|
Properties mapped to atoms/structures (energy, forces, PCA, etc) |
Yes |
|
Custom shapes (spheres, arrows) to visualize in structures |
No |
|
Default visualization settings (map axes, colors, etc.) |
No |
|
Atom-centered neighborhoods |
No |
|
Parameters for multidimensional properties (e.g., time series) |
No |
Below is the detailed description of the values types and examples for each entry.
Metadata (meta)¶
Optional. Contains description of your dataset. The fields will be rendered as markdown.
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
string |
Short title of your dataset |
Yes |
|
|
string |
Detailed explanation of content/origin |
No |
|
|
string[] |
List of dataset authors |
No |
|
|
string[] |
Citations/links (one per array item) |
No |
|
Example:¶
"meta": {
"name": "MAD PCA",
"description": "1000 validation structures from the *MAD dataset* under PCA",
"authors": ["Author 1"],
"references": ["https://arxiv.org/abs/2506.19674"]
}
Properties (properties)¶
Required. Defines all dataset properties to be available for a display inside the widget. The field is a dictionary where each key is the property name (e.g., “energy”, “charge”) and each value is the property definition, either in full form (explicit dictionary with target and metadata) or short form (values only, target inferred from array length).
Full definition¶
Each property is a dictionary with the following fields:
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
string |
Scope of the property: |
Yes |
|
|
number[] | string[] | number[][] |
Values (scalars or arrays; see shapes below) |
Yes |
|
|
string |
Physical units of the values |
No |
|
|
string |
Property description |
No |
|
|
string[] |
For multidimensional: single parameter name (links to |
If multidimensional properties |
|
Example:
properties = {
"forces": {
"target": "atom",
"values": [[0.1, 0.0, -0.1], [0.2, -0.1, 0.0]],
"units": "eV/Å",
"description": "DFT-calculated forces"
}
}
Shortened definition¶
You can omit the dictionary and provide only the array of values. The target ("atom"
or "structure") is automatically inferred by comparing the array length to
n_atoms and n_structures.
Example:
properties = {
"energy": [-5.0, -4.8], # inferred as "structure" if 2 structures
}
If the number of atoms equals the number of structures, Chemiscope assumes
"structure" by default and issues a warning.
Value types and shapes¶
Type |
Format |
Details |
Example |
|---|---|---|---|
Scalar |
1D list or ndarray |
Length must match |
|
Multi-dimensional |
2D ndarray ( |
Generates multiple properties (e.g., |
|
Categorical |
List of strings |
Used for symbols setting |
|
Settings (settings)¶
Optional. Preconfigures the default visualization settings for the dataset, such as map
axes, colors, and structure viewer options. The settings field is a dictionary with
top-level keys for different panels.
Top-level settings¶
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
string |
Default view: |
No |
|
|
dict |
Map panel settings (axes, colors, etc.) |
No |
See below |
|
array[dict] |
Structure viewer settings (one dict per viewer; up to 9) |
No |
See below |
|
integer[] |
Indices of environments/structures to pin in viewers (up to 9; defaults to [0]) |
No |
|
Map settings (map)¶
Configures the scatter plot. Sub-keys for axes (x/y/z), color, size, etc.
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
dict |
Axis config: |
No |
|
|
dict |
Color config: like axis, plus |
No |
|
|
dict |
Size config: |
No |
|
|
string |
Property name for categorical symbols (string values) |
No |
|
|
bool |
Thin black outline on markers |
No |
|
|
bool |
Connect points with a thin black line (e.g., for trajectories) |
No |
|
Structure settings (structure)¶
Array of dicts (one per viewer).
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
bool |
Show bonds |
No |
true |
|
bool |
Show atoms |
No |
true |
|
bool |
Use space-filling representation |
No |
false |
|
bool |
Show atom labels |
No |
false |
|
string |
An environment property value for the atom labels |
No |
|
|
bool |
Show unit cell |
No |
true |
|
integer[3] |
Repetitions in a/b/c directions |
No |
|
|
bool |
Auto-rotate molecule |
No |
false |
|
string |
Axis system: |
No |
|
|
bool |
Maintain orientation when changing structures |
No |
true |
|
dict |
Environment options: |
No |
|
|
dict |
Atom coloring: |
No |
|
Examples¶
Basic 2D map with color:
"settings": {
"map": {
"x": {"property": "PCA[1]"},
"y": {"property": "PCA[2]"},
"z": {"property": ""},
"color": {"property": "energy"}
}
}
Trajectory mode with pinned structures:
"settings": {
"target": "structure",
"map": {"joinPoints": true},
"structure": [{
"keepOrientation": true,
"playbackDelay": 50
}],
"pinned": [0, 10, 20]
}
Environments (environments)¶
Optional. Specifies atom-centered environments for datasets where properties are associated with specific atoms rather than entire structures. Omitting this field defaults to structure-level visualization only.
The environments field is an array of objects, each defining an environment. To
generate, use helper function chemiscope.all_atomic_environments().
Environment definition¶
Each environment is a dictionary with:
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
integer |
0-based index of the structure in |
Yes |
0 |
|
integer |
0-based index of the central atom in the structure |
Yes |
8 |
|
number |
Spherical cutoff radius (in Å; must be > 0) |
Yes |
3.5 |
Examples¶
"environments": [
{"structure": 0, "center": 0, "cutoff": 3.5},
{"structure": 0, "center": 1, "cutoff": 3.5},
{"structure": 0, "center": 2, "cutoff": 3.5}
]
Shapes (shapes)¶
Optional. Defines custom 3D shapes (e.g., spheres, arrows) to overlay in the structure viewer. This is useful for visualizing additional features like atomic forces (as arrows), uncertainty ellipsoids, or custom meshes.
The shapes field is a dictionary where each key is a shape group name (e.g.,
“forces”), and the value is the shape group definition. Multiple groups can be defined
for different visualizations.
Shape group definition¶
Each shape group is a dictionary with the following fields:
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
string |
Shape type: |
Yes |
|
|
dict |
Parameters at different levels: |
Yes |
See below |
Parameter levels¶
Parameters are specified in a nested dictionary and merged from general to specific:
global: Dictionary of default parameters applied to all shapes in the group.structure: List of dictionaries, one per structure. Overridesglobalfor that structure.atom: Flat list of dictionaries, one per atom. Overridesstructureandglobalfor that atom.
Common parameters¶
These apply to any shape kind:
Parameter |
Type |
Description |
Required |
|---|---|---|---|
|
number[3] |
Center position (defaults to structure origin or atom position) |
No |
|
number |
Scaling factor for size |
No |
|
number[4] |
Rotation quaternion (x, y, z, w); ignored for |
No |
|
string | hex |
Color (e.g., |
No |
Kind-specific parameters¶
Each shape kind supports additional parameters (in addition to the common ones above).
Sphere
Parameter |
Type |
Description |
Required |
|---|---|---|---|
|
number |
Sphere radius. |
Yes |
Ellipsoid
Parameter |
Type |
Description |
Required |
|---|---|---|---|
|
number[3] |
Semi-axes lengths along x, y, z. |
Yes |
Cylinder
Parameter |
Type |
Description |
Required |
|---|---|---|---|
|
number[3] |
Direction and length; tip at vector end. |
Yes |
|
number |
Cylinder radius. |
Yes |
Arrow
Parameter |
Type |
Description |
Required |
|---|---|---|---|
|
number[3] |
Direction and length; tip at vector end. |
Yes |
|
number |
Shaft radius. |
Yes |
|
number |
Arrowhead radius. |
Yes |
|
number |
Arrowhead length; may extend beyond base if the vector is short. |
Yes |
Custom
Parameter |
Type |
Description |
Required |
|---|---|---|---|
|
number[N][3] |
List of vertex positions. |
Yes |
|
integer[M][3] |
Mesh triangulation indices. |
No |
Examples¶
Global spheres (same for all structures/atoms):
"shapes": {
"highlight_spheres": {
"kind": "sphere",
"parameters": {
"global": {"radius": 0.5, "color": "red"}
}
}
}
Per-atom arrows (e.g., for forces):
"shapes": {
"forces": {
"kind": "arrow",
"parameters": {
"global": {"baseRadius": 0.1, "headRadius": 0.2, "headLength": 0.3},
"atom": [ // length = total atoms
{"vector": [1.0, 0.0, 0.0]},
{"vector": [0.0, 1.0, 0.0]},
/* ... */
]
}
}
}
Custom mesh with per-structure scaling:
"shapes": {
"tetrahedron": {
"kind": "custom",
"parameters": {
"global": {
"vertices": [[0,0,0], [1,0,0], [0,1,0], [0,0,1]],
"simplices": [[0,1,2], [0,1,3], [0,2,3], [1,2,3]]
},
"structure": [ // length = number of structures
{"scale": 1.0},
{"scale": 2.0},
/* ... */
]
}
}
}
Structures (structures)¶
Required. Contains all atomic configurations in your dataset. In the most common use
case, it is automatically converted internally from a list of ASE.Atoms objects.
Each structure is represented as an object with the following fields:
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
integer |
Number of atoms in the structure |
Yes |
|
|
string[] |
Chemical symbols (length must match |
Yes |
|
|
number[] |
X coordinates (Å) |
Yes |
|
|
number[] |
Y coordinates (Å) |
Yes |
|
|
number[] |
Z coordinates (Å) |
Yes |
|
|
number[9] |
Unit cell vectors as |
No |
|
|
bool[3] |
Periodic boundary conditions for x, y, z. |
No |
|
|
integer[][3] |
List of bonds as |
No |
|
|
string[] |
Optional alternative to |
No |
|
|
string[] |
Residue names (useful for biomolecules) |
No |
|
|
integer[] |
Residue indices corresponding to each atom |
No |
|
|
string[] |
Chain identifiers for biomolecules |
No |
|
|
bool[] |
Marks heteroatoms (non-standard or non-biopolymer atoms) |
No |
|
|
number |
Scalar energy value for the structure (arbitrary units) |
No |
|
|
number[][3] |
Per-atom force vectors (same length as |
No |
|
Example:¶
{
"size": 3,
"names": ["O", "H", "H"],
"x": [0.0, 0.76, -0.76],
"y": [0.0, 0.59, 0.59],
"z": [0.0, 0.0, 0.0]
}
Parameters (parameters)¶
Optional. Defines the variables for multidimensional properties. This is required when
properties use the parameters field in the properties.
The parameters field is a dictionary where each key is a name (referenced in
property parameters), and the value is the parameter definition.
Parameter definition¶
Each parameter is a dictionary with the following fields:
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
number[] |
Array of values (length must match the second dimension of linked properties) |
Yes |
|
|
string |
Display name |
No |
|
|
string |
Units |
No |
|
Example¶
"parameters": {
"time": {
"values": [0, 10, 20, 30], // matches length in linked property
"name": "Simulation time",
"units": "fs"
}
}
// linked property (from properties section)
"properties": {
"energy": {
"target": "structure",
"values": [[-1.0, -1.1, -1.2, -1.3], /* ... */],
"parameters": ["time"],
"units": "eV"
}
}