molstar 3.31.2 → 3.31.4

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 (80) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +202 -202
  3. package/build/viewer/embedded.html +52 -52
  4. package/build/viewer/index.html +115 -115
  5. package/build/viewer/molstar.js +1 -1
  6. package/lib/apps/docking-viewer/index.html +36 -36
  7. package/lib/apps/viewer/embedded.html +52 -52
  8. package/lib/apps/viewer/index.html +115 -115
  9. package/lib/commonjs/extensions/meshes/mesh-extension.d.ts +4 -2
  10. package/lib/commonjs/extensions/meshes/mesh-streaming/behavior.d.ts +2 -0
  11. package/lib/commonjs/mol-canvas3d/canvas3d.js +2 -1
  12. package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +1 -1
  13. package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +0 -1
  14. package/lib/commonjs/mol-geo/geometry/points/points.d.ts +1 -1
  15. package/lib/commonjs/mol-gl/shader/cylinders.vert.d.ts +2 -2
  16. package/lib/commonjs/mol-gl/shader/cylinders.vert.js +2 -2
  17. package/lib/commonjs/mol-gl/shader/spheres.vert.d.ts +2 -2
  18. package/lib/commonjs/mol-gl/shader/spheres.vert.js +2 -2
  19. package/lib/commonjs/mol-math/linear-algebra/matrix/principal-axes.js +1 -1
  20. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
  21. package/lib/commonjs/mol-plugin/context.js +1 -0
  22. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.js +2 -1
  23. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.js +2 -1
  24. package/lib/commonjs/mol-repr/structure/visual/util/link.d.ts +1 -0
  25. package/lib/commonjs/mol-repr/structure/visual/util/link.js +27 -9
  26. package/lib/commonjs/mol-script/language/builder.d.ts +1 -0
  27. package/lib/commonjs/mol-util/data-source.js +2 -1
  28. package/lib/examples/alpha-orbitals/index.html +72 -72
  29. package/lib/examples/basic-wrapper/index.html +137 -137
  30. package/lib/examples/lighting/index.html +88 -88
  31. package/lib/examples/proteopedia-wrapper/index.html +236 -236
  32. package/lib/extensions/meshes/mesh-extension.d.ts +4 -2
  33. package/lib/extensions/meshes/mesh-streaming/behavior.d.ts +2 -0
  34. package/lib/mol-canvas3d/canvas3d.js +2 -1
  35. package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +1 -1
  36. package/lib/mol-geo/geometry/lines/lines.d.ts +0 -1
  37. package/lib/mol-geo/geometry/points/points.d.ts +1 -1
  38. package/lib/mol-gl/shader/cylinders.vert.d.ts +2 -2
  39. package/lib/mol-gl/shader/cylinders.vert.js +2 -2
  40. package/lib/mol-gl/shader/spheres.vert.d.ts +2 -2
  41. package/lib/mol-gl/shader/spheres.vert.js +2 -2
  42. package/lib/mol-math/linear-algebra/matrix/principal-axes.js +1 -1
  43. package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
  44. package/lib/mol-plugin/context.js +1 -0
  45. package/lib/mol-plugin/version.js +2 -2
  46. package/lib/mol-plugin-ui/skin/base/base.scss +32 -32
  47. package/lib/mol-plugin-ui/skin/base/components/controls-base.scss +333 -333
  48. package/lib/mol-plugin-ui/skin/base/components/controls.scss +418 -418
  49. package/lib/mol-plugin-ui/skin/base/components/help.scss +27 -27
  50. package/lib/mol-plugin-ui/skin/base/components/line-graph.scss +67 -67
  51. package/lib/mol-plugin-ui/skin/base/components/log.scss +100 -100
  52. package/lib/mol-plugin-ui/skin/base/components/misc.scss +663 -663
  53. package/lib/mol-plugin-ui/skin/base/components/sequence.scss +125 -125
  54. package/lib/mol-plugin-ui/skin/base/components/slider.scss +165 -165
  55. package/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -99
  56. package/lib/mol-plugin-ui/skin/base/components/toast.scss +83 -83
  57. package/lib/mol-plugin-ui/skin/base/components/transformer.scss +163 -163
  58. package/lib/mol-plugin-ui/skin/base/components/viewport.scss +137 -137
  59. package/lib/mol-plugin-ui/skin/base/layout/common.scss +71 -71
  60. package/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +89 -89
  61. package/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +98 -98
  62. package/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +108 -108
  63. package/lib/mol-plugin-ui/skin/base/layout.scss +40 -40
  64. package/lib/mol-plugin-ui/skin/base/logo.scss +12 -12
  65. package/lib/mol-plugin-ui/skin/base/normalize.scss +209 -209
  66. package/lib/mol-plugin-ui/skin/base/ui.scss +40 -40
  67. package/lib/mol-plugin-ui/skin/base/variables.scss +88 -88
  68. package/lib/mol-plugin-ui/skin/blue.scss +1 -1
  69. package/lib/mol-plugin-ui/skin/colors/blue.scss +23 -23
  70. package/lib/mol-plugin-ui/skin/colors/dark.scss +23 -23
  71. package/lib/mol-plugin-ui/skin/colors/light.scss +29 -29
  72. package/lib/mol-plugin-ui/skin/dark.scss +1 -1
  73. package/lib/mol-plugin-ui/skin/light.scss +1 -1
  74. package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.js +2 -1
  75. package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.js +2 -1
  76. package/lib/mol-repr/structure/visual/util/link.d.ts +1 -0
  77. package/lib/mol-repr/structure/visual/util/link.js +27 -9
  78. package/lib/mol-script/language/builder.d.ts +1 -0
  79. package/lib/mol-util/data-source.js +2 -1
  80. package/package.json +178 -177
@@ -1,2 +1,2 @@
1
- @import 'colors/blue';
1
+ @import 'colors/blue';
2
2
  @import 'base/base';
@@ -1,24 +1,24 @@
1
- $default-background: #2D3E50;
2
- $font-color: #EDF1F2;
3
- $hover-font-color: #3B9AD9;
4
- $entity-current-font-color: #FFFFFF;
5
- $msp-btn-remove-background: #BF3A31;
6
- $msp-btn-remove-hover-font-color:#ffffff;
7
- $msp-btn-commit-on-font-color: #ffffff;
8
- $entity-badge-font-color: #ccd4e0;
9
-
10
- // used in LOG
11
- $log-message: #0CCA5D;
12
- $log-info: #5E3673;
13
- $log-warning: #FCC937;
14
- $log-error: #FD354B;
15
-
16
- $logo-background: rgba(0,0,0,0.75);
17
-
18
- @function color-lower-contrast($color, $amount) {
19
- @return darken($color, $amount);
20
- }
21
-
22
- @function color-increase-contrast($color, $amount) {
23
- @return lighten($color, $amount);
1
+ $default-background: #2D3E50;
2
+ $font-color: #EDF1F2;
3
+ $hover-font-color: #3B9AD9;
4
+ $entity-current-font-color: #FFFFFF;
5
+ $msp-btn-remove-background: #BF3A31;
6
+ $msp-btn-remove-hover-font-color:#ffffff;
7
+ $msp-btn-commit-on-font-color: #ffffff;
8
+ $entity-badge-font-color: #ccd4e0;
9
+
10
+ // used in LOG
11
+ $log-message: #0CCA5D;
12
+ $log-info: #5E3673;
13
+ $log-warning: #FCC937;
14
+ $log-error: #FD354B;
15
+
16
+ $logo-background: rgba(0,0,0,0.75);
17
+
18
+ @function color-lower-contrast($color, $amount) {
19
+ @return darken($color, $amount);
20
+ }
21
+
22
+ @function color-increase-contrast($color, $amount) {
23
+ @return lighten($color, $amount);
24
24
  }
@@ -1,24 +1,24 @@
1
- $default-background: #111318;
2
- $font-color: #ccd4e0;
3
- $hover-font-color: #51A2FB;
4
- $entity-current-font-color: #68BEFD;
5
- $msp-btn-remove-background: #DE0A28;
6
- $msp-btn-remove-hover-font-color:#F2F4F7;
7
- $msp-btn-commit-on-font-color: #68BEFD;
8
- $entity-badge-font-color: #ccd4e0;
9
-
10
- // used in LOG
11
- $log-message: #0CCA5D;
12
- $log-info: #5E3673;
13
- $log-warning: #FCC937;
14
- $log-error: #FD354B;
15
-
16
- $logo-background: rgba(0,0,0,0.75);
17
-
18
- @function color-lower-contrast($color, $amount) {
19
- @return darken($color, $amount);
20
- }
21
-
22
- @function color-increase-contrast($color, $amount) {
23
- @return lighten($color, $amount);
1
+ $default-background: #111318;
2
+ $font-color: #ccd4e0;
3
+ $hover-font-color: #51A2FB;
4
+ $entity-current-font-color: #68BEFD;
5
+ $msp-btn-remove-background: #DE0A28;
6
+ $msp-btn-remove-hover-font-color:#F2F4F7;
7
+ $msp-btn-commit-on-font-color: #68BEFD;
8
+ $entity-badge-font-color: #ccd4e0;
9
+
10
+ // used in LOG
11
+ $log-message: #0CCA5D;
12
+ $log-info: #5E3673;
13
+ $log-warning: #FCC937;
14
+ $log-error: #FD354B;
15
+
16
+ $logo-background: rgba(0,0,0,0.75);
17
+
18
+ @function color-lower-contrast($color, $amount) {
19
+ @return darken($color, $amount);
20
+ }
21
+
22
+ @function color-increase-contrast($color, $amount) {
23
+ @return lighten($color, $amount);
24
24
  }
@@ -1,30 +1,30 @@
1
- // this is complement of the dark theme
2
-
3
- @function compl($color) {
4
- @return rgb(255 - red($color), 255 - green($color), 255 - blue($color));
5
- }
6
-
7
- $default-background: compl(#111318);
8
- $font-color: compl(#ccd4e0);
9
- $hover-font-color: compl(#51A2FB);
10
- $entity-current-font-color: compl(#68BEFD);
11
- $msp-btn-commit-on-font-color: compl(#68BEFD);
12
- $entity-badge-font-color: lighten(#ccd4e0,10%);
13
- $msp-btn-remove-background: #DE0A28;
14
- $msp-btn-remove-hover-font-color:#F2F4F7;
15
-
16
- // used in LOG
17
- $log-message: #0CCA5D;
18
- $log-info: #5E3673;
19
- $log-warning: #FCC937;
20
- $log-error: #FD354B;
21
-
22
- $logo-background: compl(#111318);
23
-
24
- @function color-lower-contrast($color, $amount) {
25
- @return lighten($color, $amount);
26
- }
27
-
28
- @function color-increase-contrast($color, $amount) {
29
- @return darken($color, $amount);
1
+ // this is complement of the dark theme
2
+
3
+ @function compl($color) {
4
+ @return rgb(255 - red($color), 255 - green($color), 255 - blue($color));
5
+ }
6
+
7
+ $default-background: compl(#111318);
8
+ $font-color: compl(#ccd4e0);
9
+ $hover-font-color: compl(#51A2FB);
10
+ $entity-current-font-color: compl(#68BEFD);
11
+ $msp-btn-commit-on-font-color: compl(#68BEFD);
12
+ $entity-badge-font-color: lighten(#ccd4e0,10%);
13
+ $msp-btn-remove-background: #DE0A28;
14
+ $msp-btn-remove-hover-font-color:#F2F4F7;
15
+
16
+ // used in LOG
17
+ $log-message: #0CCA5D;
18
+ $log-info: #5E3673;
19
+ $log-warning: #FCC937;
20
+ $log-error: #FD354B;
21
+
22
+ $logo-background: compl(#111318);
23
+
24
+ @function color-lower-contrast($color, $amount) {
25
+ @return lighten($color, $amount);
26
+ }
27
+
28
+ @function color-increase-contrast($color, $amount) {
29
+ @return darken($color, $amount);
30
30
  }
@@ -1,2 +1,2 @@
1
- @import 'colors/dark';
1
+ @import 'colors/dark';
2
2
  @import 'base/base';
@@ -1,2 +1,2 @@
1
- @import 'colors/light';
1
+ @import 'colors/light';
2
2
  @import 'base/base';
@@ -182,7 +182,8 @@ export function InterUnitBondCylinderImpostorVisual(materialId) {
182
182
  getLoci: getInterBondLoci,
183
183
  eachLocation: eachInterBond,
184
184
  setUpdateState: function (state, newProps, currentProps, newTheme, currentTheme, newStructure, currentStructure) {
185
- state.createGeometry = (newProps.sizeAspectRatio !== currentProps.sizeAspectRatio ||
185
+ state.createGeometry = (newProps.sizeFactor !== currentProps.sizeFactor ||
186
+ newProps.sizeAspectRatio !== currentProps.sizeAspectRatio ||
186
187
  newProps.linkScale !== currentProps.linkScale ||
187
188
  newProps.linkSpacing !== currentProps.linkSpacing ||
188
189
  newProps.ignoreHydrogens !== currentProps.ignoreHydrogens ||
@@ -203,7 +203,8 @@ export function IntraUnitBondCylinderImpostorVisual(materialId) {
203
203
  getLoci: getIntraBondLoci,
204
204
  eachLocation: eachIntraBond,
205
205
  setUpdateState: function (state, newProps, currentProps, newTheme, currentTheme, newStructureGroup, currentStructureGroup) {
206
- state.createGeometry = (newProps.sizeAspectRatio !== currentProps.sizeAspectRatio ||
206
+ state.createGeometry = (newProps.sizeFactor !== currentProps.sizeFactor ||
207
+ newProps.sizeAspectRatio !== currentProps.sizeAspectRatio ||
207
208
  newProps.linkScale !== currentProps.linkScale ||
208
209
  newProps.linkSpacing !== currentProps.linkSpacing ||
209
210
  newProps.ignoreHydrogens !== currentProps.ignoreHydrogens ||
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author Zhenyu Zhang <jump2cn@gmail.com>
5
6
  */
6
7
  import { Vec3 } from '../../../../mol-math/linear-algebra';
7
8
  import { ParamDefinition as PD } from '../../../../mol-util/param-definition';
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author Zhenyu Zhang <jump2cn@gmail.com>
5
6
  */
6
7
  import { Vec3 } from '../../../../mol-math/linear-algebra';
7
8
  import { ParamDefinition as PD } from '../../../../mol-util/param-definition';
@@ -21,7 +22,7 @@ export var LinkCylinderParams = {
21
22
  aromaticScale: PD.Numeric(0.3, { min: 0, max: 1, step: 0.01 }),
22
23
  aromaticSpacing: PD.Numeric(1.5, { min: 0, max: 3, step: 0.01 }),
23
24
  aromaticDashCount: PD.Numeric(2, { min: 2, max: 6, step: 2 }),
24
- dashCount: PD.Numeric(4, { min: 2, max: 10, step: 2 }),
25
+ dashCount: PD.Numeric(4, { min: 0, max: 10, step: 2 }),
25
26
  dashScale: PD.Numeric(0.8, { min: 0, max: 2, step: 0.1 }),
26
27
  dashCap: PD.Boolean(true),
27
28
  stubCap: PD.Boolean(true),
@@ -32,7 +33,7 @@ export var LinkLineParams = {
32
33
  linkScale: PD.Numeric(0.5, { min: 0, max: 1, step: 0.1 }),
33
34
  linkSpacing: PD.Numeric(0.1, { min: 0, max: 2, step: 0.01 }),
34
35
  aromaticDashCount: PD.Numeric(2, { min: 2, max: 6, step: 2 }),
35
- dashCount: PD.Numeric(4, { min: 2, max: 10, step: 2 }),
36
+ dashCount: PD.Numeric(4, { min: 0, max: 10, step: 2 }),
36
37
  };
37
38
  export var DefaultLinkLineProps = PD.getDefaultValues(LinkLineParams);
38
39
  var tmpV12 = Vec3();
@@ -117,7 +118,12 @@ export function createLinkCylinderMesh(ctx, linkBuilder, props, mesh) {
117
118
  else if (linkStyle === 1 /* LinkStyle.Dashed */) {
118
119
  cylinderProps.radiusTop = cylinderProps.radiusBottom = linkRadius * dashScale;
119
120
  cylinderProps.topCap = cylinderProps.bottomCap = dashCap;
120
- addFixedCountDashedCylinder(builderState, va, vb, 0.5, segmentCount, cylinderProps);
121
+ if (segmentCount > 1) {
122
+ addFixedCountDashedCylinder(builderState, va, vb, 0.5, segmentCount, cylinderProps);
123
+ }
124
+ else {
125
+ addCylinder(builderState, va, vb, 0.5, cylinderProps);
126
+ }
121
127
  }
122
128
  else if (linkStyle === 2 /* LinkStyle.Double */ || linkStyle === 3 /* LinkStyle.OffsetDouble */ || linkStyle === 4 /* LinkStyle.Triple */ || linkStyle === 5 /* LinkStyle.OffsetTriple */ || linkStyle === 7 /* LinkStyle.Aromatic */ || linkStyle === 8 /* LinkStyle.MirroredAromatic */) {
123
129
  var order = (linkStyle === 2 /* LinkStyle.Double */ || linkStyle === 3 /* LinkStyle.OffsetDouble */) ? 2 :
@@ -237,9 +243,15 @@ export function createLinkCylinderImpostors(ctx, linkBuilder, props, cylinders)
237
243
  builder.add(va[0], va[1], va[2], vm[0], vm[1], vm[2], 1, linkCap, linkStub, edgeIndex);
238
244
  }
239
245
  else if (linkStyle === 1 /* LinkStyle.Dashed */) {
240
- v3scale(tmpV12, v3sub(tmpV12, vb, va), lengthScale);
241
- v3sub(vb, vb, tmpV12);
242
- builder.addFixedCountDashes(va, vb, segmentCount, dashScale, dashCap, dashCap, edgeIndex);
246
+ if (segmentCount > 1) {
247
+ v3scale(tmpV12, v3sub(tmpV12, vb, va), lengthScale);
248
+ v3sub(vb, vb, tmpV12);
249
+ builder.addFixedCountDashes(va, vb, segmentCount, dashScale, dashCap, dashCap, edgeIndex);
250
+ }
251
+ else {
252
+ v3scale(vm, v3add(vm, va, vb), 0.5);
253
+ builder.add(va[0], va[1], va[2], vm[0], vm[1], vm[2], dashScale, dashCap, dashCap, edgeIndex);
254
+ }
243
255
  }
244
256
  else if (linkStyle === 2 /* LinkStyle.Double */ || linkStyle === 3 /* LinkStyle.OffsetDouble */ || linkStyle === 4 /* LinkStyle.Triple */ || linkStyle === 5 /* LinkStyle.OffsetTriple */ || linkStyle === 7 /* LinkStyle.Aromatic */ || linkStyle === 8 /* LinkStyle.MirroredAromatic */) {
245
257
  var order = (linkStyle === 2 /* LinkStyle.Double */ || linkStyle === 3 /* LinkStyle.OffsetDouble */) ? 2 :
@@ -341,9 +353,15 @@ export function createLinkLines(ctx, linkBuilder, props, lines) {
341
353
  builder.add(va[0], va[1], va[2], vm[0], vm[1], vm[2], edgeIndex);
342
354
  }
343
355
  else if (linkStyle === 1 /* LinkStyle.Dashed */) {
344
- v3scale(tmpV12, v3sub(tmpV12, vb, va), lengthScale);
345
- v3sub(vb, vb, tmpV12);
346
- builder.addFixedCountDashes(va, vb, segmentCount, edgeIndex);
356
+ if (segmentCount > 1) {
357
+ v3scale(tmpV12, v3sub(tmpV12, vb, va), lengthScale);
358
+ v3sub(vb, vb, tmpV12);
359
+ builder.addFixedCountDashes(va, vb, segmentCount, edgeIndex);
360
+ }
361
+ else {
362
+ v3scale(vm, v3add(vm, va, vb), 0.5);
363
+ builder.add(va[0], va[1], va[2], vm[0], vm[1], vm[2], edgeIndex);
364
+ }
347
365
  }
348
366
  else if (linkStyle === 2 /* LinkStyle.Double */ || linkStyle === 3 /* LinkStyle.OffsetDouble */ || linkStyle === 4 /* LinkStyle.Triple */ || linkStyle === 5 /* LinkStyle.OffsetTriple */ || linkStyle === 7 /* LinkStyle.Aromatic */ || linkStyle === 8 /* LinkStyle.MirroredAromatic */) {
349
367
  var order = linkStyle === 2 /* LinkStyle.Double */ || linkStyle === 3 /* LinkStyle.OffsetDouble */ ? 2 :
@@ -10,6 +10,7 @@ export declare namespace MolScriptBuilder {
10
10
  '@header': string;
11
11
  type: {
12
12
  '@header': string;
13
+ /** atom macromolecular property set */
13
14
  bool: MSymbol<import("./symbol").Arguments<import("./symbol").Arguments.PropTypes<{
14
15
  0: import("./symbol").Argument<import("./type").Type.AnyValue>;
15
16
  }>>, import("./type").Type.OneOf<boolean>>;
@@ -343,7 +343,8 @@ var _fs = undefined;
343
343
  function getFS() {
344
344
  if (_fs)
345
345
  return _fs;
346
- _fs = require('fs');
346
+ var req = require; // To fool webpack
347
+ _fs = req('fs');
347
348
  return _fs;
348
349
  }
349
350
  /** Alternative implementation of ajaxGetInternal (because xhr2 does not support file:// protocol) */