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"]
}
Structures (structures)¶
Required. Contains all atomic configurations in your dataset. 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 |
|
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]
}
Properties (properties)¶
Required. Defines all dataset properties to be available for a display inside
the widget. The field is an object where each key is the property name (e.g.,
"energy", "charge") and each value is the property definition.
Each property is an object 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 = {
"something": {
"target": "atom",
"values": [0.1, 0.0, -0.1, 0.2, -0.1, 0.0],
"units": "Cd / mol",
"description": "some description"
}
}
Value types and shapes¶
Type |
Format |
Details |
Example |
|---|---|---|---|
Scalar |
Array of numbers |
Length must match the number of atoms (for |
|
Multi-dimensional |
Array of arrays of numbers |
Used for parameterized properties; outer array length must match the
number of atoms (for |
|
Categorical |
Array of strings |
Used for symbols setting |
|
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 an object where each key is a name (referenced in
property parameters), and the value is the parameter definition.
Parameter definition¶
Each parameter is an object 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"
}
}
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 an object 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 an object 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 an object with the following fields:
Field |
Type |
Description |
Required |
Example |
|---|---|---|---|---|
|
string |
Shape type: |
Yes |
|
|
object |
Parameters at different levels: |
Yes |
See below |
Parameter levels¶
Parameters are specified in nested objects and merged from general to specific:
global: Object containing the default parameters applied to all shapes in the group.structure: array of objects, one per structure. Overridesglobalfor that structure.atom: array of objects, 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] |
array 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},
/* ... */
]
}
}
}
Settings (settings)¶
Optional. Preconfigures the default visualization settings for the dataset, such
as map axes, colors, and structure viewer options. The settings field is an
object with top-level keys for different panels.
Top-level settings¶
Field |
Type |
Description |
Example |
|---|---|---|---|
|
string |
Default view: |
|
|
object |
Map panel settings (axes, colors, etc.) |
See below |
|
array[object] |
Structure viewer settings (one object per viewer; up to 9) |
See below |
|
integer[] |
Indices of environments/structures to pin in viewers (up to 9; defaults to [0]) |
|
Map settings (map)¶
Configures the scatter plot. Sub-keys for axes (x/y/z), color, size, etc.
Field |
Type |
Description |
Example |
|---|---|---|---|
|
object |
Axis config: |
|
|
object |
Color config: like axis, plus |
|
|
object |
Size config: |
|
|
string |
Property name for categorical symbols (string values) |
|
|
bool |
Thin black outline on markers |
|
|
bool |
Connect points with a thin black line (e.g., for trajectories) |
|
Structure settings (structure)¶
Array of objects (one per viewer).
Field |
Type |
Description |
Example |
|---|---|---|---|
|
bool |
Show bonds |
true |
|
bool |
Show atoms |
true |
|
bool |
Use space-filling representation |
false |
|
bool |
Show atom labels |
false |
|
string |
An environment property value for the atom labels |
|
|
bool |
Show unit cell |
true |
|
integer[3] |
Repetitions in a/b/c directions |
|
|
bool |
Auto-rotate molecule |
false |
|
string |
Axis system: |
|
|
bool |
Maintain orientation when changing structures |
true |
|
integer |
Delay between frames in milliseconds when playing back structures |
50 |
|
object |
Environment options: |
|
|
object |
Atom coloring: |
|
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]
}