@czi-sds/data-viz 2.2.0 → 2.4.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.
Files changed (39) hide show
  1. package/dist/HeatmapChart.cjs.d.ts +2 -0
  2. package/dist/HeatmapChart.cjs.js +8 -0
  3. package/dist/HeatmapChart.esm.d.ts +2 -0
  4. package/dist/HeatmapChart.esm.js +3 -0
  5. package/dist/ProteinStructureViewer.cjs.d.ts +2 -0
  6. package/dist/ProteinStructureViewer.cjs.js +14 -0
  7. package/dist/ProteinStructureViewer.esm.d.ts +2 -0
  8. package/dist/ProteinStructureViewer.esm.js +3 -0
  9. package/dist/StackedBarChart.cjs.d.ts +2 -0
  10. package/dist/StackedBarChart.cjs.js +8 -0
  11. package/dist/StackedBarChart.esm.d.ts +2 -0
  12. package/dist/StackedBarChart.esm.js +3 -0
  13. package/dist/colorScales.cjs.d.ts +2 -0
  14. package/dist/colorScales.cjs.js +6 -0
  15. package/dist/colorScales.esm.d.ts +2 -0
  16. package/dist/colorScales.esm.js +3 -0
  17. package/dist/index.cjs.d.ts +5 -735
  18. package/dist/index.cjs.js +16 -5465
  19. package/dist/index.esm.d.ts +5 -737
  20. package/dist/index.esm.js +5 -5423
  21. package/dist/shared/HeatmapChart.cjs.js +349 -0
  22. package/dist/shared/HeatmapChart.esm.js +342 -0
  23. package/dist/shared/ProteinStructureViewer.cjs.js +4780 -0
  24. package/dist/shared/ProteinStructureViewer.esm.js +4728 -0
  25. package/dist/shared/StackedBarChart.cjs.js +489 -0
  26. package/dist/shared/StackedBarChart.esm.js +483 -0
  27. package/dist/shared/colorScales.cjs.d.ts +45 -0
  28. package/dist/shared/colorScales.cjs.js +126 -0
  29. package/dist/shared/colorScales.esm.d.ts +45 -0
  30. package/dist/shared/colorScales.esm.js +103 -0
  31. package/dist/shared/index.cjs.d.ts +183 -0
  32. package/dist/shared/index.esm.d.ts +183 -0
  33. package/dist/shared/index2.cjs.d.ts +389 -0
  34. package/dist/shared/index2.esm.d.ts +391 -0
  35. package/dist/shared/index3.cjs.d.ts +166 -0
  36. package/dist/shared/index3.esm.d.ts +166 -0
  37. package/dist/shared/objectSpread2.cjs.js +124 -0
  38. package/dist/shared/objectSpread2.esm.js +85 -0
  39. package/package.json +64 -2
@@ -1,735 +1,5 @@
1
- /// <reference types="react" />
2
- import { HTMLAttributes } from "react";
3
- import { DatasetComponentOption, ECharts, EChartsOption, ScatterSeriesOption } from "echarts";
4
- import { DiscreteColorGeneratorOptions, TooltipProps, TooltipTableContentProps } from "@czi-sds/components";
5
- import { PluginUISpec } from "molstar/lib/mol-plugin-ui/spec";
6
- //#region src/common/colorScales.d.ts
7
- /** RGB triplet with each channel in the range 0-255. */
8
- type Rgb = [number, number, number];
9
- /** A stop on a continuous color scale, positioned at `t` in the range 0-1. */
10
- interface ContinuousColorStop {
11
- t: number;
12
- color: string;
13
- }
14
- /**
15
- * A band on a stepped color scale. `threshold` is the upper bound of the band
16
- * on the normalized 0-1 value range; `label` is rendered above the band in the
17
- * legend.
18
- */
19
- interface SteppedColorStop {
20
- threshold: number;
21
- color: string;
22
- label: string;
23
- }
24
- /**
25
- * How values map to colors, both in a visualization and in its legend. A
26
- * continuous scale interpolates between its stops and renders as a gradient
27
- * bar; a stepped scale renders as discrete bands.
28
- */
29
- type ColorScale = {
30
- kind: "continuous";
31
- stops: ContinuousColorStop[];
32
- } | {
33
- kind: "stepped";
34
- stops: SteppedColorStop[];
35
- };
36
- /**
37
- * Perceptually uniform sequential scale (matplotlib's plasma), the default for
38
- * value overlays.
39
- */
40
- declare const PLASMA_COLOR_SCALE: ColorScale;
41
- /**
42
- * Colors a raw value against a scale, normalizing it into `min`-`max` first.
43
- * Returns null when the value sits at or below `min`, or when the range is
44
- * degenerate, so callers can fall back to a neutral color.
45
- */
46
- declare function sampleColorScale(scale: ColorScale, value: number, max: number, min?: number): Rgb | null;
47
- /** CSS `linear-gradient` spanning a continuous scale, for the legend bar. */
48
- declare function toCssGradient(stops: ContinuousColorStop[]): string;
49
- //#endregion
50
- //#region src/core/HeatmapChart/hooks/utils.d.ts
51
- interface CreateChartOptionsProps {
52
- /**
53
- * The crosshair following the pointer. One object applies to both axes; a
54
- * two-entry array configures them separately.
55
- * https://echarts.apache.org/en/option.html#axisPointer
56
- */
57
- axisPointer?: EChartsOption["axisPointer"];
58
- /**
59
- * The cells, as a flat array of objects whose fields are named by `encode`.
60
- * The data point object shape can be whatever you like, but it must be consistent with the `encode` option
61
- * For example, if the data point shape is:
62
- * {
63
- * geneIndex: 0,
64
- * cellTypeIndex: 0,
65
- * percentage: 0.5
66
- * }
67
- * and you want geneIndex to be encoded to x axis and cellTypeIndex to be encoded to y axis, then make sure your encode option is:
68
- * encode: {
69
- * x: 'geneIndex',
70
- * y: 'cellTypeIndex'
71
- * }
72
- */
73
- data: DatasetComponentOption["source"];
74
- /**
75
- * ECharts' dataZoom configuration for that window, merged over the defaults
76
- * it sets. One object applies to both axes; a two-entry array configures them
77
- * separately. It reaches the chart only while `camera.active` is true.
78
- *
79
- * The `dataZoom` prop is utilized for implementing zoom functionality within a
80
- * specific area of the chart. This feature empowers users to inspect data in
81
- * granular detail, obtain an overview of the entire dataset, or eliminate
82
- * outlier points.
83
- * By applying the `dataZoom` prop while locking the zoom level, the chart
84
- * efficiently renders a confined portion of the heatmap. This selective
85
- * rendering strategy becomes especially advantageous when dealing with
86
- * extensive datasets. Instead of rendering the entire heatmap at once,
87
- * the chart dynamically loads and renders specific segments as the user
88
- * scrolls through the data. This approach optimizes performance and enables
89
- * the creation of heatmaps with large amounts of data.
90
- * https://echarts.apache.org/en/option.html#dataZoom
91
- */
92
- dataZoom?: EChartsOption["dataZoom"];
93
- /**
94
- * Renders only a window of the grid, measured in cells, and lets the pointer
95
- * pan it. Sizes are ignored unless `active` is true.
96
- *
97
- * The `camera` prop is utilized for implementing camera view port functionality
98
- * within a specific area of the chart. This feature empowers users to render
99
- * a confined portion of the heatmap. This selective rendering strategy becomes
100
- * especially advantageous when dealing with extensive datasets. Instead of
101
- * rendering the entire heatmap at once, the chart dynamically loads and renders
102
- * specific segments as the user scrolls through the data. This approach optimizes
103
- * performance and enables the creation of heatmaps with large amounts of data.
104
- *
105
- * The `height` and `width` properties are used to specify the dimensions of the
106
- * camera view port. The `active` property is used to enable or disable the camera
107
- * view port functionality.
108
- */
109
- camera?: {
110
- active: boolean;
111
- height: number;
112
- width: number;
113
- };
114
- /**
115
- * How a cell is drawn while the pointer is over it. Takes the same shape as
116
- * `itemStyle`: color, border, opacity.
117
- * https://echarts.apache.org/en/option.html#series-scatter.emphasis
118
- */
119
- emphasis?: ScatterSeriesOption["emphasis"];
120
- /**
121
- * The categories along the x axis. A cell's encoded x value is an index into
122
- * this array.
123
- * For example:
124
- * [{ value: "gene1", textStyle: { color: "red" } }, "gene2", "gene3"]
125
- */
126
- xAxisData: CategoryAxisData;
127
- /**
128
- * The categories along the y axis.
129
- * For example:
130
- * [{ value: "cellType1", textStyle: { color: "red" } }, "cellType2", "cellType3"]
131
- */
132
- yAxisData: CategoryAxisData;
133
- /**
134
- * Width of the chart in pixels. Must be greater than zero; the component
135
- * throws otherwise.
136
- */
137
- width: number;
138
- /**
139
- * Height of the chart in pixels, under the same rule.
140
- */
141
- height: number;
142
- /**
143
- * Which fields of a data item place it on each axis. Omitting it leaves
144
- * ECharts to guess from the field order.
145
- * For example, if the data is:
146
- * {
147
- * geneIndex: 0,
148
- * cellTypeIndex: 0,
149
- * percentage: 0.5
150
- * }
151
- * and we want to encode `geneIndex` to x axis and `cellTypeIndex` to y axis, then
152
- * encode: {
153
- * x: 'geneIndex',
154
- * y: 'cellTypeIndex'
155
- * }
156
- * https://echarts.apache.org/en/option.html#series-scatter.encode
157
- */
158
- encode?: {
159
- x: string;
160
- y: string;
161
- };
162
- /**
163
- * How a cell is painted. Its color accepts a callback receiving the data
164
- * item, which is how a value becomes a color.
165
- * https://echarts.apache.org/en/option.html#series-scatter.itemStyle
166
- */
167
- itemStyle?: ScatterSeriesOption["itemStyle"];
168
- /**
169
- * The shape of a cell. Circles turn the grid into a dot plot, where diameter
170
- * can carry a second measurement.
171
- */
172
- symbol?: "circle" | "rect" | "roundRect";
173
- /**
174
- * Cell size in pixels: one number, a [width, height] pair, or a callback
175
- * given the data item. Set it to the cell pitch for a solid grid.
176
- *
177
- * `symbolSize` can be set to single numbers like 10, or use an array to represent width and height. For example, [20, 10] means symbol width is 20, and height is 10.
178
- *
179
- * If size of symbols needs to be different, you can set with callback function in the following format:
180
- *
181
- * (value: Array|number, params: Object) => number|Array
182
- *
183
- * The first parameter value is the value in data, and the second parameter params is the rest parameters of data item.
184
- * https://echarts.apache.org/en/option.html#series-scatter.symbolSize
185
- */
186
- symbolSize?: ScatterSeriesOption["symbolSize"];
187
- /**
188
- * Where the plotting area sits inside the container. The function form
189
- * receives the computed default, for insetting it without recomputing the
190
- * size.
191
- * https://echarts.apache.org/en/option.html#grid
192
- */
193
- grid?: EChartsOption["grid"] | ((defaultOption: EChartsOption["grid"]) => EChartsOption["grid"]);
194
- /**
195
- * Anything else ECharts understands, merged over the generated options.
196
- * https://echarts.apache.org/en/option.html
197
- */
198
- options?: EChartsOption;
199
- /**
200
- * ECharts event listeners by name. Each handler gets the raw event, whose
201
- * data property is the cell, and the chart instance.
202
- * https://echarts.apache.org/en/api.html#events
203
- */
204
- onEvents?: Record<string, (event: unknown, chart: ECharts) => void>;
205
- }
206
- type OrdinalRawValue = string | number;
207
- /**
208
- * (thuang): This copies echarts' CategoryAxisBaseOption["data"] type, since it's not exported
209
- */
210
- type CategoryAxisData = (OrdinalRawValue | {
211
- value: OrdinalRawValue;
212
- /**
213
- * (thuang): This should be echarts `TextCommonOption` type, but it's not exported
214
- */
215
- textStyle?: never;
216
- })[];
217
- //#endregion
218
- //#region src/core/HeatmapChart/index.d.ts
219
- interface HeatmapChartProps extends HTMLAttributes<HTMLDivElement>, CreateChartOptionsProps {
220
- /**
221
- * Which renderer ECharts initialises with. Canvas copes better with very
222
- * large grids. Changing it rebuilds the chart.
223
- * @default "svg"
224
- */
225
- echartsRendererMode?: "svg" | "canvas";
226
- }
227
- declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<HeatmapChartProps & import("react").RefAttributes<HTMLDivElement>>>;
228
- //#endregion
229
- //#region src/core/ProteinStructureViewer/ProteinStructureViewer.types.d.ts
230
- /**
231
- * Per-residue values painted onto the structure in place of the default pLDDT
232
- * coloring, along with the legend that describes them.
233
- */
234
- interface ResidueValueOverlay {
235
- /** 0-based residue index to value. Residues absent from the map read as 0. */
236
- values: Map<number, number>;
237
- /** Value mapped to the top of the color scale. */
238
- max: number;
239
- /**
240
- * Values at or below this render in a neutral gray rather than on the scale.
241
- * Values above it are normalized into `min`-`max` before being sampled, so
242
- * this is also what the legend's lower tick reports.
243
- * @default 0
244
- */
245
- min?: number;
246
- /**
247
- * Scale used to color residues and to draw the legend.
248
- * @default PLASMA_COLOR_SCALE
249
- */
250
- colorScale?: ColorScale;
251
- /** Legend caption, e.g. "Feature activation". */
252
- label?: string;
253
- /**
254
- * Title of the help tooltip on the legend caption. The common case: a
255
- * string is enough. Use `tooltipProps` when the tooltip needs a subtitle, a
256
- * custom body, or any other SDS Tooltip prop. Overrides
257
- * `tooltipProps.title` when both are set.
258
- */
259
- tooltip?: string;
260
- /**
261
- * Props forwarded to the SDS Tooltip on the legend caption. The trigger is
262
- * the caption's help icon, so `children` is omitted.
263
- */
264
- tooltipProps?: Partial<Omit<TooltipProps, "children">>;
265
- /**
266
- * Label for the per-residue readout that replaces a stat slot on hover.
267
- * @default "Value"
268
- */
269
- readoutLabel?: string;
270
- }
271
- /**
272
- * A residue the user pointed at, in each of the ways a caller might need to
273
- * address it.
274
- *
275
- * `index` is the viewer's own key: the position in `plddt` and in
276
- * `residueOverlay`'s map, and what `selectedResidue` takes. `chainId`, `seqId`
277
- * and `insCode` are what the file says, which is what the sequence panel shows
278
- * and what a system that supplied the structure will recognise. They differ
279
- * from `index` whenever the file does not number a single chain from 1 -- a
280
- * crop, or a complex -- so address a residue outside the viewer with those
281
- * three, not with `index`.
282
- *
283
- * `insCode` is rarely set but is part of the address when it is: `10` and `10A`
284
- * are different residues on the same chain, so chain and number alone do not
285
- * name one.
286
- */
287
- interface ResidueRef {
288
- /** 0-based position in the structure, counting residues in file order. */
289
- index: number;
290
- /** Three-letter residue code, e.g. `"LYS"`. */
291
- compId: string;
292
- /** Chain the residue sits on, as named in the file. */
293
- chainId: string;
294
- /** Residue number as written in the file. */
295
- seqId: number;
296
- /** Insertion code, or `""` when the residue has none. */
297
- insCode: string;
298
- }
299
- /**
300
- * A chain the viewer found in the structure it loaded, reported through
301
- * `onChainsChange` so a consumer can label, color or hide chains by name
302
- * without parsing the PDB itself.
303
- *
304
- * `chainId` is the file's own name for the chain, the same one `ResidueRef`
305
- * reports, and the key every chain-keyed prop takes. A chain carrying several
306
- * symmetry operators appears once, under the first.
307
- *
308
- * Describes the chain's polymer. The ligands and ions sitting on it are drawn
309
- * and are hidden and selected with it, but are not counted here or spanned by
310
- * the range below - they are no part of the sequence. A chain holding nothing
311
- * but heteroatoms is left out altogether, having no sequence to describe.
312
- */
313
- interface ChainRef {
314
- /** Chain as named in the file (`auth_asym_id`), e.g. `"A"`. */
315
- chainId: string;
316
- /** Chain as the sequence panel captions it. */
317
- label: string;
318
- /** Lowest 0-based residue index of the chain's polymer. */
319
- startIndex: number;
320
- /** Highest 0-based residue index of the chain's polymer. */
321
- endIndex: number;
322
- /** Polymer residues the chain holds. */
323
- residueCount: number;
324
- }
325
- /**
326
- * What is selected, in the two ways a caller might say it. `null` selects
327
- * nothing.
328
- *
329
- * The two combine: `{ chains: ["A"], residues: [150] }` takes all of chain A
330
- * plus one residue elsewhere. `chains` is kept as named rather than expanded
331
- * into indices, so a whole-chain selection survives a round trip through a
332
- * consumer's state at its original size.
333
- */
334
- interface StructureSelection {
335
- /**
336
- * 0-based residue indices, counting residues in file order across the whole
337
- * structure - the same index `plddt` and `residueOverlay` are keyed by.
338
- */
339
- residues?: number[];
340
- /** Whole chains by `chainId`, each standing for every residue on it. */
341
- chains?: string[];
342
- }
343
- /**
344
- * How large a downloaded image is, in pixels.
345
- *
346
- * Named rather than given as dimensions because the aspect is Mol*'s to
347
- * choose: each of these is one of its own presets, and a size picked here
348
- * would have to be reconciled with the canvas the image is rendered from.
349
- */
350
- type DownloadResolution = "low" | "medium" | "high" | "maximum";
351
- /** Pixel dimensions each resolution produces, for documentation and labels. */
352
- declare const DOWNLOAD_RESOLUTIONS: Record<DownloadResolution, string>;
353
- /**
354
- * Turns on the capture button under the reset-camera control, and says what it
355
- * should produce. Omit it and no button is drawn.
356
- *
357
- * The image is rendered fresh at the size asked for rather than scaled up from
358
- * the canvas, so a high resolution costs time rather than sharpness - which is
359
- * why the default sits in the middle rather than at the top.
360
- */
361
- interface StructureDownload {
362
- /**
363
- * Size of the image. See `DOWNLOAD_RESOLUTIONS` for the pixel dimensions.
364
- * @default "medium"
365
- */
366
- resolution?: DownloadResolution;
367
- /**
368
- * Background behind the structure, as `#RRGGBB`. Omit for a transparent
369
- * one, which is what a figure usually wants - the viewer's own canvas color
370
- * is deliberately not inherited, since a screenshot tends to outlive the
371
- * theme it was taken under.
372
- */
373
- backgroundColor?: string;
374
- /**
375
- * Draw the orientation axes into the image. Independent of `showAxes`, which
376
- * is about the view rather than the capture: the widget orients a reader who
377
- * can turn the structure, and earns its place less in a still.
378
- * @default false
379
- */
380
- showAxes?: boolean;
381
- /**
382
- * Name for the downloaded file, without an extension. Defaults to the one
383
- * Mol* derives from the loaded structure.
384
- */
385
- filename?: string;
386
- }
387
- /** A whole-structure statistic shown along the bottom of the viewer. */
388
- interface StructureStat {
389
- value: string;
390
- label: string;
391
- }
392
- interface ProteinStructureViewerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
393
- /** Structure to render, as raw PDB text. */
394
- pdb: string;
395
- /**
396
- * Per-residue pLDDT confidence on a 0-1 scale, ordered by residue. When
397
- * supplied the structure is colored by pLDDT unless `residueOverlay` takes
398
- * over.
399
- */
400
- plddt?: number[] | null;
401
- /**
402
- * Canvas background, as `#RRGGBB`. Defaults to the SDS theme's base
403
- * background, so the canvas follows the surrounding page in both modes.
404
- */
405
- backgroundColor?: string;
406
- /**
407
- * Sequence panel background, as any CSS color. Defaults to the SDS theme's
408
- * primary surface, so the panel follows the surrounding page in both modes.
409
- */
410
- sequenceViewerBackgroundColor?: string;
411
- /**
412
- * Show the orientation axes widget and the reset-camera button.
413
- * @default true
414
- */
415
- showAxes?: boolean;
416
- /**
417
- * Adds a capture button beneath the reset-camera control, which downloads a
418
- * PNG of the structure as it currently stands. Omit for no button.
419
- */
420
- download?: StructureDownload | null;
421
- /**
422
- * Show the sequence panel pinned along the bottom of the viewer.
423
- * @default true
424
- */
425
- showSequenceViewer?: boolean;
426
- /**
427
- * Show the stats and color scale legend overlaid on the viewer.
428
- * @default true
429
- */
430
- showLegend?: boolean;
431
- /** Per-residue values that override pLDDT coloring while set. */
432
- residueOverlay?: ResidueValueOverlay | null;
433
- /**
434
- * What is selected, or null when nothing is. Controlled: the camera frames
435
- * whatever the selection covers, and clearing it zooms back out to the
436
- * default view.
437
- */
438
- selection?: StructureSelection | null;
439
- /**
440
- * Chains hidden from the 3D view, by `chainId`. Leave undefined to let the
441
- * viewer own visibility itself, which is what the chain legend's toggles
442
- * drive; passing it takes that over, and the toggles then only report.
443
- */
444
- hiddenChains?: string[];
445
- /**
446
- * Color per chain, by `chainId`, as `#RRGGBB`. Chains left out fall back to
447
- * the viewer's palette. Only visible while chain coloring is what is on
448
- * screen, which is when neither `plddt` nor `residueOverlay` is set.
449
- */
450
- chainColors?: Record<string, string>;
451
- /**
452
- * Show the chain legend, which lists each chain with its color and a
453
- * visibility toggle. Ignored on a single-chain structure, where there is
454
- * nothing to tell apart or hide.
455
- * @default true
456
- */
457
- showChainLegend?: boolean;
458
- /**
459
- * Stop a chain from lighting up in the 3D view while its name is pointed at,
460
- * in the legend or above its grid in the sequence panel.
461
- *
462
- * The highlight is on by default, since on a complex it is how a reader
463
- * finds out which chain is which. Turn it off where the movement is more
464
- * distracting than the answer is useful - a grid of viewers a pointer
465
- * crosses on its way somewhere else, or a page driving its own highlighting
466
- * through `selection`.
467
- * @default false
468
- */
469
- disableChainHighlightOnHover?: boolean;
470
- /**
471
- * Mol* plugin spec laid over the viewer's own, which is how the whole of
472
- * Mol*'s configuration is reachable without a prop here for each setting.
473
- * Anything named here wins, so `canvas3d.postprocessing`, a `PluginConfig`
474
- * item, or `layout.initial` can all be set to something other than the
475
- * default the viewer picked.
476
- *
477
- * List-valued keys - `behaviors`, `config`, `actions`, `animations`,
478
- * `customFormats`, `customParamEditors` - are appended to rather than
479
- * replaced. For `config` that is what lets an entry override the viewer's,
480
- * since Mol* reads the list in order. It also means a behavior cannot be
481
- * taken away: the ones the viewer drops stay dropped, and the ones it keeps
482
- * cannot be removed from here.
483
- *
484
- * Read once, when the plugin is created, except for `canvas3d`, which is
485
- * re-applied whenever it changes. Creating the plugin throws away the camera,
486
- * so the rest is deliberately not reactive.
487
- */
488
- molstarSpec?: Partial<PluginUISpec>;
489
- /**
490
- * Up to three whole-structure stats shown along the bottom. A null entry
491
- * reserves its column without rendering anything, so the columns never shift
492
- * as values come and go.
493
- */
494
- stats?: (StructureStat | null)[];
495
- /** Called with the clicked residue. */
496
- onResidueClick?: (residue: ResidueRef) => void;
497
- /**
498
- * Called as the pointer moves over residues, and with `null` when it leaves
499
- * the structure.
500
- */
501
- onResidueHover?: (residue: ResidueRef | null) => void;
502
- /**
503
- * Called with the new selection whenever the user makes one - clicking a
504
- * residue, dragging across the sequence, clicking a chain caption - and with
505
- * `null` when they click empty space to clear it.
506
- *
507
- * A whole-chain selection arrives as `{ chains: [id] }` rather than as every
508
- * index on it, so echoing it straight back into `selection` costs nothing.
509
- */
510
- onSelectionChange?: (selection: StructureSelection | null) => void;
511
- /**
512
- * Called with the chains found in the structure, whenever a structure is
513
- * loaded. Fires with `[]` when the structure holds none.
514
- */
515
- onChainsChange?: (chains: ChainRef[]) => void;
516
- /**
517
- * Called with the chains now hidden when a visibility toggle is used. Fires
518
- * whether or not `hiddenChains` is controlled, so a consumer can follow the
519
- * viewer's own state without owning it.
520
- */
521
- onChainVisibilityChange?: (hiddenChains: string[]) => void;
522
- }
523
- /**
524
- * Readout that replaces the whole-structure stats while something is hovered
525
- * or selected. Covers one residue or many: a drag across the sequence and a
526
- * whole-chain selection report through this too, as a mean over what they
527
- * cover.
528
- */
529
- interface ResidueReadout {
530
- /** e.g. "PHE 17", "Chain A", or "24 residues". */
531
- label: string;
532
- /**
533
- * pLDDT on a 0-1 scale, or null when unavailable. The mean across the
534
- * residues covered when there is more than one, ignoring those without a
535
- * score.
536
- */
537
- plddt: number | null;
538
- /**
539
- * Overlay value, or null when the overlay holds none - which is also what a
540
- * structure paints neutral - or when no overlay is set. The mean across the
541
- * residues covered when there is more than one, ignoring those the overlay
542
- * says nothing about.
543
- */
544
- value: number | null;
545
- /**
546
- * Residues the readout covers, which is what makes the numbers above means
547
- * rather than readings. 1 for a single residue.
548
- */
549
- residueCount: number;
550
- }
551
- //#endregion
552
- //#region src/core/ProteinStructureViewer/utils/plddt.d.ts
553
- /**
554
- * AlphaFold's pLDDT confidence bands. Thresholds are on the 0-1 scale that
555
- * `plddt` values use, ascending from lowest to highest confidence.
556
- */
557
- declare const PLDDT_COLOR_SCALE: ColorScale;
558
- /**
559
- * Rewrites a PDB file's B-factor column with pLDDT scores so Mol* can read them
560
- * off the parsed model. B-factors occupy columns 60-66 of ATOM/HETATM lines;
561
- * scores arrive on a 0-1 scale and are stored on the conventional 0-100 one.
562
- * Residues past the end of `plddtValues` fall back to a mid-confidence 50.
563
- *
564
- * A residue is identified by chain, sequence number and insertion code. The
565
- * code has to be part of that: `10` and `10A` are two residues, Mol* counts
566
- * them as two, and treating them as one here would hand every residue after
567
- * them its neighbour's score.
568
- */
569
- declare function injectPlddtIntoPdb(pdbData: string, plddtValues: number[]): string;
570
- //#endregion
571
- //#region src/core/ProteinStructureViewer/index.d.ts
572
- declare const _default$1: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<ProteinStructureViewerProps & import("react").RefAttributes<HTMLDivElement>>>;
573
- //#endregion
574
- //#region src/core/StackedBarChart/StackedBarChart.types.d.ts
575
- interface StackedBarChartDataItem {
576
- /**
577
- * The segment's label in the legend, and the key the animations track it by.
578
- * Must be unique within the chart.
579
- */
580
- name: string;
581
- /**
582
- * The quantity the segment stands for.
583
- */
584
- value: number;
585
- /**
586
- * Any CSS color. Without it the segment takes a generated palette color,
587
- * which can shift as categories come and go.
588
- */
589
- color?: string;
590
- /**
591
- * A unit for this item's counted value, for data that mixes units across
592
- * categories.
593
- */
594
- unit?: string;
595
- /**
596
- * Takes the segment and its legend item out of every interaction: no hover,
597
- * no tooltip, no selection.
598
- * @default false
599
- */
600
- disabled?: boolean;
601
- /**
602
- * Content for a TooltipTable shown above the segment on hover. Use it for the
603
- * breakdown behind the number; a segment without it has no tooltip.
604
- */
605
- tooltip?: TooltipTableContentProps;
606
- }
607
- interface StackedBarChartProps extends HTMLAttributes<HTMLDivElement> {
608
- /**
609
- * A heading above the bar. It is also what makes room for the badge; with no
610
- * title, no badge is drawn.
611
- */
612
- title?: string;
613
- /**
614
- * Overrides the badge text, which otherwise counts the data and the selection
615
- * ("7", or "3 of 7").
616
- */
617
- badge?: string;
618
- /**
619
- * Removes the badge, leaving the title on its own.
620
- * @default false
621
- */
622
- hideBadge?: boolean;
623
- /**
624
- * The segments, in the order they are drawn.
625
- */
626
- data: StackedBarChartDataItem[];
627
- /**
628
- * Any CSS width; a number is read as pixels. It sets the width of the whole
629
- * chart, legend included.
630
- * @default 100%
631
- */
632
- width?: number | string;
633
- /**
634
- * Height of the bar in pixels. Values below 1 are clamped to 1, so the bar
635
- * cannot disappear.
636
- * @default 16
637
- */
638
- barHeight?: number;
639
- /**
640
- * Draws the legend below the bar. It is the only place segment names appear,
641
- * and the only part of the chart a keyboard can reach.
642
- * @default true
643
- */
644
- showLegend?: boolean;
645
- /**
646
- * Shows each item's value beside its name in the legend.
647
- * @default true
648
- */
649
- showLegendValues?: boolean;
650
- /**
651
- * "percentage" shows the segment's share of the bar, rounded. "count" shows
652
- * the raw value followed by the item's unit, or the chart's unit if the item
653
- * has none.
654
- * @default "percentage"
655
- */
656
- legendValueFormat?: "percentage" | "count";
657
- /**
658
- * Indices into data that are currently selected. The chart is controlled: it
659
- * draws this and never changes it.
660
- */
661
- selectedIndices?: number[];
662
- /**
663
- * Called with the next selection when a segment or legend item is clicked.
664
- * Without it, clicking selects nothing.
665
- */
666
- onSelectionChange?: (selectedIndices: number[], selectedData: StackedBarChartDataItem[]) => void;
667
- /**
668
- * Called when the pointer enters a segment. The chart already syncs its own
669
- * hover highlight between bar and legend, so this is for driving something
670
- * outside it.
671
- */
672
- onSegmentMouseEnter?: (item: StackedBarChartDataItem, index: number) => void;
673
- /**
674
- * Called when the pointer leaves a segment.
675
- */
676
- onSegmentMouseLeave?: (item: StackedBarChartDataItem, index: number) => void;
677
- /**
678
- * Called when the pointer enters a legend item.
679
- */
680
- onLegendItemMouseEnter?: (item: StackedBarChartDataItem, index: number) => void;
681
- /**
682
- * Called when the pointer leaves a legend item.
683
- */
684
- onLegendItemMouseLeave?: (item: StackedBarChartDataItem, index: number) => void;
685
- /**
686
- * Fires on a segment click, alongside any selection change rather than
687
- * instead of it.
688
- */
689
- onSegmentClick?: (item: StackedBarChartDataItem, index: number) => void;
690
- /**
691
- * The same, for a click on a legend item.
692
- */
693
- onLegendItemClick?: (item: StackedBarChartDataItem, index: number) => void;
694
- /**
695
- * What a selection does to the unselected segments: fade them to 20% opacity,
696
- * or drop them from the bar and let the rest take the space.
697
- * @default "dim"
698
- */
699
- selectionBehavior?: "dim" | "hide";
700
- /**
701
- * Whether the bar shows a breakdown of the data (segments always fill it) or
702
- * progress towards maxAmount.
703
- * @default "proportional"
704
- */
705
- mode?: "proportional" | "cumulative";
706
- /**
707
- * Cumulative mode only. The value the full bar represents. Any difference
708
- * between it and the sum of the data is drawn as the Remaining segment.
709
- */
710
- maxAmount?: number;
711
- /**
712
- * Name of the grey gap segment in cumulative mode.
713
- * @default "Remaining"
714
- */
715
- remainingLabel?: string;
716
- /**
717
- * A unit for the Remaining segment's value alone.
718
- */
719
- remainingUnit?: string;
720
- /**
721
- * The unit appended to counted values, for items that do not carry one of
722
- * their own.
723
- */
724
- unit?: string;
725
- /**
726
- * Tunes the generated palette (start hue, rotations, lightness range, gamma).
727
- * Items with their own color are untouched by it.
728
- */
729
- colorGeneratorOptions?: DiscreteColorGeneratorOptions;
730
- }
731
- //#endregion
732
- //#region src/core/StackedBarChart/index.d.ts
733
- declare const StackedBarChart: (props: StackedBarChartProps) => JSX.Element;
734
- //#endregion
735
- export { ChainRef, type ColorScale, type ContinuousColorStop, DOWNLOAD_RESOLUTIONS, DownloadResolution, _default as HeatmapChart, HeatmapChartProps, PLASMA_COLOR_SCALE, PLDDT_COLOR_SCALE, _default$1 as ProteinStructureViewer, ProteinStructureViewerProps, ResidueReadout, ResidueRef, ResidueValueOverlay, StackedBarChart, type StackedBarChartDataItem, type StackedBarChartProps, type SteppedColorStop, StructureDownload, StructureSelection, StructureStat, injectPlddtIntoPdb, sampleColorScale, toCssGradient };
1
+ import { n as _default, t as HeatmapChartProps } from "./shared/index.cjs.js";
2
+ import { a as sampleColorScale, i as SteppedColorStop, n as ContinuousColorStop, o as toCssGradient, r as PLASMA_COLOR_SCALE, t as ColorScale } from "./shared/colorScales.cjs.js";
3
+ import { _ as StructureStat, a as injectPlddtIntoPdb, c as ChainRef, d as ProteinStructureViewerProps, f as ResidueReadout, g as StructureSelection, h as StructureDownload, i as injectPlddtIntoMmcif, l as DOWNLOAD_RESOLUTIONS, m as ResidueValueOverlay, n as PLDDT_COLOR_SCALE, o as StructureFormat, p as ResidueRef, r as injectPlddt, s as detectStructureFormat, t as _default$1, u as DownloadResolution } from "./shared/index2.cjs.js";
4
+ import { n as StackedBarChartDataItem, r as StackedBarChartProps, t as StackedBarChart } from "./shared/index3.cjs.js";
5
+ export { ChainRef, type ColorScale, type ContinuousColorStop, DOWNLOAD_RESOLUTIONS, DownloadResolution, _default as HeatmapChart, HeatmapChartProps, PLASMA_COLOR_SCALE, PLDDT_COLOR_SCALE, _default$1 as ProteinStructureViewer, ProteinStructureViewerProps, ResidueReadout, ResidueRef, ResidueValueOverlay, StackedBarChart, type StackedBarChartDataItem, type StackedBarChartProps, type SteppedColorStop, StructureDownload, type StructureFormat, StructureSelection, StructureStat, detectStructureFormat, injectPlddt, injectPlddtIntoMmcif, injectPlddtIntoPdb, sampleColorScale, toCssGradient };