Przeglądaj źródła

auto-generate transformer docs

David Sehnal 6 lat temu
rodzic
commit
917fc2e14c

+ 4 - 0
README.md

@@ -117,6 +117,10 @@ Run the image
 
     export NODE_PATH="build/src"; node build/src/servers/model/test.js
 
+**State Transformer Docs**
+
+    node build/state-docs
+
 ## Contributing
 Just open an issue or make a pull request. All contributions are welcome.
 

+ 670 - 0
docs/state/transforms.md

@@ -0,0 +1,670 @@
+# Mol* Plugin State Transformer Reference
+
+* [build-in.root](#build-in-root)
+* [ms-plugin.download](#ms-plugin-download)
+* [ms-plugin.read-file](#ms-plugin-read-file)
+* [ms-plugin.parse-cif](#ms-plugin-parse-cif)
+* [ms-plugin.parse-ccp4](#ms-plugin-parse-ccp4)
+* [ms-plugin.trajectory-from-mmcif](#ms-plugin-trajectory-from-mmcif)
+* [ms-plugin.model-from-trajectory](#ms-plugin-model-from-trajectory)
+* [ms-plugin.structure-from-model](#ms-plugin-structure-from-model)
+* [ms-plugin.structure-assembly-from-model](#ms-plugin-structure-assembly-from-model)
+* [ms-plugin.structure-selection](#ms-plugin-structure-selection)
+* [ms-plugin.structure-complex-element](#ms-plugin-structure-complex-element)
+* [ms-plugin.custom-model-properties](#ms-plugin-custom-model-properties)
+* [ms-plugin.volume-from-ccp4](#ms-plugin-volume-from-ccp4)
+* [ms-plugin.representation-highlight-loci](#ms-plugin-representation-highlight-loci)
+* [ms-plugin.representation-select-loci](#ms-plugin-representation-select-loci)
+* [ms-plugin.default-loci-label-provider](#ms-plugin-default-loci-label-provider)
+* [ms-plugin.structure-representation-3d](#ms-plugin-structure-representation-3d)
+* [ms-plugin.explode-structure-representation-3d](#ms-plugin-explode-structure-representation-3d)
+* [ms-plugin.volume-representation-3d](#ms-plugin-volume-representation-3d)
+* [ms-plugin.focus-loci-on-select](#ms-plugin-focus-loci-on-select)
+* [ms-plugin.pdbe-structure-quality-report-prop](#ms-plugin-pdbe-structure-quality-report-prop)
+* [ms-plugin.rcsb-assembly-symmetry-prop](#ms-plugin-rcsb-assembly-symmetry-prop)
+* [ms-plugin.structure-animation](#ms-plugin-structure-animation)
+* [ms-plugin.scene-labels](#ms-plugin-scene-labels)
+
+----------------------------
+## <a name="build-in-root"></a>build-in.root :: () -> ()
+*For internal use.*
+
+----------------------------
+## <a name="ms-plugin-download"></a>ms-plugin.download :: Root -> String | Binary
+*Download string or binary data from the specified URL*
+
+### Parameters
+- **url**: String *(Resource URL. Must be the same domain or support CORS.)*
+- **label**?: String
+- **isBinary**?: true/false *(If true, download data as binary (string otherwise))*
+
+### Default Parameters
+```js
+{
+  "url": "https://www.ebi.ac.uk/pdbe/static/entry/1cbs_updated.cif"
+}
+```
+----------------------------
+## <a name="ms-plugin-read-file"></a>ms-plugin.read-file :: Root -> String | Binary
+*Read string or binary data from the specified file*
+
+### Parameters
+- **file**: JavaScript File Handle
+- **label**?: String
+- **isBinary**?: true/false *(If true, open file as as binary (string otherwise))*
+
+### Default Parameters
+```js
+{}
+```
+----------------------------
+## <a name="ms-plugin-parse-cif"></a>ms-plugin.parse-cif :: String | Binary -> Cif
+*Parse CIF from String or Binary data*
+
+----------------------------
+## <a name="ms-plugin-parse-ccp4"></a>ms-plugin.parse-ccp4 :: Binary -> Ccp4
+*Parse CCP4 from Binary data*
+
+----------------------------
+## <a name="ms-plugin-trajectory-from-mmcif"></a>ms-plugin.trajectory-from-mmcif :: Cif -> Trajectory
+*Identify and create all separate models in the specified CIF data block*
+
+### Parameters
+- **blockHeader**?: String *(Header of the block to parse. If none is specifed, the 1st data block in the file is used.)*
+
+### Default Parameters
+```js
+{}
+```
+----------------------------
+## <a name="ms-plugin-model-from-trajectory"></a>ms-plugin.model-from-trajectory :: Trajectory -> Model
+*Create a molecular structure from the specified model.*
+
+### Parameters
+- **modelIndex**: Numeric value *(Zero-based index of the model)*
+
+### Default Parameters
+```js
+{
+  "modelIndex": 0
+}
+```
+----------------------------
+## <a name="ms-plugin-structure-from-model"></a>ms-plugin.structure-from-model :: Model -> Structure
+*Create a molecular structure from the specified model.*
+
+----------------------------
+## <a name="ms-plugin-structure-assembly-from-model"></a>ms-plugin.structure-assembly-from-model :: Model -> Structure
+*Create a molecular structure assembly.*
+
+### Parameters
+- **id**: String *(Assembly Id. If none specified (undefined or empty string), the asymmetric unit is used.)*
+
+### Default Parameters
+```js
+{
+  "id": ""
+}
+```
+----------------------------
+## <a name="ms-plugin-structure-selection"></a>ms-plugin.structure-selection :: Structure -> Structure
+*Create a molecular structure from the specified query expression.*
+
+### Parameters
+- **query**: Value
+- **label**?: String
+
+### Default Parameters
+```js
+{}
+```
+----------------------------
+## <a name="ms-plugin-structure-complex-element"></a>ms-plugin.structure-complex-element :: Structure -> Structure
+*Create a molecular structure from the specified model.*
+
+### Parameters
+- **type**: One of 'atomic-sequence', 'water', 'atomic-het', 'spheres'
+
+### Default Parameters
+```js
+{
+  "type": "atomic-sequence"
+}
+```
+----------------------------
+## <a name="ms-plugin-custom-model-properties"></a>ms-plugin.custom-model-properties :: Model -> Model
+
+### Parameters
+- **properties**: Array of  *(A list of property descriptor ids.)*
+
+### Default Parameters
+```js
+{
+  "properties": []
+}
+```
+----------------------------
+## <a name="ms-plugin-volume-from-ccp4"></a>ms-plugin.volume-from-ccp4 :: Ccp4 -> Data
+*Create Volume from CCP4/MRC data*
+
+### Parameters
+- **voxelSize**: 3D vector [x, y, z]
+
+### Default Parameters
+```js
+{
+  "voxelSize": [
+    1,
+    1,
+    1
+  ]
+}
+```
+----------------------------
+## <a name="ms-plugin-representation-highlight-loci"></a>ms-plugin.representation-highlight-loci :: Root -> Behavior
+
+----------------------------
+## <a name="ms-plugin-representation-select-loci"></a>ms-plugin.representation-select-loci :: Root -> Behavior
+
+----------------------------
+## <a name="ms-plugin-default-loci-label-provider"></a>ms-plugin.default-loci-label-provider :: Root -> Behavior
+
+----------------------------
+## <a name="ms-plugin-structure-representation-3d"></a>ms-plugin.structure-representation-3d :: Structure -> Representation3D
+
+### Parameters
+- **type**: Object { name: string, params: object } where name+params are:
+  - **cartoon**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **doubleSided**: true/false
+      - **flipSided**: true/false
+      - **flatShaded**: true/false
+      - **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
+      - **sizeFactor**: Numeric value
+      - **linearSegments**: Numeric value
+      - **radialSegments**: Numeric value
+      - **aspectRatio**: Numeric value
+      - **arrowFactor**: Numeric value
+      - **visuals**: Array of 'polymer-trace', 'polymer-gap', 'nucleotide-block', 'direction-wedge'
+
+  - **ball-and-stick**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **doubleSided**: true/false
+      - **flipSided**: true/false
+      - **flatShaded**: true/false
+      - **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
+      - **sizeFactor**: Numeric value
+      - **detail**: Numeric value
+      - **linkScale**: Numeric value
+      - **linkSpacing**: Numeric value
+      - **radialSegments**: Numeric value
+      - **sizeAspectRatio**: Numeric value
+      - **visuals**: Array of 'element-sphere', 'intra-link', 'inter-link'
+
+  - **carbohydrate**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **doubleSided**: true/false
+      - **flipSided**: true/false
+      - **flatShaded**: true/false
+      - **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
+      - **detail**: Numeric value
+      - **sizeFactor**: Numeric value
+      - **linkScale**: Numeric value
+      - **linkSpacing**: Numeric value
+      - **radialSegments**: Numeric value
+      - **linkSizeFactor**: Numeric value
+      - **visuals**: Array of 'carbohydrate-symbol', 'carbohydrate-link', 'carbohydrate-terminal-link'
+
+  - **distance-restraint**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **doubleSided**: true/false
+      - **flipSided**: true/false
+      - **flatShaded**: true/false
+      - **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
+      - **linkScale**: Numeric value
+      - **linkSpacing**: Numeric value
+      - **radialSegments**: Numeric value
+      - **sizeFactor**: Numeric value
+
+  - **molecular-surface**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **doubleSided**: true/false
+      - **flipSided**: true/false
+      - **flatShaded**: true/false
+      - **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
+      - **resolution**: Numeric value
+      - **radiusOffset**: Numeric value
+      - **smoothness**: Numeric value
+      - **useGpu**: true/false
+      - **ignoreCache**: true/false
+      - **sizeFactor**: Numeric value
+      - **lineSizeAttenuation**: true/false
+      - **visuals**: Array of 'gaussian-surface', 'gaussian-wireframe'
+
+  - **molecular-volume**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **isoValue**: Numeric value
+      - **renderMode**: One of 'isosurface', 'volume'
+      - **controlPoints**: A list of 2d vectors [xi, yi][]
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+      - **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
+      - **resolution**: Numeric value
+      - **radiusOffset**: Numeric value
+      - **smoothness**: Numeric value
+
+  - **point**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **sizeFactor**: Numeric value
+      - **pointSizeAttenuation**: true/false
+      - **pointFilledCircle**: true/false
+      - **pointEdgeBleach**: Numeric value
+      - **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
+
+  - **spacefill**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **doubleSided**: true/false
+      - **flipSided**: true/false
+      - **flatShaded**: true/false
+      - **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
+      - **sizeFactor**: Numeric value
+      - **detail**: Numeric value
+
+
+- **colorTheme**: Object { name: string, params: object } where name+params are:
+  - **carbohydrate-symbol**:
+Object with:
+
+  - **chain-id**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **cross-link**:
+Object with:
+      - **domain**: Interval [min, max]
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **element-index**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **element-symbol**:
+Object with:
+
+  - **molecule-type**:
+Object with:
+
+  - **polymer-id**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **polymer-index**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **residue-name**:
+Object with:
+
+  - **secondary-structure**:
+Object with:
+
+  - **sequence-id**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **shape-group**:
+Object with:
+
+  - **unit-index**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **uniform**:
+Object with:
+      - **value**: Color as 0xrrggbb
+
+
+- **sizeTheme**: Object { name: string, params: object } where name+params are:
+  - **physical**:
+Object with:
+
+  - **shape-group**:
+Object with:
+
+  - **uniform**:
+Object with:
+      - **value**: Numeric value
+
+
+
+### Default Parameters
+```js
+{
+  "type": {
+    "name": "cartoon",
+    "params": {
+      "alpha": 1,
+      "useFog": true,
+      "highlightColor": 16737945,
+      "selectColor": 3407641,
+      "quality": "auto",
+      "doubleSided": false,
+      "flipSided": false,
+      "flatShaded": false,
+      "unitKinds": [
+        "atomic",
+        "spheres"
+      ],
+      "sizeFactor": 0.2,
+      "linearSegments": 8,
+      "radialSegments": 16,
+      "aspectRatio": 5,
+      "arrowFactor": 1.5,
+      "visuals": [
+        "polymer-trace"
+      ]
+    }
+  },
+  "colorTheme": {
+    "name": "polymer-id",
+    "params": {
+      "list": "RedYellowBlue"
+    }
+  },
+  "sizeTheme": {
+    "name": "uniform",
+    "params": {
+      "value": 1
+    }
+  }
+}
+```
+----------------------------
+## <a name="ms-plugin-explode-structure-representation-3d"></a>ms-plugin.explode-structure-representation-3d :: Representation3D -> Obj
+
+### Parameters
+- **t**: Numeric value
+
+### Default Parameters
+```js
+{
+  "t": 0
+}
+```
+----------------------------
+## <a name="ms-plugin-volume-representation-3d"></a>ms-plugin.volume-representation-3d :: Data -> Representation3D
+
+### Parameters
+- **type**: Object { name: string, params: object } where name+params are:
+  - **isosurface**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **doubleSided**: true/false
+      - **flipSided**: true/false
+      - **flatShaded**: true/false
+      - **isoValue**: Numeric value
+
+  - **direct-volume**:
+Object with:
+      - **alpha**: Numeric value
+      - **useFog**: true/false
+      - **highlightColor**: Color as 0xrrggbb
+      - **selectColor**: Color as 0xrrggbb
+      - **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+      - **isoValue**: Numeric value
+      - **renderMode**: One of 'isosurface', 'volume'
+      - **controlPoints**: A list of 2d vectors [xi, yi][]
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+
+- **colorTheme**: Object { name: string, params: object } where name+params are:
+  - **carbohydrate-symbol**:
+Object with:
+
+  - **chain-id**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **cross-link**:
+Object with:
+      - **domain**: Interval [min, max]
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **element-index**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **element-symbol**:
+Object with:
+
+  - **molecule-type**:
+Object with:
+
+  - **polymer-id**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **polymer-index**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **residue-name**:
+Object with:
+
+  - **secondary-structure**:
+Object with:
+
+  - **sequence-id**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **shape-group**:
+Object with:
+
+  - **unit-index**:
+Object with:
+      - **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
+
+  - **uniform**:
+Object with:
+      - **value**: Color as 0xrrggbb
+
+
+- **sizeTheme**: Object { name: string, params: object } where name+params are:
+  - **physical**:
+Object with:
+
+  - **shape-group**:
+Object with:
+
+  - **uniform**:
+Object with:
+      - **value**: Numeric value
+
+
+
+### Default Parameters
+```js
+{
+  "type": {
+    "name": "isosurface",
+    "params": {
+      "alpha": 1,
+      "useFog": true,
+      "highlightColor": 16737945,
+      "selectColor": 3407641,
+      "quality": "auto",
+      "doubleSided": false,
+      "flipSided": false,
+      "flatShaded": false,
+      "isoValue": 0.22
+    }
+  },
+  "colorTheme": {
+    "name": "uniform",
+    "params": {
+      "value": 13421772
+    }
+  },
+  "sizeTheme": {
+    "name": "uniform",
+    "params": {
+      "value": 1
+    }
+  }
+}
+```
+----------------------------
+## <a name="ms-plugin-focus-loci-on-select"></a>ms-plugin.focus-loci-on-select :: Root -> Behavior
+
+### Parameters
+- **minRadius**: Numeric value
+- **extraRadius**: Numeric value *(Value added to the boundning sphere radius of the Loci.)*
+
+### Default Parameters
+```js
+{
+  "minRadius": 10,
+  "extraRadius": 4
+}
+```
+----------------------------
+## <a name="ms-plugin-pdbe-structure-quality-report-prop"></a>ms-plugin.pdbe-structure-quality-report-prop :: Root -> Behavior
+
+### Parameters
+- **autoAttach**: true/false
+
+### Default Parameters
+```js
+{
+  "autoAttach": false
+}
+```
+----------------------------
+## <a name="ms-plugin-rcsb-assembly-symmetry-prop"></a>ms-plugin.rcsb-assembly-symmetry-prop :: Root -> Behavior
+
+### Parameters
+- **autoAttach**: true/false
+
+### Default Parameters
+```js
+{
+  "autoAttach": false
+}
+```
+----------------------------
+## <a name="ms-plugin-structure-animation"></a>ms-plugin.structure-animation :: Root -> Behavior
+
+### Parameters
+- **rotate**: true/false
+- **rotateValue**: Numeric value
+- **explode**: true/false
+- **explodeValue**: Numeric value
+
+### Default Parameters
+```js
+{
+  "rotate": false,
+  "rotateValue": 0,
+  "explode": false,
+  "explodeValue": 0
+}
+```
+----------------------------
+## <a name="ms-plugin-scene-labels"></a>ms-plugin.scene-labels :: Root -> Behavior
+
+### Parameters
+- **alpha**: Numeric value
+- **useFog**: true/false
+- **highlightColor**: Color as 0xrrggbb
+- **selectColor**: Color as 0xrrggbb
+- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
+- **fontFamily**: One of 'sans-serif', 'monospace', 'serif', 'cursive'
+- **fontQuality**: One of '0', '1', '2', '3', '4'
+- **fontStyle**: One of 'normal', 'italic', 'oblique'
+- **fontVariant**: One of 'normal', 'small-caps'
+- **fontWeight**: One of 'normal', 'bold'
+- **sizeFactor**: Numeric value
+- **borderWidth**: Numeric value
+- **borderColor**: Color as 0xrrggbb
+- **offsetX**: Numeric value
+- **offsetY**: Numeric value
+- **offsetZ**: Numeric value
+- **background**: true/false
+- **backgroundMargin**: Numeric value
+- **backgroundColor**: Color as 0xrrggbb
+- **backgroundOpacity**: Numeric value
+- **attachment**: One of 'bottom-left', 'bottom-center', 'bottom-right', 'middle-left', 'middle-center', 'middle-right', 'top-left', 'top-center', 'top-right'
+- **levels**: Array of 'structure', 'polymer', 'ligand'
+
+### Default Parameters
+```js
+{
+  "alpha": 1,
+  "useFog": true,
+  "highlightColor": 16737945,
+  "selectColor": 3407641,
+  "quality": "auto",
+  "fontFamily": "sans-serif",
+  "fontQuality": 3,
+  "fontStyle": "normal",
+  "fontVariant": "normal",
+  "fontWeight": "normal",
+  "sizeFactor": 1,
+  "borderWidth": 0,
+  "borderColor": 8421504,
+  "offsetX": 0,
+  "offsetY": 0,
+  "offsetZ": 0,
+  "background": true,
+  "backgroundMargin": 0.2,
+  "backgroundColor": 16775930,
+  "backgroundOpacity": 0.9,
+  "attachment": "middle-center",
+  "levels": []
+}
+```
+----------------------------

+ 69 - 0
src/apps/state-docs/index.ts

@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author David Sehnal <david.sehnal@gmail.com>
+ */
+
+import * as _ from 'mol-plugin/state/transforms'
+import { Transformer, StateObject } from 'mol-state';
+import { StringBuilder } from 'mol-util';
+import * as fs from 'fs';
+import { paramsToMd } from './pd-to-md';
+import { PluginContext } from 'mol-plugin/context';
+import { ParamDefinition } from 'mol-util/param-definition';
+
+// force the transform to be evaluated
+_.StateTransforms.Data.Download.id
+
+// Empty plugin context
+const ctx = new PluginContext({
+    actions: [],
+    behaviors: []
+});
+
+const builder = StringBuilder.create();
+
+function typeToString(o: StateObject.Ctor[]) {
+    if (o.length === 0) return '()';
+    return o.map(o => o.name).join(' | ');
+}
+
+function writeTransformer(t: Transformer) {
+    StringBuilder.write(builder, `## <a name="${t.id.replace('.', '-')}"></a>${t.id} :: ${typeToString(t.definition.from)} -> ${typeToString(t.definition.to)}`);
+    StringBuilder.newline(builder);
+    if (t.definition.display.description) {
+        StringBuilder.write(builder, `*${t.definition.display.description}*`)
+        StringBuilder.newline(builder);
+    }
+    StringBuilder.newline(builder);
+    if (t.definition.params) {
+        const params = t.definition.params(void 0, ctx);
+        StringBuilder.write(builder, `### Parameters`);
+        StringBuilder.newline(builder);
+        StringBuilder.write(builder, paramsToMd(params));
+        StringBuilder.newline(builder);
+
+        StringBuilder.write(builder, `### Default Parameters`);
+        StringBuilder.newline(builder);
+        StringBuilder.write(builder, `\`\`\`js\n${JSON.stringify(ParamDefinition.getDefaultValues(params), null, 2)}\n\`\`\``);
+        StringBuilder.newline(builder);
+    }
+    StringBuilder.write(builder, '----------------------------')
+    StringBuilder.newline(builder);
+}
+
+const transformers = Transformer.getAll();
+
+StringBuilder.write(builder, '# Mol* Plugin State Transformer Reference');
+StringBuilder.newline(builder);
+StringBuilder.newline(builder);
+transformers.forEach(t => {
+    StringBuilder.write(builder, `* [${t.id}](#${t.id.replace('.', '-')})`);
+    StringBuilder.newline(builder);
+});
+StringBuilder.newline(builder);
+StringBuilder.write(builder, '----------------------------')
+StringBuilder.newline(builder);
+transformers.forEach(t => writeTransformer(t));
+
+fs.writeFileSync(`docs/state/transforms.md`, StringBuilder.getString(builder));

+ 71 - 0
src/apps/state-docs/pd-to-md.ts

@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author David Sehnal <david.sehnal@gmail.com>
+ */
+
+import { ParamDefinition as PD } from 'mol-util/param-definition';
+
+export function paramsToMd(params: PD.Params) {
+    return getParams(params, 0);
+}
+
+function paramInfo(param: PD.Any, offset: number): string {
+    switch (param.type) {
+        case 'value': return 'Value';
+        case 'boolean': return 'true/false';
+        case 'number': return 'Numeric value';
+        case 'converted': return paramInfo(param.converted, offset);
+        case 'multi-select': return `Array of ${oToS(param.options)}`;
+        case 'color': return 'Color as 0xrrggbb';
+        case 'color-scale': return `One of ${oToS(param.options)}`;
+        case 'vec3': return `3D vector [x, y, z]`;
+        case 'file': return `JavaScript File Handle`;
+        case 'select': return `One of ${oToS(param.options)}`;
+        case 'text': return 'String';
+        case 'interval': return `Interval [min, max]`;
+        case 'group': return `Object with:\n${getParams(param.params, offset + 2)}`;
+        case 'mapped': return `Object { name: string, params: object } where name+params are:\n${getMapped(param, offset + 2)}`;
+        case 'line-graph': return `A list of 2d vectors [xi, yi][]`;
+        default:
+            const _: never = param;
+            console.warn(`${_} has no associated UI component`);
+            return '';
+    }
+}
+
+function oToS(options: [string, string][]) {
+    return options.map(o => `'${o[0]}'`).join(', ');
+}
+
+function offsetS(n: number) {
+    return new Array(n + 1).join(' ') + '- ';
+}
+
+function getMapped(param: PD.Mapped<any>, offset: number) {
+    let ret = '';
+    for (const [n] of param.select.options) {
+        ret += offsetS(offset);
+        ret += `**${n}**:\n`;
+        ret += paramInfo(param.map(n), offset + 2);
+        ret += '\n';
+    }
+    return ret;
+}
+
+function getParams(params: PD.Params, offset: number) {
+    let ret = '';
+    for (const k of Object.keys(params)) {
+        const param = params[k];
+        ret += offsetS(offset);
+        ret += `**${k}**${param.isOptional ? '?:' : ':'} ${paramInfo(param, offset)}`;
+        // if (param.defaultValue) {
+        //     ret += ` = ${JSON.stringify(param.defaultValue)}`;
+        // }
+        if (param.description) {
+            ret += ` *(${param.description})*`;
+        }
+        ret += '\n';
+    }
+    return ret;
+}

+ 6 - 3
src/mol-plugin/state/transforms/model.ts

@@ -137,7 +137,7 @@ export { StructureSelection }
 type StructureSelection = typeof StructureSelection
 const StructureSelection = PluginStateTransform.BuiltIn({
     name: 'structure-selection',
-    display: { name: 'Structure Selection', description: 'Create a molecular structure from the specified model.' },
+    display: { name: 'Structure Selection', description: 'Create a molecular structure from the specified query expression.' },
     from: SO.Molecule.Structure,
     to: SO.Molecule.Structure,
     params: {
@@ -156,14 +156,17 @@ const StructureSelection = PluginStateTransform.BuiltIn({
 });
 
 export { StructureComplexElement }
-namespace StructureComplexElement { export type Types = 'atomic-sequence' | 'water' | 'atomic-het' | 'spheres' }
+namespace StructureComplexElement {
+    export type Types = 'atomic-sequence' | 'water' | 'atomic-het' | 'spheres'
+}
+const StructureComplexElementTypes: [StructureComplexElement.Types, StructureComplexElement.Types][] = ['atomic-sequence', 'water', 'atomic-het', 'spheres'].map(t => [t, t] as any);
 type StructureComplexElement = typeof StructureComplexElement
 const StructureComplexElement = PluginStateTransform.BuiltIn({
     name: 'structure-complex-element',
     display: { name: 'Complex Element', description: 'Create a molecular structure from the specified model.' },
     from: SO.Molecule.Structure,
     to: SO.Molecule.Structure,
-    params: { type: PD.Text<StructureComplexElement.Types>('atomic-sequence', { isHidden: true }) }
+    params: { type: PD.Select<StructureComplexElement.Types>('atomic-sequence', StructureComplexElementTypes, { isHidden: true }) }
 })({
     apply({ a, params }) {
         // TODO: update function.

+ 6 - 2
src/mol-state/transformer.ts

@@ -89,7 +89,7 @@ export namespace Transformer {
         readonly from: StateObject.Ctor[],
         readonly to: StateObject.Ctor[],
         readonly display: { readonly name: string, readonly description?: string },
-        params?(a: A, globalCtx: unknown): { [K in keyof P]: PD.Any },
+        params?(a: A | undefined, globalCtx: unknown): { [K in keyof P]: PD.Any },
     }
 
     const registry = new Map<Id, Transformer<any, any>>();
@@ -105,6 +105,10 @@ export namespace Transformer {
         }
     }
 
+    export function getAll() {
+        return Array.from(registry.values());
+    }
+
     export function get(id: string): Transformer {
         const t = registry.get(id as Id);
         if (!t) {
@@ -196,7 +200,7 @@ export namespace Transformer {
         name: 'root',
         from: [],
         to: [],
-        display: { name: 'Root' },
+        display: { name: 'Root', description: 'For internal use.' },
         apply() { throw new Error('should never be applied'); },
         update() { return UpdateResult.Unchanged; }
     })

+ 1 - 1
src/mol-util/now.ts

@@ -11,7 +11,7 @@ const now: () => now.Timestamp = (function () {
     if (typeof window !== 'undefined' && window.performance) {
         const perf = window.performance;
         return () => perf.now();
-    } else if (typeof process !== 'undefined' && process.hrtime !== 'undefined') {
+    } else if (typeof process !== 'undefined' && process.hrtime !== 'undefined' && typeof process.hrtime === 'function') {
         return () => {
             const t = process.hrtime();
             return t[0] * 1000 + t[1] / 1000000;

+ 3 - 1
src/mol-util/uuid.ts

@@ -9,6 +9,8 @@ import { now } from 'mol-util/now';
 type UUID = string & { '@type': 'uuid' }
 
 namespace UUID {
+    const _btoa = typeof btoa !== 'undefined' ? btoa : (s: string) => Buffer.from(s).toString('base64')
+
     const chars: string[] = [];
     /** Creates 22 characted "base64" UUID */
     export function create22(): UUID {
@@ -17,7 +19,7 @@ namespace UUID {
             chars[i] = String.fromCharCode((d + Math.random()*0xff)%0xff | 0);
             d = Math.floor(d/0xff);
         }
-        return btoa(chars.join('')).replace(/\+/g, '-').replace(/\//g, '_').substr(0, 22) as UUID;
+        return _btoa(chars.join('')).replace(/\+/g, '-').replace(/\//g, '_').substr(0, 22) as UUID;
     }
 
     export function createv4(): UUID {

+ 16 - 5
webpack.config.js

@@ -9,25 +9,25 @@ const sharedConfig = {
             {
                 loader: 'raw-loader',
                 test: /\.(glsl|frag|vert)$/,
-                include: [ path.resolve(__dirname, 'build/src/') ],
+                include: [path.resolve(__dirname, 'build/src/')],
             },
             {
                 loader: 'glslify-loader',
                 test: /\.(glsl|frag|vert)$/,
-                include: [ path.resolve(__dirname, 'build/src/') ]
+                include: [path.resolve(__dirname, 'build/src/')]
             },
 
             {
                 loader: 'file-loader',
                 test: /\.(woff2?|ttf|otf|eot|svg|html)$/,
-                include: [ path.resolve(__dirname, 'build/src/') ],
+                include: [path.resolve(__dirname, 'build/src/')],
                 options: {
                     name: '[name].[ext]'
                 }
             },
             {
-                test:/\.(s*)css$/,
-                use: [ MiniCssExtractPlugin.loader, 'css-loader', 'resolve-url-loader', 'sass-loader' ]
+                test: /\.(s*)css$/,
+                use: [MiniCssExtractPlugin.loader, 'css-loader', 'resolve-url-loader', 'sass-loader']
             }
         ]
     },
@@ -64,11 +64,22 @@ function createEntryPoint(name, dir, out) {
     }
 }
 
+function createNodeEntryPoint(name, dir, out) {
+    return {
+        target: 'node',
+        entry: path.resolve(__dirname, `build/src/${dir}/${name}.js`),
+        output: { filename: `${name}.js`, path: path.resolve(__dirname, `build/${out}`) },
+        ...sharedConfig
+    }
+}
+
 function createApp(name) { return createEntryPoint('index', `apps/${name}`, name) }
 function createBrowserTest(name) { return createEntryPoint(name, 'tests/browser', 'tests') }
+function createNodeApp(name) { return createNodeEntryPoint('index', `apps/${name}`, name) }
 
 module.exports = [
     createApp('viewer'),
+    createNodeApp('state-docs'),
     createApp('model-server-query'),
 
     createBrowserTest('font-atlas'),