@cosmol-studio/cosmol-viewer 0.6.3-rc.2 → 0.6.3

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 CHANGED
@@ -95,8 +95,8 @@ bond selections use Stick and residue selections use Cartoon.
95
95
 
96
96
  ## COSMolKit scientific objects
97
97
 
98
- In a browser application, importing the Viewer npm entry initializes both CK
99
- and Viewer WASM modules automatically:
98
+ In a browser application, CK and Viewer each initialize their WASM module on
99
+ import:
100
100
 
101
101
  ```js
102
102
  import * as ck from "@cosmol-studio/cosmolkit";
@@ -6,6 +6,8 @@ export type ByteInput = number;
6
6
 
7
7
  export type BytesInput = Uint8Array;
8
8
 
9
+ export type ColorEntries = Record<string, BytesInput>;
10
+
9
11
  export type DoubleInput = number;
10
12
 
11
13
  export type FloatArrayInput = Float32Array;
@@ -54,6 +56,24 @@ export class Animation {
54
56
  toJson(): string;
55
57
  }
56
58
 
59
+ /**
60
+ * Reusable element and per-atom colors for molecular displays.
61
+ */
62
+ export class MoleculeColors {
63
+ private constructor();
64
+ free(): void;
65
+ [Symbol.dispose](): void;
66
+ /**
67
+ * Return the built-in molecular color scheme.
68
+ */
69
+ static default(): MoleculeColors;
70
+ static new(elements: ColorEntries): MoleculeColors;
71
+ /**
72
+ * Return a new scheme with colors keyed by zero-based CK atom ID.
73
+ */
74
+ withAtomColors(atoms: ColorEntries): MoleculeColors;
75
+ }
76
+
57
77
  /**
58
78
  * Reusable scene state. Cloned binding handles refer to the same scene.
59
79
  */
@@ -88,6 +108,11 @@ export class Scene {
88
108
  setLightColor(color: BytesInput): void;
89
109
  setLightIntensity(intensity: FloatInput): void;
90
110
  setLighting(ambient: FloatInput, diffuse: FloatInput, specular: FloatInput, intensity: FloatInput, color: BytesInput): void;
111
+ /**
112
+ * Set the element palette for subsequent molecular displays.
113
+ * Use MoleculeColors.default() to restore the built-in palette.
114
+ */
115
+ setMoleculePalette(colors: MoleculeColors): void;
91
116
  setScale(scale: FloatInput): void;
92
117
  setTransparentBackground(enabled: BoolInput): void;
93
118
  setZoomDisabled(disabled: BoolInput): void;
@@ -167,6 +192,10 @@ export class Style {
167
192
  static cartoon(): Style;
168
193
  cloneStyle(): Style;
169
194
  color(rgb: BytesInput): Style;
195
+ /**
196
+ * Apply a reusable molecular color scheme.
197
+ */
198
+ colors(colors: MoleculeColors): Style;
170
199
  configureSurface(probe_radius: FloatInput, grid_spacing: FloatInput, solvent_accessible: BoolInput, sharp_boundaries: BoolInput): Style;
171
200
  conformer(id: IndexInput): Style;
172
201
  coordinates2d(): Style;
@@ -253,6 +282,7 @@ export interface InitOutput {
253
282
  readonly __setCkTypes: (a: any, b: any, c: any) => void;
254
283
  readonly __setViewerTypes: (a: any, b: any, c: any, d: any) => void;
255
284
  readonly __wbg_animation_free: (a: number, b: number) => void;
285
+ readonly __wbg_moleculecolors_free: (a: number, b: number) => void;
256
286
  readonly __wbg_scene_free: (a: number, b: number) => void;
257
287
  readonly __wbg_selection_free: (a: number, b: number) => void;
258
288
  readonly __wbg_selector_free: (a: number, b: number) => void;
@@ -269,6 +299,9 @@ export interface InitOutput {
269
299
  readonly animation_setStaticScene: (a: number, b: number, c: number) => void;
270
300
  readonly animation_toJson: (a: number, b: number) => void;
271
301
  readonly bindingContractJson: (a: number) => void;
302
+ readonly moleculecolors_default: (a: number) => void;
303
+ readonly moleculecolors_new: (a: number, b: any) => void;
304
+ readonly moleculecolors_withAtomColors: (a: number, b: number, c: any) => void;
272
305
  readonly scene_add: (a: number, b: number, c: any, d: number) => void;
273
306
  readonly scene_cloneScene: (a: number, b: number) => void;
274
307
  readonly scene_mergeShapes: (a: number, b: number, c: number) => void;
@@ -291,6 +324,7 @@ export interface InitOutput {
291
324
  readonly scene_setLightColor: (a: number, b: number, c: any) => void;
292
325
  readonly scene_setLightIntensity: (a: number, b: number, c: any) => void;
293
326
  readonly scene_setLighting: (a: number, b: number, c: any, d: any, e: any, f: any, g: any) => void;
327
+ readonly scene_setMoleculePalette: (a: number, b: number, c: number) => void;
294
328
  readonly scene_setScale: (a: number, b: number, c: any) => void;
295
329
  readonly scene_setTransparentBackground: (a: number, b: number, c: any) => void;
296
330
  readonly scene_setZoomDisabled: (a: number, b: number, c: any) => void;
@@ -322,6 +356,7 @@ export interface InitOutput {
322
356
  readonly style_cartoon: (a: number) => void;
323
357
  readonly style_cloneStyle: (a: number, b: number) => void;
324
358
  readonly style_color: (a: number, b: number, c: any) => void;
359
+ readonly style_colors: (a: number, b: number, c: number) => void;
325
360
  readonly style_configureSurface: (a: number, b: number, c: any, d: any, e: any, f: any) => void;
326
361
  readonly style_conformer: (a: number, b: number, c: any) => void;
327
362
  readonly style_coordinates2d: (a: number, b: number) => void;
@@ -346,11 +381,11 @@ export interface InitOutput {
346
381
  readonly viewer_showFps: (a: number, b: number, c: any) => void;
347
382
  readonly viewer_takeScreenshot: (a: number) => any;
348
383
  readonly viewer_update: (a: number, b: number, c: number) => void;
349
- readonly __wasm_bindgen_func_elem_8603: (a: number, b: number, c: number, d: any) => void;
350
- readonly __wasm_bindgen_func_elem_8605: (a: number, b: number, c: any, d: any) => void;
351
- readonly __wasm_bindgen_func_elem_3742: (a: number, b: number, c: number) => void;
352
- readonly __wasm_bindgen_func_elem_3743: (a: number, b: number, c: any) => void;
353
- readonly __wasm_bindgen_func_elem_3743_91: (a: number, b: number, c: any) => void;
384
+ readonly __wasm_bindgen_func_elem_8692: (a: number, b: number, c: number, d: any) => void;
385
+ readonly __wasm_bindgen_func_elem_8694: (a: number, b: number, c: any, d: any) => void;
386
+ readonly __wasm_bindgen_func_elem_3829: (a: number, b: number, c: number) => void;
387
+ readonly __wasm_bindgen_func_elem_3830: (a: number, b: number, c: any) => void;
388
+ readonly __wasm_bindgen_func_elem_3830_96: (a: number, b: number, c: any) => void;
354
389
  readonly __wbindgen_export: (a: number, b: number) => number;
355
390
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
356
391
  readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
@@ -196,6 +196,92 @@ export class Animation {
196
196
  }
197
197
  if (Symbol.dispose) Animation.prototype[Symbol.dispose] = Animation.prototype.free;
198
198
 
199
+ /**
200
+ * Reusable element and per-atom colors for molecular displays.
201
+ */
202
+ export class MoleculeColors {
203
+ constructor() {
204
+ throw new Error('cannot invoke `new` directly');
205
+ }
206
+ static __wrap(ptr) {
207
+ const obj = Object.create(MoleculeColors.prototype);
208
+ obj.__wbg_ptr = ptr;
209
+ MoleculeColorsFinalization.register(obj, obj.__wbg_ptr, obj);
210
+ return obj;
211
+ }
212
+ __destroy_into_raw() {
213
+ const ptr = this.__wbg_ptr;
214
+ this.__wbg_ptr = 0;
215
+ MoleculeColorsFinalization.unregister(this);
216
+ return ptr;
217
+ }
218
+ free() {
219
+ const ptr = this.__destroy_into_raw();
220
+ wasm.__wbg_moleculecolors_free(ptr, 0);
221
+ }
222
+ /**
223
+ * Return the built-in molecular color scheme.
224
+ * @returns {MoleculeColors}
225
+ */
226
+ static default() {
227
+ try {
228
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
229
+ wasm.moleculecolors_default(retptr);
230
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
231
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
232
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
233
+ if (r2) {
234
+ throw takeFromExternrefTable0(r1);
235
+ }
236
+ return MoleculeColors.__wrap(r0);
237
+ } finally {
238
+ wasm.__wbindgen_add_to_stack_pointer(16);
239
+ }
240
+ }
241
+ /**
242
+ * @param {ColorEntries} elements
243
+ * @returns {MoleculeColors}
244
+ */
245
+ static new(elements) {
246
+ try {
247
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
248
+ wasm.moleculecolors_new(retptr, elements);
249
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
250
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
251
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
252
+ if (r2) {
253
+ throw takeFromExternrefTable0(r1);
254
+ }
255
+ return MoleculeColors.__wrap(r0);
256
+ } finally {
257
+ wasm.__wbindgen_add_to_stack_pointer(16);
258
+ }
259
+ }
260
+ /**
261
+ * Return a new scheme with colors keyed by zero-based CK atom ID.
262
+ * @param {ColorEntries} atoms
263
+ * @returns {MoleculeColors}
264
+ */
265
+ withAtomColors(atoms) {
266
+ try {
267
+ if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value');
268
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
269
+ _assertNum(this.__wbg_ptr);
270
+ wasm.moleculecolors_withAtomColors(retptr, this.__wbg_ptr, atoms);
271
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
272
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
273
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
274
+ if (r2) {
275
+ throw takeFromExternrefTable0(r1);
276
+ }
277
+ return MoleculeColors.__wrap(r0);
278
+ } finally {
279
+ wasm.__wbindgen_add_to_stack_pointer(16);
280
+ }
281
+ }
282
+ }
283
+ if (Symbol.dispose) MoleculeColors.prototype[Symbol.dispose] = MoleculeColors.prototype.free;
284
+
199
285
  /**
200
286
  * Reusable scene state. Cloned binding handles refer to the same scene.
201
287
  */
@@ -619,6 +705,30 @@ export class Scene {
619
705
  wasm.__wbindgen_add_to_stack_pointer(16);
620
706
  }
621
707
  }
708
+ /**
709
+ * Set the element palette for subsequent molecular displays.
710
+ * Use MoleculeColors.default() to restore the built-in palette.
711
+ * @param {MoleculeColors} colors
712
+ */
713
+ setMoleculePalette(colors) {
714
+ try {
715
+ if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value');
716
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
717
+ _assertNum(this.__wbg_ptr);
718
+ _assertClass(colors, MoleculeColors);
719
+ if (colors.__wbg_ptr === 0) {
720
+ throw new Error('Attempt to use a moved value');
721
+ }
722
+ wasm.scene_setMoleculePalette(retptr, this.__wbg_ptr, colors.__wbg_ptr);
723
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
724
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
725
+ if (r1) {
726
+ throw takeFromExternrefTable0(r0);
727
+ }
728
+ } finally {
729
+ wasm.__wbindgen_add_to_stack_pointer(16);
730
+ }
731
+ }
622
732
  /**
623
733
  * @param {FloatInput} scale
624
734
  */
@@ -1395,6 +1505,32 @@ export class Style {
1395
1505
  wasm.__wbindgen_add_to_stack_pointer(16);
1396
1506
  }
1397
1507
  }
1508
+ /**
1509
+ * Apply a reusable molecular color scheme.
1510
+ * @param {MoleculeColors} colors
1511
+ * @returns {Style}
1512
+ */
1513
+ colors(colors) {
1514
+ try {
1515
+ if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value');
1516
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
1517
+ _assertNum(this.__wbg_ptr);
1518
+ _assertClass(colors, MoleculeColors);
1519
+ if (colors.__wbg_ptr === 0) {
1520
+ throw new Error('Attempt to use a moved value');
1521
+ }
1522
+ wasm.style_colors(retptr, this.__wbg_ptr, colors.__wbg_ptr);
1523
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1524
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1525
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1526
+ if (r2) {
1527
+ throw takeFromExternrefTable0(r1);
1528
+ }
1529
+ return Style.__wrap(r0);
1530
+ } finally {
1531
+ wasm.__wbindgen_add_to_stack_pointer(16);
1532
+ }
1533
+ }
1398
1534
  /**
1399
1535
  * @param {FloatInput} probe_radius
1400
1536
  * @param {FloatInput} grid_spacing
@@ -2428,6 +2564,10 @@ function __wbg_get_imports() {
2428
2564
  __wbg_enable_e955d456ef6b93f7: function() { return logError(function (arg0, arg1) {
2429
2565
  arg0.enable(arg1 >>> 0);
2430
2566
  }, arguments); },
2567
+ __wbg_entries_7bb1459bd9b5c2b9: function() { return logError(function (arg0) {
2568
+ const ret = Object.entries(arg0);
2569
+ return ret;
2570
+ }, arguments); },
2431
2571
  __wbg_error_26c06b769da3d042: function() { return logError(function (arg0, arg1) {
2432
2572
  let deferred0_0;
2433
2573
  let deferred0_1;
@@ -2622,6 +2762,10 @@ function __wbg_get_imports() {
2622
2762
  const ret = arg0[arg1 >>> 0];
2623
2763
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2624
2764
  }, arguments); },
2765
+ __wbg_get_d7176cfb76d71114: function() { return logError(function (arg0, arg1) {
2766
+ const ret = arg0[arg1 >>> 0];
2767
+ return ret;
2768
+ }, arguments); },
2625
2769
  __wbg_get_unchecked_e6325ad374eff861: function() { return logError(function (arg0, arg1) {
2626
2770
  const ret = arg0[arg1 >>> 0];
2627
2771
  return ret;
@@ -2768,6 +2912,17 @@ function __wbg_get_imports() {
2768
2912
  _assertBoolean(ret);
2769
2913
  return ret;
2770
2914
  }, arguments); },
2915
+ __wbg_instanceof_Map_0b4fc8b62e73f163: function() { return logError(function (arg0) {
2916
+ let result;
2917
+ try {
2918
+ result = arg0 instanceof Map;
2919
+ } catch (_) {
2920
+ result = false;
2921
+ }
2922
+ const ret = result;
2923
+ _assertBoolean(ret);
2924
+ return ret;
2925
+ }, arguments); },
2771
2926
  __wbg_instanceof_ResizeObserverEntry_a0c6243afc3437cc: function() { return logError(function (arg0) {
2772
2927
  let result;
2773
2928
  try {
@@ -2870,6 +3025,11 @@ function __wbg_get_imports() {
2870
3025
  _assertBoolean(ret);
2871
3026
  return ret;
2872
3027
  }, arguments); },
3028
+ __wbg_isView_7c4f5a7c257b3a84: function() { return logError(function (arg0) {
3029
+ const ret = ArrayBuffer.isView(arg0);
3030
+ _assertBoolean(ret);
3031
+ return ret;
3032
+ }, arguments); },
2873
3033
  __wbg_is_2248ff2b575d60c7: function() { return logError(function (arg0, arg1) {
2874
3034
  const ret = Object.is(arg0, arg1);
2875
3035
  _assertBoolean(ret);
@@ -3022,7 +3182,7 @@ function __wbg_get_imports() {
3022
3182
  const a = state0.a;
3023
3183
  state0.a = 0;
3024
3184
  try {
3025
- return __wasm_bindgen_func_elem_8605(a, state0.b, arg0, arg1);
3185
+ return __wasm_bindgen_func_elem_8694(a, state0.b, arg0, arg1);
3026
3186
  } finally {
3027
3187
  state0.a = a;
3028
3188
  }
@@ -3469,23 +3629,23 @@ function __wbg_get_imports() {
3469
3629
  return ret;
3470
3630
  }, arguments); },
3471
3631
  __wbindgen_generic_0000000000000001: function() { return logError(function (arg0, arg1) {
3472
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1394, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3473
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8603);
3632
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1416, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3633
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8692);
3474
3634
  return ret;
3475
3635
  }, arguments); },
3476
3636
  __wbindgen_generic_0000000000000002: function() { return logError(function (arg0, arg1) {
3477
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 568, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3478
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3743);
3637
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 590, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3638
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3830);
3479
3639
  return ret;
3480
3640
  }, arguments); },
3481
3641
  __wbindgen_generic_0000000000000003: function() { return logError(function (arg0, arg1) {
3482
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 568, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3483
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3743_91);
3642
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 590, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3643
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3830_96);
3484
3644
  return ret;
3485
3645
  }, arguments); },
3486
3646
  __wbindgen_generic_0000000000000004: function() { return logError(function (arg0, arg1) {
3487
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 571, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3488
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3742);
3647
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 593, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3648
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3829);
3489
3649
  return ret;
3490
3650
  }, arguments); },
3491
3651
  __wbindgen_generic_0000000000000005: function() { return logError(function (arg0) {
@@ -3562,30 +3722,30 @@ function __wbg_get_imports() {
3562
3722
 
3563
3723
 
3564
3724
  //#endregion
3565
- function __wasm_bindgen_func_elem_3743(arg0, arg1, arg2) {
3725
+ function __wasm_bindgen_func_elem_3830(arg0, arg1, arg2) {
3566
3726
  _assertNum(arg0);
3567
3727
  _assertNum(arg1);
3568
- wasm.__wasm_bindgen_func_elem_3743(arg0, arg1, arg2);
3728
+ wasm.__wasm_bindgen_func_elem_3830(arg0, arg1, arg2);
3569
3729
  }
3570
3730
 
3571
- function __wasm_bindgen_func_elem_3743_91(arg0, arg1, arg2) {
3731
+ function __wasm_bindgen_func_elem_3830_96(arg0, arg1, arg2) {
3572
3732
  _assertNum(arg0);
3573
3733
  _assertNum(arg1);
3574
- wasm.__wasm_bindgen_func_elem_3743_91(arg0, arg1, arg2);
3734
+ wasm.__wasm_bindgen_func_elem_3830_96(arg0, arg1, arg2);
3575
3735
  }
3576
3736
 
3577
- function __wasm_bindgen_func_elem_8605(arg0, arg1, arg2, arg3) {
3737
+ function __wasm_bindgen_func_elem_8694(arg0, arg1, arg2, arg3) {
3578
3738
  _assertNum(arg0);
3579
3739
  _assertNum(arg1);
3580
- wasm.__wasm_bindgen_func_elem_8605(arg0, arg1, arg2, arg3);
3740
+ wasm.__wasm_bindgen_func_elem_8694(arg0, arg1, arg2, arg3);
3581
3741
  }
3582
3742
 
3583
- function __wasm_bindgen_func_elem_3742(arg0, arg1) {
3743
+ function __wasm_bindgen_func_elem_3829(arg0, arg1) {
3584
3744
  try {
3585
3745
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
3586
3746
  _assertNum(arg0);
3587
3747
  _assertNum(arg1);
3588
- wasm.__wasm_bindgen_func_elem_3742(retptr, arg0, arg1);
3748
+ wasm.__wasm_bindgen_func_elem_3829(retptr, arg0, arg1);
3589
3749
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3590
3750
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3591
3751
  if (r1) {
@@ -3596,12 +3756,12 @@ function __wasm_bindgen_func_elem_3742(arg0, arg1) {
3596
3756
  }
3597
3757
  }
3598
3758
 
3599
- function __wasm_bindgen_func_elem_8603(arg0, arg1, arg2) {
3759
+ function __wasm_bindgen_func_elem_8692(arg0, arg1, arg2) {
3600
3760
  try {
3601
3761
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
3602
3762
  _assertNum(arg0);
3603
3763
  _assertNum(arg1);
3604
- wasm.__wasm_bindgen_func_elem_8603(retptr, arg0, arg1, arg2);
3764
+ wasm.__wasm_bindgen_func_elem_8692(retptr, arg0, arg1, arg2);
3605
3765
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3606
3766
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3607
3767
  if (r1) {
@@ -3617,6 +3777,9 @@ const __wbindgen_enum_ResizeObserverBoxOptions = ["border-box", "content-box", "
3617
3777
  const AnimationFinalization = (typeof FinalizationRegistry === 'undefined')
3618
3778
  ? { register: () => {}, unregister: () => {} }
3619
3779
  : new FinalizationRegistry(ptr => wasm.__wbg_animation_free(ptr, 1));
3780
+ const MoleculeColorsFinalization = (typeof FinalizationRegistry === 'undefined')
3781
+ ? { register: () => {}, unregister: () => {} }
3782
+ : new FinalizationRegistry(ptr => wasm.__wbg_moleculecolors_free(ptr, 1));
3620
3783
  const SceneFinalization = (typeof FinalizationRegistry === 'undefined')
3621
3784
  ? { register: () => {}, unregister: () => {} }
3622
3785
  : new FinalizationRegistry(ptr => wasm.__wbg_scene_free(ptr, 1));
Binary file
package/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import * as ck from "@cosmol-studio/cosmolkit";
3
3
  import initWasm, { __setCkTypes, __setViewerTypes, Selection, Sphere, Stick, Style } from "./cosmol_viewer_wasm.js";
4
4
 
5
- await Promise.all([ck.default(), initWasm()]);
5
+ await initWasm();
6
6
 
7
7
  __setCkTypes(ck.Molecule, ck.Protein, ck.Element);
8
8
  __setViewerTypes(Selection, Sphere, Stick, Style);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@cosmol-studio/cosmol-viewer",
3
3
  "type": "module",
4
4
  "description": "Molecular visualization tools by rust",
5
- "version": "0.6.3-rc.2",
5
+ "version": "0.6.3",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -23,10 +23,10 @@
23
23
  "./index.js"
24
24
  ],
25
25
  "dependencies": {
26
- "@cosmol-studio/cosmolkit": "0.6.2"
26
+ "@cosmol-studio/cosmolkit": "0.6.3"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public",
30
- "tag": "rc"
30
+ "tag": "latest"
31
31
  }
32
32
  }