molstar 3.0.0-dev.9 → 3.0.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.
Files changed (212) hide show
  1. package/README.md +7 -0
  2. package/build/viewer/index.html +2 -2
  3. package/build/viewer/molstar.js +1 -1
  4. package/lib/apps/viewer/app.d.ts +1 -1
  5. package/lib/apps/viewer/app.js +15 -5
  6. package/lib/apps/viewer/index.html +2 -2
  7. package/lib/commonjs/apps/viewer/app.d.ts +1 -1
  8. package/lib/commonjs/apps/viewer/app.js +15 -5
  9. package/lib/commonjs/examples/basic-wrapper/index.js +7 -3
  10. package/lib/commonjs/examples/proteopedia-wrapper/index.js +7 -1
  11. package/lib/commonjs/extensions/anvil/representation.js +1 -1
  12. package/lib/commonjs/extensions/model-export/export.d.ts +9 -0
  13. package/lib/commonjs/extensions/model-export/export.js +129 -0
  14. package/lib/commonjs/extensions/model-export/index.d.ts +7 -0
  15. package/lib/commonjs/extensions/model-export/index.js +36 -0
  16. package/lib/commonjs/extensions/model-export/ui.d.ts +11 -0
  17. package/lib/commonjs/extensions/model-export/ui.js +77 -0
  18. package/lib/commonjs/extensions/mp4-export/encoder.js +1 -1
  19. package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
  20. package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +2 -2
  21. package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +12 -4
  22. package/lib/commonjs/mol-canvas3d/canvas3d.js +1 -1
  23. package/lib/commonjs/mol-canvas3d/controls/trackball.d.ts +9 -4
  24. package/lib/commonjs/mol-canvas3d/controls/trackball.js +50 -11
  25. package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
  26. package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
  27. package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  28. package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
  29. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
  30. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +1 -1
  31. package/lib/commonjs/mol-io/reader/mol/parser.d.ts +23 -1
  32. package/lib/commonjs/mol-io/reader/mol/parser.js +116 -4
  33. package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
  34. package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.js +9 -0
  35. package/lib/commonjs/mol-io/reader/sdf/parser.d.ts +3 -1
  36. package/lib/commonjs/mol-io/reader/sdf/parser.js +11 -2
  37. package/lib/commonjs/mol-io/writer/cif/encoder/binary.js +9 -2
  38. package/lib/commonjs/mol-math/geometry/symmetry-operator.d.ts +1 -1
  39. package/lib/commonjs/mol-math/geometry/symmetry-operator.js +10 -4
  40. package/lib/commonjs/mol-model/structure/export/mmcif.d.ts +1 -1
  41. package/lib/commonjs/mol-model/structure/export/mmcif.js +8 -5
  42. package/lib/commonjs/mol-model/structure/model/properties/common.d.ts +1 -1
  43. package/lib/commonjs/mol-model/structure/structure/properties.d.ts +1 -0
  44. package/lib/commonjs/mol-model/structure/structure/properties.js +2 -1
  45. package/lib/commonjs/mol-model/structure/structure/symmetry.js +1 -3
  46. package/lib/commonjs/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
  47. package/lib/commonjs/mol-model-formats/structure/basic/atomic.d.ts +2 -2
  48. package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +6 -6
  49. package/lib/commonjs/mol-model-formats/structure/basic/coarse.d.ts +1 -1
  50. package/lib/commonjs/mol-model-formats/structure/basic/coarse.js +3 -3
  51. package/lib/commonjs/mol-model-formats/structure/basic/entities.d.ts +2 -1
  52. package/lib/commonjs/mol-model-formats/structure/basic/entities.js +28 -24
  53. package/lib/commonjs/mol-model-formats/structure/basic/parser.js +17 -8
  54. package/lib/commonjs/mol-model-formats/structure/basic/properties.d.ts +6 -1
  55. package/lib/commonjs/mol-model-formats/structure/basic/properties.js +12 -22
  56. package/lib/commonjs/mol-model-formats/structure/mol.d.ts +2 -1
  57. package/lib/commonjs/mol-model-formats/structure/mol.js +19 -5
  58. package/lib/commonjs/mol-model-props/common/custom-property.d.ts +1 -1
  59. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  60. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +25 -10
  61. package/lib/commonjs/mol-model-props/sequence/best-database-mapping.js +15 -15
  62. package/lib/commonjs/mol-plugin/animation-loop.d.ts +2 -0
  63. package/lib/commonjs/mol-plugin/animation-loop.js +1 -1
  64. package/lib/commonjs/mol-plugin/commands.d.ts +6 -2
  65. package/lib/commonjs/mol-plugin/spec.d.ts +1 -1
  66. package/lib/commonjs/mol-plugin/spec.js +3 -1
  67. package/lib/commonjs/mol-plugin-state/actions/file.d.ts +3 -2
  68. package/lib/commonjs/mol-plugin-state/actions/file.js +67 -31
  69. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
  70. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.js +62 -0
  71. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
  72. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
  73. package/lib/commonjs/mol-plugin-state/animation/model.d.ts +4 -0
  74. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
  75. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
  76. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +149 -5
  77. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +74 -2
  78. package/lib/commonjs/mol-plugin-state/manager/animation.d.ts +5 -1
  79. package/lib/commonjs/mol-plugin-state/manager/animation.js +5 -5
  80. package/lib/commonjs/mol-plugin-ui/structure/superposition.js +2 -2
  81. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
  82. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +4 -8
  83. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  84. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
  85. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  86. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
  87. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  88. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
  89. package/lib/commonjs/mol-repr/visual.d.ts +1 -1
  90. package/lib/commonjs/mol-repr/visual.js +2 -1
  91. package/lib/commonjs/mol-state/tree/immutable.d.ts +18 -0
  92. package/lib/commonjs/mol-state/tree/transient.d.ts +3 -4
  93. package/lib/commonjs/mol-theme/color/element-symbol.d.ts +243 -1
  94. package/lib/commonjs/mol-theme/color/element-symbol.js +10 -5
  95. package/lib/commonjs/mol-theme/color/entity-id.d.ts +1 -1
  96. package/lib/commonjs/mol-theme/color/entity-id.js +26 -5
  97. package/lib/commonjs/mol-theme/color/illustrative.d.ts +100 -29
  98. package/lib/commonjs/mol-theme/color/illustrative.js +26 -7
  99. package/lib/commonjs/mol-theme/color/molecule-type.d.ts +19 -1
  100. package/lib/commonjs/mol-theme/color/molecule-type.js +10 -5
  101. package/lib/commonjs/mol-theme/color/residue-name.d.ts +77 -1
  102. package/lib/commonjs/mol-theme/color/residue-name.js +10 -5
  103. package/lib/commonjs/mol-theme/color/secondary-structure.d.ts +27 -1
  104. package/lib/commonjs/mol-theme/color/secondary-structure.js +10 -5
  105. package/lib/commonjs/mol-theme/color.d.ts +230 -14
  106. package/lib/commonjs/mol-util/color/color.d.ts +1 -1
  107. package/lib/commonjs/mol-util/color/color.js +1 -1
  108. package/lib/commonjs/mol-util/color/params.d.ts +10 -0
  109. package/lib/commonjs/mol-util/color/params.js +19 -0
  110. package/lib/examples/basic-wrapper/index.js +7 -3
  111. package/lib/examples/proteopedia-wrapper/index.js +7 -1
  112. package/lib/extensions/anvil/representation.js +1 -1
  113. package/lib/extensions/model-export/export.d.ts +9 -0
  114. package/lib/extensions/model-export/export.js +125 -0
  115. package/lib/extensions/model-export/index.d.ts +7 -0
  116. package/lib/extensions/model-export/index.js +33 -0
  117. package/lib/extensions/model-export/ui.d.ts +11 -0
  118. package/lib/extensions/model-export/ui.js +74 -0
  119. package/lib/extensions/mp4-export/encoder.js +1 -1
  120. package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
  121. package/lib/extensions/rcsb/graphql/types.d.ts +2 -2
  122. package/lib/mol-canvas3d/canvas3d.d.ts +12 -4
  123. package/lib/mol-canvas3d/canvas3d.js +1 -1
  124. package/lib/mol-canvas3d/controls/trackball.d.ts +9 -4
  125. package/lib/mol-canvas3d/controls/trackball.js +51 -12
  126. package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
  127. package/lib/mol-io/reader/cif/schema/bird.js +1 -1
  128. package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  129. package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
  130. package/lib/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
  131. package/lib/mol-io/reader/cif/schema/mmcif.js +1 -1
  132. package/lib/mol-io/reader/mol/parser.d.ts +23 -1
  133. package/lib/mol-io/reader/mol/parser.js +112 -3
  134. package/lib/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
  135. package/lib/mol-io/reader/sdf/parser-v3-util.js +9 -0
  136. package/lib/mol-io/reader/sdf/parser.d.ts +3 -1
  137. package/lib/mol-io/reader/sdf/parser.js +12 -3
  138. package/lib/mol-io/writer/cif/encoder/binary.js +9 -2
  139. package/lib/mol-math/geometry/symmetry-operator.d.ts +1 -1
  140. package/lib/mol-math/geometry/symmetry-operator.js +10 -4
  141. package/lib/mol-model/structure/export/mmcif.d.ts +1 -1
  142. package/lib/mol-model/structure/export/mmcif.js +8 -5
  143. package/lib/mol-model/structure/model/properties/common.d.ts +1 -1
  144. package/lib/mol-model/structure/structure/properties.d.ts +1 -0
  145. package/lib/mol-model/structure/structure/properties.js +2 -1
  146. package/lib/mol-model/structure/structure/symmetry.js +1 -3
  147. package/lib/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
  148. package/lib/mol-model-formats/structure/basic/atomic.d.ts +2 -2
  149. package/lib/mol-model-formats/structure/basic/atomic.js +6 -6
  150. package/lib/mol-model-formats/structure/basic/coarse.d.ts +1 -1
  151. package/lib/mol-model-formats/structure/basic/coarse.js +3 -3
  152. package/lib/mol-model-formats/structure/basic/entities.d.ts +2 -1
  153. package/lib/mol-model-formats/structure/basic/entities.js +25 -22
  154. package/lib/mol-model-formats/structure/basic/parser.js +19 -10
  155. package/lib/mol-model-formats/structure/basic/properties.d.ts +6 -1
  156. package/lib/mol-model-formats/structure/basic/properties.js +12 -25
  157. package/lib/mol-model-formats/structure/mol.d.ts +2 -1
  158. package/lib/mol-model-formats/structure/mol.js +17 -3
  159. package/lib/mol-model-props/common/custom-property.d.ts +1 -1
  160. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  161. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +25 -10
  162. package/lib/mol-model-props/sequence/best-database-mapping.js +15 -15
  163. package/lib/mol-plugin/animation-loop.d.ts +2 -0
  164. package/lib/mol-plugin/animation-loop.js +1 -1
  165. package/lib/mol-plugin/commands.d.ts +6 -2
  166. package/lib/mol-plugin/spec.d.ts +1 -1
  167. package/lib/mol-plugin/spec.js +3 -1
  168. package/lib/mol-plugin/version.js +2 -2
  169. package/lib/mol-plugin-state/actions/file.d.ts +3 -2
  170. package/lib/mol-plugin-state/actions/file.js +67 -31
  171. package/lib/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
  172. package/lib/mol-plugin-state/animation/built-in/camera-rock.js +59 -0
  173. package/lib/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
  174. package/lib/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
  175. package/lib/mol-plugin-state/animation/model.d.ts +4 -0
  176. package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
  177. package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
  178. package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +149 -5
  179. package/lib/mol-plugin-state/builder/structure/representation-preset.js +74 -2
  180. package/lib/mol-plugin-state/manager/animation.d.ts +5 -1
  181. package/lib/mol-plugin-state/manager/animation.js +5 -5
  182. package/lib/mol-plugin-ui/structure/superposition.js +2 -2
  183. package/lib/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
  184. package/lib/mol-plugin-ui/viewport/simple-settings.js +4 -8
  185. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  186. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
  187. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  188. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
  189. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  190. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
  191. package/lib/mol-repr/visual.d.ts +1 -1
  192. package/lib/mol-repr/visual.js +2 -1
  193. package/lib/mol-state/tree/immutable.d.ts +18 -0
  194. package/lib/mol-state/tree/transient.d.ts +3 -4
  195. package/lib/mol-theme/color/element-symbol.d.ts +243 -1
  196. package/lib/mol-theme/color/element-symbol.js +10 -5
  197. package/lib/mol-theme/color/entity-id.d.ts +1 -1
  198. package/lib/mol-theme/color/entity-id.js +26 -5
  199. package/lib/mol-theme/color/illustrative.d.ts +100 -29
  200. package/lib/mol-theme/color/illustrative.js +26 -7
  201. package/lib/mol-theme/color/molecule-type.d.ts +19 -1
  202. package/lib/mol-theme/color/molecule-type.js +10 -5
  203. package/lib/mol-theme/color/residue-name.d.ts +77 -1
  204. package/lib/mol-theme/color/residue-name.js +10 -5
  205. package/lib/mol-theme/color/secondary-structure.d.ts +27 -1
  206. package/lib/mol-theme/color/secondary-structure.js +10 -5
  207. package/lib/mol-theme/color.d.ts +230 -14
  208. package/lib/mol-util/color/color.d.ts +1 -1
  209. package/lib/mol-util/color/color.js +1 -1
  210. package/lib/mol-util/color/params.d.ts +10 -0
  211. package/lib/mol-util/color/params.js +15 -0
  212. package/package.json +36 -35
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-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>
@@ -13,6 +13,7 @@ import { PluginContext } from '../../../mol-plugin/context';
13
13
  import { StateObjectRef, StateObjectSelector } from '../../../mol-state';
14
14
  import { StaticStructureComponentType } from '../../helpers/structure-component';
15
15
  import { StructureSelectionQueries as Q } from '../../helpers/structure-selection-query';
16
+ import { Color } from '../../../mol-util/color';
16
17
  export interface StructureRepresentationPresetProvider<P = any, S extends _Result = _Result> extends PresetProvider<PluginStateObject.Molecule.Structure, P, S> {
17
18
  }
18
19
  export declare function StructureRepresentationPresetProvider<P, S extends _Result>(repr: StructureRepresentationPresetProvider<P, S>): StructureRepresentationPresetProvider<P, S>;
@@ -31,9 +32,9 @@ export declare namespace StructureRepresentationPresetProvider {
31
32
  ignoreHydrogens: PD.Base<boolean | undefined>;
32
33
  quality: PD.Base<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined>;
33
34
  theme: PD.Base<PD.Normalize<{
34
- globalName: "uniform" | "occupancy" | "element-index" | "element-symbol" | "shape-group" | "uncertainty" | "carbohydrate-symbol" | "chain-id" | "operator-name" | "molecule-type" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "unit-index" | "entity-source" | "illustrative" | "hydrophobicity" | "model-index" | "operator-hkl" | "partial-charge" | "atom-id" | "entity-id" | "volume-value" | undefined;
35
+ globalName: "uniform" | "occupancy" | "element-index" | "element-symbol" | "shape-group" | "uncertainty" | "carbohydrate-symbol" | "chain-id" | "operator-name" | "molecule-type" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "unit-index" | "entity-source" | "entity-id" | "illustrative" | "hydrophobicity" | "model-index" | "operator-hkl" | "partial-charge" | "atom-id" | "volume-value" | undefined;
35
36
  carbonColor: "element-symbol" | "chain-id" | "operator-name" | undefined;
36
- symmetryColor: "uniform" | "occupancy" | "element-index" | "element-symbol" | "shape-group" | "uncertainty" | "carbohydrate-symbol" | "chain-id" | "operator-name" | "molecule-type" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "unit-index" | "entity-source" | "illustrative" | "hydrophobicity" | "model-index" | "operator-hkl" | "partial-charge" | "atom-id" | "entity-id" | "volume-value" | undefined;
37
+ symmetryColor: "uniform" | "occupancy" | "element-index" | "element-symbol" | "shape-group" | "uncertainty" | "carbohydrate-symbol" | "chain-id" | "operator-name" | "molecule-type" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "unit-index" | "entity-source" | "entity-id" | "illustrative" | "hydrophobicity" | "model-index" | "operator-hkl" | "partial-charge" | "atom-id" | "volume-value" | undefined;
37
38
  focus: PD.Normalize<{
38
39
  name: any;
39
40
  params: any;
@@ -44,8 +45,8 @@ export declare namespace StructureRepresentationPresetProvider {
44
45
  function reprBuilder(plugin: PluginContext, params: CommonParams, structure?: Structure): {
45
46
  update: import("../../../mol-state/state/builder").StateBuilder.Root;
46
47
  builder: import("./representation").StructureRepresentationBuilder;
47
- color: "uniform" | "occupancy" | "element-index" | "element-symbol" | "shape-group" | "uncertainty" | "carbohydrate-symbol" | "chain-id" | "operator-name" | "molecule-type" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "unit-index" | "entity-source" | "illustrative" | "hydrophobicity" | "model-index" | "operator-hkl" | "partial-charge" | "atom-id" | "entity-id" | "volume-value" | undefined;
48
- symmetryColor: "uniform" | "occupancy" | "element-index" | "element-symbol" | "shape-group" | "uncertainty" | "carbohydrate-symbol" | "chain-id" | "operator-name" | "molecule-type" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "unit-index" | "entity-source" | "illustrative" | "hydrophobicity" | "model-index" | "operator-hkl" | "partial-charge" | "atom-id" | "entity-id" | "volume-value" | undefined;
48
+ color: "uniform" | "occupancy" | "element-index" | "element-symbol" | "shape-group" | "uncertainty" | "carbohydrate-symbol" | "chain-id" | "operator-name" | "molecule-type" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "unit-index" | "entity-source" | "entity-id" | "illustrative" | "hydrophobicity" | "model-index" | "operator-hkl" | "partial-charge" | "atom-id" | "volume-value" | undefined;
49
+ symmetryColor: "uniform" | "occupancy" | "element-index" | "element-symbol" | "shape-group" | "uncertainty" | "carbohydrate-symbol" | "chain-id" | "operator-name" | "molecule-type" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "unit-index" | "entity-source" | "entity-id" | "illustrative" | "hydrophobicity" | "model-index" | "operator-hkl" | "partial-charge" | "atom-id" | "volume-value" | undefined;
49
50
  typeParams: {
50
51
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest";
51
52
  ignoreHydrogens: boolean;
@@ -77,6 +78,127 @@ export declare namespace StructureRepresentationPresetProvider {
77
78
  }>, "operator-name">>;
78
79
  saturation: PD.Numeric;
79
80
  lightness: PD.Numeric;
81
+ colors: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
82
+ H: Color;
83
+ D: Color;
84
+ T: Color;
85
+ HE: Color;
86
+ LI: Color;
87
+ BE: Color;
88
+ B: Color;
89
+ C: Color;
90
+ N: Color;
91
+ O: Color;
92
+ F: Color;
93
+ NE: Color;
94
+ NA: Color;
95
+ MG: Color;
96
+ AL: Color;
97
+ SI: Color;
98
+ P: Color;
99
+ S: Color;
100
+ CL: Color;
101
+ AR: Color;
102
+ K: Color;
103
+ CA: Color;
104
+ SC: Color;
105
+ TI: Color;
106
+ V: Color;
107
+ CR: Color;
108
+ MN: Color;
109
+ FE: Color;
110
+ CO: Color;
111
+ NI: Color;
112
+ CU: Color;
113
+ ZN: Color;
114
+ GA: Color;
115
+ GE: Color;
116
+ AS: Color;
117
+ SE: Color;
118
+ BR: Color;
119
+ KR: Color;
120
+ RB: Color;
121
+ SR: Color;
122
+ Y: Color;
123
+ ZR: Color;
124
+ NB: Color;
125
+ MO: Color;
126
+ TC: Color;
127
+ RU: Color;
128
+ RH: Color;
129
+ PD: Color;
130
+ AG: Color;
131
+ CD: Color;
132
+ IN: Color;
133
+ SN: Color;
134
+ SB: Color;
135
+ TE: Color;
136
+ I: Color;
137
+ XE: Color;
138
+ CS: Color;
139
+ BA: Color;
140
+ LA: Color;
141
+ CE: Color;
142
+ PR: Color;
143
+ ND: Color;
144
+ PM: Color;
145
+ SM: Color;
146
+ EU: Color;
147
+ GD: Color;
148
+ TB: Color;
149
+ DY: Color;
150
+ HO: Color;
151
+ ER: Color;
152
+ TM: Color;
153
+ YB: Color;
154
+ LU: Color;
155
+ HF: Color;
156
+ TA: Color;
157
+ W: Color;
158
+ RE: Color;
159
+ OS: Color;
160
+ IR: Color;
161
+ PT: Color;
162
+ AU: Color;
163
+ HG: Color;
164
+ TL: Color;
165
+ PB: Color;
166
+ BI: Color;
167
+ PO: Color;
168
+ AT: Color;
169
+ RN: Color;
170
+ FR: Color;
171
+ RA: Color;
172
+ AC: Color;
173
+ TH: Color;
174
+ PA: Color;
175
+ U: Color;
176
+ NP: Color;
177
+ PU: Color;
178
+ AM: Color;
179
+ CM: Color;
180
+ BK: Color;
181
+ CF: Color;
182
+ ES: Color;
183
+ FM: Color;
184
+ MD: Color;
185
+ NO: Color;
186
+ LR: Color;
187
+ RF: Color;
188
+ DB: Color;
189
+ SG: Color;
190
+ BH: Color;
191
+ HS: Color;
192
+ MT: Color;
193
+ DS: Color;
194
+ RG: Color;
195
+ CN: Color;
196
+ UUT: Color;
197
+ FL: Color;
198
+ UUP: Color;
199
+ LV: Color;
200
+ UUH: Color;
201
+ }>, "custom">>;
80
202
  }>>;
81
203
  };
82
204
  function updateFocusRepr<T extends ColorTheme.BuiltIn>(plugin: PluginContext, structure: Structure, themeName: T | undefined, themeParams: ColorTheme.BuiltInParams<T> | undefined): Promise<void>;
@@ -241,6 +363,28 @@ export declare const PresetStructureRepresentations: {
241
363
  lipid: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
242
364
  };
243
365
  }>;
366
+ illustrative: StructureRepresentationPresetProvider<{
367
+ showCarbohydrateSymbol: boolean;
368
+ ignoreHydrogens: boolean | undefined;
369
+ quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest" | undefined;
370
+ theme: PD.Normalize<{
371
+ globalName: any;
372
+ carbonColor: any;
373
+ symmetryColor: any;
374
+ focus: any;
375
+ }> | undefined;
376
+ }, {
377
+ components?: undefined;
378
+ representations?: undefined;
379
+ } | {
380
+ components: {
381
+ all: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
382
+ branched: undefined;
383
+ };
384
+ representations: {
385
+ all: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
386
+ };
387
+ }>;
244
388
  };
245
389
  export declare type PresetStructureRepresentations = typeof PresetStructureRepresentations;
246
390
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
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>
@@ -21,6 +21,8 @@ var operator_name_1 = require("../../../mol-theme/color/operator-name");
21
21
  var index_pair_1 = require("../../../mol-model-formats/structure/property/bonds/index-pair");
22
22
  var struct_conn_1 = require("../../../mol-model-formats/structure/property/bonds/struct_conn");
23
23
  var type_helpers_1 = require("../../../mol-util/type-helpers");
24
+ var color_1 = require("../../../mol-util/color");
25
+ var postprocessing_1 = require("../../../mol-canvas3d/passes/postprocessing");
24
26
  function StructureRepresentationPresetProvider(repr) { return repr; }
25
27
  exports.StructureRepresentationPresetProvider = StructureRepresentationPresetProvider;
26
28
  (function (StructureRepresentationPresetProvider) {
@@ -81,6 +83,14 @@ exports.StructureRepresentationPresetProvider = StructureRepresentationPresetPro
81
83
  var CommonParams = StructureRepresentationPresetProvider.CommonParams;
82
84
  var reprBuilder = StructureRepresentationPresetProvider.reprBuilder;
83
85
  var updateFocusRepr = StructureRepresentationPresetProvider.updateFocusRepr;
86
+ function resetPostprocessingProps(plugin) {
87
+ if (plugin.canvas3d) {
88
+ var p = param_definition_1.ParamDefinition.getDefaultValues(postprocessing_1.PostprocessingParams);
89
+ plugin.canvas3d.setProps({
90
+ postprocessing: { outline: p.outline, occlusion: p.occlusion }
91
+ });
92
+ }
93
+ }
84
94
  var auto = StructureRepresentationPresetProvider({
85
95
  id: 'preset-structure-representation-auto',
86
96
  display: {
@@ -120,6 +130,7 @@ var empty = StructureRepresentationPresetProvider({
120
130
  apply: function (ref, params, plugin) {
121
131
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
122
132
  return (0, tslib_1.__generator)(this, function (_a) {
133
+ resetPostprocessingProps(plugin);
123
134
  return [2 /*return*/, {}];
124
135
  });
125
136
  });
@@ -194,6 +205,7 @@ var polymerAndLigand = StructureRepresentationPresetProvider({
194
205
  return [4 /*yield*/, updateFocusRepr(plugin, structure, (_h = (_g = params.theme) === null || _g === void 0 ? void 0 : _g.focus) === null || _h === void 0 ? void 0 : _h.name, (_k = (_j = params.theme) === null || _j === void 0 ? void 0 : _j.focus) === null || _k === void 0 ? void 0 : _k.params)];
195
206
  case 10:
196
207
  _o.sent();
208
+ resetPostprocessingProps(plugin);
197
209
  return [2 /*return*/, { components: components, representations: representations }];
198
210
  }
199
211
  });
@@ -245,6 +257,7 @@ var proteinAndNucleic = StructureRepresentationPresetProvider({
245
257
  return [4 /*yield*/, updateFocusRepr(plugin, structure, (_b = (_a = params.theme) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.name, (_d = (_c = params.theme) === null || _c === void 0 ? void 0 : _c.focus) === null || _d === void 0 ? void 0 : _d.params)];
246
258
  case 4:
247
259
  _g.sent();
260
+ resetPostprocessingProps(plugin);
248
261
  return [2 /*return*/, { components: components, representations: representations }];
249
262
  }
250
263
  });
@@ -311,6 +324,7 @@ var coarseSurface = StructureRepresentationPresetProvider({
311
324
  return [4 /*yield*/, updateFocusRepr(plugin, structure, (_b = (_a = params.theme) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.name, (_d = (_c = params.theme) === null || _c === void 0 ? void 0 : _c.focus) === null || _d === void 0 ? void 0 : _d.params)];
312
325
  case 4:
313
326
  _g.sent();
327
+ resetPostprocessingProps(plugin);
314
328
  return [2 /*return*/, { components: components, representations: representations }];
315
329
  }
316
330
  });
@@ -354,6 +368,7 @@ var polymerCartoon = StructureRepresentationPresetProvider({
354
368
  return [4 /*yield*/, updateFocusRepr(plugin, structure, (_b = (_a = params.theme) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.name, (_d = (_c = params.theme) === null || _c === void 0 ? void 0 : _c.focus) === null || _d === void 0 ? void 0 : _d.params)];
355
369
  case 3:
356
370
  _g.sent();
371
+ resetPostprocessingProps(plugin);
357
372
  return [2 /*return*/, { components: components, representations: representations }];
358
373
  }
359
374
  });
@@ -431,6 +446,62 @@ var atomicDetail = StructureRepresentationPresetProvider({
431
446
  return [4 /*yield*/, updateFocusRepr(plugin, structure, (_c = (_b = (_a = params.theme) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : color, (_f = (_e = (_d = params.theme) === null || _d === void 0 ? void 0 : _d.focus) === null || _e === void 0 ? void 0 : _e.params) !== null && _f !== void 0 ? _f : colorParams)];
432
447
  case 5:
433
448
  _o.sent();
449
+ resetPostprocessingProps(plugin);
450
+ return [2 /*return*/, { components: components, representations: representations }];
451
+ }
452
+ });
453
+ });
454
+ }
455
+ });
456
+ var illustrative = StructureRepresentationPresetProvider({
457
+ id: 'preset-structure-representation-illustrative',
458
+ display: {
459
+ name: 'Illustrative', group: 'Miscellaneous',
460
+ description: '...'
461
+ },
462
+ params: function () { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, CommonParams), { showCarbohydrateSymbol: param_definition_1.ParamDefinition.Boolean(false) })); },
463
+ apply: function (ref, params, plugin) {
464
+ var _a, _b, _c, _d, _e;
465
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
466
+ var structureCell, components, structure, _f, update, builder, typeParams, color, representations;
467
+ var _g;
468
+ return (0, tslib_1.__generator)(this, function (_h) {
469
+ switch (_h.label) {
470
+ case 0:
471
+ structureCell = mol_state_1.StateObjectRef.resolveAndCheck(plugin.state.data, ref);
472
+ if (!structureCell)
473
+ return [2 /*return*/, {}];
474
+ _g = {};
475
+ return [4 /*yield*/, presetStaticComponent(plugin, structureCell, 'all')];
476
+ case 1:
477
+ components = (_g.all = _h.sent(),
478
+ _g.branched = undefined,
479
+ _g);
480
+ structure = structureCell.obj.data;
481
+ _f = reprBuilder(plugin, params, structure), update = _f.update, builder = _f.builder, typeParams = _f.typeParams, color = _f.color;
482
+ representations = {
483
+ all: builder.buildRepresentation(update, components.all, { type: 'spacefill', typeParams: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, typeParams), { ignoreLight: true }), color: 'illustrative' }, { tag: 'all' }),
484
+ };
485
+ return [4 /*yield*/, update.commit({ revertOnError: true })];
486
+ case 2:
487
+ _h.sent();
488
+ return [4 /*yield*/, updateFocusRepr(plugin, structure, (_c = (_b = (_a = params.theme) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : color, (_e = (_d = params.theme) === null || _d === void 0 ? void 0 : _d.focus) === null || _e === void 0 ? void 0 : _e.params)];
489
+ case 3:
490
+ _h.sent();
491
+ if (plugin.canvas3d) {
492
+ plugin.canvas3d.setProps({
493
+ postprocessing: {
494
+ outline: {
495
+ name: 'on',
496
+ params: { scale: 1, color: (0, color_1.Color)(0x000000), threshold: 0.25 }
497
+ },
498
+ occlusion: {
499
+ name: 'on',
500
+ params: { bias: 0.9, blurKernelSize: 15, radius: 5, samples: 32 }
501
+ },
502
+ }
503
+ });
504
+ }
434
505
  return [2 /*return*/, { components: components, representations: representations }];
435
506
  }
436
507
  });
@@ -452,6 +523,7 @@ exports.PresetStructureRepresentations = {
452
523
  'polymer-cartoon': polymerCartoon,
453
524
  'polymer-and-ligand': polymerAndLigand,
454
525
  'protein-and-nucleic': proteinAndNucleic,
455
- 'coarse-surface': coarseSurface
526
+ 'coarse-surface': coarseSurface,
527
+ 'illustrative': illustrative,
456
528
  };
457
529
  //# sourceMappingURL=representation-preset.js.map
@@ -29,7 +29,7 @@ declare class PluginAnimationManager extends StatefulPluginComponent<PluginAnima
29
29
  updateCurrentParams(values: any): void;
30
30
  register(animation: PluginStateAnimation): void;
31
31
  play<P>(animation: PluginStateAnimation<P>, params: P): Promise<void>;
32
- tick(t: number, isSynchronous?: boolean): Promise<void>;
32
+ tick(t: number, isSynchronous?: boolean, animation?: PluginAnimationManager.AnimationInfo): Promise<void>;
33
33
  private isStopped;
34
34
  private isApplying;
35
35
  start(): Promise<void>;
@@ -43,6 +43,10 @@ declare class PluginAnimationManager extends StatefulPluginComponent<PluginAnima
43
43
  constructor(context: PluginContext);
44
44
  }
45
45
  declare namespace PluginAnimationManager {
46
+ interface AnimationInfo {
47
+ currentFrame: number;
48
+ frameCount: number;
49
+ }
46
50
  interface Current {
47
51
  anim: PluginStateAnimation;
48
52
  params: PD.Params;
@@ -115,7 +115,7 @@ var PluginAnimationManager = /** @class */ (function (_super) {
115
115
  });
116
116
  });
117
117
  };
118
- PluginAnimationManager.prototype.tick = function (t, isSynchronous) {
118
+ PluginAnimationManager.prototype.tick = function (t, isSynchronous, animation) {
119
119
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
120
120
  return (0, tslib_1.__generator)(this, function (_a) {
121
121
  switch (_a.label) {
@@ -123,8 +123,8 @@ var PluginAnimationManager = /** @class */ (function (_super) {
123
123
  this.currentTime = t;
124
124
  if (this.isStopped)
125
125
  return [2 /*return*/];
126
- if (!isSynchronous) return [3 /*break*/, 2];
127
- return [4 /*yield*/, this.applyFrame()];
126
+ if (!(isSynchronous || animation)) return [3 /*break*/, 2];
127
+ return [4 /*yield*/, this.applyFrame(animation)];
128
128
  case 1:
129
129
  _a.sent();
130
130
  return [3 /*break*/, 3];
@@ -223,7 +223,7 @@ var PluginAnimationManager = /** @class */ (function (_super) {
223
223
  });
224
224
  });
225
225
  };
226
- PluginAnimationManager.prototype.applyFrame = function () {
226
+ PluginAnimationManager.prototype.applyFrame = function (animation) {
227
227
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
228
228
  var t, newState;
229
229
  return (0, tslib_1.__generator)(this, function (_a) {
@@ -232,7 +232,7 @@ var PluginAnimationManager = /** @class */ (function (_super) {
232
232
  t = this.currentTime;
233
233
  if (this._current.startedTime < 0)
234
234
  this._current.startedTime = t;
235
- return [4 /*yield*/, this._current.anim.apply(this._current.state, { lastApplied: this._current.lastTime, current: t - this._current.startedTime }, { params: this._current.paramValues, plugin: this.context })];
235
+ return [4 /*yield*/, this._current.anim.apply(this._current.state, { lastApplied: this._current.lastTime, current: t - this._current.startedTime, animation: animation }, { params: this._current.paramValues, plugin: this.context })];
236
236
  case 1:
237
237
  newState = _a.sent();
238
238
  if (newState.kind === 'finished') {
@@ -162,8 +162,8 @@ var SuperpositionControls = /** @class */ (function (_super) {
162
162
  _i++;
163
163
  return [3 /*break*/, 1];
164
164
  case 4:
165
- rmsd /= transforms.length - 1;
166
- this.plugin.log.info("Superposed ".concat(input.length, " structures with avg. RMSD ").concat(rmsd.toFixed(2), "."));
165
+ rmsd /= Math.max(transforms.length - 1, 1);
166
+ this.plugin.log.info("Superposed ".concat(input.length, " structures with avg. RMSD ").concat(rmsd.toFixed(2), " \u00C5."));
167
167
  return [4 /*yield*/, new Promise(function (res) { return requestAnimationFrame(res); })];
168
168
  case 5:
169
169
  _a.sent();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
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
  * @author David Sehnal <david.sehnal@gmail.com>
@@ -4,7 +4,7 @@ exports.SimpleSettingsControl = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var jsx_runtime_1 = require("react/jsx-runtime");
6
6
  /**
7
- * Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
7
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
8
8
  *
9
9
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
10
10
  * @author David Sehnal <david.sehnal@gmail.com>
@@ -47,10 +47,7 @@ var LayoutOptions = {
47
47
  'left': 'Left Panel'
48
48
  };
49
49
  var SimpleSettingsParams = {
50
- spin: param_definition_1.ParamDefinition.Group({
51
- spin: canvas3d_1.Canvas3DParams.trackball.params.spin,
52
- speed: canvas3d_1.Canvas3DParams.trackball.params.spinSpeed
53
- }, { pivot: 'spin' }),
50
+ animate: canvas3d_1.Canvas3DParams.trackball.params.animate,
54
51
  camera: canvas3d_1.Canvas3DParams.camera,
55
52
  background: param_definition_1.ParamDefinition.Group({
56
53
  color: param_definition_1.ParamDefinition.Color((0, color_1.Color)(0xFCFBF9), { label: 'Background', description: 'Custom background color' }),
@@ -100,7 +97,7 @@ var SimpleSettingsMapping = (0, param_mapping_1.ParamMapping)({
100
97
  var renderer = canvas.renderer;
101
98
  return {
102
99
  layout: props.layout,
103
- spin: { spin: !!canvas.trackball.spin, speed: canvas.trackball.spinSpeed },
100
+ animate: canvas.trackball.animate,
104
101
  camera: canvas.camera,
105
102
  background: {
106
103
  color: renderer.backgroundColor,
@@ -116,8 +113,7 @@ var SimpleSettingsMapping = (0, param_mapping_1.ParamMapping)({
116
113
  },
117
114
  update: function (s, props) {
118
115
  var canvas = props.canvas;
119
- canvas.trackball.spin = s.spin.spin;
120
- canvas.trackball.spinSpeed = s.spin.speed;
116
+ canvas.trackball.animate = s.animate;
121
117
  canvas.camera = s.camera;
122
118
  canvas.transparentBackground = s.background.transparent;
123
119
  canvas.renderer.backgroundColor = s.background.color;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
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
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
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
  */
@@ -81,6 +81,7 @@ function getLinkLoci(pickingId, structure, id) {
81
81
  }
82
82
  return loci_1.EmptyLoci;
83
83
  }
84
+ var __linkIndicesSet = new Set();
84
85
  function eachCarbohydrateLink(loci, structure, apply) {
85
86
  var changed = false;
86
87
  if (!structure_1.StructureElement.Loci.is(loci))
@@ -91,12 +92,15 @@ function eachCarbohydrateLink(loci, structure, apply) {
91
92
  var _loop_1 = function (unit, indices) {
92
93
  if (!structure_1.Unit.isAtomic(unit))
93
94
  return "continue";
95
+ __linkIndicesSet.clear();
94
96
  int_1.OrderedSet.forEach(indices, function (v) {
95
- // TODO avoid duplicate calls to apply
96
97
  var linkIndices = getLinkIndices(unit, unit.elements[v]);
97
98
  for (var i = 0, il = linkIndices.length; i < il; ++i) {
98
- if (apply(int_1.Interval.ofSingleton(linkIndices[i])))
99
- changed = true;
99
+ if (!__linkIndicesSet.has(linkIndices[i])) {
100
+ __linkIndicesSet.add(linkIndices[i]);
101
+ if (apply(int_1.Interval.ofSingleton(linkIndices[i])))
102
+ changed = true;
103
+ }
100
104
  }
101
105
  });
102
106
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
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
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
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
  */
@@ -25,8 +25,8 @@ var loci_1 = require("../../../mol-model/loci");
25
25
  var common_1 = require("./util/common");
26
26
  var base_1 = require("../../../mol-geo/geometry/base");
27
27
  var t = linear_algebra_1.Mat4.identity();
28
- var sVec = linear_algebra_1.Vec3.zero();
29
- var pd = linear_algebra_1.Vec3.zero();
28
+ var sVec = (0, linear_algebra_1.Vec3)();
29
+ var pd = (0, linear_algebra_1.Vec3)();
30
30
  var SideFactor = 2 * 0.806; // 0.806 == Math.cos(Math.PI / 4)
31
31
  var box = (0, box_1.Box)();
32
32
  var perforatedBox = (0, box_1.PerforatedBox)();
@@ -186,6 +186,7 @@ function getCarbohydrateLoci(pickingId, structure, id) {
186
186
  }
187
187
  return loci_1.EmptyLoci;
188
188
  }
189
+ var __elementIndicesSet = new Set();
189
190
  /** For each carbohydrate (usually a monosaccharide) when all its residue's elements are in a loci. */
190
191
  function eachCarbohydrate(loci, structure, apply) {
191
192
  var getElementIndices = structure.carbohydrates.getElementIndices;
@@ -197,12 +198,15 @@ function eachCarbohydrate(loci, structure, apply) {
197
198
  var _loop_1 = function (unit, indices) {
198
199
  if (!structure_1.Unit.isAtomic(unit))
199
200
  return "continue";
201
+ __elementIndicesSet.clear();
200
202
  int_1.OrderedSet.forEach(indices, function (v) {
201
- // TODO avoid duplicate calls to apply
202
203
  var elementIndices = getElementIndices(unit, unit.elements[v]);
203
204
  for (var i = 0, il = elementIndices.length; i < il; ++i) {
204
- if (apply(int_1.Interval.ofSingleton(elementIndices[i] * 2)))
205
- changed = true;
205
+ if (!__elementIndicesSet.has(elementIndices[i])) {
206
+ __elementIndicesSet.add(elementIndices[i]);
207
+ if (apply(int_1.Interval.ofSingleton(elementIndices[i] * 2)))
208
+ changed = true;
209
+ }
206
210
  }
207
211
  });
208
212
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
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
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
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
  */
@@ -105,6 +105,7 @@ function getTerminalLinkLoci(pickingId, structure, id) {
105
105
  }
106
106
  return loci_1.EmptyLoci;
107
107
  }
108
+ var __linkIndicesSet = new Set();
108
109
  function eachTerminalLink(loci, structure, apply) {
109
110
  var changed = false;
110
111
  if (!structure_1.StructureElement.Loci.is(loci))
@@ -115,12 +116,15 @@ function eachTerminalLink(loci, structure, apply) {
115
116
  var _loop_1 = function (unit, indices) {
116
117
  if (!structure_1.Unit.isAtomic(unit))
117
118
  return "continue";
119
+ __linkIndicesSet.clear();
118
120
  int_1.OrderedSet.forEach(indices, function (v) {
119
- // TODO avoid duplicate calls to apply
120
121
  var linkIndices = getTerminalLinkIndices(unit, unit.elements[v]);
121
122
  for (var i = 0, il = linkIndices.length; i < il; ++i) {
122
- if (apply(int_1.Interval.ofSingleton(linkIndices[i])))
123
- changed = true;
123
+ if (!__linkIndicesSet.has(linkIndices[i])) {
124
+ __linkIndicesSet.add(linkIndices[i]);
125
+ if (apply(int_1.Interval.ofSingleton(linkIndices[i])))
126
+ changed = true;
127
+ }
124
128
  }
125
129
  });
126
130
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
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
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
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
  */
@@ -51,6 +51,7 @@ var Visual;
51
51
  var array = tMarker.ref.value.array;
52
52
  var currentStatus = markerStatus.ref.value;
53
53
  if (!(0, loci_1.isEveryLoci)(loci)) {
54
+ // assume that all interval are non-overlapping
54
55
  var intervalSize_1 = 0;
55
56
  lociApply(loci, function (interval) {
56
57
  intervalSize_1 += int_1.Interval.size(interval);