瀏覽代碼

transformer docs tweaks

Alexander Rose 6 年之前
父節點
當前提交
62fda3e3e6
共有 3 個文件被更改,包括 55 次插入12 次删除
  1. 1 1
      README.md
  2. 47 7
      docs/state/transforms.md
  3. 7 4
      src/mol-plugin/layout.ts

+ 1 - 1
README.md

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

+ 47 - 7
docs/state/transforms.md

@@ -5,6 +5,7 @@
 * [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.parse-dsn6](#ms-plugin-parse-dsn6)
 * [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)
@@ -13,6 +14,7 @@
 * [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.volume-from-dsn6](#ms-plugin-volume-from-dsn6)
 * [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)
@@ -63,7 +65,11 @@
 
 ----------------------------
 ## <a name="ms-plugin-parse-ccp4"></a>ms-plugin.parse-ccp4 :: Binary -> Ccp4
-*Parse CCP4 from Binary data*
+*Parse CCP4/MRC from Binary data*
+
+----------------------------
+## <a name="ms-plugin-parse-dsn6"></a>ms-plugin.parse-dsn6 :: Binary -> Dsn6
+*Parse CCP4/BRIX from Binary data*
 
 ----------------------------
 ## <a name="ms-plugin-trajectory-from-mmcif"></a>ms-plugin.trajectory-from-mmcif :: Cif -> Trajectory
@@ -98,13 +104,11 @@
 *Create a molecular structure assembly.*
 
 ### Parameters
-- **id**: String *(Assembly Id. If none specified (undefined or empty string), the asymmetric unit is used.)*
+- **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
@@ -150,6 +154,23 @@
 ### Parameters
 - **voxelSize**: 3D vector [x, y, z]
 
+### Default Parameters
+```js
+{
+  "voxelSize": [
+    1,
+    1,
+    1
+  ]
+}
+```
+----------------------------
+## <a name="ms-plugin-volume-from-dsn6"></a>ms-plugin.volume-from-dsn6 :: Dsn6 -> Data
+*Create Volume from DSN6/BRIX data*
+
+### Parameters
+- **voxelSize**: 3D vector [x, y, z]
+
 ### Default Parameters
 ```js
 {
@@ -445,7 +466,12 @@ Object with:
       - **doubleSided**: true/false
       - **flipSided**: true/false
       - **flatShaded**: true/false
-      - **isoValue**: Numeric value
+      - **isoValue**:       - **absolute**: Numeric value
+      - **relative**: Numeric value
+
+      - **sizeFactor**: Numeric value
+      - **lineSizeAttenuation**: true/false
+      - **visuals**: Array of 'solid', 'wireframe'
 
   - **direct-volume**:
 Object with:
@@ -540,7 +566,21 @@ Object with:
       "doubleSided": false,
       "flipSided": false,
       "flatShaded": false,
-      "isoValue": 0.22
+      "isoValue": {
+        "kind": "relative",
+        "stats": {
+          "min": 0,
+          "max": 0,
+          "mean": 0,
+          "sigma": 0
+        },
+        "relativeValue": 2
+      },
+      "sizeFactor": 1,
+      "lineSizeAttenuation": false,
+      "visuals": [
+        "solid"
+      ]
     }
   },
   "colorTheme": {

+ 7 - 4
src/mol-plugin/layout.ts

@@ -172,9 +172,12 @@ export class PluginLayout extends PluginComponent<PluginLayoutStateProps> {
 
         PluginCommands.Layout.Update.subscribe(context, e => this.updateProps(e.state));
 
-        // <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
-        this.expandedViewport = document.createElement('meta') as any;
-        this.expandedViewport.name = 'viewport';
-        this.expandedViewport.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0';
+        // TODO how best make sure it runs on node.js as well as in the browser?
+        if (typeof document !== 'undefined') {
+            // <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
+            this.expandedViewport = document.createElement('meta') as any;
+            this.expandedViewport.name = 'viewport';
+            this.expandedViewport.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0';
+        }
     }
 }