molstar 3.0.0-dev.9 → 3.1.0
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/docking-viewer/viewport.d.ts +2 -0
- package/lib/apps/viewer/app.d.ts +2 -1
- package/lib/apps/viewer/app.js +21 -8
- package/lib/apps/viewer/index.html +2 -2
- package/lib/commonjs/apps/docking-viewer/viewport.d.ts +2 -0
- package/lib/commonjs/apps/viewer/app.d.ts +2 -1
- package/lib/commonjs/apps/viewer/app.js +23 -10
- 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/behavior.d.ts +1 -0
- package/lib/commonjs/extensions/anvil/representation.js +1 -1
- package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
- package/lib/commonjs/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
- 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 +4 -2
- package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +13 -13
- package/lib/commonjs/extensions/rcsb/validation-report/behavior.d.ts +3 -0
- package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +12 -4
- package/lib/commonjs/mol-canvas3d/canvas3d.js +1 -1
- 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-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +2 -2
- package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/cylinders.frag.js +2 -2
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +2 -2
- package/lib/commonjs/mol-gl/shader/mesh.frag.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/mesh.frag.js +2 -2
- package/lib/commonjs/mol-gl/shader/spheres.frag.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/spheres.frag.js +2 -2
- 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/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/categories/secondary-structure.js +8 -8
- 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/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/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-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/dynamic/selection/structure-focus-representation.d.ts +2 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +16 -7
- 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/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/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 +8 -6
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +2 -1
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +180 -6
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +48 -2
- package/lib/commonjs/mol-plugin-state/builder/structure/representation.d.ts +2 -1
- 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-state/manager/structure/component.d.ts +2 -1
- package/lib/commonjs/mol-plugin-state/manager/structure/component.js +11 -8
- package/lib/commonjs/mol-plugin-ui/controls/icons.d.ts +2 -1
- package/lib/commonjs/mol-plugin-ui/controls/icons.js +8 -5
- package/lib/commonjs/mol-plugin-ui/controls.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/controls.js +2 -1
- package/lib/commonjs/mol-plugin-ui/structure/quick-styles.d.ts +25 -0
- package/lib/commonjs/mol-plugin-ui/structure/quick-styles.js +131 -0
- package/lib/commonjs/mol-plugin-ui/structure/superposition.js +2 -2
- package/lib/commonjs/mol-plugin-ui/structure/volume.js +4 -4
- 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/registry.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/representation/cartoon.d.ts +4 -4
- package/lib/commonjs/mol-repr/structure/representation/cartoon.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/behavior.d.ts +1 -0
- package/lib/extensions/anvil/representation.js +1 -1
- package/lib/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
- package/lib/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
- 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 +4 -2
- package/lib/extensions/rcsb/graphql/types.d.ts +13 -13
- package/lib/extensions/rcsb/validation-report/behavior.d.ts +3 -0
- package/lib/mol-canvas3d/canvas3d.d.ts +12 -4
- package/lib/mol-canvas3d/canvas3d.js +1 -1
- 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-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -2
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +2 -2
- package/lib/mol-gl/shader/cylinders.frag.d.ts +2 -2
- package/lib/mol-gl/shader/cylinders.frag.js +2 -2
- package/lib/mol-gl/shader/direct-volume.frag.d.ts +2 -2
- package/lib/mol-gl/shader/direct-volume.frag.js +2 -2
- package/lib/mol-gl/shader/mesh.frag.d.ts +2 -2
- package/lib/mol-gl/shader/mesh.frag.js +2 -2
- package/lib/mol-gl/shader/spheres.frag.d.ts +2 -2
- package/lib/mol-gl/shader/spheres.frag.js +2 -2
- 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/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/categories/secondary-structure.js +8 -8
- 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/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/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-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/dynamic/selection/structure-focus-representation.d.ts +2 -1
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +16 -7
- package/lib/mol-plugin/behavior/static/representation.js +1 -1
- package/lib/mol-plugin/commands.d.ts +6 -2
- 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/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 +8 -6
- package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +2 -1
- package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +180 -6
- package/lib/mol-plugin-state/builder/structure/representation-preset.js +48 -2
- package/lib/mol-plugin-state/builder/structure/representation.d.ts +2 -1
- 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-state/manager/structure/component.d.ts +2 -1
- package/lib/mol-plugin-state/manager/structure/component.js +11 -8
- package/lib/mol-plugin-ui/controls/icons.d.ts +2 -1
- package/lib/mol-plugin-ui/controls/icons.js +5 -3
- package/lib/mol-plugin-ui/controls.d.ts +1 -1
- package/lib/mol-plugin-ui/controls.js +2 -1
- package/lib/mol-plugin-ui/structure/quick-styles.d.ts +25 -0
- package/lib/mol-plugin-ui/structure/quick-styles.js +128 -0
- package/lib/mol-plugin-ui/structure/superposition.js +2 -2
- package/lib/mol-plugin-ui/structure/volume.js +4 -4
- 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/registry.d.ts +1 -1
- package/lib/mol-repr/structure/representation/cartoon.d.ts +4 -4
- package/lib/mol-repr/structure/representation/cartoon.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 +38 -40
package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2019-
|
|
3
|
+
* Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
4
|
*
|
|
5
5
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
6
6
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -27,11 +27,19 @@ var StructureFocusRepresentationParams = function (plugin) {
|
|
|
27
27
|
expandRadius: param_definition_1.ParamDefinition.Numeric(5, { min: 1, max: 10, step: 1 }),
|
|
28
28
|
targetParams: param_definition_1.ParamDefinition.Group(reprParams, {
|
|
29
29
|
label: 'Target',
|
|
30
|
-
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, {
|
|
30
|
+
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, {
|
|
31
|
+
type: 'ball-and-stick',
|
|
32
|
+
size: 'physical',
|
|
33
|
+
typeParams: { sizeFactor: 0.22, sizeAspectRatio: 0.73, adjustCylinderLength: true, xrayShaded: true, aromaticBonds: false, multipleBonds: 'off', excludeTypes: ['hydrogen-bond', 'metal-coordination'] },
|
|
34
|
+
})
|
|
31
35
|
}),
|
|
32
36
|
surroundingsParams: param_definition_1.ParamDefinition.Group(reprParams, {
|
|
33
37
|
label: 'Surroundings',
|
|
34
|
-
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, {
|
|
38
|
+
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, {
|
|
39
|
+
type: 'ball-and-stick',
|
|
40
|
+
size: 'physical',
|
|
41
|
+
typeParams: { sizeFactor: 0.16, excludeTypes: ['hydrogen-bond', 'metal-coordination'] }
|
|
42
|
+
})
|
|
35
43
|
}),
|
|
36
44
|
nciParams: param_definition_1.ParamDefinition.Group(reprParams, {
|
|
37
45
|
label: 'Non-covalent Int.',
|
|
@@ -44,6 +52,7 @@ var StructureFocusRepresentationParams = function (plugin) {
|
|
|
44
52
|
components: param_definition_1.ParamDefinition.MultiSelect(FocusComponents, param_definition_1.ParamDefinition.arrayToOptions(FocusComponents)),
|
|
45
53
|
excludeTargetFromSurroundings: param_definition_1.ParamDefinition.Boolean(false, { label: 'Exclude Target', description: 'Exclude the focus "target" from the surroudings component.' }),
|
|
46
54
|
ignoreHydrogens: param_definition_1.ParamDefinition.Boolean(false),
|
|
55
|
+
ignoreLight: param_definition_1.ParamDefinition.Boolean(false),
|
|
47
56
|
material: material_1.Material.getParam(),
|
|
48
57
|
clip: param_definition_1.ParamDefinition.Group(clip_1.Clip.Params),
|
|
49
58
|
};
|
|
@@ -71,9 +80,9 @@ var StructureFocusRepresentationBehavior = /** @class */ (function (_super) {
|
|
|
71
80
|
configurable: true
|
|
72
81
|
});
|
|
73
82
|
StructureFocusRepresentationBehavior.prototype.getReprParams = function (reprParams) {
|
|
74
|
-
return (0, tslib_1.__assign)((0, tslib_1.__assign)({},
|
|
83
|
+
return (0, tslib_1.__assign)((0, tslib_1.__assign)({}, reprParams), { type: {
|
|
75
84
|
name: reprParams.type.name,
|
|
76
|
-
params: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, reprParams.type.params), { ignoreHydrogens: this.params.ignoreHydrogens, material: this.params.material, clip: this.params.clip })
|
|
85
|
+
params: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, reprParams.type.params), { ignoreHydrogens: this.params.ignoreHydrogens, ignoreLight: this.params.ignoreLight, material: this.params.material, clip: this.params.clip })
|
|
77
86
|
} });
|
|
78
87
|
};
|
|
79
88
|
StructureFocusRepresentationBehavior.prototype.ensureShape = function (cell) {
|
|
@@ -107,7 +116,7 @@ var StructureFocusRepresentationBehavior = /** @class */ (function (_super) {
|
|
|
107
116
|
if (components.indexOf('interactions') >= 0 && !refs[StructureFocusRepresentationTags.SurrNciRepr] && cell.obj && interactions_1.InteractionsRepresentationProvider.isApplicable((_a = cell.obj) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
108
117
|
refs[StructureFocusRepresentationTags.SurrNciRepr] = builder
|
|
109
118
|
.to(refs[StructureFocusRepresentationTags.SurrSel])
|
|
110
|
-
.apply(transforms_1.StateTransforms.Representation.StructureRepresentation3D, this.params.nciParams, { tags: StructureFocusRepresentationTags.SurrNciRepr }).ref;
|
|
119
|
+
.apply(transforms_1.StateTransforms.Representation.StructureRepresentation3D, this.getReprParams(this.params.nciParams), { tags: StructureFocusRepresentationTags.SurrNciRepr }).ref;
|
|
111
120
|
}
|
|
112
121
|
return { state: state, builder: builder, refs: refs };
|
|
113
122
|
};
|
|
@@ -217,7 +226,7 @@ var StructureFocusRepresentationBehavior = /** @class */ (function (_super) {
|
|
|
217
226
|
if (!hasComponent)
|
|
218
227
|
builder.delete(repr.transform.ref);
|
|
219
228
|
else
|
|
220
|
-
builder.to(repr).update(this.params.nciParams);
|
|
229
|
+
builder.to(repr).update(this.getReprParams(this.params.nciParams));
|
|
221
230
|
}
|
|
222
231
|
return [4 /*yield*/, commands_1.PluginCommands.State.Update(this.plugin, { state: state, tree: builder, options: { doNotLogTiming: true, doNotUpdateCurrent: true } })];
|
|
223
232
|
case 1:
|
|
@@ -89,7 +89,7 @@ function UpdateRepresentationVisibility(ctx) {
|
|
|
89
89
|
}
|
|
90
90
|
exports.UpdateRepresentationVisibility = UpdateRepresentationVisibility;
|
|
91
91
|
function updateVisibility(cell, r) {
|
|
92
|
-
if (r.state.visible === cell.state.isHidden) {
|
|
92
|
+
if (r.state.visible === !!cell.state.isHidden) {
|
|
93
93
|
r.setState({ visible: !cell.state.isHidden });
|
|
94
94
|
return true;
|
|
95
95
|
}
|
|
@@ -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;
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2018-
|
|
3
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
4
|
*
|
|
5
5
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
6
6
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -19,6 +19,7 @@ var transforms_1 = require("../mol-plugin-state/transforms");
|
|
|
19
19
|
var transformers_1 = require("../mol-plugin/behavior/dynamic/volume-streaming/transformers");
|
|
20
20
|
var state_interpolation_1 = require("../mol-plugin-state/animation/built-in/state-interpolation");
|
|
21
21
|
var spin_structure_1 = require("../mol-plugin-state/animation/built-in/spin-structure");
|
|
22
|
+
var camera_rock_1 = require("../mol-plugin-state/animation/built-in/camera-rock");
|
|
22
23
|
var PluginSpec;
|
|
23
24
|
(function (PluginSpec) {
|
|
24
25
|
function Action(action, params) {
|
|
@@ -98,6 +99,7 @@ var DefaultPluginSpec = function () { return ({
|
|
|
98
99
|
animations: [
|
|
99
100
|
model_index_1.AnimateModelIndex,
|
|
100
101
|
camera_spin_1.AnimateCameraSpin,
|
|
102
|
+
camera_rock_1.AnimateCameraRock,
|
|
101
103
|
state_snapshots_1.AnimateStateSnapshots,
|
|
102
104
|
assembly_unwind_1.AnimateAssemblyUnwind,
|
|
103
105
|
spin_structure_1.AnimateStructureSpin,
|
|
@@ -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;
|
|
@@ -9,8 +9,10 @@ exports.DownloadFile = exports.OpenFiles = void 0;
|
|
|
9
9
|
var tslib_1 = require("tslib");
|
|
10
10
|
var mol_state_1 = require("../../mol-state");
|
|
11
11
|
var mol_task_1 = require("../../mol-task");
|
|
12
|
+
var assets_1 = require("../../mol-util/assets");
|
|
12
13
|
var file_info_1 = require("../../mol-util/file-info");
|
|
13
14
|
var param_definition_1 = require("../../mol-util/param-definition");
|
|
15
|
+
var zip_1 = require("../../mol-util/zip/zip");
|
|
14
16
|
var objects_1 = require("../objects");
|
|
15
17
|
exports.OpenFiles = mol_state_1.StateAction.build({
|
|
16
18
|
display: { name: 'Open Files', description: 'Load one or more files and optionally create default visuals' },
|
|
@@ -34,53 +36,87 @@ exports.OpenFiles = mol_state_1.StateAction.build({
|
|
|
34
36
|
case 0:
|
|
35
37
|
plugin.behaviors.layout.leftPanelTabName.next('data');
|
|
36
38
|
return [4 /*yield*/, state.transaction(function () { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () {
|
|
37
|
-
var _i, _a, file,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
switch (_d.label) {
|
|
39
|
+
var processFile, _i, _a, file, zippedFiles, _b, _c, _d, _e, _f, fn, filedata, asset, e_1;
|
|
40
|
+
return (0, tslib_1.__generator)(this, function (_g) {
|
|
41
|
+
switch (_g.label) {
|
|
41
42
|
case 0:
|
|
42
43
|
if (params.files === null) {
|
|
43
44
|
plugin.log.error('No file(s) selected');
|
|
44
45
|
return [2 /*return*/];
|
|
45
46
|
}
|
|
47
|
+
processFile = function (file) { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () {
|
|
48
|
+
var info, isBinary, data, provider, parsed;
|
|
49
|
+
var _a, _b;
|
|
50
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
51
|
+
switch (_c.label) {
|
|
52
|
+
case 0:
|
|
53
|
+
info = (0, file_info_1.getFileInfo)(file.file);
|
|
54
|
+
isBinary = plugin.dataFormats.binaryExtensions.has(info.ext);
|
|
55
|
+
return [4 /*yield*/, plugin.builders.data.readFile({ file: file, isBinary: isBinary })];
|
|
56
|
+
case 1:
|
|
57
|
+
data = (_c.sent()).data;
|
|
58
|
+
provider = params.format.name === 'auto'
|
|
59
|
+
? plugin.dataFormats.auto(info, (_a = data.cell) === null || _a === void 0 ? void 0 : _a.obj)
|
|
60
|
+
: plugin.dataFormats.get(params.format.params);
|
|
61
|
+
if (!provider) {
|
|
62
|
+
plugin.log.warn("OpenFiles: could not find data provider for '".concat(info.name, ".").concat(info.ext, "'"));
|
|
63
|
+
return [2 /*return*/];
|
|
64
|
+
}
|
|
65
|
+
return [4 /*yield*/, provider.parse(plugin, data)];
|
|
66
|
+
case 2:
|
|
67
|
+
parsed = _c.sent();
|
|
68
|
+
if (!params.visuals) return [3 /*break*/, 4];
|
|
69
|
+
return [4 /*yield*/, ((_b = provider.visuals) === null || _b === void 0 ? void 0 : _b.call(provider, plugin, parsed))];
|
|
70
|
+
case 3:
|
|
71
|
+
_c.sent();
|
|
72
|
+
_c.label = 4;
|
|
73
|
+
case 4: return [2 /*return*/];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}); };
|
|
46
77
|
_i = 0, _a = params.files;
|
|
47
|
-
|
|
78
|
+
_g.label = 1;
|
|
48
79
|
case 1:
|
|
49
|
-
if (!(_i < _a.length)) return [3 /*break*/,
|
|
80
|
+
if (!(_i < _a.length)) return [3 /*break*/, 14];
|
|
50
81
|
file = _a[_i];
|
|
51
|
-
|
|
82
|
+
_g.label = 2;
|
|
52
83
|
case 2:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
provider = params.format.name === 'auto'
|
|
60
|
-
? plugin.dataFormats.auto(info, (_b = data.cell) === null || _b === void 0 ? void 0 : _b.obj)
|
|
61
|
-
: plugin.dataFormats.get(params.format.params);
|
|
62
|
-
if (!provider) {
|
|
63
|
-
plugin.log.warn("OpenFiles: could not find data provider for '".concat(info.name, ".").concat(info.ext, "'"));
|
|
64
|
-
return [3 /*break*/, 8];
|
|
65
|
-
}
|
|
66
|
-
return [4 /*yield*/, provider.parse(plugin, data)];
|
|
84
|
+
_g.trys.push([2, 12, , 13]);
|
|
85
|
+
if (!(file.file && file.name.toLowerCase().endsWith('.zip'))) return [3 /*break*/, 9];
|
|
86
|
+
_b = zip_1.unzip;
|
|
87
|
+
_c = [taskCtx];
|
|
88
|
+
return [4 /*yield*/, file.file.arrayBuffer()];
|
|
89
|
+
case 3: return [4 /*yield*/, _b.apply(void 0, _c.concat([_g.sent()]))];
|
|
67
90
|
case 4:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
91
|
+
zippedFiles = _g.sent();
|
|
92
|
+
_d = 0, _e = Object.entries(zippedFiles);
|
|
93
|
+
_g.label = 5;
|
|
71
94
|
case 5:
|
|
72
|
-
_d.
|
|
73
|
-
_d
|
|
74
|
-
|
|
95
|
+
if (!(_d < _e.length)) return [3 /*break*/, 8];
|
|
96
|
+
_f = _e[_d], fn = _f[0], filedata = _f[1];
|
|
97
|
+
asset = assets_1.Asset.File(new File([filedata], fn));
|
|
98
|
+
return [4 /*yield*/, processFile(asset)];
|
|
99
|
+
case 6:
|
|
100
|
+
_g.sent();
|
|
101
|
+
_g.label = 7;
|
|
75
102
|
case 7:
|
|
76
|
-
|
|
103
|
+
_d++;
|
|
104
|
+
return [3 /*break*/, 5];
|
|
105
|
+
case 8: return [3 /*break*/, 11];
|
|
106
|
+
case 9: return [4 /*yield*/, processFile(file)];
|
|
107
|
+
case 10:
|
|
108
|
+
_g.sent();
|
|
109
|
+
_g.label = 11;
|
|
110
|
+
case 11: return [3 /*break*/, 13];
|
|
111
|
+
case 12:
|
|
112
|
+
e_1 = _g.sent();
|
|
77
113
|
console.error(e_1);
|
|
78
114
|
plugin.log.error("Error opening file '".concat(file.name, "'"));
|
|
79
|
-
return [3 /*break*/,
|
|
80
|
-
case
|
|
115
|
+
return [3 /*break*/, 13];
|
|
116
|
+
case 13:
|
|
81
117
|
_i++;
|
|
82
118
|
return [3 /*break*/, 1];
|
|
83
|
-
case
|
|
119
|
+
case 14: return [2 /*return*/];
|
|
84
120
|
}
|
|
85
121
|
});
|
|
86
122
|
}); }).runInContext(taskCtx)];
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2018-
|
|
3
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
4
|
*
|
|
5
5
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
6
6
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -74,8 +74,8 @@ var DownloadDensity = mol_state_1.StateAction.build({
|
|
|
74
74
|
case 'pdb-xray':
|
|
75
75
|
downloadParams = src.params.provider.server === 'pdbe' ? {
|
|
76
76
|
url: assets_1.Asset.Url(src.params.type === '2fofc'
|
|
77
|
-
? "
|
|
78
|
-
: "
|
|
77
|
+
? "https://www.ebi.ac.uk/pdbe/coordinates/files/".concat(src.params.provider.id.toLowerCase(), ".ccp4")
|
|
78
|
+
: "https://www.ebi.ac.uk/pdbe/coordinates/files/".concat(src.params.provider.id.toLowerCase(), "_diff.ccp4")),
|
|
79
79
|
isBinary: true,
|
|
80
80
|
label: "PDBe X-ray map: ".concat(src.params.provider.id)
|
|
81
81
|
} : {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
|
+
*/
|
|
6
|
+
import { Camera } from '../../../mol-canvas3d/camera';
|
|
7
|
+
import { PluginStateAnimation } from '../model';
|
|
8
|
+
declare type State = {
|
|
9
|
+
snapshot: Camera.Snapshot;
|
|
10
|
+
};
|
|
11
|
+
export declare const AnimateCameraRock: PluginStateAnimation<{
|
|
12
|
+
durationInMs: number;
|
|
13
|
+
speed: number;
|
|
14
|
+
angle: number;
|
|
15
|
+
}, State | undefined>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
|
+
*
|
|
5
|
+
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AnimateCameraRock = void 0;
|
|
9
|
+
var tslib_1 = require("tslib");
|
|
10
|
+
var interpolate_1 = require("../../../mol-math/interpolate");
|
|
11
|
+
var quat_1 = require("../../../mol-math/linear-algebra/3d/quat");
|
|
12
|
+
var vec3_1 = require("../../../mol-math/linear-algebra/3d/vec3");
|
|
13
|
+
var misc_1 = require("../../../mol-math/misc");
|
|
14
|
+
var param_definition_1 = require("../../../mol-util/param-definition");
|
|
15
|
+
var model_1 = require("../model");
|
|
16
|
+
var _dir = (0, vec3_1.Vec3)(), _axis = (0, vec3_1.Vec3)(), _rot = (0, quat_1.Quat)();
|
|
17
|
+
exports.AnimateCameraRock = model_1.PluginStateAnimation.create({
|
|
18
|
+
name: 'built-in.animate-camera-rock',
|
|
19
|
+
display: { name: 'Camera Rock', description: 'Rock the 3D scene around the x-axis in view space' },
|
|
20
|
+
isExportable: true,
|
|
21
|
+
params: function () { return ({
|
|
22
|
+
durationInMs: param_definition_1.ParamDefinition.Numeric(4000, { min: 100, max: 20000, step: 100 }),
|
|
23
|
+
speed: param_definition_1.ParamDefinition.Numeric(1, { min: 1, max: 10, step: 1 }, { description: 'How many times to rock from side to side.' }),
|
|
24
|
+
angle: param_definition_1.ParamDefinition.Numeric(10, { min: 0, max: 180, step: 1 }, { description: 'How many degrees to rotate in each direction.' }),
|
|
25
|
+
}); },
|
|
26
|
+
initialState: function (p, ctx) { return ({ snapshot: ctx.canvas3d.camera.getSnapshot() }); },
|
|
27
|
+
getDuration: function (p) { return ({ kind: 'fixed', durationMs: p.durationInMs }); },
|
|
28
|
+
teardown: function (_, state, ctx) {
|
|
29
|
+
var _a;
|
|
30
|
+
(_a = ctx.canvas3d) === null || _a === void 0 ? void 0 : _a.requestCameraReset({ snapshot: state.snapshot, durationMs: 0 });
|
|
31
|
+
},
|
|
32
|
+
apply: function (animState, t, ctx) {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
|
|
35
|
+
var snapshot, phase, angle, position;
|
|
36
|
+
return (0, tslib_1.__generator)(this, function (_c) {
|
|
37
|
+
if (t.current === 0) {
|
|
38
|
+
return [2 /*return*/, { kind: 'next', state: animState }];
|
|
39
|
+
}
|
|
40
|
+
snapshot = animState.snapshot;
|
|
41
|
+
if (snapshot.radiusMax < 0.0001) {
|
|
42
|
+
return [2 /*return*/, { kind: 'finished' }];
|
|
43
|
+
}
|
|
44
|
+
phase = t.animation
|
|
45
|
+
? ((_a = t.animation) === null || _a === void 0 ? void 0 : _a.currentFrame) / (t.animation.frameCount + 1)
|
|
46
|
+
: (0, interpolate_1.clamp)(t.current / ctx.params.durationInMs, 0, 1);
|
|
47
|
+
angle = Math.sin(phase * ctx.params.speed * Math.PI * 2) * (0, misc_1.degToRad)(ctx.params.angle);
|
|
48
|
+
vec3_1.Vec3.sub(_dir, snapshot.position, snapshot.target);
|
|
49
|
+
vec3_1.Vec3.normalize(_axis, snapshot.up);
|
|
50
|
+
quat_1.Quat.setAxisAngle(_rot, _axis, angle);
|
|
51
|
+
vec3_1.Vec3.transformQuat(_dir, _dir, _rot);
|
|
52
|
+
position = vec3_1.Vec3.add((0, vec3_1.Vec3)(), snapshot.target, _dir);
|
|
53
|
+
(_b = ctx.plugin.canvas3d) === null || _b === void 0 ? void 0 : _b.requestCameraReset({ snapshot: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, snapshot), { position: position }), durationMs: 0 });
|
|
54
|
+
if (phase >= 0.99999) {
|
|
55
|
+
return [2 /*return*/, { kind: 'finished' }];
|
|
56
|
+
}
|
|
57
|
+
return [2 /*return*/, { kind: 'next', state: animState }];
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=camera-rock.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
4
|
*
|
|
5
5
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
6
6
|
*/
|
|
@@ -15,11 +15,11 @@ var model_1 = require("../model");
|
|
|
15
15
|
var _dir = (0, vec3_1.Vec3)(), _axis = (0, vec3_1.Vec3)(), _rot = (0, quat_1.Quat)();
|
|
16
16
|
exports.AnimateCameraSpin = model_1.PluginStateAnimation.create({
|
|
17
17
|
name: 'built-in.animate-camera-spin',
|
|
18
|
-
display: { name: 'Camera Spin' },
|
|
18
|
+
display: { name: 'Camera Spin', description: 'Spin the 3D scene around the x-axis in view space' },
|
|
19
19
|
isExportable: true,
|
|
20
20
|
params: function () { return ({
|
|
21
21
|
durationInMs: param_definition_1.ParamDefinition.Numeric(4000, { min: 100, max: 20000, step: 100 }),
|
|
22
|
-
speed: param_definition_1.ParamDefinition.Numeric(1, { min: 1, max: 10, step: 1 }, { description: 'How many times to spin in the specified
|
|
22
|
+
speed: param_definition_1.ParamDefinition.Numeric(1, { min: 1, max: 10, step: 1 }, { description: 'How many times to spin in the specified duration.' }),
|
|
23
23
|
direction: param_definition_1.ParamDefinition.Select('cw', [['cw', 'Clockwise'], ['ccw', 'Counter Clockwise']], { cycle: true })
|
|
24
24
|
}); },
|
|
25
25
|
initialState: function (_, ctx) { var _a; return ({ snapshot: (_a = ctx.canvas3d) === null || _a === void 0 ? void 0 : _a.camera.getSnapshot() }); },
|
|
@@ -40,11 +40,9 @@ exports.AnimateCameraSpin = model_1.PluginStateAnimation.create({
|
|
|
40
40
|
if (snapshot.radiusMax < 0.0001) {
|
|
41
41
|
return [2 /*return*/, { kind: 'finished' }];
|
|
42
42
|
}
|
|
43
|
-
phase =
|
|
44
|
-
|
|
45
|
-
(
|
|
46
|
-
return [2 /*return*/, { kind: 'finished' }];
|
|
47
|
-
}
|
|
43
|
+
phase = t.animation
|
|
44
|
+
? ((_a = t.animation) === null || _a === void 0 ? void 0 : _a.currentFrame) / (t.animation.frameCount + 1)
|
|
45
|
+
: (0, interpolate_1.clamp)(t.current / ctx.params.durationInMs, 0, 1);
|
|
48
46
|
angle = 2 * Math.PI * phase * ctx.params.speed * (ctx.params.direction === 'ccw' ? -1 : 1);
|
|
49
47
|
vec3_1.Vec3.sub(_dir, snapshot.position, snapshot.target);
|
|
50
48
|
vec3_1.Vec3.normalize(_axis, snapshot.up);
|
|
@@ -52,6 +50,9 @@ exports.AnimateCameraSpin = model_1.PluginStateAnimation.create({
|
|
|
52
50
|
vec3_1.Vec3.transformQuat(_dir, _dir, _rot);
|
|
53
51
|
position = vec3_1.Vec3.add((0, vec3_1.Vec3)(), snapshot.target, _dir);
|
|
54
52
|
(_b = ctx.plugin.canvas3d) === null || _b === void 0 ? void 0 : _b.requestCameraReset({ snapshot: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, snapshot), { position: position }), durationMs: 0 });
|
|
53
|
+
if (phase >= 0.99999) {
|
|
54
|
+
return [2 /*return*/, { kind: 'finished' }];
|
|
55
|
+
}
|
|
55
56
|
return [2 /*return*/, { kind: 'next', state: animState }];
|
|
56
57
|
});
|
|
57
58
|
});
|
|
@@ -28,7 +28,7 @@ export declare namespace TrajectoryHierarchyPresetProvider {
|
|
|
28
28
|
[x: string]: any;
|
|
29
29
|
}>;
|
|
30
30
|
}>> | undefined>;
|
|
31
|
-
representationPreset: PD.Base<"auto" | "empty" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined>;
|
|
31
|
+
representationPreset: PD.Base<"auto" | "empty" | "illustrative" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined>;
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
export declare const PresetTrajectoryHierarchy: {
|
|
@@ -41,7 +41,7 @@ export declare const PresetTrajectoryHierarchy: {
|
|
|
41
41
|
autoAttach: any;
|
|
42
42
|
properties: any;
|
|
43
43
|
}>> | undefined;
|
|
44
|
-
representationPreset: "auto" | "empty" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
44
|
+
representationPreset: "auto" | "empty" | "illustrative" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
45
45
|
model: PD.Normalize<PD.Normalize<{
|
|
46
46
|
modelIndex: any;
|
|
47
47
|
}>> | undefined;
|
|
@@ -66,6 +66,7 @@ export declare const PresetTrajectoryHierarchy: {
|
|
|
66
66
|
}>, "symmetry-assembly"> | undefined;
|
|
67
67
|
representationPresetParams: PD.Normalize<{
|
|
68
68
|
ignoreHydrogens: any;
|
|
69
|
+
ignoreLight: any;
|
|
69
70
|
quality: any;
|
|
70
71
|
theme: any;
|
|
71
72
|
}> | undefined;
|
|
@@ -86,10 +87,11 @@ export declare const PresetTrajectoryHierarchy: {
|
|
|
86
87
|
autoAttach: any;
|
|
87
88
|
properties: any;
|
|
88
89
|
}>> | undefined;
|
|
89
|
-
representationPreset: "auto" | "empty" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
90
|
+
representationPreset: "auto" | "empty" | "illustrative" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
90
91
|
useDefaultIfSingleModel: boolean | undefined;
|
|
91
92
|
representationPresetParams: PD.Normalize<{
|
|
92
93
|
ignoreHydrogens: any;
|
|
94
|
+
ignoreLight: any;
|
|
93
95
|
quality: any;
|
|
94
96
|
theme: any;
|
|
95
97
|
}> | undefined;
|
|
@@ -116,7 +118,7 @@ export declare const PresetTrajectoryHierarchy: {
|
|
|
116
118
|
autoAttach: any;
|
|
117
119
|
properties: any;
|
|
118
120
|
}>> | undefined;
|
|
119
|
-
representationPreset: "auto" | "empty" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
121
|
+
representationPreset: "auto" | "empty" | "illustrative" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
120
122
|
model: PD.Normalize<PD.Normalize<{
|
|
121
123
|
modelIndex: any;
|
|
122
124
|
}>> | undefined;
|
|
@@ -137,7 +139,7 @@ export declare const PresetTrajectoryHierarchy: {
|
|
|
137
139
|
autoAttach: any;
|
|
138
140
|
properties: any;
|
|
139
141
|
}>> | undefined;
|
|
140
|
-
representationPreset: "auto" | "empty" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
142
|
+
representationPreset: "auto" | "empty" | "illustrative" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
141
143
|
model: PD.Normalize<PD.Normalize<{
|
|
142
144
|
modelIndex: any;
|
|
143
145
|
}>> | undefined;
|
|
@@ -158,7 +160,7 @@ export declare const PresetTrajectoryHierarchy: {
|
|
|
158
160
|
autoAttach: any;
|
|
159
161
|
properties: any;
|
|
160
162
|
}>> | undefined;
|
|
161
|
-
representationPreset: "auto" | "empty" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
163
|
+
representationPreset: "auto" | "empty" | "illustrative" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
162
164
|
model: PD.Normalize<PD.Normalize<{
|
|
163
165
|
modelIndex: any;
|
|
164
166
|
}>> | undefined;
|
|
@@ -23,7 +23,7 @@ export declare class TrajectoryHierarchyBuilder {
|
|
|
23
23
|
autoAttach: any;
|
|
24
24
|
properties: any;
|
|
25
25
|
}>> | undefined;
|
|
26
|
-
representationPreset: "auto" | "empty" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
26
|
+
representationPreset: "auto" | "empty" | "illustrative" | "atomic-detail" | "polymer-cartoon" | "polymer-and-ligand" | "protein-and-nucleic" | "coarse-surface" | undefined;
|
|
27
27
|
model: PD.Normalize<PD.Normalize<{
|
|
28
28
|
modelIndex: any;
|
|
29
29
|
}>> | undefined;
|
|
@@ -48,6 +48,7 @@ export declare class TrajectoryHierarchyBuilder {
|
|
|
48
48
|
}>, "symmetry-assembly"> | undefined;
|
|
49
49
|
representationPresetParams: PD.Normalize<{
|
|
50
50
|
ignoreHydrogens: any;
|
|
51
|
+
ignoreLight: any;
|
|
51
52
|
quality: any;
|
|
52
53
|
theme: any;
|
|
53
54
|
}> | undefined;
|