pdbe-molstar 3.2.1-beta.1 → 3.2.1-beta.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.
Files changed (73) hide show
  1. package/README.md +1 -1
  2. package/build/pdbe-molstar-component.js +2 -2
  3. package/build/pdbe-molstar-light.css +2 -2
  4. package/build/pdbe-molstar-plugin.js +2 -2
  5. package/build/pdbe-molstar-plugin.js.LICENSE.txt +1 -1
  6. package/build/pdbe-molstar.css +2 -2
  7. package/lib/alphafold-transparency.d.ts +3 -3
  8. package/lib/alphafold-transparency.js +10 -11
  9. package/lib/custom-events.d.ts +1 -1
  10. package/lib/custom-events.js +1 -1
  11. package/lib/domain-annotations/behavior.d.ts +1 -1
  12. package/lib/domain-annotations/behavior.js +3 -3
  13. package/lib/domain-annotations/color.d.ts +3 -3
  14. package/lib/domain-annotations/color.js +4 -4
  15. package/lib/domain-annotations/prop.d.ts +6 -6
  16. package/lib/domain-annotations/prop.js +7 -7
  17. package/lib/extensions/foldseek.d.ts +1 -1
  18. package/lib/extensions/foldseek.js +2 -2
  19. package/lib/helpers.d.ts +20 -13
  20. package/lib/helpers.js +49 -11
  21. package/lib/index(light).d.ts +4 -179
  22. package/lib/index(light).js +6 -1234
  23. package/lib/index.d.ts +4 -179
  24. package/lib/index.js +6 -1234
  25. package/lib/labels.d.ts +1 -1
  26. package/lib/labels.js +3 -3
  27. package/lib/loci-details.d.ts +2 -2
  28. package/lib/loci-details.js +3 -3
  29. package/lib/plugin-custom-state.d.ts +6 -9
  30. package/lib/sifts-mapping.d.ts +3 -3
  31. package/lib/sifts-mapping.js +4 -4
  32. package/lib/sifts-mappings-behaviour.d.ts +1 -1
  33. package/lib/sifts-mappings-behaviour.js +10 -10
  34. package/lib/spec.d.ts +36 -11
  35. package/lib/spec.js +38 -7
  36. package/lib/{overlay.scss → styles/index.scss} +11 -0
  37. package/lib/superposition-export.d.ts +1 -1
  38. package/lib/superposition-export.js +7 -7
  39. package/lib/superposition-focus-representation.d.ts +3 -3
  40. package/lib/superposition-focus-representation.js +8 -8
  41. package/lib/superposition-sifts-mapping.d.ts +5 -5
  42. package/lib/superposition-sifts-mapping.js +3 -3
  43. package/lib/superposition.d.ts +7 -4
  44. package/lib/superposition.js +147 -184
  45. package/lib/ui/alphafold-superposition.d.ts +4 -4
  46. package/lib/ui/alphafold-superposition.js +8 -8
  47. package/lib/ui/alphafold-tranparency.d.ts +2 -2
  48. package/lib/ui/alphafold-tranparency.js +4 -4
  49. package/lib/ui/annotation-controls.d.ts +1 -1
  50. package/lib/ui/annotation-controls.js +7 -7
  51. package/lib/ui/annotation-row-controls.d.ts +2 -2
  52. package/lib/ui/annotation-row-controls.js +3 -3
  53. package/lib/ui/export-superposition.d.ts +1 -1
  54. package/lib/ui/export-superposition.js +9 -9
  55. package/lib/ui/pdbe-left-panel.d.ts +8 -8
  56. package/lib/ui/pdbe-left-panel.js +26 -47
  57. package/lib/ui/pdbe-screenshot-controls.d.ts +2 -2
  58. package/lib/ui/pdbe-screenshot-controls.js +7 -7
  59. package/lib/ui/pdbe-structure-controls.d.ts +1 -1
  60. package/lib/ui/pdbe-structure-controls.js +8 -8
  61. package/lib/ui/pdbe-viewport-controls.d.ts +1 -1
  62. package/lib/ui/pdbe-viewport-controls.js +4 -2
  63. package/lib/ui/segment-tree.d.ts +4 -4
  64. package/lib/ui/segment-tree.js +12 -32
  65. package/lib/ui/superposition-components.d.ts +1 -1
  66. package/lib/ui/superposition-components.js +8 -8
  67. package/lib/ui/superposition-viewport.d.ts +1 -1
  68. package/lib/ui/superposition-viewport.js +5 -5
  69. package/lib/ui/symmetry-annotation-controls.d.ts +6 -6
  70. package/lib/ui/symmetry-annotation-controls.js +6 -6
  71. package/lib/viewer.d.ts +178 -0
  72. package/lib/viewer.js +1286 -0
  73. package/package.json +4 -4
package/lib/index.d.ts CHANGED
@@ -1,179 +1,4 @@
1
- import { Canvas3DProps } from 'Molstar/mol-canvas3d/canvas3d';
2
- import { EmptyLoci } from 'Molstar/mol-model/loci';
3
- import { StructureElement } from 'Molstar/mol-model/structure';
4
- import { StructureRef } from 'Molstar/mol-plugin-state/manager/structure/hierarchy-state';
5
- import { PluginContext } from 'Molstar/mol-plugin/context';
6
- import { Color } from 'Molstar/mol-util/color/color';
7
- import * as Foldseek from './extensions/foldseek';
8
- import { LoadParams, QueryParam } from './helpers';
9
- import { ColorParams, InitParams } from './spec';
10
- import 'Molstar/mol-plugin-ui/skin/dark.scss';
11
- import './overlay.scss';
12
- export declare class PDBeMolstarPlugin {
13
- private _ev;
14
- readonly events: {
15
- loadComplete: import("rxjs").Subject<boolean>;
16
- };
17
- plugin: PluginContext;
18
- initParams: InitParams;
19
- targetElement: HTMLElement;
20
- assemblyRef: string;
21
- defaultRendererProps: Canvas3DProps['renderer'];
22
- defaultMarkingProps: Canvas3DProps['marking'];
23
- isHighlightColorUpdated: boolean;
24
- isSelectedColorUpdated: boolean;
25
- /** Keeps track of representations added by `.visual.select` for each structure. */
26
- private addedReprs;
27
- /** Maps structure IDs (assigned when loading) to cell refs. */
28
- private structureRefMap;
29
- /** Extract InitParams from attributes of an HTML element */
30
- static initParamsFromHtmlAttributes(element: HTMLElement): Partial<InitParams>;
31
- render(target: string | HTMLElement, options: Partial<InitParams>): Promise<void>;
32
- getMoleculeSrcUrl(): {
33
- url: string;
34
- format: string;
35
- isBinary: boolean;
36
- };
37
- get state(): import("molstar/lib/mol-state/state").State;
38
- createLigandStructure(isBranched: boolean): Promise<void>;
39
- load({ url, format, isBinary, assemblyId, progressMessage, id }: LoadParams, fullLoad?: boolean): Promise<void>;
40
- /** Remove loaded structure(s).
41
- * `structureNumberOrId` is either index (numbered from 1!) or the ID that was provided when loading the structure.
42
- * If `structureNumberOrId` is undefined, remove all structures.
43
- * You will likely need to call `await this.visual.reset({ camera: true })` afterwards. */
44
- deleteStructure(structureNumberOrId?: number): Promise<void>;
45
- applyVisualParams: () => void;
46
- /** Get loci corresponding to a selection within a structure.
47
- * If `params` contains more items, return loci for the union of the selections.
48
- * If `structureNumber` is provided, use the specified structure (numbered from 1!); otherwise use the last added structure. */
49
- getLociForParams(params: QueryParam[], structureNumber?: number): StructureElement.Loci | EmptyLoci;
50
- getLociByPLDDT(score: number, structureNumber?: number): StructureElement.Loci | {
51
- kind: "empty-loci";
52
- };
53
- /** For each item in params, get loci and bundle */
54
- private getSelections;
55
- private getBundle;
56
- normalizeColor(colorVal: AnyColor | null | undefined, defaultColor?: Color): Color;
57
- /** Get structure ref for a structure with given `structureNumberOrId`.
58
- * `structureNumberOrId` is either index (numbered from 1!) or the ID that was provided when loading the structure.
59
- * If `structureNumberOrId` is undefined, return refs for all loaded structures. */
60
- private getStructures;
61
- /** Get StructureRef for a structure with given `structureNumberOrId`.
62
- * `structureNumberOrId` is either index (numbered from 1!) or the ID that was provided when loading the structure. */
63
- getStructure(structureNumberOrId: number | string): StructureRef | undefined;
64
- /** Helper methods related to canvas and layout */
65
- canvas: {
66
- /** Set canvas background color. */
67
- setBgColor: (color?: {
68
- r: number;
69
- g: number;
70
- b: number;
71
- }) => Promise<void>;
72
- /** Set controls panel visibility. Without `isVisible` parameter, toggle controls panel visibility. */
73
- toggleControls: (isVisible?: boolean) => void;
74
- /** Set full-screen mode on or off. Without `isExpanded` parameter, toggle full-screen mode. */
75
- toggleExpanded: (isExpanded?: boolean) => void;
76
- applySettings: (settings?: {
77
- color?: {
78
- r: number;
79
- g: number;
80
- b: number;
81
- };
82
- lighting?: string;
83
- }) => Promise<void>;
84
- };
85
- /** Helper methods related to 3D visuals */
86
- visual: {
87
- /** Change the visibility of individual entity visuals */
88
- visibility: (data: {
89
- polymer?: boolean;
90
- het?: boolean;
91
- water?: boolean;
92
- carbs?: boolean;
93
- nonStandard?: boolean;
94
- maps?: boolean;
95
- }) => Promise<void>;
96
- /** Change the visibility of a structure.
97
- * `structureNumberOrId` is either index (numbered from 1!) or the ID that was provided when loading the structure.
98
- * If `visibility` is undefined, toggle current visibility state. */
99
- structureVisibility: (structureNumberOrId: string | number, visibility?: boolean) => Promise<void>;
100
- /** With `isSpinning` parameter, switch visual rotation on or off. Without `isSpinning` parameter, toggle rotation. If `resetCamera`, also reset the camera zoom. */
101
- toggleSpin: (isSpinning?: boolean, resetCamera?: boolean) => Promise<void>;
102
- /** Focus (zoom) on the part of the structure defined by `selection`.
103
- * If `selection` contains more items, focus on the union of those.
104
- * If `structureNumber` is provided, use the specified structure (numbered from 1!); otherwise use the last added structure. */
105
- focus: (selection: QueryParam[], structureNumber?: number) => Promise<void>;
106
- /** Trigger highlight on the part of the structure defined by `data`
107
- * (this will look the same as when the user hovers over a part of the structure).
108
- * If `focus`, also zoom on the highlighted part.
109
- * If `structureNumber` is provided, use the specified structure (numbered from 1!); otherwise use the last added structure. */
110
- highlight: (params: {
111
- data: QueryParam[];
112
- color?: ColorParams;
113
- focus?: boolean;
114
- structureNumber?: number;
115
- }) => Promise<void>;
116
- /** Remove any current highlight and reset the highlight color to its default value. */
117
- clearHighlight: () => Promise<void>;
118
- /** Color the parts of the structure defined by `data`. Color the rest of the structure in `nonSelectedColor` if provided.
119
- * If any items in `data` contain `focus`, zoom to the union of these items.
120
- * If any items in `data` contain `sideChain` or `representation`, add extra representations to them (colored in `representationColor` if provided).
121
- * If `structureNumber` is provided, apply to the specified structure (numbered from 1!); otherwise apply to all loaded structures.
122
- * Remove any previously added coloring and extra representations, unless `keepColors` and/or `keepRepresentations` is set. */
123
- select: (params: {
124
- data: QueryParam[];
125
- nonSelectedColor?: any;
126
- structureId?: string;
127
- structureNumber?: number;
128
- keepColors?: boolean;
129
- keepRepresentations?: boolean;
130
- }) => Promise<void>;
131
- /** Remove any coloring and extra representations previously added by the `select` method.
132
- * If `structureNumber` is provided, apply to the specified structure (numbered from 1!); otherwise apply to all loaded structures.
133
- * If `keepColors`, current residue coloring is preserved. If `keepRepresentations`, current added representations are preserved. */
134
- clearSelection: (structureNumberOrId?: number | string, options?: {
135
- keepColors?: boolean;
136
- keepRepresentations?: boolean;
137
- }) => Promise<void>;
138
- /** Add interactive tooltips to parts of the structure. The added tooltips will be shown on a separate line in the tooltip box.
139
- * Repeated call to this function removes any previously added tooltips.
140
- * `structureNumber` counts from 1; if not provided, tooltips will be applied to all loaded structures.
141
- * Example: `await this.visual.tooltips({ data: [{ struct_asym_id: 'A', tooltip: 'Chain A' }, { struct_asym_id: 'B', tooltip: 'Chain B' }] });`. */
142
- tooltips: (params: {
143
- data: QueryParam[];
144
- structureId?: string;
145
- structureNumber?: number;
146
- }) => Promise<void>;
147
- /** Remove any custom tooltips added by the `tooltips` method. */
148
- clearTooltips: (structureNumberOrId?: number) => Promise<void>;
149
- /** Set highlight and/or selection color.
150
- * Highlight color is used when the user hovers over a part of the structure or when applying the `highlight` method.
151
- * Selection color is used when creating selections with Selection Mode (the mouse cursor icon) and is not related to the color used by the `select` method. */
152
- setColor: (params: {
153
- highlight?: ColorParams;
154
- select?: ColorParams;
155
- }) => Promise<void>;
156
- /** Reset various settings to defaults:
157
- * `camera` resets camera position (i.e. zooms on the whole scene).
158
- * `theme` resets color theme for visual representations.
159
- * `highlightColor` and `selectColor` reset colors previously set by the `setColor` method. */
160
- reset: (params: {
161
- camera?: boolean;
162
- theme?: boolean;
163
- highlightColor?: boolean;
164
- selectColor?: boolean;
165
- }) => Promise<void>;
166
- /** Change parameters of the plugin instance.
167
- * Can be used to load a different structure.
168
- * If `fullLoad`, remove currently loaded structure before loading the new one;
169
- * otherwise add the new structure to existing structures. */
170
- update: (options: Partial<InitParams>, fullLoad?: boolean) => Promise<boolean>;
171
- };
172
- clear(): Promise<void>;
173
- /** Helper functions related to specific views or use cases */
174
- static extensions: {
175
- foldseek: typeof Foldseek;
176
- };
177
- }
178
- type AnyColor = ColorParams | string | number;
179
- export {};
1
+ /** Entrypoint for the bundler. If you want to import PDBeMolstarPlugin without CSS, import from ./viewer instead. */
2
+ export * from './viewer';
3
+ import 'molstar/lib/mol-plugin-ui/skin/dark.scss';
4
+ import './styles/index.scss';