molstar 3.0.0-dev.8 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/build/viewer/index.html +2 -2
- package/build/viewer/molstar.js +1 -1
- package/lib/apps/viewer/app.d.ts +230 -0
- package/lib/apps/viewer/app.js +528 -0
- package/lib/apps/viewer/index.d.ts +2 -225
- package/lib/apps/viewer/index.html +2 -2
- package/lib/apps/viewer/index.js +2 -509
- package/lib/commonjs/apps/viewer/app.d.ts +230 -0
- package/lib/commonjs/apps/viewer/app.js +534 -0
- package/lib/commonjs/apps/viewer/index.d.ts +2 -225
- package/lib/commonjs/apps/viewer/index.js +2 -512
- package/lib/commonjs/examples/basic-wrapper/index.js +7 -3
- package/lib/commonjs/examples/proteopedia-wrapper/index.js +7 -1
- package/lib/commonjs/extensions/anvil/representation.js +1 -1
- package/lib/commonjs/extensions/model-export/export.d.ts +9 -0
- package/lib/commonjs/extensions/model-export/export.js +129 -0
- package/lib/commonjs/extensions/model-export/index.d.ts +7 -0
- package/lib/commonjs/extensions/model-export/index.js +36 -0
- package/lib/commonjs/extensions/model-export/ui.d.ts +11 -0
- package/lib/commonjs/extensions/model-export/ui.js +77 -0
- package/lib/commonjs/extensions/mp4-export/encoder.js +1 -1
- package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
- package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +2 -2
- package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +12 -4
- package/lib/commonjs/mol-canvas3d/canvas3d.js +2 -2
- package/lib/commonjs/mol-canvas3d/controls/trackball.d.ts +9 -4
- package/lib/commonjs/mol-canvas3d/controls/trackball.js +50 -11
- package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +1 -1
- package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +1 -1
- package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
- package/lib/commonjs/mol-gl/renderer.d.ts +2 -2
- package/lib/commonjs/mol-gl/renderer.js +3 -3
- package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +1 -1
- package/lib/commonjs/mol-io/reader/mol/parser.d.ts +23 -1
- package/lib/commonjs/mol-io/reader/mol/parser.js +116 -4
- package/lib/commonjs/mol-io/reader/mol2/parser.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/mol2/parser.js +33 -3
- package/lib/commonjs/mol-io/reader/mol2/schema.d.ts +12 -1
- package/lib/commonjs/mol-io/reader/mol2/schema.js +1 -1
- package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
- package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.js +9 -0
- package/lib/commonjs/mol-io/reader/sdf/parser.d.ts +3 -1
- package/lib/commonjs/mol-io/reader/sdf/parser.js +11 -2
- package/lib/commonjs/mol-io/writer/cif/encoder/binary.js +9 -2
- package/lib/commonjs/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
- package/lib/commonjs/mol-math/geometry/primitives/sphere3d.js +17 -4
- package/lib/commonjs/mol-math/geometry/symmetry-operator.d.ts +1 -1
- package/lib/commonjs/mol-math/geometry/symmetry-operator.js +10 -4
- package/lib/commonjs/mol-model/structure/export/mmcif.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/export/mmcif.js +8 -5
- package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
- package/lib/commonjs/mol-model/structure/model/properties/common.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/element/loci.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/element/loci.js +4 -2
- package/lib/commonjs/mol-model/structure/structure/element/stats.js +8 -0
- package/lib/commonjs/mol-model/structure/structure/properties.d.ts +1 -0
- package/lib/commonjs/mol-model/structure/structure/properties.js +2 -1
- package/lib/commonjs/mol-model/structure/structure/symmetry.js +1 -3
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/common.d.ts +2 -1
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/common.js +11 -2
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +20 -10
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.js +21 -11
- package/lib/commonjs/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
- package/lib/commonjs/mol-model/volume/volume.d.ts +7 -0
- package/lib/commonjs/mol-model/volume/volume.js +18 -0
- package/lib/commonjs/mol-model-formats/structure/basic/atomic.d.ts +2 -2
- package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +6 -6
- package/lib/commonjs/mol-model-formats/structure/basic/coarse.d.ts +1 -1
- package/lib/commonjs/mol-model-formats/structure/basic/coarse.js +3 -3
- package/lib/commonjs/mol-model-formats/structure/basic/entities.d.ts +2 -1
- package/lib/commonjs/mol-model-formats/structure/basic/entities.js +28 -24
- package/lib/commonjs/mol-model-formats/structure/basic/parser.js +17 -8
- package/lib/commonjs/mol-model-formats/structure/basic/properties.d.ts +6 -1
- package/lib/commonjs/mol-model-formats/structure/basic/properties.js +12 -22
- package/lib/commonjs/mol-model-formats/structure/mol.d.ts +2 -1
- package/lib/commonjs/mol-model-formats/structure/mol.js +19 -5
- package/lib/commonjs/mol-model-formats/structure/mol2.d.ts +1 -1
- package/lib/commonjs/mol-model-formats/structure/mol2.js +37 -7
- package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.d.ts +18 -1
- package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.js +18 -5
- package/lib/commonjs/mol-model-props/common/custom-property.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/interactions/common.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/interactions/common.js +16 -24
- package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
- package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
- package/lib/commonjs/mol-model-props/sequence/best-database-mapping.js +15 -15
- package/lib/commonjs/mol-plugin/animation-loop.d.ts +2 -0
- package/lib/commonjs/mol-plugin/animation-loop.js +1 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +11 -6
- package/lib/commonjs/mol-plugin/behavior/static/representation.js +1 -1
- package/lib/commonjs/mol-plugin/commands.d.ts +6 -2
- package/lib/commonjs/mol-plugin/config.d.ts +1 -1
- package/lib/commonjs/mol-plugin/spec.d.ts +1 -1
- package/lib/commonjs/mol-plugin/spec.js +3 -1
- package/lib/commonjs/mol-plugin-state/actions/file.d.ts +3 -2
- package/lib/commonjs/mol-plugin-state/actions/file.js +67 -31
- package/lib/commonjs/mol-plugin-state/actions/structure.d.ts +1 -0
- package/lib/commonjs/mol-plugin-state/actions/structure.js +41 -8
- package/lib/commonjs/mol-plugin-state/actions/volume.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/actions/volume.js +3 -3
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.js +62 -0
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
- package/lib/commonjs/mol-plugin-state/animation/model.d.ts +4 -0
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +172 -6
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +74 -2
- package/lib/commonjs/mol-plugin-state/formats/volume.js +1 -11
- package/lib/commonjs/mol-plugin-state/manager/animation.d.ts +5 -1
- package/lib/commonjs/mol-plugin-state/manager/animation.js +5 -5
- package/lib/commonjs/mol-plugin-ui/structure/superposition.js +2 -2
- package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +4 -8
- package/lib/commonjs/mol-repr/shape/loci/common.d.ts +1 -1
- package/lib/commonjs/mol-repr/shape/loci/common.js +3 -3
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
- package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/util/bond.js +5 -4
- package/lib/commonjs/mol-repr/visual.d.ts +1 -1
- package/lib/commonjs/mol-repr/visual.js +2 -1
- package/lib/commonjs/mol-state/transform.js +12 -2
- package/lib/commonjs/mol-state/tree/immutable.d.ts +18 -0
- package/lib/commonjs/mol-state/tree/transient.d.ts +3 -4
- package/lib/commonjs/mol-theme/color/element-symbol.d.ts +289 -3
- package/lib/commonjs/mol-theme/color/element-symbol.js +25 -15
- package/lib/commonjs/mol-theme/color/entity-id.d.ts +1 -1
- package/lib/commonjs/mol-theme/color/entity-id.js +29 -5
- package/lib/commonjs/mol-theme/color/illustrative.d.ts +100 -29
- package/lib/commonjs/mol-theme/color/illustrative.js +26 -7
- package/lib/commonjs/mol-theme/color/molecule-type.d.ts +19 -1
- package/lib/commonjs/mol-theme/color/molecule-type.js +10 -5
- package/lib/commonjs/mol-theme/color/residue-name.d.ts +77 -1
- package/lib/commonjs/mol-theme/color/residue-name.js +10 -5
- package/lib/commonjs/mol-theme/color/secondary-structure.d.ts +27 -1
- package/lib/commonjs/mol-theme/color/secondary-structure.js +10 -5
- package/lib/commonjs/mol-theme/color.d.ts +253 -15
- package/lib/commonjs/mol-util/color/color.d.ts +1 -1
- package/lib/commonjs/mol-util/color/color.js +1 -1
- package/lib/commonjs/mol-util/color/params.d.ts +10 -0
- package/lib/commonjs/mol-util/color/params.js +19 -0
- package/lib/commonjs/servers/volume/config.js +3 -3
- package/lib/commonjs/servers/volume/query.js +1 -1
- package/lib/examples/basic-wrapper/index.js +7 -3
- package/lib/examples/proteopedia-wrapper/index.js +7 -1
- package/lib/extensions/anvil/representation.js +1 -1
- package/lib/extensions/model-export/export.d.ts +9 -0
- package/lib/extensions/model-export/export.js +125 -0
- package/lib/extensions/model-export/index.d.ts +7 -0
- package/lib/extensions/model-export/index.js +33 -0
- package/lib/extensions/model-export/ui.d.ts +11 -0
- package/lib/extensions/model-export/ui.js +74 -0
- package/lib/extensions/mp4-export/encoder.js +1 -1
- package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
- package/lib/extensions/rcsb/graphql/types.d.ts +2 -2
- package/lib/mol-canvas3d/canvas3d.d.ts +12 -4
- package/lib/mol-canvas3d/canvas3d.js +2 -2
- package/lib/mol-canvas3d/controls/trackball.d.ts +9 -4
- package/lib/mol-canvas3d/controls/trackball.js +51 -12
- package/lib/mol-canvas3d/helper/interaction-events.js +1 -1
- package/lib/mol-canvas3d/passes/draw.d.ts +1 -1
- package/lib/mol-canvas3d/passes/draw.js +3 -3
- package/lib/mol-gl/renderer.d.ts +2 -2
- package/lib/mol-gl/renderer.js +3 -3
- package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
- package/lib/mol-io/reader/cif/schema/mmcif.js +1 -1
- package/lib/mol-io/reader/mol/parser.d.ts +23 -1
- package/lib/mol-io/reader/mol/parser.js +112 -3
- package/lib/mol-io/reader/mol2/parser.d.ts +1 -1
- package/lib/mol-io/reader/mol2/parser.js +33 -3
- package/lib/mol-io/reader/mol2/schema.d.ts +12 -1
- package/lib/mol-io/reader/mol2/schema.js +1 -1
- package/lib/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
- package/lib/mol-io/reader/sdf/parser-v3-util.js +9 -0
- package/lib/mol-io/reader/sdf/parser.d.ts +3 -1
- package/lib/mol-io/reader/sdf/parser.js +12 -3
- package/lib/mol-io/writer/cif/encoder/binary.js +9 -2
- package/lib/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
- package/lib/mol-math/geometry/primitives/sphere3d.js +17 -4
- package/lib/mol-math/geometry/symmetry-operator.d.ts +1 -1
- package/lib/mol-math/geometry/symmetry-operator.js +10 -4
- package/lib/mol-model/structure/export/mmcif.d.ts +1 -1
- package/lib/mol-model/structure/export/mmcif.js +8 -5
- package/lib/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
- package/lib/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
- package/lib/mol-model/structure/model/properties/common.d.ts +1 -1
- package/lib/mol-model/structure/structure/element/loci.d.ts +1 -1
- package/lib/mol-model/structure/structure/element/loci.js +4 -2
- package/lib/mol-model/structure/structure/element/stats.js +8 -0
- package/lib/mol-model/structure/structure/properties.d.ts +1 -0
- package/lib/mol-model/structure/structure/properties.js +2 -1
- package/lib/mol-model/structure/structure/symmetry.js +1 -3
- package/lib/mol-model/structure/structure/unit/bonds/common.d.ts +2 -1
- package/lib/mol-model/structure/structure/unit/bonds/common.js +9 -1
- package/lib/mol-model/structure/structure/unit/bonds/inter-compute.d.ts +1 -1
- package/lib/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -11
- package/lib/mol-model/structure/structure/unit/bonds/intra-compute.d.ts +1 -1
- package/lib/mol-model/structure/structure/unit/bonds/intra-compute.js +22 -12
- package/lib/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
- package/lib/mol-model/volume/volume.d.ts +7 -0
- package/lib/mol-model/volume/volume.js +18 -0
- package/lib/mol-model-formats/structure/basic/atomic.d.ts +2 -2
- package/lib/mol-model-formats/structure/basic/atomic.js +6 -6
- package/lib/mol-model-formats/structure/basic/coarse.d.ts +1 -1
- package/lib/mol-model-formats/structure/basic/coarse.js +3 -3
- package/lib/mol-model-formats/structure/basic/entities.d.ts +2 -1
- package/lib/mol-model-formats/structure/basic/entities.js +25 -22
- package/lib/mol-model-formats/structure/basic/parser.js +19 -10
- package/lib/mol-model-formats/structure/basic/properties.d.ts +6 -1
- package/lib/mol-model-formats/structure/basic/properties.js +12 -25
- package/lib/mol-model-formats/structure/mol.d.ts +2 -1
- package/lib/mol-model-formats/structure/mol.js +17 -3
- package/lib/mol-model-formats/structure/mol2.d.ts +1 -1
- package/lib/mol-model-formats/structure/mol2.js +37 -7
- package/lib/mol-model-formats/structure/property/bonds/index-pair.d.ts +18 -1
- package/lib/mol-model-formats/structure/property/bonds/index-pair.js +18 -5
- package/lib/mol-model-props/common/custom-property.d.ts +1 -1
- package/lib/mol-model-props/computed/interactions/common.d.ts +1 -1
- package/lib/mol-model-props/computed/interactions/common.js +16 -24
- package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
- package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
- package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
- package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
- package/lib/mol-model-props/sequence/best-database-mapping.js +15 -15
- package/lib/mol-plugin/animation-loop.d.ts +2 -0
- package/lib/mol-plugin/animation-loop.js +1 -1
- package/lib/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
- package/lib/mol-plugin/behavior/dynamic/representation.js +11 -6
- package/lib/mol-plugin/behavior/static/representation.js +1 -1
- package/lib/mol-plugin/commands.d.ts +6 -2
- package/lib/mol-plugin/config.d.ts +1 -1
- package/lib/mol-plugin/spec.d.ts +1 -1
- package/lib/mol-plugin/spec.js +3 -1
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/actions/file.d.ts +3 -2
- package/lib/mol-plugin-state/actions/file.js +67 -31
- package/lib/mol-plugin-state/actions/structure.d.ts +1 -0
- package/lib/mol-plugin-state/actions/structure.js +41 -8
- package/lib/mol-plugin-state/actions/volume.d.ts +1 -1
- package/lib/mol-plugin-state/actions/volume.js +3 -3
- package/lib/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
- package/lib/mol-plugin-state/animation/built-in/camera-rock.js +59 -0
- package/lib/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
- package/lib/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
- package/lib/mol-plugin-state/animation/model.d.ts +4 -0
- package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
- package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
- package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +172 -6
- package/lib/mol-plugin-state/builder/structure/representation-preset.js +74 -2
- package/lib/mol-plugin-state/formats/volume.js +1 -11
- package/lib/mol-plugin-state/manager/animation.d.ts +5 -1
- package/lib/mol-plugin-state/manager/animation.js +5 -5
- package/lib/mol-plugin-ui/structure/superposition.js +2 -2
- package/lib/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
- package/lib/mol-plugin-ui/viewport/simple-settings.js +4 -8
- package/lib/mol-repr/shape/loci/common.d.ts +1 -1
- package/lib/mol-repr/shape/loci/common.js +3 -3
- package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
- package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
- package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
- package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
- package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
- package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
- package/lib/mol-repr/structure/visual/util/bond.d.ts +1 -1
- package/lib/mol-repr/structure/visual/util/bond.js +5 -4
- package/lib/mol-repr/visual.d.ts +1 -1
- package/lib/mol-repr/visual.js +2 -1
- package/lib/mol-state/transform.js +12 -2
- package/lib/mol-state/tree/immutable.d.ts +18 -0
- package/lib/mol-state/tree/transient.d.ts +3 -4
- package/lib/mol-theme/color/element-symbol.d.ts +289 -3
- package/lib/mol-theme/color/element-symbol.js +25 -15
- package/lib/mol-theme/color/entity-id.d.ts +1 -1
- package/lib/mol-theme/color/entity-id.js +29 -5
- package/lib/mol-theme/color/illustrative.d.ts +100 -29
- package/lib/mol-theme/color/illustrative.js +26 -7
- package/lib/mol-theme/color/molecule-type.d.ts +19 -1
- package/lib/mol-theme/color/molecule-type.js +10 -5
- package/lib/mol-theme/color/residue-name.d.ts +77 -1
- package/lib/mol-theme/color/residue-name.js +10 -5
- package/lib/mol-theme/color/secondary-structure.d.ts +27 -1
- package/lib/mol-theme/color/secondary-structure.js +10 -5
- package/lib/mol-theme/color.d.ts +253 -15
- package/lib/mol-util/color/color.d.ts +1 -1
- package/lib/mol-util/color/color.js +1 -1
- package/lib/mol-util/color/params.d.ts +10 -0
- package/lib/mol-util/color/params.js +15 -0
- package/lib/servers/volume/config.js +3 -3
- package/lib/servers/volume/query.js +1 -1
- package/package.json +36 -38
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
@@ -63,11 +63,12 @@ function createInterUnitInteractionCylinderMesh(ctx, structure, theme, props, me
|
|
|
63
63
|
if (!childUnitA)
|
|
64
64
|
return true;
|
|
65
65
|
var unitA = structure.unitMap.get(b.unitA);
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
var _a = unitsFeatures.get(b.unitA), offsets = _a.offsets, members = _a.members;
|
|
67
|
+
for (var i = offsets[b.indexA], il = offsets[b.indexA + 1]; i < il; ++i) {
|
|
68
|
+
var eA = unitA.elements[members[i]];
|
|
69
|
+
if (!SortedArray.has(childUnitA.elements, eA))
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
71
72
|
}
|
|
72
73
|
return false;
|
|
73
74
|
}
|
|
@@ -115,8 +116,9 @@ function getInteractionLoci(pickingId, structure, id) {
|
|
|
115
116
|
}
|
|
116
117
|
return EmptyLoci;
|
|
117
118
|
}
|
|
119
|
+
var __unitMap = new Map();
|
|
120
|
+
var __contactIndicesSet = new Set();
|
|
118
121
|
function eachInteraction(loci, structure, apply, isMarking) {
|
|
119
|
-
var _a;
|
|
120
122
|
var changed = false;
|
|
121
123
|
if (Interactions.isLoci(loci)) {
|
|
122
124
|
if (!Structure.areEquivalent(loci.data.structure, structure))
|
|
@@ -125,8 +127,8 @@ function eachInteraction(loci, structure, apply, isMarking) {
|
|
|
125
127
|
if (loci.data.interactions !== interactions)
|
|
126
128
|
return false;
|
|
127
129
|
var contacts = interactions.contacts;
|
|
128
|
-
for (var _i = 0,
|
|
129
|
-
var c =
|
|
130
|
+
for (var _i = 0, _a = loci.elements; _i < _a.length; _i++) {
|
|
131
|
+
var c = _a[_i];
|
|
130
132
|
var idx = contacts.getEdgeIndex(c.indexA, c.unitA.id, c.indexB, c.unitB.id);
|
|
131
133
|
if (idx !== -1) {
|
|
132
134
|
if (apply(Interval.ofSingleton(idx)))
|
|
@@ -139,28 +141,52 @@ function eachInteraction(loci, structure, apply, isMarking) {
|
|
|
139
141
|
return false;
|
|
140
142
|
if (isMarking && loci.elements.length === 1)
|
|
141
143
|
return false; // only a single unit
|
|
142
|
-
var
|
|
143
|
-
if (!
|
|
144
|
+
var interactions = InteractionsProvider.get(structure).value;
|
|
145
|
+
if (!interactions)
|
|
144
146
|
return false;
|
|
147
|
+
var contacts_1 = interactions.contacts, unitsFeatures_1 = interactions.unitsFeatures;
|
|
148
|
+
for (var _b = 0, _c = loci.elements; _b < _c.length; _b++) {
|
|
149
|
+
var e = _c[_b];
|
|
150
|
+
__unitMap.set(e.unit.id, e.indices);
|
|
151
|
+
}
|
|
145
152
|
var _loop_1 = function (e) {
|
|
146
153
|
var unit = e.unit;
|
|
147
154
|
if (!Unit.isAtomic(unit))
|
|
148
155
|
return "continue";
|
|
149
|
-
if (isMarking && OrderedSet.size(e.indices) === 1)
|
|
150
|
-
return "continue";
|
|
151
156
|
OrderedSet.forEach(e.indices, function (v) {
|
|
152
157
|
for (var _i = 0, _a = contacts_1.getContactIndicesForElement(v, unit); _i < _a.length; _i++) {
|
|
153
158
|
var idx = _a[_i];
|
|
154
|
-
|
|
155
|
-
changed = true;
|
|
159
|
+
__contactIndicesSet.add(idx);
|
|
156
160
|
}
|
|
157
161
|
});
|
|
158
162
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
var e = _d[_c];
|
|
163
|
+
for (var _d = 0, _e = loci.elements; _d < _e.length; _d++) {
|
|
164
|
+
var e = _e[_d];
|
|
162
165
|
_loop_1(e);
|
|
163
166
|
}
|
|
167
|
+
__contactIndicesSet.forEach(function (i) {
|
|
168
|
+
if (isMarking) {
|
|
169
|
+
var _a = contacts_1.edges[i], indexA = _a.indexA, unitA = _a.unitA, indexB = _a.indexB, unitB = _a.unitB;
|
|
170
|
+
var indicesA = __unitMap.get(unitA);
|
|
171
|
+
var indicesB = __unitMap.get(unitB);
|
|
172
|
+
if (!indicesA || !indicesB)
|
|
173
|
+
return;
|
|
174
|
+
var _b = unitsFeatures_1.get(unitA), offsetsA = _b.offsets, membersA = _b.members;
|
|
175
|
+
for (var j = offsetsA[indexA], jl = offsetsA[indexA + 1]; j < jl; ++j) {
|
|
176
|
+
if (!OrderedSet.has(indicesA, membersA[j]))
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
var _c = unitsFeatures_1.get(unitB), offsetsB = _c.offsets, membersB = _c.members;
|
|
180
|
+
for (var j = offsetsB[indexB], jl = offsetsB[indexB + 1]; j < jl; ++j) {
|
|
181
|
+
if (!OrderedSet.has(indicesB, membersB[j]))
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (apply(Interval.ofSingleton(i)))
|
|
186
|
+
changed = true;
|
|
187
|
+
});
|
|
188
|
+
__unitMap.clear();
|
|
189
|
+
__contactIndicesSet.clear();
|
|
164
190
|
}
|
|
165
191
|
return changed;
|
|
166
192
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
@@ -49,9 +49,19 @@ function createIntraUnitInteractionsCylinderMesh(ctx, unit, structure, theme, pr
|
|
|
49
49
|
var sizeB = theme.size.size(location);
|
|
50
50
|
return Math.min(sizeA, sizeB) * sizeFactor;
|
|
51
51
|
},
|
|
52
|
-
ignore: function (edgeIndex) {
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
ignore: function (edgeIndex) {
|
|
53
|
+
if (flag[edgeIndex] === 1 /* Filtered */)
|
|
54
|
+
return true;
|
|
55
|
+
if (childUnit) {
|
|
56
|
+
var f = a[edgeIndex];
|
|
57
|
+
for (var i = offsets[f], jl = offsets[f + 1]; i < jl; ++i) {
|
|
58
|
+
var e = unit.elements[members[offsets[i]]];
|
|
59
|
+
if (!SortedArray.has(childUnit.elements, e))
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
55
65
|
};
|
|
56
66
|
m = createLinkCylinderMesh(ctx, builderProps, props, mesh);
|
|
57
67
|
sphere = Sphere3D.expand(Sphere3D(), (childUnit !== null && childUnit !== void 0 ? childUnit : unit).boundary.sphere, 1 * sizeFactor);
|
|
@@ -98,6 +108,7 @@ function getInteractionLoci(pickingId, structureGroup, id) {
|
|
|
98
108
|
}
|
|
99
109
|
return EmptyLoci;
|
|
100
110
|
}
|
|
111
|
+
var __contactIndicesSet = new Set();
|
|
101
112
|
function eachInteraction(loci, structureGroup, apply, isMarking) {
|
|
102
113
|
var changed = false;
|
|
103
114
|
if (Interactions.isLoci(loci)) {
|
|
@@ -132,28 +143,42 @@ function eachInteraction(loci, structureGroup, apply, isMarking) {
|
|
|
132
143
|
if (!interactions)
|
|
133
144
|
return false;
|
|
134
145
|
var unit = group.units[0];
|
|
135
|
-
var
|
|
146
|
+
var contacts_1 = interactions.unitsContacts.get(unit.id);
|
|
136
147
|
var features = interactions.unitsFeatures.get(unit.id);
|
|
137
|
-
var groupCount_1 =
|
|
138
|
-
var offset_1 =
|
|
148
|
+
var groupCount_1 = contacts_1.edgeCount * 2;
|
|
149
|
+
var offset_1 = contacts_1.offset;
|
|
139
150
|
var _b = features.elementsIndex, fOffsets_1 = _b.offsets, fIndices_1 = _b.indices;
|
|
151
|
+
var members_1 = features.members, offsets_1 = features.offsets;
|
|
140
152
|
var _loop_1 = function (e) {
|
|
141
153
|
var unitIdx = group.unitIndexMap.get(e.unit.id);
|
|
142
|
-
if (unitIdx
|
|
143
|
-
return "continue";
|
|
144
|
-
if (isMarking && OrderedSet.size(e.indices) === 1)
|
|
154
|
+
if (unitIdx === undefined)
|
|
145
155
|
return "continue";
|
|
146
156
|
OrderedSet.forEach(e.indices, function (v) {
|
|
147
157
|
for (var i = fOffsets_1[v], il = fOffsets_1[v + 1]; i < il; ++i) {
|
|
148
158
|
var fI = fIndices_1[i];
|
|
149
159
|
for (var j = offset_1[fI], jl = offset_1[fI + 1]; j < jl; ++j) {
|
|
150
|
-
|
|
151
|
-
|
|
160
|
+
__contactIndicesSet.add(j);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
__contactIndicesSet.forEach(function (i) {
|
|
165
|
+
if (isMarking) {
|
|
166
|
+
var fA = contacts_1.a[i];
|
|
167
|
+
for (var j = offsets_1[fA], jl = offsets_1[fA + 1]; j < jl; ++j) {
|
|
168
|
+
if (!OrderedSet.has(e.indices, members_1[j]))
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
var fB = contacts_1.b[i];
|
|
172
|
+
for (var j = offsets_1[fB], jl = offsets_1[fB + 1]; j < jl; ++j) {
|
|
173
|
+
if (!OrderedSet.has(e.indices, members_1[j]))
|
|
174
|
+
return;
|
|
152
175
|
}
|
|
153
176
|
}
|
|
177
|
+
if (apply(Interval.ofSingleton(unitIdx * groupCount_1 + i)))
|
|
178
|
+
changed = true;
|
|
154
179
|
});
|
|
180
|
+
__contactIndicesSet.clear();
|
|
155
181
|
};
|
|
156
|
-
// TODO: when isMarking, all elements of contact features need to be in the loci
|
|
157
182
|
for (var _c = 0, _d = loci.elements; _c < _d.length; _c++) {
|
|
158
183
|
var e = _d[_c];
|
|
159
184
|
_loop_1(e);
|
|
@@ -19,7 +19,7 @@ var BestDatabaseSequenceMapping;
|
|
|
19
19
|
type: 'static',
|
|
20
20
|
defaultParams: {},
|
|
21
21
|
getParams: function () { return ({}); },
|
|
22
|
-
isApplicable: function (data) { var _a, _b; return MmcifFormat.is(data.sourceData) && ((_b = (_a = data.sourceData.data.frame.categories) === null || _a === void 0 ? void 0 : _a.atom_site) === null || _b === void 0 ? void 0 : _b.fieldNames.indexOf('
|
|
22
|
+
isApplicable: function (data) { var _a, _b; return MmcifFormat.is(data.sourceData) && ((_b = (_a = data.sourceData.data.frame.categories) === null || _a === void 0 ? void 0 : _a.atom_site) === null || _b === void 0 ? void 0 : _b.fieldNames.indexOf('pdbx_sifts_xref_db_name')) >= 0; },
|
|
23
23
|
obtain: function (ctx, data) { return __awaiter(_this, void 0, void 0, function () {
|
|
24
24
|
return __generator(this, function (_a) {
|
|
25
25
|
return [2 /*return*/, { value: fromCif(data) }];
|
|
@@ -32,7 +32,7 @@ var BestDatabaseSequenceMapping;
|
|
|
32
32
|
if (!data)
|
|
33
33
|
return '';
|
|
34
34
|
var eI = loc.unit.elements[loc.element];
|
|
35
|
-
var rI = model.atomicHierarchy.residueAtomSegments.
|
|
35
|
+
var rI = model.atomicHierarchy.residueAtomSegments.index[eI];
|
|
36
36
|
return data.accession[rI];
|
|
37
37
|
}
|
|
38
38
|
BestDatabaseSequenceMapping.getKey = getKey;
|
|
@@ -42,7 +42,7 @@ var BestDatabaseSequenceMapping;
|
|
|
42
42
|
if (!data)
|
|
43
43
|
return;
|
|
44
44
|
var eI = loc.unit.elements[loc.element];
|
|
45
|
-
var rI = model.atomicHierarchy.residueAtomSegments.
|
|
45
|
+
var rI = model.atomicHierarchy.residueAtomSegments.index[eI];
|
|
46
46
|
var dbName = data.dbName[rI];
|
|
47
47
|
if (!dbName)
|
|
48
48
|
return;
|
|
@@ -53,10 +53,10 @@ var BestDatabaseSequenceMapping;
|
|
|
53
53
|
if (!MmcifFormat.is(model.sourceData))
|
|
54
54
|
return;
|
|
55
55
|
var atom_site = model.sourceData.data.frame.categories.atom_site;
|
|
56
|
-
var db_name = atom_site.getField('
|
|
57
|
-
var db_acc = atom_site.getField('
|
|
58
|
-
var db_num = atom_site.getField('
|
|
59
|
-
var db_res = atom_site.getField('
|
|
56
|
+
var db_name = atom_site.getField('pdbx_sifts_xref_db_name');
|
|
57
|
+
var db_acc = atom_site.getField('pdbx_sifts_xref_db_acc');
|
|
58
|
+
var db_num = atom_site.getField('pdbx_sifts_xref_db_num');
|
|
59
|
+
var db_res = atom_site.getField('pdbx_sifts_xref_db_res');
|
|
60
60
|
if (!db_name || !db_acc || !db_num || !db_res)
|
|
61
61
|
return;
|
|
62
62
|
var atomSourceIndex = model.atomicHierarchy.atomSourceIndex;
|
|
@@ -68,16 +68,16 @@ var BestDatabaseSequenceMapping;
|
|
|
68
68
|
for (var i = 0; i < count; i++) {
|
|
69
69
|
var row = atomSourceIndex.value(residueOffsets[i]);
|
|
70
70
|
if (db_name.valueKind(row) !== 0 /* Present */) {
|
|
71
|
-
dbName[
|
|
72
|
-
accession[
|
|
73
|
-
num[
|
|
74
|
-
residue[
|
|
71
|
+
dbName[i] = '';
|
|
72
|
+
accession[i] = '';
|
|
73
|
+
num[i] = 0;
|
|
74
|
+
residue[i] = '';
|
|
75
75
|
continue;
|
|
76
76
|
}
|
|
77
|
-
dbName[
|
|
78
|
-
accession[
|
|
79
|
-
num[
|
|
80
|
-
residue[
|
|
77
|
+
dbName[i] = db_name.str(row);
|
|
78
|
+
accession[i] = db_acc.str(row);
|
|
79
|
+
num[i] = db_num.int(row);
|
|
80
|
+
residue[i] = db_res.str(row);
|
|
81
81
|
}
|
|
82
82
|
return { dbName: dbName, accession: accession, num: num, residue: residue };
|
|
83
83
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
*/
|
|
6
6
|
import { PluginContext } from './context';
|
|
7
|
+
import { PluginAnimationManager } from '../mol-plugin-state/manager/animation';
|
|
7
8
|
export declare class PluginAnimationLoop {
|
|
8
9
|
private plugin;
|
|
9
10
|
private currentFrame;
|
|
@@ -12,6 +13,7 @@ export declare class PluginAnimationLoop {
|
|
|
12
13
|
tick(t: number, options?: {
|
|
13
14
|
isSynchronous?: boolean;
|
|
14
15
|
manualDraw?: boolean;
|
|
16
|
+
animation?: PluginAnimationManager.AnimationInfo;
|
|
15
17
|
}): Promise<void>;
|
|
16
18
|
private frame;
|
|
17
19
|
resetTime(t?: number): void;
|
|
@@ -30,7 +30,7 @@ var PluginAnimationLoop = /** @class */ (function () {
|
|
|
30
30
|
return __awaiter(this, void 0, void 0, function () {
|
|
31
31
|
return __generator(this, function (_b) {
|
|
32
32
|
switch (_b.label) {
|
|
33
|
-
case 0: return [4 /*yield*/, this.plugin.managers.animation.tick(t, options === null || options === void 0 ? void 0 : options.isSynchronous)];
|
|
33
|
+
case 0: return [4 /*yield*/, this.plugin.managers.animation.tick(t, options === null || options === void 0 ? void 0 : options.isSynchronous, options === null || options === void 0 ? void 0 : options.animation)];
|
|
34
34
|
case 1:
|
|
35
35
|
_b.sent();
|
|
36
36
|
(_a = this.plugin.canvas3d) === null || _a === void 0 ? void 0 : _a.tick(t, options);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -213,11 +213,16 @@ export var DefaultLociLabelProvider = PluginBehavior.create({
|
|
|
213
213
|
this.f = {
|
|
214
214
|
label: function (loci) {
|
|
215
215
|
var label = [];
|
|
216
|
-
if (StructureElement.Loci.is(loci)
|
|
217
|
-
var
|
|
218
|
-
var
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
if (StructureElement.Loci.is(loci)) {
|
|
217
|
+
var entityNames = new Set();
|
|
218
|
+
for (var _i = 0, _a = loci.elements; _i < _a.length; _i++) {
|
|
219
|
+
var u = _a[_i].unit;
|
|
220
|
+
var l = StructureElement.Location.create(loci.structure, u, u.elements[0]);
|
|
221
|
+
var name_1 = StructureProperties.entity.pdbx_description(l).join(', ');
|
|
222
|
+
entityNames.add(name_1);
|
|
223
|
+
}
|
|
224
|
+
if (entityNames.size === 1)
|
|
225
|
+
entityNames.forEach(function (name) { return label.push(name); });
|
|
221
226
|
}
|
|
222
227
|
label.push(lociLabel(loci));
|
|
223
228
|
return label.filter(function (l) { return !!l; }).join('</br>');
|
|
@@ -82,7 +82,7 @@ export function UpdateRepresentationVisibility(ctx) {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function updateVisibility(cell, r) {
|
|
85
|
-
if (r.state.visible === cell.state.isHidden) {
|
|
85
|
+
if (r.state.visible === !!cell.state.isHidden) {
|
|
86
86
|
r.setState({ visible: !cell.state.isHidden });
|
|
87
87
|
return true;
|
|
88
88
|
}
|
|
@@ -278,8 +278,12 @@ export declare const PluginCommands: {
|
|
|
278
278
|
rotateSpeed: number;
|
|
279
279
|
zoomSpeed: number;
|
|
280
280
|
panSpeed: number;
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
animate: import("../mol-util/param-definition").ParamDefinition.NamedParams<import("../mol-util/param-definition").ParamDefinition.Normalize<unknown>, "off"> | import("../mol-util/param-definition").ParamDefinition.NamedParams<import("../mol-util/param-definition").ParamDefinition.Normalize<{
|
|
282
|
+
speed: any;
|
|
283
|
+
}>, "spin"> | import("../mol-util/param-definition").ParamDefinition.NamedParams<import("../mol-util/param-definition").ParamDefinition.Normalize<{
|
|
284
|
+
speed: any;
|
|
285
|
+
angle: any;
|
|
286
|
+
}>, "rock">;
|
|
283
287
|
staticMoving: boolean;
|
|
284
288
|
dynamicDampingFactor: number;
|
|
285
289
|
minDistance: number;
|
|
@@ -47,7 +47,7 @@ export declare const PluginConfig: {
|
|
|
47
47
|
ShowAnimation: PluginConfigItem<boolean>;
|
|
48
48
|
};
|
|
49
49
|
Download: {
|
|
50
|
-
DefaultPdbProvider: PluginConfigItem<"rcsb" | "pdbe">;
|
|
50
|
+
DefaultPdbProvider: PluginConfigItem<"rcsb" | "pdbe" | "pdbj">;
|
|
51
51
|
DefaultEmdbProvider: PluginConfigItem<EmdbDownloadProvider>;
|
|
52
52
|
};
|
|
53
53
|
Structure: {
|
package/lib/mol-plugin/spec.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
package/lib/mol-plugin/spec.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -16,6 +16,7 @@ import { StateTransforms } from '../mol-plugin-state/transforms';
|
|
|
16
16
|
import { BoxifyVolumeStreaming, CreateVolumeStreamingBehavior, InitVolumeStreaming } from '../mol-plugin/behavior/dynamic/volume-streaming/transformers';
|
|
17
17
|
import { AnimateStateInterpolation } from '../mol-plugin-state/animation/built-in/state-interpolation';
|
|
18
18
|
import { AnimateStructureSpin } from '../mol-plugin-state/animation/built-in/spin-structure';
|
|
19
|
+
import { AnimateCameraRock } from '../mol-plugin-state/animation/built-in/camera-rock';
|
|
19
20
|
export { PluginSpec };
|
|
20
21
|
var PluginSpec;
|
|
21
22
|
(function (PluginSpec) {
|
|
@@ -95,6 +96,7 @@ export var DefaultPluginSpec = function () { return ({
|
|
|
95
96
|
animations: [
|
|
96
97
|
AnimateModelIndex,
|
|
97
98
|
AnimateCameraSpin,
|
|
99
|
+
AnimateCameraRock,
|
|
98
100
|
AnimateStateSnapshots,
|
|
99
101
|
AnimateAssemblyUnwind,
|
|
100
102
|
AnimateStructureSpin,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var PLUGIN_VERSION = '3.0.
|
|
2
|
-
export var PLUGIN_VERSION_DATE = new Date(typeof __MOLSTAR_DEBUG_TIMESTAMP__ !== 'undefined' ? __MOLSTAR_DEBUG_TIMESTAMP__ :
|
|
1
|
+
export var PLUGIN_VERSION = '3.0.2';
|
|
2
|
+
export var PLUGIN_VERSION_DATE = new Date(typeof __MOLSTAR_DEBUG_TIMESTAMP__ !== 'undefined' ? __MOLSTAR_DEBUG_TIMESTAMP__ : 1643574187710);
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
6
6
|
import { StateAction } from '../../mol-state';
|
|
7
|
+
import { Asset } from '../../mol-util/assets';
|
|
7
8
|
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
8
9
|
import { PluginStateObject } from '../objects';
|
|
9
10
|
export declare const OpenFiles: StateAction<PluginStateObject.Root, void, PD.Normalize<{
|
|
10
|
-
files:
|
|
11
|
+
files: Asset.File[] | null;
|
|
11
12
|
format: PD.NamedParams<PD.Normalize<unknown>, "auto"> | PD.NamedParams<string, "specific">;
|
|
12
13
|
visuals: boolean;
|
|
13
14
|
}>>;
|
|
14
15
|
export declare const DownloadFile: StateAction<PluginStateObject.Root, void, PD.Normalize<{
|
|
15
|
-
url: string |
|
|
16
|
+
url: string | Asset.Url;
|
|
16
17
|
format: string;
|
|
17
18
|
isBinary: boolean;
|
|
18
19
|
visuals: boolean;
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
import { __awaiter, __generator } from "tslib";
|
|
7
7
|
import { StateAction } from '../../mol-state';
|
|
8
8
|
import { Task } from '../../mol-task';
|
|
9
|
+
import { Asset } from '../../mol-util/assets';
|
|
9
10
|
import { getFileInfo } from '../../mol-util/file-info';
|
|
10
11
|
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
12
|
+
import { unzip } from '../../mol-util/zip/zip';
|
|
11
13
|
import { PluginStateObject } from '../objects';
|
|
12
14
|
export var OpenFiles = StateAction.build({
|
|
13
15
|
display: { name: 'Open Files', description: 'Load one or more files and optionally create default visuals' },
|
|
@@ -31,53 +33,87 @@ export var OpenFiles = StateAction.build({
|
|
|
31
33
|
case 0:
|
|
32
34
|
plugin.behaviors.layout.leftPanelTabName.next('data');
|
|
33
35
|
return [4 /*yield*/, state.transaction(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
34
|
-
var _i, _a, file,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
switch (_d.label) {
|
|
36
|
+
var processFile, _i, _a, file, zippedFiles, _b, _c, _d, _e, _f, fn, filedata, asset, e_1;
|
|
37
|
+
return __generator(this, function (_g) {
|
|
38
|
+
switch (_g.label) {
|
|
38
39
|
case 0:
|
|
39
40
|
if (params.files === null) {
|
|
40
41
|
plugin.log.error('No file(s) selected');
|
|
41
42
|
return [2 /*return*/];
|
|
42
43
|
}
|
|
44
|
+
processFile = function (file) { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
|
+
var info, isBinary, data, provider, parsed;
|
|
46
|
+
var _a, _b;
|
|
47
|
+
return __generator(this, function (_c) {
|
|
48
|
+
switch (_c.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
info = getFileInfo(file.file);
|
|
51
|
+
isBinary = plugin.dataFormats.binaryExtensions.has(info.ext);
|
|
52
|
+
return [4 /*yield*/, plugin.builders.data.readFile({ file: file, isBinary: isBinary })];
|
|
53
|
+
case 1:
|
|
54
|
+
data = (_c.sent()).data;
|
|
55
|
+
provider = params.format.name === 'auto'
|
|
56
|
+
? plugin.dataFormats.auto(info, (_a = data.cell) === null || _a === void 0 ? void 0 : _a.obj)
|
|
57
|
+
: plugin.dataFormats.get(params.format.params);
|
|
58
|
+
if (!provider) {
|
|
59
|
+
plugin.log.warn("OpenFiles: could not find data provider for '".concat(info.name, ".").concat(info.ext, "'"));
|
|
60
|
+
return [2 /*return*/];
|
|
61
|
+
}
|
|
62
|
+
return [4 /*yield*/, provider.parse(plugin, data)];
|
|
63
|
+
case 2:
|
|
64
|
+
parsed = _c.sent();
|
|
65
|
+
if (!params.visuals) return [3 /*break*/, 4];
|
|
66
|
+
return [4 /*yield*/, ((_b = provider.visuals) === null || _b === void 0 ? void 0 : _b.call(provider, plugin, parsed))];
|
|
67
|
+
case 3:
|
|
68
|
+
_c.sent();
|
|
69
|
+
_c.label = 4;
|
|
70
|
+
case 4: return [2 /*return*/];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}); };
|
|
43
74
|
_i = 0, _a = params.files;
|
|
44
|
-
|
|
75
|
+
_g.label = 1;
|
|
45
76
|
case 1:
|
|
46
|
-
if (!(_i < _a.length)) return [3 /*break*/,
|
|
77
|
+
if (!(_i < _a.length)) return [3 /*break*/, 14];
|
|
47
78
|
file = _a[_i];
|
|
48
|
-
|
|
79
|
+
_g.label = 2;
|
|
49
80
|
case 2:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
provider = params.format.name === 'auto'
|
|
57
|
-
? plugin.dataFormats.auto(info, (_b = data.cell) === null || _b === void 0 ? void 0 : _b.obj)
|
|
58
|
-
: plugin.dataFormats.get(params.format.params);
|
|
59
|
-
if (!provider) {
|
|
60
|
-
plugin.log.warn("OpenFiles: could not find data provider for '".concat(info.name, ".").concat(info.ext, "'"));
|
|
61
|
-
return [3 /*break*/, 8];
|
|
62
|
-
}
|
|
63
|
-
return [4 /*yield*/, provider.parse(plugin, data)];
|
|
81
|
+
_g.trys.push([2, 12, , 13]);
|
|
82
|
+
if (!(file.file && file.name.toLowerCase().endsWith('.zip'))) return [3 /*break*/, 9];
|
|
83
|
+
_b = unzip;
|
|
84
|
+
_c = [taskCtx];
|
|
85
|
+
return [4 /*yield*/, file.file.arrayBuffer()];
|
|
86
|
+
case 3: return [4 /*yield*/, _b.apply(void 0, _c.concat([_g.sent()]))];
|
|
64
87
|
case 4:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
88
|
+
zippedFiles = _g.sent();
|
|
89
|
+
_d = 0, _e = Object.entries(zippedFiles);
|
|
90
|
+
_g.label = 5;
|
|
68
91
|
case 5:
|
|
69
|
-
_d.
|
|
70
|
-
_d
|
|
71
|
-
|
|
92
|
+
if (!(_d < _e.length)) return [3 /*break*/, 8];
|
|
93
|
+
_f = _e[_d], fn = _f[0], filedata = _f[1];
|
|
94
|
+
asset = Asset.File(new File([filedata], fn));
|
|
95
|
+
return [4 /*yield*/, processFile(asset)];
|
|
96
|
+
case 6:
|
|
97
|
+
_g.sent();
|
|
98
|
+
_g.label = 7;
|
|
72
99
|
case 7:
|
|
73
|
-
|
|
100
|
+
_d++;
|
|
101
|
+
return [3 /*break*/, 5];
|
|
102
|
+
case 8: return [3 /*break*/, 11];
|
|
103
|
+
case 9: return [4 /*yield*/, processFile(file)];
|
|
104
|
+
case 10:
|
|
105
|
+
_g.sent();
|
|
106
|
+
_g.label = 11;
|
|
107
|
+
case 11: return [3 /*break*/, 13];
|
|
108
|
+
case 12:
|
|
109
|
+
e_1 = _g.sent();
|
|
74
110
|
console.error(e_1);
|
|
75
111
|
plugin.log.error("Error opening file '".concat(file.name, "'"));
|
|
76
|
-
return [3 /*break*/,
|
|
77
|
-
case
|
|
112
|
+
return [3 /*break*/, 13];
|
|
113
|
+
case 13:
|
|
78
114
|
_i++;
|
|
79
115
|
return [3 /*break*/, 1];
|
|
80
|
-
case
|
|
116
|
+
case 14: return [2 /*return*/];
|
|
81
117
|
}
|
|
82
118
|
});
|
|
83
119
|
}); }).runInContext(taskCtx)];
|
|
@@ -14,6 +14,7 @@ export declare const PdbDownloadProvider: {
|
|
|
14
14
|
pdbe: PD.Group<PD.Normalize<{
|
|
15
15
|
variant: "updated" | "updated-bcif" | "updtaed-bcif" | "archival";
|
|
16
16
|
}>>;
|
|
17
|
+
pdbj: PD.Group<PD.Normalize<unknown>>;
|
|
17
18
|
};
|
|
18
19
|
export declare type PdbDownloadProvider = keyof typeof PdbDownloadProvider;
|
|
19
20
|
export { DownloadStructure };
|