@cosmol-studio/cosmol-viewer 0.6.3-rc.1 → 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 +2 -2
- package/cosmol_viewer_wasm.d.ts +103 -64
- package/cosmol_viewer_wasm.js +1347 -1208
- package/cosmol_viewer_wasm_bg.wasm +0 -0
- package/index.js +1 -1
- package/package.json +3 -3
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,
|
|
99
|
-
|
|
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";
|
package/cosmol_viewer_wasm.d.ts
CHANGED
|
@@ -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;
|
|
@@ -250,9 +279,10 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
250
279
|
|
|
251
280
|
export interface InitOutput {
|
|
252
281
|
readonly memory: WebAssembly.Memory;
|
|
253
|
-
readonly __setCkTypes: (a:
|
|
254
|
-
readonly __setViewerTypes: (a:
|
|
282
|
+
readonly __setCkTypes: (a: any, b: any, c: any) => void;
|
|
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;
|
|
@@ -262,101 +292,110 @@ export interface InitOutput {
|
|
|
262
292
|
readonly __wbg_viewer_free: (a: number, b: number) => void;
|
|
263
293
|
readonly animation_addFrame: (a: number, b: number, c: number) => void;
|
|
264
294
|
readonly animation_frameCount: (a: number, b: number) => void;
|
|
265
|
-
readonly animation_new: (a: number, b:
|
|
266
|
-
readonly animation_setInterpolate: (a: number, b: number, c:
|
|
267
|
-
readonly animation_setInterval: (a: number, b: number, c:
|
|
268
|
-
readonly animation_setLoops: (a: number, b: number, c:
|
|
295
|
+
readonly animation_new: (a: number, b: any, c: any, d: any) => void;
|
|
296
|
+
readonly animation_setInterpolate: (a: number, b: number, c: any) => void;
|
|
297
|
+
readonly animation_setInterval: (a: number, b: number, c: any) => void;
|
|
298
|
+
readonly animation_setLoops: (a: number, b: number, c: any) => void;
|
|
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;
|
|
272
|
-
readonly
|
|
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;
|
|
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;
|
|
275
308
|
readonly scene_new: (a: number) => void;
|
|
276
|
-
readonly scene_recenter: (a: number, b: number, c:
|
|
277
|
-
readonly scene_recenterOn: (a: number, b: number, c:
|
|
278
|
-
readonly scene_removeShape: (a: number, b: number, c:
|
|
279
|
-
readonly scene_rotateCamera: (a: number, b: number, c:
|
|
280
|
-
readonly scene_set: (a: number, b: number, c:
|
|
281
|
-
readonly scene_setAmbientLight: (a: number, b: number, c:
|
|
282
|
-
readonly scene_setAutoRotate: (a: number, b: number, c:
|
|
283
|
-
readonly scene_setBackgroundColor: (a: number, b: number, c:
|
|
284
|
-
readonly scene_setCameraDistance: (a: number, b: number, c:
|
|
285
|
-
readonly scene_setCameraFov: (a: number, b: number, c:
|
|
286
|
-
readonly scene_setCameraTarget: (a: number, b: number, c:
|
|
287
|
-
readonly scene_setCameraView: (a: number, b: number, c:
|
|
288
|
-
readonly scene_setDepthCue: (a: number, b: number, c:
|
|
289
|
-
readonly scene_setDepthCueColor: (a: number, b: number, c:
|
|
290
|
-
readonly scene_setDepthCueRange: (a: number, b: number, c:
|
|
291
|
-
readonly scene_setLightColor: (a: number, b: number, c:
|
|
292
|
-
readonly scene_setLightIntensity: (a: number, b: number, c:
|
|
293
|
-
readonly scene_setLighting: (a: number, b: number, c:
|
|
294
|
-
readonly
|
|
295
|
-
readonly
|
|
296
|
-
readonly
|
|
309
|
+
readonly scene_recenter: (a: number, b: number, c: any) => void;
|
|
310
|
+
readonly scene_recenterOn: (a: number, b: number, c: any) => void;
|
|
311
|
+
readonly scene_removeShape: (a: number, b: number, c: any) => void;
|
|
312
|
+
readonly scene_rotateCamera: (a: number, b: number, c: any, d: any, e: any) => void;
|
|
313
|
+
readonly scene_set: (a: number, b: number, c: any, d: any, e: number) => void;
|
|
314
|
+
readonly scene_setAmbientLight: (a: number, b: number, c: any) => void;
|
|
315
|
+
readonly scene_setAutoRotate: (a: number, b: number, c: any, d: any) => void;
|
|
316
|
+
readonly scene_setBackgroundColor: (a: number, b: number, c: any) => void;
|
|
317
|
+
readonly scene_setCameraDistance: (a: number, b: number, c: any) => void;
|
|
318
|
+
readonly scene_setCameraFov: (a: number, b: number, c: any) => void;
|
|
319
|
+
readonly scene_setCameraTarget: (a: number, b: number, c: any) => void;
|
|
320
|
+
readonly scene_setCameraView: (a: number, b: number, c: any, d: any, e: any, f: any, g: any, h: any) => void;
|
|
321
|
+
readonly scene_setDepthCue: (a: number, b: number, c: any) => void;
|
|
322
|
+
readonly scene_setDepthCueColor: (a: number, b: number, c: any) => void;
|
|
323
|
+
readonly scene_setDepthCueRange: (a: number, b: number, c: any, d: any) => void;
|
|
324
|
+
readonly scene_setLightColor: (a: number, b: number, c: any) => void;
|
|
325
|
+
readonly scene_setLightIntensity: (a: number, b: number, c: any) => void;
|
|
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;
|
|
328
|
+
readonly scene_setScale: (a: number, b: number, c: any) => void;
|
|
329
|
+
readonly scene_setTransparentBackground: (a: number, b: number, c: any) => void;
|
|
330
|
+
readonly scene_setZoomDisabled: (a: number, b: number, c: any) => void;
|
|
297
331
|
readonly scene_shapeCount: (a: number, b: number) => void;
|
|
298
332
|
readonly scene_toJson: (a: number, b: number) => void;
|
|
299
333
|
readonly scene_useBlackBackground: (a: number, b: number) => void;
|
|
300
|
-
readonly select: (a: number, b:
|
|
334
|
+
readonly select: (a: number, b: any) => void;
|
|
301
335
|
readonly selection_aromatic: (a: number, b: number) => void;
|
|
302
336
|
readonly selection_cloneSelection: (a: number, b: number) => void;
|
|
303
337
|
readonly selection_difference: (a: number, b: number, c: number) => void;
|
|
304
|
-
readonly selection_element: (a: number, b: number, c:
|
|
305
|
-
readonly selection_filterIds: (a: number, b: number, c:
|
|
338
|
+
readonly selection_element: (a: number, b: number, c: any) => void;
|
|
339
|
+
readonly selection_filterIds: (a: number, b: number, c: any) => void;
|
|
306
340
|
readonly selection_ids: (a: number, b: number) => void;
|
|
307
341
|
readonly selection_len: (a: number, b: number) => void;
|
|
308
|
-
readonly selection_residueIds: (a: number, b: number, c:
|
|
342
|
+
readonly selection_residueIds: (a: number, b: number, c: any) => void;
|
|
309
343
|
readonly selection_sidechain: (a: number, b: number) => void;
|
|
310
344
|
readonly selector_atoms: (a: number, b: number) => void;
|
|
311
345
|
readonly selector_bonds: (a: number, b: number) => void;
|
|
312
346
|
readonly selector_residues: (a: number, b: number) => void;
|
|
313
347
|
readonly sphere_cloneShape: (a: number, b: number) => void;
|
|
314
|
-
readonly sphere_color: (a: number, b: number, c:
|
|
315
|
-
readonly sphere_new: (a: number, b:
|
|
316
|
-
readonly sphere_opacity: (a: number, b: number, c:
|
|
348
|
+
readonly sphere_color: (a: number, b: number, c: any) => void;
|
|
349
|
+
readonly sphere_new: (a: number, b: any, c: any) => void;
|
|
350
|
+
readonly sphere_opacity: (a: number, b: number, c: any) => void;
|
|
317
351
|
readonly stick_cloneShape: (a: number, b: number) => void;
|
|
318
|
-
readonly stick_color: (a: number, b: number, c:
|
|
319
|
-
readonly stick_new: (a: number, b:
|
|
320
|
-
readonly stick_opacity: (a: number, b: number, c:
|
|
352
|
+
readonly stick_color: (a: number, b: number, c: any) => void;
|
|
353
|
+
readonly stick_new: (a: number, b: any, c: any, d: any) => void;
|
|
354
|
+
readonly stick_opacity: (a: number, b: number, c: any) => void;
|
|
321
355
|
readonly style_ballAndStick: (a: number) => void;
|
|
322
356
|
readonly style_cartoon: (a: number) => void;
|
|
323
357
|
readonly style_cloneStyle: (a: number, b: number) => void;
|
|
324
|
-
readonly style_color: (a: number, b: number, c:
|
|
325
|
-
readonly
|
|
326
|
-
readonly
|
|
358
|
+
readonly style_color: (a: number, b: number, c: any) => void;
|
|
359
|
+
readonly style_colors: (a: number, b: number, c: number) => void;
|
|
360
|
+
readonly style_configureSurface: (a: number, b: number, c: any, d: any, e: any, f: any) => void;
|
|
361
|
+
readonly style_conformer: (a: number, b: number, c: any) => void;
|
|
327
362
|
readonly style_coordinates2d: (a: number, b: number) => void;
|
|
328
|
-
readonly style_metallic: (a: number, b: number, c:
|
|
329
|
-
readonly style_opacity: (a: number, b: number, c:
|
|
330
|
-
readonly style_outline: (a: number, b: number, c:
|
|
363
|
+
readonly style_metallic: (a: number, b: number, c: any) => void;
|
|
364
|
+
readonly style_opacity: (a: number, b: number, c: any) => void;
|
|
365
|
+
readonly style_outline: (a: number, b: number, c: any, d: any) => void;
|
|
331
366
|
readonly style_rainbowResidues: (a: number, b: number) => void;
|
|
332
|
-
readonly style_roughness: (a: number, b: number, c:
|
|
333
|
-
readonly style_scale: (a: number, b: number, c:
|
|
367
|
+
readonly style_roughness: (a: number, b: number, c: any) => void;
|
|
368
|
+
readonly style_scale: (a: number, b: number, c: any) => void;
|
|
334
369
|
readonly style_sphere: (a: number) => void;
|
|
335
370
|
readonly style_stick: (a: number) => void;
|
|
336
371
|
readonly style_surface: (a: number) => void;
|
|
337
|
-
readonly viewer_cameraParameterLogging: (a: number, b: number, c:
|
|
372
|
+
readonly viewer_cameraParameterLogging: (a: number, b: number, c: any) => void;
|
|
338
373
|
readonly viewer_close: (a: number, b: number) => void;
|
|
339
|
-
readonly viewer_dispatch: (a: number, b: number, c:
|
|
340
|
-
readonly viewer_new: (a: number, b:
|
|
341
|
-
readonly viewer_openNotebook: (a:
|
|
342
|
-
readonly viewer_play: (a: number, b: number) =>
|
|
343
|
-
readonly viewer_playNotebook: (a:
|
|
344
|
-
readonly viewer_render: (a: number, b: number) =>
|
|
345
|
-
readonly viewer_showCameraParameters: (a: number, b: number, c:
|
|
346
|
-
readonly viewer_showFps: (a: number, b: number, c:
|
|
347
|
-
readonly viewer_takeScreenshot: (a: number) =>
|
|
374
|
+
readonly viewer_dispatch: (a: number, b: number, c: any) => void;
|
|
375
|
+
readonly viewer_new: (a: number, b: any) => void;
|
|
376
|
+
readonly viewer_openNotebook: (a: any, b: any) => any;
|
|
377
|
+
readonly viewer_play: (a: number, b: number) => any;
|
|
378
|
+
readonly viewer_playNotebook: (a: any, b: any) => any;
|
|
379
|
+
readonly viewer_render: (a: number, b: number) => any;
|
|
380
|
+
readonly viewer_showCameraParameters: (a: number, b: number, c: any) => void;
|
|
381
|
+
readonly viewer_showFps: (a: number, b: number, c: any) => void;
|
|
382
|
+
readonly viewer_takeScreenshot: (a: number) => any;
|
|
348
383
|
readonly viewer_update: (a: number, b: number, c: number) => void;
|
|
349
|
-
readonly
|
|
350
|
-
readonly
|
|
351
|
-
readonly
|
|
352
|
-
readonly
|
|
353
|
-
readonly
|
|
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
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
357
|
-
readonly __wbindgen_export4: (
|
|
358
|
-
readonly
|
|
391
|
+
readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
|
|
392
|
+
readonly __wbindgen_export4: () => number;
|
|
393
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
394
|
+
readonly __wbindgen_export5: (a: number) => void;
|
|
395
|
+
readonly __wbindgen_export6: (a: number, b: number) => void;
|
|
359
396
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
397
|
+
readonly __wbindgen_export7: (a: number) => void;
|
|
398
|
+
readonly __wbindgen_start: () => void;
|
|
360
399
|
}
|
|
361
400
|
|
|
362
401
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|