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) 2018-
|
|
2
|
+
* Copyright (c) 2018-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
|
*/
|
|
@@ -154,9 +154,152 @@ export declare const ElementSymbolColorThemeParams: {
|
|
|
154
154
|
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
155
155
|
list: any;
|
|
156
156
|
}>, "colors">;
|
|
157
|
-
}>, "operator-name"
|
|
157
|
+
}>, "operator-name"> | PD.NamedParams<PD.Normalize<{
|
|
158
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
159
|
+
maxCount: any;
|
|
160
|
+
hue: any;
|
|
161
|
+
chroma: any;
|
|
162
|
+
luminance: any;
|
|
163
|
+
clusteringStepCount: any;
|
|
164
|
+
minSampleCount: any;
|
|
165
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
166
|
+
list: any;
|
|
167
|
+
}>, "colors">;
|
|
168
|
+
}>, "entity-id"> | PD.NamedParams<PD.Normalize<{
|
|
169
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
170
|
+
maxCount: any;
|
|
171
|
+
hue: any;
|
|
172
|
+
chroma: any;
|
|
173
|
+
luminance: any;
|
|
174
|
+
clusteringStepCount: any;
|
|
175
|
+
minSampleCount: any;
|
|
176
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
177
|
+
list: any;
|
|
178
|
+
}>, "colors">;
|
|
179
|
+
}>, "entity-source">>;
|
|
158
180
|
saturation: PD.Numeric;
|
|
159
181
|
lightness: PD.Numeric;
|
|
182
|
+
colors: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
183
|
+
H: Color;
|
|
184
|
+
D: Color;
|
|
185
|
+
T: Color;
|
|
186
|
+
HE: Color;
|
|
187
|
+
LI: Color;
|
|
188
|
+
BE: Color;
|
|
189
|
+
B: Color;
|
|
190
|
+
C: Color;
|
|
191
|
+
N: Color;
|
|
192
|
+
O: Color;
|
|
193
|
+
F: Color;
|
|
194
|
+
NE: Color;
|
|
195
|
+
NA: Color;
|
|
196
|
+
MG: Color;
|
|
197
|
+
AL: Color;
|
|
198
|
+
SI: Color;
|
|
199
|
+
P: Color;
|
|
200
|
+
S: Color;
|
|
201
|
+
CL: Color;
|
|
202
|
+
AR: Color;
|
|
203
|
+
K: Color;
|
|
204
|
+
CA: Color;
|
|
205
|
+
SC: Color;
|
|
206
|
+
TI: Color;
|
|
207
|
+
V: Color;
|
|
208
|
+
CR: Color;
|
|
209
|
+
MN: Color;
|
|
210
|
+
FE: Color;
|
|
211
|
+
CO: Color;
|
|
212
|
+
NI: Color;
|
|
213
|
+
CU: Color;
|
|
214
|
+
ZN: Color;
|
|
215
|
+
GA: Color;
|
|
216
|
+
GE: Color;
|
|
217
|
+
AS: Color;
|
|
218
|
+
SE: Color;
|
|
219
|
+
BR: Color;
|
|
220
|
+
KR: Color;
|
|
221
|
+
RB: Color;
|
|
222
|
+
SR: Color;
|
|
223
|
+
Y: Color;
|
|
224
|
+
ZR: Color;
|
|
225
|
+
NB: Color;
|
|
226
|
+
MO: Color;
|
|
227
|
+
TC: Color;
|
|
228
|
+
RU: Color;
|
|
229
|
+
RH: Color;
|
|
230
|
+
PD: Color;
|
|
231
|
+
AG: Color;
|
|
232
|
+
CD: Color;
|
|
233
|
+
IN: Color;
|
|
234
|
+
SN: Color;
|
|
235
|
+
SB: Color;
|
|
236
|
+
TE: Color;
|
|
237
|
+
I: Color;
|
|
238
|
+
XE: Color;
|
|
239
|
+
CS: Color;
|
|
240
|
+
BA: Color;
|
|
241
|
+
LA: Color;
|
|
242
|
+
CE: Color;
|
|
243
|
+
PR: Color;
|
|
244
|
+
ND: Color;
|
|
245
|
+
PM: Color;
|
|
246
|
+
SM: Color;
|
|
247
|
+
EU: Color;
|
|
248
|
+
GD: Color;
|
|
249
|
+
TB: Color;
|
|
250
|
+
DY: Color;
|
|
251
|
+
HO: Color;
|
|
252
|
+
ER: Color;
|
|
253
|
+
TM: Color;
|
|
254
|
+
YB: Color;
|
|
255
|
+
LU: Color;
|
|
256
|
+
HF: Color;
|
|
257
|
+
TA: Color;
|
|
258
|
+
W: Color;
|
|
259
|
+
RE: Color;
|
|
260
|
+
OS: Color;
|
|
261
|
+
IR: Color;
|
|
262
|
+
PT: Color;
|
|
263
|
+
AU: Color;
|
|
264
|
+
HG: Color;
|
|
265
|
+
TL: Color;
|
|
266
|
+
PB: Color;
|
|
267
|
+
BI: Color;
|
|
268
|
+
PO: Color;
|
|
269
|
+
AT: Color;
|
|
270
|
+
RN: Color;
|
|
271
|
+
FR: Color;
|
|
272
|
+
RA: Color;
|
|
273
|
+
AC: Color;
|
|
274
|
+
TH: Color;
|
|
275
|
+
PA: Color;
|
|
276
|
+
U: Color;
|
|
277
|
+
NP: Color;
|
|
278
|
+
PU: Color;
|
|
279
|
+
AM: Color;
|
|
280
|
+
CM: Color;
|
|
281
|
+
BK: Color;
|
|
282
|
+
CF: Color;
|
|
283
|
+
ES: Color;
|
|
284
|
+
FM: Color;
|
|
285
|
+
MD: Color;
|
|
286
|
+
NO: Color;
|
|
287
|
+
LR: Color;
|
|
288
|
+
RF: Color;
|
|
289
|
+
DB: Color;
|
|
290
|
+
SG: Color;
|
|
291
|
+
BH: Color;
|
|
292
|
+
HS: Color;
|
|
293
|
+
MT: Color;
|
|
294
|
+
DS: Color;
|
|
295
|
+
RG: Color;
|
|
296
|
+
CN: Color;
|
|
297
|
+
UUT: Color;
|
|
298
|
+
FL: Color;
|
|
299
|
+
UUP: Color;
|
|
300
|
+
LV: Color;
|
|
301
|
+
UUH: Color;
|
|
302
|
+
}>, "custom">>;
|
|
160
303
|
};
|
|
161
304
|
export declare type ElementSymbolColorThemeParams = typeof ElementSymbolColorThemeParams;
|
|
162
305
|
export declare function getElementSymbolColorThemeParams(ctx: ThemeDataContext): {
|
|
@@ -183,9 +326,152 @@ export declare function getElementSymbolColorThemeParams(ctx: ThemeDataContext):
|
|
|
183
326
|
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
184
327
|
list: any;
|
|
185
328
|
}>, "colors">;
|
|
186
|
-
}>, "operator-name"
|
|
329
|
+
}>, "operator-name"> | PD.NamedParams<PD.Normalize<{
|
|
330
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
331
|
+
maxCount: any;
|
|
332
|
+
hue: any;
|
|
333
|
+
chroma: any;
|
|
334
|
+
luminance: any;
|
|
335
|
+
clusteringStepCount: any;
|
|
336
|
+
minSampleCount: any;
|
|
337
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
338
|
+
list: any;
|
|
339
|
+
}>, "colors">;
|
|
340
|
+
}>, "entity-id"> | PD.NamedParams<PD.Normalize<{
|
|
341
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
342
|
+
maxCount: any;
|
|
343
|
+
hue: any;
|
|
344
|
+
chroma: any;
|
|
345
|
+
luminance: any;
|
|
346
|
+
clusteringStepCount: any;
|
|
347
|
+
minSampleCount: any;
|
|
348
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
349
|
+
list: any;
|
|
350
|
+
}>, "colors">;
|
|
351
|
+
}>, "entity-source">>;
|
|
187
352
|
saturation: PD.Numeric;
|
|
188
353
|
lightness: PD.Numeric;
|
|
354
|
+
colors: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
355
|
+
H: Color;
|
|
356
|
+
D: Color;
|
|
357
|
+
T: Color;
|
|
358
|
+
HE: Color;
|
|
359
|
+
LI: Color;
|
|
360
|
+
BE: Color;
|
|
361
|
+
B: Color;
|
|
362
|
+
C: Color;
|
|
363
|
+
N: Color;
|
|
364
|
+
O: Color;
|
|
365
|
+
F: Color;
|
|
366
|
+
NE: Color;
|
|
367
|
+
NA: Color;
|
|
368
|
+
MG: Color;
|
|
369
|
+
AL: Color;
|
|
370
|
+
SI: Color;
|
|
371
|
+
P: Color;
|
|
372
|
+
S: Color;
|
|
373
|
+
CL: Color;
|
|
374
|
+
AR: Color;
|
|
375
|
+
K: Color;
|
|
376
|
+
CA: Color;
|
|
377
|
+
SC: Color;
|
|
378
|
+
TI: Color;
|
|
379
|
+
V: Color;
|
|
380
|
+
CR: Color;
|
|
381
|
+
MN: Color;
|
|
382
|
+
FE: Color;
|
|
383
|
+
CO: Color;
|
|
384
|
+
NI: Color;
|
|
385
|
+
CU: Color;
|
|
386
|
+
ZN: Color;
|
|
387
|
+
GA: Color;
|
|
388
|
+
GE: Color;
|
|
389
|
+
AS: Color;
|
|
390
|
+
SE: Color;
|
|
391
|
+
BR: Color;
|
|
392
|
+
KR: Color;
|
|
393
|
+
RB: Color;
|
|
394
|
+
SR: Color;
|
|
395
|
+
Y: Color;
|
|
396
|
+
ZR: Color;
|
|
397
|
+
NB: Color;
|
|
398
|
+
MO: Color;
|
|
399
|
+
TC: Color;
|
|
400
|
+
RU: Color;
|
|
401
|
+
RH: Color;
|
|
402
|
+
PD: Color;
|
|
403
|
+
AG: Color;
|
|
404
|
+
CD: Color;
|
|
405
|
+
IN: Color;
|
|
406
|
+
SN: Color;
|
|
407
|
+
SB: Color;
|
|
408
|
+
TE: Color;
|
|
409
|
+
I: Color;
|
|
410
|
+
XE: Color;
|
|
411
|
+
CS: Color;
|
|
412
|
+
BA: Color;
|
|
413
|
+
LA: Color;
|
|
414
|
+
CE: Color;
|
|
415
|
+
PR: Color;
|
|
416
|
+
ND: Color;
|
|
417
|
+
PM: Color;
|
|
418
|
+
SM: Color;
|
|
419
|
+
EU: Color;
|
|
420
|
+
GD: Color;
|
|
421
|
+
TB: Color;
|
|
422
|
+
DY: Color;
|
|
423
|
+
HO: Color;
|
|
424
|
+
ER: Color;
|
|
425
|
+
TM: Color;
|
|
426
|
+
YB: Color;
|
|
427
|
+
LU: Color;
|
|
428
|
+
HF: Color;
|
|
429
|
+
TA: Color;
|
|
430
|
+
W: Color;
|
|
431
|
+
RE: Color;
|
|
432
|
+
OS: Color;
|
|
433
|
+
IR: Color;
|
|
434
|
+
PT: Color;
|
|
435
|
+
AU: Color;
|
|
436
|
+
HG: Color;
|
|
437
|
+
TL: Color;
|
|
438
|
+
PB: Color;
|
|
439
|
+
BI: Color;
|
|
440
|
+
PO: Color;
|
|
441
|
+
AT: Color;
|
|
442
|
+
RN: Color;
|
|
443
|
+
FR: Color;
|
|
444
|
+
RA: Color;
|
|
445
|
+
AC: Color;
|
|
446
|
+
TH: Color;
|
|
447
|
+
PA: Color;
|
|
448
|
+
U: Color;
|
|
449
|
+
NP: Color;
|
|
450
|
+
PU: Color;
|
|
451
|
+
AM: Color;
|
|
452
|
+
CM: Color;
|
|
453
|
+
BK: Color;
|
|
454
|
+
CF: Color;
|
|
455
|
+
ES: Color;
|
|
456
|
+
FM: Color;
|
|
457
|
+
MD: Color;
|
|
458
|
+
NO: Color;
|
|
459
|
+
LR: Color;
|
|
460
|
+
RF: Color;
|
|
461
|
+
DB: Color;
|
|
462
|
+
SG: Color;
|
|
463
|
+
BH: Color;
|
|
464
|
+
HS: Color;
|
|
465
|
+
MT: Color;
|
|
466
|
+
DS: Color;
|
|
467
|
+
RG: Color;
|
|
468
|
+
CN: Color;
|
|
469
|
+
UUT: Color;
|
|
470
|
+
FL: Color;
|
|
471
|
+
UUP: Color;
|
|
472
|
+
LV: Color;
|
|
473
|
+
UUH: Color;
|
|
474
|
+
}>, "custom">>;
|
|
189
475
|
};
|
|
190
476
|
export declare function elementSymbolColor(colorMap: ElementSymbolColors, element: ElementSymbol): Color;
|
|
191
477
|
export declare function ElementSymbolColorTheme(ctx: ThemeDataContext, props: PD.Values<ElementSymbolColorThemeParams>): ColorTheme<ElementSymbolColorThemeParams>;
|
|
@@ -1,34 +1,42 @@
|
|
|
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 Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.ElementSymbolColorThemeProvider = exports.ElementSymbolColorTheme = exports.elementSymbolColor = exports.getElementSymbolColorThemeParams = exports.ElementSymbolColorThemeParams = exports.ElementSymbolColors = void 0;
|
|
9
|
-
var tslib_1 = require("tslib");
|
|
10
9
|
var color_1 = require("../../mol-util/color");
|
|
11
10
|
var structure_1 = require("../../mol-model/structure");
|
|
12
11
|
var param_definition_1 = require("../../mol-util/param-definition");
|
|
13
12
|
var legend_1 = require("../../mol-util/legend");
|
|
14
13
|
var color_2 = require("../../mol-util/color/color");
|
|
14
|
+
var params_1 = require("../../mol-util/color/params");
|
|
15
15
|
var chain_id_1 = require("./chain-id");
|
|
16
16
|
var operator_name_1 = require("./operator-name");
|
|
17
|
+
var entity_id_1 = require("./entity-id");
|
|
18
|
+
var type_helpers_1 = require("../../mol-util/type-helpers");
|
|
19
|
+
var entity_source_1 = require("./entity-source");
|
|
17
20
|
// from Jmol http://jmol.sourceforge.net/jscolors/ (or 0xFFFFFF)
|
|
18
21
|
exports.ElementSymbolColors = (0, color_1.ColorMap)({
|
|
19
22
|
'H': 0xFFFFFF, 'D': 0xFFFFC0, 'T': 0xFFFFA0, 'HE': 0xD9FFFF, 'LI': 0xCC80FF, 'BE': 0xC2FF00, 'B': 0xFFB5B5, 'C': 0x909090, 'N': 0x3050F8, 'O': 0xFF0D0D, 'F': 0x90E050, 'NE': 0xB3E3F5, 'NA': 0xAB5CF2, 'MG': 0x8AFF00, 'AL': 0xBFA6A6, 'SI': 0xF0C8A0, 'P': 0xFF8000, 'S': 0xFFFF30, 'CL': 0x1FF01F, 'AR': 0x80D1E3, 'K': 0x8F40D4, 'CA': 0x3DFF00, 'SC': 0xE6E6E6, 'TI': 0xBFC2C7, 'V': 0xA6A6AB, 'CR': 0x8A99C7, 'MN': 0x9C7AC7, 'FE': 0xE06633, 'CO': 0xF090A0, 'NI': 0x50D050, 'CU': 0xC88033, 'ZN': 0x7D80B0, 'GA': 0xC28F8F, 'GE': 0x668F8F, 'AS': 0xBD80E3, 'SE': 0xFFA100, 'BR': 0xA62929, 'KR': 0x5CB8D1, 'RB': 0x702EB0, 'SR': 0x00FF00, 'Y': 0x94FFFF, 'ZR': 0x94E0E0, 'NB': 0x73C2C9, 'MO': 0x54B5B5, 'TC': 0x3B9E9E, 'RU': 0x248F8F, 'RH': 0x0A7D8C, 'PD': 0x006985, 'AG': 0xC0C0C0, 'CD': 0xFFD98F, 'IN': 0xA67573, 'SN': 0x668080, 'SB': 0x9E63B5, 'TE': 0xD47A00, 'I': 0x940094, 'XE': 0x940094, 'CS': 0x57178F, 'BA': 0x00C900, 'LA': 0x70D4FF, 'CE': 0xFFFFC7, 'PR': 0xD9FFC7, 'ND': 0xC7FFC7, 'PM': 0xA3FFC7, 'SM': 0x8FFFC7, 'EU': 0x61FFC7, 'GD': 0x45FFC7, 'TB': 0x30FFC7, 'DY': 0x1FFFC7, 'HO': 0x00FF9C, 'ER': 0x00E675, 'TM': 0x00D452, 'YB': 0x00BF38, 'LU': 0x00AB24, 'HF': 0x4DC2FF, 'TA': 0x4DA6FF, 'W': 0x2194D6, 'RE': 0x267DAB, 'OS': 0x266696, 'IR': 0x175487, 'PT': 0xD0D0E0, 'AU': 0xFFD123, 'HG': 0xB8B8D0, 'TL': 0xA6544D, 'PB': 0x575961, 'BI': 0x9E4FB5, 'PO': 0xAB5C00, 'AT': 0x754F45, 'RN': 0x428296, 'FR': 0x420066, 'RA': 0x007D00, 'AC': 0x70ABFA, 'TH': 0x00BAFF, 'PA': 0x00A1FF, 'U': 0x008FFF, 'NP': 0x0080FF, 'PU': 0x006BFF, 'AM': 0x545CF2, 'CM': 0x785CE3, 'BK': 0x8A4FE3, 'CF': 0xA136D4, 'ES': 0xB31FD4, 'FM': 0xB31FBA, 'MD': 0xB30DA6, 'NO': 0xBD0D87, 'LR': 0xC70066, 'RF': 0xCC0059, 'DB': 0xD1004F, 'SG': 0xD90045, 'BH': 0xE00038, 'HS': 0xE6002E, 'MT': 0xEB0026, 'DS': 0xFFFFFF, 'RG': 0xFFFFFF, 'CN': 0xFFFFFF, 'UUT': 0xFFFFFF, 'FL': 0xFFFFFF, 'UUP': 0xFFFFFF, 'LV': 0xFFFFFF, 'UUH': 0xFFFFFF
|
|
20
23
|
});
|
|
21
24
|
var DefaultElementSymbolColor = (0, color_1.Color)(0xFFFFFF);
|
|
22
25
|
var Description = 'Assigns a color to every atom according to its chemical element.';
|
|
23
|
-
// TODO generalise `carbonColor` param to all themes?
|
|
24
26
|
exports.ElementSymbolColorThemeParams = {
|
|
25
27
|
carbonColor: param_definition_1.ParamDefinition.MappedStatic('chain-id', {
|
|
26
|
-
'chain-id': param_definition_1.ParamDefinition.Group(
|
|
27
|
-
'
|
|
28
|
-
'
|
|
28
|
+
'chain-id': param_definition_1.ParamDefinition.Group(chain_id_1.ChainIdColorThemeParams),
|
|
29
|
+
'entity-id': param_definition_1.ParamDefinition.Group(entity_id_1.EntityIdColorThemeParams),
|
|
30
|
+
'entity-source': param_definition_1.ParamDefinition.Group(entity_source_1.EntitySourceColorThemeParams),
|
|
31
|
+
'operator-name': param_definition_1.ParamDefinition.Group(operator_name_1.OperatorNameColorThemeParams),
|
|
32
|
+
'element-symbol': param_definition_1.ParamDefinition.EmptyGroup()
|
|
29
33
|
}, { description: 'Use chain-id coloring for carbon atoms.' }),
|
|
30
34
|
saturation: param_definition_1.ParamDefinition.Numeric(0, { min: -6, max: 6, step: 0.1 }),
|
|
31
|
-
lightness: param_definition_1.ParamDefinition.Numeric(0.2, { min: -6, max: 6, step: 0.1 })
|
|
35
|
+
lightness: param_definition_1.ParamDefinition.Numeric(0.2, { min: -6, max: 6, step: 0.1 }),
|
|
36
|
+
colors: param_definition_1.ParamDefinition.MappedStatic('default', {
|
|
37
|
+
'default': param_definition_1.ParamDefinition.EmptyGroup(),
|
|
38
|
+
'custom': param_definition_1.ParamDefinition.Group((0, params_1.getColorMapParams)(exports.ElementSymbolColors))
|
|
39
|
+
})
|
|
32
40
|
};
|
|
33
41
|
function getElementSymbolColorThemeParams(ctx) {
|
|
34
42
|
return exports.ElementSymbolColorThemeParams; // TODO return copy
|
|
@@ -40,12 +48,14 @@ function elementSymbolColor(colorMap, element) {
|
|
|
40
48
|
}
|
|
41
49
|
exports.elementSymbolColor = elementSymbolColor;
|
|
42
50
|
function ElementSymbolColorTheme(ctx, props) {
|
|
43
|
-
var colorMap = (0, color_2.getAdjustedColorMap)(exports.ElementSymbolColors, props.saturation, props.lightness);
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
? (0,
|
|
48
|
-
|
|
51
|
+
var colorMap = (0, color_2.getAdjustedColorMap)(props.colors.name === 'default' ? exports.ElementSymbolColors : props.colors.params, props.saturation, props.lightness);
|
|
52
|
+
var pcc = props.carbonColor;
|
|
53
|
+
var carbonColor = pcc.name === 'chain-id' ? (0, chain_id_1.ChainIdColorTheme)(ctx, pcc.params).color :
|
|
54
|
+
pcc.name === 'entity-id' ? (0, entity_id_1.EntityIdColorTheme)(ctx, pcc.params).color :
|
|
55
|
+
pcc.name === 'entity-source' ? (0, entity_source_1.EntitySourceColorTheme)(ctx, pcc.params).color :
|
|
56
|
+
pcc.name === 'operator-name' ? (0, operator_name_1.OperatorNameColorTheme)(ctx, pcc.params).color :
|
|
57
|
+
pcc.name === 'element-symbol' ? undefined :
|
|
58
|
+
(0, type_helpers_1.assertUnreachable)(pcc);
|
|
49
59
|
function elementColor(element, location) {
|
|
50
60
|
return (carbonColor && element === 'C')
|
|
51
61
|
? carbonColor(location, false)
|
|
@@ -75,8 +85,8 @@ function ElementSymbolColorTheme(ctx, props) {
|
|
|
75
85
|
color: color,
|
|
76
86
|
props: props,
|
|
77
87
|
description: Description,
|
|
78
|
-
legend: (0, legend_1.TableLegend)(Object.keys(
|
|
79
|
-
return [name,
|
|
88
|
+
legend: (0, legend_1.TableLegend)(Object.keys(colorMap).map(function (name) {
|
|
89
|
+
return [name, colorMap[name]];
|
|
80
90
|
}))
|
|
81
91
|
};
|
|
82
92
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
* Copyright (c) 2021-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
4
|
*
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
6
|
*/
|
|
@@ -32,9 +32,33 @@ function getEntityIdSerialMap(structure) {
|
|
|
32
32
|
if (!map.has(k))
|
|
33
33
|
map.set(k, map.size);
|
|
34
34
|
}
|
|
35
|
+
var coarseHierarchy = structure.models[i].coarseHierarchy;
|
|
36
|
+
if (coarseHierarchy.isDefined) {
|
|
37
|
+
var spheres_entity_id = coarseHierarchy.spheres.entity_id;
|
|
38
|
+
for (var j = 0, jl = spheres_entity_id.rowCount; j < jl; ++j) {
|
|
39
|
+
var k = key(spheres_entity_id.value(j), i);
|
|
40
|
+
if (!map.has(k))
|
|
41
|
+
map.set(k, map.size);
|
|
42
|
+
}
|
|
43
|
+
var gaussians_entity_id = coarseHierarchy.gaussians.entity_id;
|
|
44
|
+
for (var j = 0, jl = gaussians_entity_id.rowCount; j < jl; ++j) {
|
|
45
|
+
var k = key(gaussians_entity_id.value(j), i);
|
|
46
|
+
if (!map.has(k))
|
|
47
|
+
map.set(k, map.size);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
35
50
|
}
|
|
36
51
|
return map;
|
|
37
52
|
}
|
|
53
|
+
function getEntityId(location) {
|
|
54
|
+
switch (location.unit.kind) {
|
|
55
|
+
case 0 /* Atomic */:
|
|
56
|
+
return structure_1.StructureProperties.chain.label_entity_id(location);
|
|
57
|
+
case 1 /* Spheres */:
|
|
58
|
+
case 2 /* Gaussians */:
|
|
59
|
+
return structure_1.StructureProperties.coarse.entity_id(location);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
38
62
|
function EntityIdColorTheme(ctx, props) {
|
|
39
63
|
var color;
|
|
40
64
|
var legend;
|
|
@@ -48,17 +72,17 @@ function EntityIdColorTheme(ctx, props) {
|
|
|
48
72
|
color = function (location) {
|
|
49
73
|
var serial = undefined;
|
|
50
74
|
if (structure_1.StructureElement.Location.is(location)) {
|
|
51
|
-
var
|
|
75
|
+
var entityId = getEntityId(location);
|
|
52
76
|
var modelIndex = location.structure.models.indexOf(location.unit.model);
|
|
53
|
-
var k = key(
|
|
77
|
+
var k = key(entityId, modelIndex);
|
|
54
78
|
serial = entityIdSerialMap_1.get(k);
|
|
55
79
|
}
|
|
56
80
|
else if (structure_1.Bond.isLocation(location)) {
|
|
57
81
|
l_1.unit = location.aUnit;
|
|
58
82
|
l_1.element = location.aUnit.elements[location.aIndex];
|
|
59
|
-
var
|
|
83
|
+
var entityId = getEntityId(l_1);
|
|
60
84
|
var modelIndex = l_1.structure.models.indexOf(l_1.unit.model);
|
|
61
|
-
var k = key(
|
|
85
|
+
var k = key(entityId, modelIndex);
|
|
62
86
|
serial = entityIdSerialMap_1.get(k);
|
|
63
87
|
}
|
|
64
88
|
return serial === undefined ? DefaultColor : palette_2.color(serial);
|
|
@@ -1,45 +1,116 @@
|
|
|
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
|
*/
|
|
6
|
+
import { Color } from '../../mol-util/color';
|
|
6
7
|
import { ColorTheme } from '../color';
|
|
7
8
|
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
8
9
|
import { ThemeDataContext } from '../theme';
|
|
9
10
|
export declare const IllustrativeColorThemeParams: {
|
|
11
|
+
style: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
12
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
13
|
+
maxCount: any;
|
|
14
|
+
hue: any;
|
|
15
|
+
chroma: any;
|
|
16
|
+
luminance: any;
|
|
17
|
+
clusteringStepCount: any;
|
|
18
|
+
minSampleCount: any;
|
|
19
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
20
|
+
list: any;
|
|
21
|
+
}>, "colors">;
|
|
22
|
+
asymId: "label" | "auth";
|
|
23
|
+
}>, "chain-id"> | PD.NamedParams<PD.Normalize<{
|
|
24
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
25
|
+
maxCount: any;
|
|
26
|
+
hue: any;
|
|
27
|
+
chroma: any;
|
|
28
|
+
luminance: any;
|
|
29
|
+
clusteringStepCount: any;
|
|
30
|
+
minSampleCount: any;
|
|
31
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
32
|
+
list: any;
|
|
33
|
+
}>, "colors">;
|
|
34
|
+
}>, "entity-id"> | PD.NamedParams<PD.Normalize<{
|
|
35
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
36
|
+
maxCount: any;
|
|
37
|
+
hue: any;
|
|
38
|
+
chroma: any;
|
|
39
|
+
luminance: any;
|
|
40
|
+
clusteringStepCount: any;
|
|
41
|
+
minSampleCount: any;
|
|
42
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
43
|
+
list: any;
|
|
44
|
+
}>, "colors">;
|
|
45
|
+
}>, "entity-source"> | PD.NamedParams<PD.Normalize<{
|
|
46
|
+
value: Color;
|
|
47
|
+
}>, "uniform"> | PD.NamedParams<PD.Normalize<{
|
|
48
|
+
saturation: number;
|
|
49
|
+
lightness: number;
|
|
50
|
+
colors: PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
51
|
+
water: any;
|
|
52
|
+
ion: any;
|
|
53
|
+
protein: any;
|
|
54
|
+
RNA: any;
|
|
55
|
+
DNA: any;
|
|
56
|
+
PNA: any;
|
|
57
|
+
saccharide: any;
|
|
58
|
+
}>, "custom">;
|
|
59
|
+
}>, "molecule-type">>;
|
|
10
60
|
carbonLightness: PD.Numeric;
|
|
11
|
-
palette: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
12
|
-
maxCount: number;
|
|
13
|
-
hue: [number, number];
|
|
14
|
-
chroma: [number, number];
|
|
15
|
-
luminance: [number, number];
|
|
16
|
-
clusteringStepCount: number;
|
|
17
|
-
minSampleCount: number;
|
|
18
|
-
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
19
|
-
list: {
|
|
20
|
-
kind: "set" | "interpolate";
|
|
21
|
-
colors: import("../../mol-util/color/color").ColorListEntry[];
|
|
22
|
-
};
|
|
23
|
-
}>, "colors">>;
|
|
24
|
-
asymId: PD.Select<"label" | "auth">;
|
|
25
61
|
};
|
|
26
62
|
export declare type IllustrativeColorThemeParams = typeof IllustrativeColorThemeParams;
|
|
27
63
|
export declare function getIllustrativeColorThemeParams(ctx: ThemeDataContext): {
|
|
64
|
+
style: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
65
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
66
|
+
maxCount: any;
|
|
67
|
+
hue: any;
|
|
68
|
+
chroma: any;
|
|
69
|
+
luminance: any;
|
|
70
|
+
clusteringStepCount: any;
|
|
71
|
+
minSampleCount: any;
|
|
72
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
73
|
+
list: any;
|
|
74
|
+
}>, "colors">;
|
|
75
|
+
asymId: "label" | "auth";
|
|
76
|
+
}>, "chain-id"> | PD.NamedParams<PD.Normalize<{
|
|
77
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
78
|
+
maxCount: any;
|
|
79
|
+
hue: any;
|
|
80
|
+
chroma: any;
|
|
81
|
+
luminance: any;
|
|
82
|
+
clusteringStepCount: any;
|
|
83
|
+
minSampleCount: any;
|
|
84
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
85
|
+
list: any;
|
|
86
|
+
}>, "colors">;
|
|
87
|
+
}>, "entity-id"> | PD.NamedParams<PD.Normalize<{
|
|
88
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
89
|
+
maxCount: any;
|
|
90
|
+
hue: any;
|
|
91
|
+
chroma: any;
|
|
92
|
+
luminance: any;
|
|
93
|
+
clusteringStepCount: any;
|
|
94
|
+
minSampleCount: any;
|
|
95
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
96
|
+
list: any;
|
|
97
|
+
}>, "colors">;
|
|
98
|
+
}>, "entity-source"> | PD.NamedParams<PD.Normalize<{
|
|
99
|
+
value: Color;
|
|
100
|
+
}>, "uniform"> | PD.NamedParams<PD.Normalize<{
|
|
101
|
+
saturation: number;
|
|
102
|
+
lightness: number;
|
|
103
|
+
colors: PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
104
|
+
water: any;
|
|
105
|
+
ion: any;
|
|
106
|
+
protein: any;
|
|
107
|
+
RNA: any;
|
|
108
|
+
DNA: any;
|
|
109
|
+
PNA: any;
|
|
110
|
+
saccharide: any;
|
|
111
|
+
}>, "custom">;
|
|
112
|
+
}>, "molecule-type">>;
|
|
28
113
|
carbonLightness: PD.Numeric;
|
|
29
|
-
palette: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
30
|
-
maxCount: number;
|
|
31
|
-
hue: [number, number];
|
|
32
|
-
chroma: [number, number];
|
|
33
|
-
luminance: [number, number];
|
|
34
|
-
clusteringStepCount: number;
|
|
35
|
-
minSampleCount: number;
|
|
36
|
-
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
37
|
-
list: {
|
|
38
|
-
kind: "set" | "interpolate";
|
|
39
|
-
colors: import("../../mol-util/color/color").ColorListEntry[];
|
|
40
|
-
};
|
|
41
|
-
}>, "colors">>;
|
|
42
|
-
asymId: PD.Select<"label" | "auth">;
|
|
43
114
|
};
|
|
44
115
|
export declare function IllustrativeColorTheme(ctx: ThemeDataContext, props: PD.Values<IllustrativeColorThemeParams>): ColorTheme<IllustrativeColorThemeParams>;
|
|
45
116
|
export declare const IllustrativeColorThemeProvider: ColorTheme.Provider<IllustrativeColorThemeParams, 'illustrative'>;
|
|
@@ -1,27 +1,46 @@
|
|
|
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 Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.IllustrativeColorThemeProvider = exports.IllustrativeColorTheme = exports.getIllustrativeColorThemeParams = exports.IllustrativeColorThemeParams = void 0;
|
|
9
|
-
var tslib_1 = require("tslib");
|
|
10
9
|
var color_1 = require("../../mol-util/color");
|
|
11
10
|
var structure_1 = require("../../mol-model/structure");
|
|
12
11
|
var param_definition_1 = require("../../mol-util/param-definition");
|
|
13
12
|
var chain_id_1 = require("./chain-id");
|
|
13
|
+
var uniform_1 = require("./uniform");
|
|
14
|
+
var type_helpers_1 = require("../../mol-util/type-helpers");
|
|
15
|
+
var entity_id_1 = require("./entity-id");
|
|
16
|
+
var molecule_type_1 = require("./molecule-type");
|
|
17
|
+
var entity_source_1 = require("./entity-source");
|
|
14
18
|
var DefaultIllustrativeColor = (0, color_1.Color)(0xEEEEEE);
|
|
15
|
-
var Description = "Assigns an illustrative color that gives every chain a
|
|
16
|
-
exports.IllustrativeColorThemeParams =
|
|
19
|
+
var Description = "Assigns an illustrative color that gives every chain a color based on the choosen style but with lighter carbons (inspired by David Goodsell's Molecule of the Month style).";
|
|
20
|
+
exports.IllustrativeColorThemeParams = {
|
|
21
|
+
style: param_definition_1.ParamDefinition.MappedStatic('entity-id', {
|
|
22
|
+
uniform: param_definition_1.ParamDefinition.Group(uniform_1.UniformColorThemeParams),
|
|
23
|
+
'chain-id': param_definition_1.ParamDefinition.Group(chain_id_1.ChainIdColorThemeParams),
|
|
24
|
+
'entity-id': param_definition_1.ParamDefinition.Group(entity_id_1.EntityIdColorThemeParams),
|
|
25
|
+
'entity-source': param_definition_1.ParamDefinition.Group(entity_source_1.EntitySourceColorThemeParams),
|
|
26
|
+
'molecule-type': param_definition_1.ParamDefinition.Group(molecule_type_1.MoleculeTypeColorThemeParams),
|
|
27
|
+
}),
|
|
28
|
+
carbonLightness: param_definition_1.ParamDefinition.Numeric(0.8, { min: -6, max: 6, step: 0.1 })
|
|
29
|
+
};
|
|
17
30
|
function getIllustrativeColorThemeParams(ctx) {
|
|
18
|
-
|
|
31
|
+
var params = param_definition_1.ParamDefinition.clone(exports.IllustrativeColorThemeParams);
|
|
32
|
+
return params;
|
|
19
33
|
}
|
|
20
34
|
exports.getIllustrativeColorThemeParams = getIllustrativeColorThemeParams;
|
|
21
35
|
function IllustrativeColorTheme(ctx, props) {
|
|
22
|
-
var _a = (0,
|
|
36
|
+
var _a = props.style.name === 'uniform' ? (0, uniform_1.UniformColorTheme)(ctx, props.style.params) :
|
|
37
|
+
props.style.name === 'chain-id' ? (0, chain_id_1.ChainIdColorTheme)(ctx, props.style.params) :
|
|
38
|
+
props.style.name === 'entity-id' ? (0, entity_id_1.EntityIdColorTheme)(ctx, props.style.params) :
|
|
39
|
+
props.style.name === 'entity-source' ? (0, entity_source_1.EntitySourceColorTheme)(ctx, props.style.params) :
|
|
40
|
+
props.style.name === 'molecule-type' ? (0, molecule_type_1.MoleculeTypeColorTheme)(ctx, props.style.params) :
|
|
41
|
+
(0, type_helpers_1.assertUnreachable)(props.style), styleColor = _a.color, legend = _a.legend;
|
|
23
42
|
function illustrativeColor(location, typeSymbol) {
|
|
24
|
-
var baseColor =
|
|
43
|
+
var baseColor = styleColor(location, false);
|
|
25
44
|
return typeSymbol === 'C' ? color_1.Color.lighten(baseColor, props.carbonLightness) : baseColor;
|
|
26
45
|
}
|
|
27
46
|
function color(location) {
|