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.
- package/README.md +7 -0
- package/build/viewer/index.html +2 -2
- package/build/viewer/molstar.js +1 -1
- package/lib/apps/viewer/app.d.ts +1 -1
- package/lib/apps/viewer/app.js +15 -5
- package/lib/apps/viewer/index.html +2 -2
- package/lib/commonjs/apps/viewer/app.d.ts +1 -1
- package/lib/commonjs/apps/viewer/app.js +15 -5
- package/lib/commonjs/examples/basic-wrapper/index.js +7 -3
- package/lib/commonjs/examples/proteopedia-wrapper/index.js +7 -1
- package/lib/commonjs/extensions/anvil/representation.js +1 -1
- package/lib/commonjs/extensions/model-export/export.d.ts +9 -0
- package/lib/commonjs/extensions/model-export/export.js +129 -0
- package/lib/commonjs/extensions/model-export/index.d.ts +7 -0
- package/lib/commonjs/extensions/model-export/index.js +36 -0
- package/lib/commonjs/extensions/model-export/ui.d.ts +11 -0
- package/lib/commonjs/extensions/model-export/ui.js +77 -0
- package/lib/commonjs/extensions/mp4-export/encoder.js +1 -1
- package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
- package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +2 -2
- package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +12 -4
- package/lib/commonjs/mol-canvas3d/canvas3d.js +1 -1
- package/lib/commonjs/mol-canvas3d/controls/trackball.d.ts +9 -4
- package/lib/commonjs/mol-canvas3d/controls/trackball.js +50 -11
- package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +1 -1
- package/lib/commonjs/mol-io/reader/mol/parser.d.ts +23 -1
- package/lib/commonjs/mol-io/reader/mol/parser.js +116 -4
- package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
- package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.js +9 -0
- package/lib/commonjs/mol-io/reader/sdf/parser.d.ts +3 -1
- package/lib/commonjs/mol-io/reader/sdf/parser.js +11 -2
- package/lib/commonjs/mol-io/writer/cif/encoder/binary.js +9 -2
- package/lib/commonjs/mol-math/geometry/symmetry-operator.d.ts +1 -1
- package/lib/commonjs/mol-math/geometry/symmetry-operator.js +10 -4
- package/lib/commonjs/mol-model/structure/export/mmcif.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/export/mmcif.js +8 -5
- package/lib/commonjs/mol-model/structure/model/properties/common.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/properties.d.ts +1 -0
- package/lib/commonjs/mol-model/structure/structure/properties.js +2 -1
- package/lib/commonjs/mol-model/structure/structure/symmetry.js +1 -3
- package/lib/commonjs/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
- package/lib/commonjs/mol-model-formats/structure/basic/atomic.d.ts +2 -2
- package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +6 -6
- package/lib/commonjs/mol-model-formats/structure/basic/coarse.d.ts +1 -1
- package/lib/commonjs/mol-model-formats/structure/basic/coarse.js +3 -3
- package/lib/commonjs/mol-model-formats/structure/basic/entities.d.ts +2 -1
- package/lib/commonjs/mol-model-formats/structure/basic/entities.js +28 -24
- package/lib/commonjs/mol-model-formats/structure/basic/parser.js +17 -8
- package/lib/commonjs/mol-model-formats/structure/basic/properties.d.ts +6 -1
- package/lib/commonjs/mol-model-formats/structure/basic/properties.js +12 -22
- package/lib/commonjs/mol-model-formats/structure/mol.d.ts +2 -1
- package/lib/commonjs/mol-model-formats/structure/mol.js +19 -5
- package/lib/commonjs/mol-model-props/common/custom-property.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +25 -10
- package/lib/commonjs/mol-model-props/sequence/best-database-mapping.js +15 -15
- package/lib/commonjs/mol-plugin/animation-loop.d.ts +2 -0
- package/lib/commonjs/mol-plugin/animation-loop.js +1 -1
- package/lib/commonjs/mol-plugin/commands.d.ts +6 -2
- package/lib/commonjs/mol-plugin/spec.d.ts +1 -1
- package/lib/commonjs/mol-plugin/spec.js +3 -1
- package/lib/commonjs/mol-plugin-state/actions/file.d.ts +3 -2
- package/lib/commonjs/mol-plugin-state/actions/file.js +67 -31
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.js +62 -0
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
- package/lib/commonjs/mol-plugin-state/animation/model.d.ts +4 -0
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +149 -5
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +74 -2
- package/lib/commonjs/mol-plugin-state/manager/animation.d.ts +5 -1
- package/lib/commonjs/mol-plugin-state/manager/animation.js +5 -5
- package/lib/commonjs/mol-plugin-ui/structure/superposition.js +2 -2
- package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +4 -8
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
- package/lib/commonjs/mol-repr/visual.d.ts +1 -1
- package/lib/commonjs/mol-repr/visual.js +2 -1
- package/lib/commonjs/mol-state/tree/immutable.d.ts +18 -0
- package/lib/commonjs/mol-state/tree/transient.d.ts +3 -4
- package/lib/commonjs/mol-theme/color/element-symbol.d.ts +243 -1
- package/lib/commonjs/mol-theme/color/element-symbol.js +10 -5
- package/lib/commonjs/mol-theme/color/entity-id.d.ts +1 -1
- package/lib/commonjs/mol-theme/color/entity-id.js +26 -5
- package/lib/commonjs/mol-theme/color/illustrative.d.ts +100 -29
- package/lib/commonjs/mol-theme/color/illustrative.js +26 -7
- package/lib/commonjs/mol-theme/color/molecule-type.d.ts +19 -1
- package/lib/commonjs/mol-theme/color/molecule-type.js +10 -5
- package/lib/commonjs/mol-theme/color/residue-name.d.ts +77 -1
- package/lib/commonjs/mol-theme/color/residue-name.js +10 -5
- package/lib/commonjs/mol-theme/color/secondary-structure.d.ts +27 -1
- package/lib/commonjs/mol-theme/color/secondary-structure.js +10 -5
- package/lib/commonjs/mol-theme/color.d.ts +230 -14
- package/lib/commonjs/mol-util/color/color.d.ts +1 -1
- package/lib/commonjs/mol-util/color/color.js +1 -1
- package/lib/commonjs/mol-util/color/params.d.ts +10 -0
- package/lib/commonjs/mol-util/color/params.js +19 -0
- package/lib/examples/basic-wrapper/index.js +7 -3
- package/lib/examples/proteopedia-wrapper/index.js +7 -1
- package/lib/extensions/anvil/representation.js +1 -1
- package/lib/extensions/model-export/export.d.ts +9 -0
- package/lib/extensions/model-export/export.js +125 -0
- package/lib/extensions/model-export/index.d.ts +7 -0
- package/lib/extensions/model-export/index.js +33 -0
- package/lib/extensions/model-export/ui.d.ts +11 -0
- package/lib/extensions/model-export/ui.js +74 -0
- package/lib/extensions/mp4-export/encoder.js +1 -1
- package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
- package/lib/extensions/rcsb/graphql/types.d.ts +2 -2
- package/lib/mol-canvas3d/canvas3d.d.ts +12 -4
- package/lib/mol-canvas3d/canvas3d.js +1 -1
- package/lib/mol-canvas3d/controls/trackball.d.ts +9 -4
- package/lib/mol-canvas3d/controls/trackball.js +51 -12
- package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
- package/lib/mol-io/reader/cif/schema/mmcif.js +1 -1
- package/lib/mol-io/reader/mol/parser.d.ts +23 -1
- package/lib/mol-io/reader/mol/parser.js +112 -3
- package/lib/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
- package/lib/mol-io/reader/sdf/parser-v3-util.js +9 -0
- package/lib/mol-io/reader/sdf/parser.d.ts +3 -1
- package/lib/mol-io/reader/sdf/parser.js +12 -3
- package/lib/mol-io/writer/cif/encoder/binary.js +9 -2
- package/lib/mol-math/geometry/symmetry-operator.d.ts +1 -1
- package/lib/mol-math/geometry/symmetry-operator.js +10 -4
- package/lib/mol-model/structure/export/mmcif.d.ts +1 -1
- package/lib/mol-model/structure/export/mmcif.js +8 -5
- package/lib/mol-model/structure/model/properties/common.d.ts +1 -1
- package/lib/mol-model/structure/structure/properties.d.ts +1 -0
- package/lib/mol-model/structure/structure/properties.js +2 -1
- package/lib/mol-model/structure/structure/symmetry.js +1 -3
- package/lib/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
- package/lib/mol-model-formats/structure/basic/atomic.d.ts +2 -2
- package/lib/mol-model-formats/structure/basic/atomic.js +6 -6
- package/lib/mol-model-formats/structure/basic/coarse.d.ts +1 -1
- package/lib/mol-model-formats/structure/basic/coarse.js +3 -3
- package/lib/mol-model-formats/structure/basic/entities.d.ts +2 -1
- package/lib/mol-model-formats/structure/basic/entities.js +25 -22
- package/lib/mol-model-formats/structure/basic/parser.js +19 -10
- package/lib/mol-model-formats/structure/basic/properties.d.ts +6 -1
- package/lib/mol-model-formats/structure/basic/properties.js +12 -25
- package/lib/mol-model-formats/structure/mol.d.ts +2 -1
- package/lib/mol-model-formats/structure/mol.js +17 -3
- package/lib/mol-model-props/common/custom-property.d.ts +1 -1
- package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
- package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +25 -10
- package/lib/mol-model-props/sequence/best-database-mapping.js +15 -15
- package/lib/mol-plugin/animation-loop.d.ts +2 -0
- package/lib/mol-plugin/animation-loop.js +1 -1
- package/lib/mol-plugin/commands.d.ts +6 -2
- package/lib/mol-plugin/spec.d.ts +1 -1
- package/lib/mol-plugin/spec.js +3 -1
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/actions/file.d.ts +3 -2
- package/lib/mol-plugin-state/actions/file.js +67 -31
- package/lib/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
- package/lib/mol-plugin-state/animation/built-in/camera-rock.js +59 -0
- package/lib/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
- package/lib/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
- package/lib/mol-plugin-state/animation/model.d.ts +4 -0
- package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
- package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
- package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +149 -5
- package/lib/mol-plugin-state/builder/structure/representation-preset.js +74 -2
- package/lib/mol-plugin-state/manager/animation.d.ts +5 -1
- package/lib/mol-plugin-state/manager/animation.js +5 -5
- package/lib/mol-plugin-ui/structure/superposition.js +2 -2
- package/lib/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
- package/lib/mol-plugin-ui/viewport/simple-settings.js +4 -8
- package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
- package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
- package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
- package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
- package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
- package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
- package/lib/mol-repr/visual.d.ts +1 -1
- package/lib/mol-repr/visual.js +2 -1
- package/lib/mol-state/tree/immutable.d.ts +18 -0
- package/lib/mol-state/tree/transient.d.ts +3 -4
- package/lib/mol-theme/color/element-symbol.d.ts +243 -1
- package/lib/mol-theme/color/element-symbol.js +10 -5
- package/lib/mol-theme/color/entity-id.d.ts +1 -1
- package/lib/mol-theme/color/entity-id.js +26 -5
- package/lib/mol-theme/color/illustrative.d.ts +100 -29
- package/lib/mol-theme/color/illustrative.js +26 -7
- package/lib/mol-theme/color/molecule-type.d.ts +19 -1
- package/lib/mol-theme/color/molecule-type.js +10 -5
- package/lib/mol-theme/color/residue-name.d.ts +77 -1
- package/lib/mol-theme/color/residue-name.js +10 -5
- package/lib/mol-theme/color/secondary-structure.d.ts +27 -1
- package/lib/mol-theme/color/secondary-structure.js +10 -5
- package/lib/mol-theme/color.d.ts +230 -14
- package/lib/mol-util/color/color.d.ts +1 -1
- package/lib/mol-util/color/color.js +1 -1
- package/lib/mol-util/color/params.d.ts +10 -0
- package/lib/mol-util/color/params.js +15 -0
- package/package.json +36 -35
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
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
|
*/
|
|
@@ -157,6 +157,127 @@ export declare const ElementSymbolColorThemeParams: {
|
|
|
157
157
|
}>, "operator-name">>;
|
|
158
158
|
saturation: PD.Numeric;
|
|
159
159
|
lightness: PD.Numeric;
|
|
160
|
+
colors: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
161
|
+
H: Color;
|
|
162
|
+
D: Color;
|
|
163
|
+
T: Color;
|
|
164
|
+
HE: Color;
|
|
165
|
+
LI: Color;
|
|
166
|
+
BE: Color;
|
|
167
|
+
B: Color;
|
|
168
|
+
C: Color;
|
|
169
|
+
N: Color;
|
|
170
|
+
O: Color;
|
|
171
|
+
F: Color;
|
|
172
|
+
NE: Color;
|
|
173
|
+
NA: Color;
|
|
174
|
+
MG: Color;
|
|
175
|
+
AL: Color;
|
|
176
|
+
SI: Color;
|
|
177
|
+
P: Color;
|
|
178
|
+
S: Color;
|
|
179
|
+
CL: Color;
|
|
180
|
+
AR: Color;
|
|
181
|
+
K: Color;
|
|
182
|
+
CA: Color;
|
|
183
|
+
SC: Color;
|
|
184
|
+
TI: Color;
|
|
185
|
+
V: Color;
|
|
186
|
+
CR: Color;
|
|
187
|
+
MN: Color;
|
|
188
|
+
FE: Color;
|
|
189
|
+
CO: Color;
|
|
190
|
+
NI: Color;
|
|
191
|
+
CU: Color;
|
|
192
|
+
ZN: Color;
|
|
193
|
+
GA: Color;
|
|
194
|
+
GE: Color;
|
|
195
|
+
AS: Color;
|
|
196
|
+
SE: Color;
|
|
197
|
+
BR: Color;
|
|
198
|
+
KR: Color;
|
|
199
|
+
RB: Color;
|
|
200
|
+
SR: Color;
|
|
201
|
+
Y: Color;
|
|
202
|
+
ZR: Color;
|
|
203
|
+
NB: Color;
|
|
204
|
+
MO: Color;
|
|
205
|
+
TC: Color;
|
|
206
|
+
RU: Color;
|
|
207
|
+
RH: Color;
|
|
208
|
+
PD: Color;
|
|
209
|
+
AG: Color;
|
|
210
|
+
CD: Color;
|
|
211
|
+
IN: Color;
|
|
212
|
+
SN: Color;
|
|
213
|
+
SB: Color;
|
|
214
|
+
TE: Color;
|
|
215
|
+
I: Color;
|
|
216
|
+
XE: Color;
|
|
217
|
+
CS: Color;
|
|
218
|
+
BA: Color;
|
|
219
|
+
LA: Color;
|
|
220
|
+
CE: Color;
|
|
221
|
+
PR: Color;
|
|
222
|
+
ND: Color;
|
|
223
|
+
PM: Color;
|
|
224
|
+
SM: Color;
|
|
225
|
+
EU: Color;
|
|
226
|
+
GD: Color;
|
|
227
|
+
TB: Color;
|
|
228
|
+
DY: Color;
|
|
229
|
+
HO: Color;
|
|
230
|
+
ER: Color;
|
|
231
|
+
TM: Color;
|
|
232
|
+
YB: Color;
|
|
233
|
+
LU: Color;
|
|
234
|
+
HF: Color;
|
|
235
|
+
TA: Color;
|
|
236
|
+
W: Color;
|
|
237
|
+
RE: Color;
|
|
238
|
+
OS: Color;
|
|
239
|
+
IR: Color;
|
|
240
|
+
PT: Color;
|
|
241
|
+
AU: Color;
|
|
242
|
+
HG: Color;
|
|
243
|
+
TL: Color;
|
|
244
|
+
PB: Color;
|
|
245
|
+
BI: Color;
|
|
246
|
+
PO: Color;
|
|
247
|
+
AT: Color;
|
|
248
|
+
RN: Color;
|
|
249
|
+
FR: Color;
|
|
250
|
+
RA: Color;
|
|
251
|
+
AC: Color;
|
|
252
|
+
TH: Color;
|
|
253
|
+
PA: Color;
|
|
254
|
+
U: Color;
|
|
255
|
+
NP: Color;
|
|
256
|
+
PU: Color;
|
|
257
|
+
AM: Color;
|
|
258
|
+
CM: Color;
|
|
259
|
+
BK: Color;
|
|
260
|
+
CF: Color;
|
|
261
|
+
ES: Color;
|
|
262
|
+
FM: Color;
|
|
263
|
+
MD: Color;
|
|
264
|
+
NO: Color;
|
|
265
|
+
LR: Color;
|
|
266
|
+
RF: Color;
|
|
267
|
+
DB: Color;
|
|
268
|
+
SG: Color;
|
|
269
|
+
BH: Color;
|
|
270
|
+
HS: Color;
|
|
271
|
+
MT: Color;
|
|
272
|
+
DS: Color;
|
|
273
|
+
RG: Color;
|
|
274
|
+
CN: Color;
|
|
275
|
+
UUT: Color;
|
|
276
|
+
FL: Color;
|
|
277
|
+
UUP: Color;
|
|
278
|
+
LV: Color;
|
|
279
|
+
UUH: Color;
|
|
280
|
+
}>, "custom">>;
|
|
160
281
|
};
|
|
161
282
|
export declare type ElementSymbolColorThemeParams = typeof ElementSymbolColorThemeParams;
|
|
162
283
|
export declare function getElementSymbolColorThemeParams(ctx: ThemeDataContext): {
|
|
@@ -186,6 +307,127 @@ export declare function getElementSymbolColorThemeParams(ctx: ThemeDataContext):
|
|
|
186
307
|
}>, "operator-name">>;
|
|
187
308
|
saturation: PD.Numeric;
|
|
188
309
|
lightness: PD.Numeric;
|
|
310
|
+
colors: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
311
|
+
H: Color;
|
|
312
|
+
D: Color;
|
|
313
|
+
T: Color;
|
|
314
|
+
HE: Color;
|
|
315
|
+
LI: Color;
|
|
316
|
+
BE: Color;
|
|
317
|
+
B: Color;
|
|
318
|
+
C: Color;
|
|
319
|
+
N: Color;
|
|
320
|
+
O: Color;
|
|
321
|
+
F: Color;
|
|
322
|
+
NE: Color;
|
|
323
|
+
NA: Color;
|
|
324
|
+
MG: Color;
|
|
325
|
+
AL: Color;
|
|
326
|
+
SI: Color;
|
|
327
|
+
P: Color;
|
|
328
|
+
S: Color;
|
|
329
|
+
CL: Color;
|
|
330
|
+
AR: Color;
|
|
331
|
+
K: Color;
|
|
332
|
+
CA: Color;
|
|
333
|
+
SC: Color;
|
|
334
|
+
TI: Color;
|
|
335
|
+
V: Color;
|
|
336
|
+
CR: Color;
|
|
337
|
+
MN: Color;
|
|
338
|
+
FE: Color;
|
|
339
|
+
CO: Color;
|
|
340
|
+
NI: Color;
|
|
341
|
+
CU: Color;
|
|
342
|
+
ZN: Color;
|
|
343
|
+
GA: Color;
|
|
344
|
+
GE: Color;
|
|
345
|
+
AS: Color;
|
|
346
|
+
SE: Color;
|
|
347
|
+
BR: Color;
|
|
348
|
+
KR: Color;
|
|
349
|
+
RB: Color;
|
|
350
|
+
SR: Color;
|
|
351
|
+
Y: Color;
|
|
352
|
+
ZR: Color;
|
|
353
|
+
NB: Color;
|
|
354
|
+
MO: Color;
|
|
355
|
+
TC: Color;
|
|
356
|
+
RU: Color;
|
|
357
|
+
RH: Color;
|
|
358
|
+
PD: Color;
|
|
359
|
+
AG: Color;
|
|
360
|
+
CD: Color;
|
|
361
|
+
IN: Color;
|
|
362
|
+
SN: Color;
|
|
363
|
+
SB: Color;
|
|
364
|
+
TE: Color;
|
|
365
|
+
I: Color;
|
|
366
|
+
XE: Color;
|
|
367
|
+
CS: Color;
|
|
368
|
+
BA: Color;
|
|
369
|
+
LA: Color;
|
|
370
|
+
CE: Color;
|
|
371
|
+
PR: Color;
|
|
372
|
+
ND: Color;
|
|
373
|
+
PM: Color;
|
|
374
|
+
SM: Color;
|
|
375
|
+
EU: Color;
|
|
376
|
+
GD: Color;
|
|
377
|
+
TB: Color;
|
|
378
|
+
DY: Color;
|
|
379
|
+
HO: Color;
|
|
380
|
+
ER: Color;
|
|
381
|
+
TM: Color;
|
|
382
|
+
YB: Color;
|
|
383
|
+
LU: Color;
|
|
384
|
+
HF: Color;
|
|
385
|
+
TA: Color;
|
|
386
|
+
W: Color;
|
|
387
|
+
RE: Color;
|
|
388
|
+
OS: Color;
|
|
389
|
+
IR: Color;
|
|
390
|
+
PT: Color;
|
|
391
|
+
AU: Color;
|
|
392
|
+
HG: Color;
|
|
393
|
+
TL: Color;
|
|
394
|
+
PB: Color;
|
|
395
|
+
BI: Color;
|
|
396
|
+
PO: Color;
|
|
397
|
+
AT: Color;
|
|
398
|
+
RN: Color;
|
|
399
|
+
FR: Color;
|
|
400
|
+
RA: Color;
|
|
401
|
+
AC: Color;
|
|
402
|
+
TH: Color;
|
|
403
|
+
PA: Color;
|
|
404
|
+
U: Color;
|
|
405
|
+
NP: Color;
|
|
406
|
+
PU: Color;
|
|
407
|
+
AM: Color;
|
|
408
|
+
CM: Color;
|
|
409
|
+
BK: Color;
|
|
410
|
+
CF: Color;
|
|
411
|
+
ES: Color;
|
|
412
|
+
FM: Color;
|
|
413
|
+
MD: Color;
|
|
414
|
+
NO: Color;
|
|
415
|
+
LR: Color;
|
|
416
|
+
RF: Color;
|
|
417
|
+
DB: Color;
|
|
418
|
+
SG: Color;
|
|
419
|
+
BH: Color;
|
|
420
|
+
HS: Color;
|
|
421
|
+
MT: Color;
|
|
422
|
+
DS: Color;
|
|
423
|
+
RG: Color;
|
|
424
|
+
CN: Color;
|
|
425
|
+
UUT: Color;
|
|
426
|
+
FL: Color;
|
|
427
|
+
UUP: Color;
|
|
428
|
+
LV: Color;
|
|
429
|
+
UUH: Color;
|
|
430
|
+
}>, "custom">>;
|
|
189
431
|
};
|
|
190
432
|
export declare function elementSymbolColor(colorMap: ElementSymbolColors, element: ElementSymbol): Color;
|
|
191
433
|
export declare function ElementSymbolColorTheme(ctx: ThemeDataContext, props: PD.Values<ElementSymbolColorThemeParams>): ColorTheme<ElementSymbolColorThemeParams>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
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
|
*/
|
|
@@ -9,6 +9,7 @@ import { StructureElement, Unit, Bond } from '../../mol-model/structure';
|
|
|
9
9
|
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
10
10
|
import { TableLegend } from '../../mol-util/legend';
|
|
11
11
|
import { getAdjustedColorMap } from '../../mol-util/color/color';
|
|
12
|
+
import { getColorMapParams } from '../../mol-util/color/params';
|
|
12
13
|
import { ChainIdColorTheme, ChainIdColorThemeParams } from './chain-id';
|
|
13
14
|
import { OperatorNameColorThemeParams, OperatorNameColorTheme } from './operator-name';
|
|
14
15
|
// from Jmol http://jmol.sourceforge.net/jscolors/ (or 0xFFFFFF)
|
|
@@ -25,7 +26,11 @@ export var ElementSymbolColorThemeParams = {
|
|
|
25
26
|
'element-symbol': PD.Group({})
|
|
26
27
|
}, { description: 'Use chain-id coloring for carbon atoms.' }),
|
|
27
28
|
saturation: PD.Numeric(0, { min: -6, max: 6, step: 0.1 }),
|
|
28
|
-
lightness: PD.Numeric(0.2, { min: -6, max: 6, step: 0.1 })
|
|
29
|
+
lightness: PD.Numeric(0.2, { min: -6, max: 6, step: 0.1 }),
|
|
30
|
+
colors: PD.MappedStatic('default', {
|
|
31
|
+
'default': PD.EmptyGroup(),
|
|
32
|
+
'custom': PD.Group(getColorMapParams(ElementSymbolColors))
|
|
33
|
+
})
|
|
29
34
|
};
|
|
30
35
|
export function getElementSymbolColorThemeParams(ctx) {
|
|
31
36
|
return ElementSymbolColorThemeParams; // TODO return copy
|
|
@@ -35,7 +40,7 @@ export function elementSymbolColor(colorMap, element) {
|
|
|
35
40
|
return c === undefined ? DefaultElementSymbolColor : c;
|
|
36
41
|
}
|
|
37
42
|
export function ElementSymbolColorTheme(ctx, props) {
|
|
38
|
-
var colorMap = getAdjustedColorMap(ElementSymbolColors, props.saturation, props.lightness);
|
|
43
|
+
var colorMap = getAdjustedColorMap(props.colors.name === 'default' ? ElementSymbolColors : props.colors.params, props.saturation, props.lightness);
|
|
39
44
|
var carbonColor = props.carbonColor.name === 'chain-id'
|
|
40
45
|
? ChainIdColorTheme(ctx, props.carbonColor.params).color
|
|
41
46
|
: props.carbonColor.name === 'operator-name'
|
|
@@ -70,8 +75,8 @@ export function ElementSymbolColorTheme(ctx, props) {
|
|
|
70
75
|
color: color,
|
|
71
76
|
props: props,
|
|
72
77
|
description: Description,
|
|
73
|
-
legend: TableLegend(Object.keys(
|
|
74
|
-
return [name,
|
|
78
|
+
legend: TableLegend(Object.keys(colorMap).map(function (name) {
|
|
79
|
+
return [name, colorMap[name]];
|
|
75
80
|
}))
|
|
76
81
|
};
|
|
77
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
2
|
+
* Copyright (c) 2021-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
|
*/
|
|
@@ -28,9 +28,30 @@ function getEntityIdSerialMap(structure) {
|
|
|
28
28
|
if (!map.has(k))
|
|
29
29
|
map.set(k, map.size);
|
|
30
30
|
}
|
|
31
|
+
var spheres_entity_id = structure.models[i].coarseHierarchy.spheres.entity_id;
|
|
32
|
+
for (var j = 0, jl = spheres_entity_id.rowCount; j < jl; ++j) {
|
|
33
|
+
var k = key(spheres_entity_id.value(j), i);
|
|
34
|
+
if (!map.has(k))
|
|
35
|
+
map.set(k, map.size);
|
|
36
|
+
}
|
|
37
|
+
var gaussians_entity_id = structure.models[i].coarseHierarchy.gaussians.entity_id;
|
|
38
|
+
for (var j = 0, jl = gaussians_entity_id.rowCount; j < jl; ++j) {
|
|
39
|
+
var k = key(gaussians_entity_id.value(j), i);
|
|
40
|
+
if (!map.has(k))
|
|
41
|
+
map.set(k, map.size);
|
|
42
|
+
}
|
|
31
43
|
}
|
|
32
44
|
return map;
|
|
33
45
|
}
|
|
46
|
+
function getEntityId(location) {
|
|
47
|
+
switch (location.unit.kind) {
|
|
48
|
+
case 0 /* Atomic */:
|
|
49
|
+
return StructureProperties.chain.label_entity_id(location);
|
|
50
|
+
case 1 /* Spheres */:
|
|
51
|
+
case 2 /* Gaussians */:
|
|
52
|
+
return StructureProperties.coarse.entity_id(location);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
34
55
|
export function EntityIdColorTheme(ctx, props) {
|
|
35
56
|
var color;
|
|
36
57
|
var legend;
|
|
@@ -44,17 +65,17 @@ export function EntityIdColorTheme(ctx, props) {
|
|
|
44
65
|
color = function (location) {
|
|
45
66
|
var serial = undefined;
|
|
46
67
|
if (StructureElement.Location.is(location)) {
|
|
47
|
-
var
|
|
68
|
+
var entityId = getEntityId(location);
|
|
48
69
|
var modelIndex = location.structure.models.indexOf(location.unit.model);
|
|
49
|
-
var k = key(
|
|
70
|
+
var k = key(entityId, modelIndex);
|
|
50
71
|
serial = entityIdSerialMap_1.get(k);
|
|
51
72
|
}
|
|
52
73
|
else if (Bond.isLocation(location)) {
|
|
53
74
|
l_1.unit = location.aUnit;
|
|
54
75
|
l_1.element = location.aUnit.elements[location.aIndex];
|
|
55
|
-
var
|
|
76
|
+
var entityId = getEntityId(l_1);
|
|
56
77
|
var modelIndex = l_1.structure.models.indexOf(l_1.unit.model);
|
|
57
|
-
var k = key(
|
|
78
|
+
var k = key(entityId, modelIndex);
|
|
58
79
|
serial = entityIdSerialMap_1.get(k);
|
|
59
80
|
}
|
|
60
81
|
return serial === undefined ? DefaultColor : palette_1.color(serial);
|
|
@@ -1,45 +1,116 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2019-
|
|
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
|
*/
|
|
6
|
+
import { Color } from '../../mol-util/color';
|
|
6
7
|
import { ColorTheme } from '../color';
|
|
7
8
|
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
8
9
|
import { ThemeDataContext } from '../theme';
|
|
9
10
|
export declare const IllustrativeColorThemeParams: {
|
|
11
|
+
style: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
12
|
+
value: Color;
|
|
13
|
+
}>, "uniform"> | PD.NamedParams<PD.Normalize<{
|
|
14
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
15
|
+
maxCount: any;
|
|
16
|
+
hue: any;
|
|
17
|
+
chroma: any;
|
|
18
|
+
luminance: any;
|
|
19
|
+
clusteringStepCount: any;
|
|
20
|
+
minSampleCount: any;
|
|
21
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
22
|
+
list: any;
|
|
23
|
+
}>, "colors">;
|
|
24
|
+
asymId: "label" | "auth";
|
|
25
|
+
}>, "chain-id"> | PD.NamedParams<PD.Normalize<{
|
|
26
|
+
saturation: number;
|
|
27
|
+
lightness: number;
|
|
28
|
+
colors: PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
29
|
+
water: any;
|
|
30
|
+
ion: any;
|
|
31
|
+
protein: any;
|
|
32
|
+
RNA: any;
|
|
33
|
+
DNA: any;
|
|
34
|
+
PNA: any;
|
|
35
|
+
saccharide: any;
|
|
36
|
+
}>, "custom">;
|
|
37
|
+
}>, "molecule-type"> | PD.NamedParams<PD.Normalize<{
|
|
38
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
39
|
+
maxCount: any;
|
|
40
|
+
hue: any;
|
|
41
|
+
chroma: any;
|
|
42
|
+
luminance: any;
|
|
43
|
+
clusteringStepCount: any;
|
|
44
|
+
minSampleCount: any;
|
|
45
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
46
|
+
list: any;
|
|
47
|
+
}>, "colors">;
|
|
48
|
+
}>, "entity-source"> | PD.NamedParams<PD.Normalize<{
|
|
49
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
50
|
+
maxCount: any;
|
|
51
|
+
hue: any;
|
|
52
|
+
chroma: any;
|
|
53
|
+
luminance: any;
|
|
54
|
+
clusteringStepCount: any;
|
|
55
|
+
minSampleCount: any;
|
|
56
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
57
|
+
list: any;
|
|
58
|
+
}>, "colors">;
|
|
59
|
+
}>, "entity-id">>;
|
|
10
60
|
carbonLightness: PD.Numeric;
|
|
11
|
-
palette: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
12
|
-
maxCount: number;
|
|
13
|
-
hue: [number, number];
|
|
14
|
-
chroma: [number, number];
|
|
15
|
-
luminance: [number, number];
|
|
16
|
-
clusteringStepCount: number;
|
|
17
|
-
minSampleCount: number;
|
|
18
|
-
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
19
|
-
list: {
|
|
20
|
-
kind: "set" | "interpolate";
|
|
21
|
-
colors: import("../../mol-util/color/color").ColorListEntry[];
|
|
22
|
-
};
|
|
23
|
-
}>, "colors">>;
|
|
24
|
-
asymId: PD.Select<"label" | "auth">;
|
|
25
61
|
};
|
|
26
62
|
export declare type IllustrativeColorThemeParams = typeof IllustrativeColorThemeParams;
|
|
27
63
|
export declare function getIllustrativeColorThemeParams(ctx: ThemeDataContext): {
|
|
64
|
+
style: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
65
|
+
value: Color;
|
|
66
|
+
}>, "uniform"> | PD.NamedParams<PD.Normalize<{
|
|
67
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
68
|
+
maxCount: any;
|
|
69
|
+
hue: any;
|
|
70
|
+
chroma: any;
|
|
71
|
+
luminance: any;
|
|
72
|
+
clusteringStepCount: any;
|
|
73
|
+
minSampleCount: any;
|
|
74
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
75
|
+
list: any;
|
|
76
|
+
}>, "colors">;
|
|
77
|
+
asymId: "label" | "auth";
|
|
78
|
+
}>, "chain-id"> | PD.NamedParams<PD.Normalize<{
|
|
79
|
+
saturation: number;
|
|
80
|
+
lightness: number;
|
|
81
|
+
colors: PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
82
|
+
water: any;
|
|
83
|
+
ion: any;
|
|
84
|
+
protein: any;
|
|
85
|
+
RNA: any;
|
|
86
|
+
DNA: any;
|
|
87
|
+
PNA: any;
|
|
88
|
+
saccharide: any;
|
|
89
|
+
}>, "custom">;
|
|
90
|
+
}>, "molecule-type"> | PD.NamedParams<PD.Normalize<{
|
|
91
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
92
|
+
maxCount: any;
|
|
93
|
+
hue: any;
|
|
94
|
+
chroma: any;
|
|
95
|
+
luminance: any;
|
|
96
|
+
clusteringStepCount: any;
|
|
97
|
+
minSampleCount: any;
|
|
98
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
99
|
+
list: any;
|
|
100
|
+
}>, "colors">;
|
|
101
|
+
}>, "entity-source"> | PD.NamedParams<PD.Normalize<{
|
|
102
|
+
palette: PD.NamedParams<PD.Normalize<{
|
|
103
|
+
maxCount: any;
|
|
104
|
+
hue: any;
|
|
105
|
+
chroma: any;
|
|
106
|
+
luminance: any;
|
|
107
|
+
clusteringStepCount: any;
|
|
108
|
+
minSampleCount: any;
|
|
109
|
+
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
110
|
+
list: any;
|
|
111
|
+
}>, "colors">;
|
|
112
|
+
}>, "entity-id">>;
|
|
28
113
|
carbonLightness: PD.Numeric;
|
|
29
|
-
palette: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
30
|
-
maxCount: number;
|
|
31
|
-
hue: [number, number];
|
|
32
|
-
chroma: [number, number];
|
|
33
|
-
luminance: [number, number];
|
|
34
|
-
clusteringStepCount: number;
|
|
35
|
-
minSampleCount: number;
|
|
36
|
-
}>, "generate"> | PD.NamedParams<PD.Normalize<{
|
|
37
|
-
list: {
|
|
38
|
-
kind: "set" | "interpolate";
|
|
39
|
-
colors: import("../../mol-util/color/color").ColorListEntry[];
|
|
40
|
-
};
|
|
41
|
-
}>, "colors">>;
|
|
42
|
-
asymId: PD.Select<"label" | "auth">;
|
|
43
114
|
};
|
|
44
115
|
export declare function IllustrativeColorTheme(ctx: ThemeDataContext, props: PD.Values<IllustrativeColorThemeParams>): ColorTheme<IllustrativeColorThemeParams>;
|
|
45
116
|
export declare const IllustrativeColorThemeProvider: ColorTheme.Provider<IllustrativeColorThemeParams, 'illustrative'>;
|
|
@@ -1,23 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2019-
|
|
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
|
*/
|
|
6
|
-
import { __assign } from "tslib";
|
|
7
6
|
import { Color } from '../../mol-util/color';
|
|
8
7
|
import { StructureElement, Unit, Bond } from '../../mol-model/structure';
|
|
9
8
|
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
10
9
|
import { ChainIdColorTheme, ChainIdColorThemeParams } from './chain-id';
|
|
10
|
+
import { UniformColorTheme, UniformColorThemeParams } from './uniform';
|
|
11
|
+
import { assertUnreachable } from '../../mol-util/type-helpers';
|
|
12
|
+
import { EntityIdColorTheme, EntityIdColorThemeParams } from './entity-id';
|
|
13
|
+
import { MoleculeTypeColorTheme, MoleculeTypeColorThemeParams } from './molecule-type';
|
|
14
|
+
import { EntitySourceColorTheme, EntitySourceColorThemeParams } from './entity-source';
|
|
11
15
|
var DefaultIllustrativeColor = Color(0xEEEEEE);
|
|
12
|
-
var Description = "Assigns an illustrative color that gives every chain a
|
|
13
|
-
export var IllustrativeColorThemeParams =
|
|
16
|
+
var Description = "Assigns an illustrative color that gives every chain a color based on the choosen style but with lighter carbons (inspired by David Goodsell's Molecule of the Month style).";
|
|
17
|
+
export var IllustrativeColorThemeParams = {
|
|
18
|
+
style: PD.MappedStatic('entity-id', {
|
|
19
|
+
uniform: PD.Group(UniformColorThemeParams),
|
|
20
|
+
'chain-id': PD.Group(ChainIdColorThemeParams),
|
|
21
|
+
'entity-id': PD.Group(EntityIdColorThemeParams),
|
|
22
|
+
'entity-source': PD.Group(EntitySourceColorThemeParams),
|
|
23
|
+
'molecule-type': PD.Group(MoleculeTypeColorThemeParams),
|
|
24
|
+
}),
|
|
25
|
+
carbonLightness: PD.Numeric(0.8, { min: -6, max: 6, step: 0.1 })
|
|
26
|
+
};
|
|
14
27
|
export function getIllustrativeColorThemeParams(ctx) {
|
|
15
|
-
|
|
28
|
+
var params = PD.clone(IllustrativeColorThemeParams);
|
|
29
|
+
return params;
|
|
16
30
|
}
|
|
17
31
|
export function IllustrativeColorTheme(ctx, props) {
|
|
18
|
-
var _a =
|
|
32
|
+
var _a = props.style.name === 'uniform' ? UniformColorTheme(ctx, props.style.params) :
|
|
33
|
+
props.style.name === 'chain-id' ? ChainIdColorTheme(ctx, props.style.params) :
|
|
34
|
+
props.style.name === 'entity-id' ? EntityIdColorTheme(ctx, props.style.params) :
|
|
35
|
+
props.style.name === 'entity-source' ? EntitySourceColorTheme(ctx, props.style.params) :
|
|
36
|
+
props.style.name === 'molecule-type' ? MoleculeTypeColorTheme(ctx, props.style.params) :
|
|
37
|
+
assertUnreachable(props.style), styleColor = _a.color, legend = _a.legend;
|
|
19
38
|
function illustrativeColor(location, typeSymbol) {
|
|
20
|
-
var baseColor =
|
|
39
|
+
var baseColor = styleColor(location, false);
|
|
21
40
|
return typeSymbol === 'C' ? Color.lighten(baseColor, props.carbonLightness) : baseColor;
|
|
22
41
|
}
|
|
23
42
|
function color(location) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
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
|
*/
|
|
@@ -21,11 +21,29 @@ export declare type MoleculeTypeColors = typeof MoleculeTypeColors;
|
|
|
21
21
|
export declare const MoleculeTypeColorThemeParams: {
|
|
22
22
|
saturation: PD.Numeric;
|
|
23
23
|
lightness: PD.Numeric;
|
|
24
|
+
colors: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
25
|
+
water: Color;
|
|
26
|
+
ion: Color;
|
|
27
|
+
protein: Color;
|
|
28
|
+
RNA: Color;
|
|
29
|
+
DNA: Color;
|
|
30
|
+
PNA: Color;
|
|
31
|
+
saccharide: Color;
|
|
32
|
+
}>, "custom">>;
|
|
24
33
|
};
|
|
25
34
|
export declare type MoleculeTypeColorThemeParams = typeof MoleculeTypeColorThemeParams;
|
|
26
35
|
export declare function getMoleculeTypeColorThemeParams(ctx: ThemeDataContext): {
|
|
27
36
|
saturation: PD.Numeric;
|
|
28
37
|
lightness: PD.Numeric;
|
|
38
|
+
colors: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "default"> | PD.NamedParams<PD.Normalize<{
|
|
39
|
+
water: Color;
|
|
40
|
+
ion: Color;
|
|
41
|
+
protein: Color;
|
|
42
|
+
RNA: Color;
|
|
43
|
+
DNA: Color;
|
|
44
|
+
PNA: Color;
|
|
45
|
+
saccharide: Color;
|
|
46
|
+
}>, "custom">>;
|
|
29
47
|
};
|
|
30
48
|
export declare function moleculeTypeColor(colorMap: MoleculeTypeColors, unit: Unit, element: ElementIndex): Color;
|
|
31
49
|
export declare function MoleculeTypeColorTheme(ctx: ThemeDataContext, props: PD.Values<MoleculeTypeColorThemeParams>): ColorTheme<MoleculeTypeColorThemeParams>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
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
|
*/
|
|
@@ -9,6 +9,7 @@ import { getElementMoleculeType } from '../../mol-model/structure/util';
|
|
|
9
9
|
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
10
10
|
import { TableLegend } from '../../mol-util/legend';
|
|
11
11
|
import { getAdjustedColorMap } from '../../mol-util/color/color';
|
|
12
|
+
import { getColorMapParams } from '../../mol-util/color/params';
|
|
12
13
|
export var MoleculeTypeColors = ColorMap({
|
|
13
14
|
water: 0x386cb0,
|
|
14
15
|
ion: 0xf0027f,
|
|
@@ -22,7 +23,11 @@ var DefaultMoleculeTypeColor = Color(0xffff99);
|
|
|
22
23
|
var Description = 'Assigns a color based on the molecule type of a residue.';
|
|
23
24
|
export var MoleculeTypeColorThemeParams = {
|
|
24
25
|
saturation: PD.Numeric(0, { min: -6, max: 6, step: 0.1 }),
|
|
25
|
-
lightness: PD.Numeric(0, { min: -6, max: 6, step: 0.1 })
|
|
26
|
+
lightness: PD.Numeric(0, { min: -6, max: 6, step: 0.1 }),
|
|
27
|
+
colors: PD.MappedStatic('default', {
|
|
28
|
+
'default': PD.EmptyGroup(),
|
|
29
|
+
'custom': PD.Group(getColorMapParams(MoleculeTypeColors))
|
|
30
|
+
})
|
|
26
31
|
};
|
|
27
32
|
export function getMoleculeTypeColorThemeParams(ctx) {
|
|
28
33
|
return MoleculeTypeColorThemeParams; // TODO return copy
|
|
@@ -41,7 +46,7 @@ export function moleculeTypeColor(colorMap, unit, element) {
|
|
|
41
46
|
return DefaultMoleculeTypeColor;
|
|
42
47
|
}
|
|
43
48
|
export function MoleculeTypeColorTheme(ctx, props) {
|
|
44
|
-
var colorMap = getAdjustedColorMap(MoleculeTypeColors, props.saturation, props.lightness);
|
|
49
|
+
var colorMap = getAdjustedColorMap(props.colors.name === 'default' ? MoleculeTypeColors : props.colors.params, props.saturation, props.lightness);
|
|
45
50
|
function color(location) {
|
|
46
51
|
if (StructureElement.Location.is(location)) {
|
|
47
52
|
return moleculeTypeColor(colorMap, location.unit, location.element);
|
|
@@ -57,8 +62,8 @@ export function MoleculeTypeColorTheme(ctx, props) {
|
|
|
57
62
|
color: color,
|
|
58
63
|
props: props,
|
|
59
64
|
description: Description,
|
|
60
|
-
legend: TableLegend(Object.keys(
|
|
61
|
-
return [name,
|
|
65
|
+
legend: TableLegend(Object.keys(colorMap).map(function (name) {
|
|
66
|
+
return [name, colorMap[name]];
|
|
62
67
|
}).concat([['Other/unknown', DefaultMoleculeTypeColor]]))
|
|
63
68
|
};
|
|
64
69
|
}
|