@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
@@ -0,0 +1,391 @@
1
+ /// <reference types="react" />
2
+ import { t as ColorScale } from "./colorScales.esm.js";
3
+ import { HTMLAttributes } from "react";
4
+ import { TooltipProps } from "@czi-sds/components";
5
+ import { PluginUISpec } from "molstar/lib/mol-plugin-ui/spec";
6
+ import { CustomElementProperty } from "molstar/lib/mol-model-props/common/custom-element-property";
7
+
8
+ //#region src/core/ProteinStructureViewer/ProteinStructureViewer.types.d.ts
9
+ /**
10
+ * Per-residue values painted onto the structure in place of the default pLDDT
11
+ * coloring, along with the legend that describes them.
12
+ */
13
+ interface ResidueValueOverlay {
14
+ /** 0-based residue index to value. Residues absent from the map read as 0. */
15
+ values: Map<number, number>;
16
+ /** Value mapped to the top of the color scale. */
17
+ max: number;
18
+ /**
19
+ * Values at or below this render in a neutral gray rather than on the scale.
20
+ * Values above it are normalized into `min`-`max` before being sampled, so
21
+ * this is also what the legend's lower tick reports.
22
+ * @default 0
23
+ */
24
+ min?: number;
25
+ /**
26
+ * Scale used to color residues and to draw the legend.
27
+ * @default PLASMA_COLOR_SCALE
28
+ */
29
+ colorScale?: ColorScale;
30
+ /** Legend caption, e.g. "Feature activation". */
31
+ label?: string;
32
+ /**
33
+ * Title of the help tooltip on the legend caption. The common case: a
34
+ * string is enough. Use `tooltipProps` when the tooltip needs a subtitle, a
35
+ * custom body, or any other SDS Tooltip prop. Overrides
36
+ * `tooltipProps.title` when both are set.
37
+ */
38
+ tooltip?: string;
39
+ /**
40
+ * Props forwarded to the SDS Tooltip on the legend caption. The trigger is
41
+ * the caption's help icon, so `children` is omitted.
42
+ */
43
+ tooltipProps?: Partial<Omit<TooltipProps, "children">>;
44
+ /**
45
+ * Label for the per-residue readout that replaces a stat slot on hover.
46
+ * @default "Value"
47
+ */
48
+ readoutLabel?: string;
49
+ }
50
+ /**
51
+ * A residue the user pointed at, in each of the ways a caller might need to
52
+ * address it.
53
+ *
54
+ * `index` is the viewer's own key: the position in `plddt` and in
55
+ * `residueOverlay`'s map, and what `selectedResidue` takes. `chainId`, `seqId`
56
+ * and `insCode` are what the file says, which is what the sequence panel shows
57
+ * and what a system that supplied the structure will recognise. They differ
58
+ * from `index` whenever the file does not number a single chain from 1 -- a
59
+ * crop, or a complex -- so address a residue outside the viewer with those
60
+ * three, not with `index`.
61
+ *
62
+ * `insCode` is rarely set but is part of the address when it is: `10` and `10A`
63
+ * are different residues on the same chain, so chain and number alone do not
64
+ * name one.
65
+ */
66
+ interface ResidueRef {
67
+ /** 0-based position in the structure, counting residues in file order. */
68
+ index: number;
69
+ /** Three-letter residue code, e.g. `"LYS"`. */
70
+ compId: string;
71
+ /** Chain the residue sits on, as named in the file. */
72
+ chainId: string;
73
+ /** Residue number as written in the file. */
74
+ seqId: number;
75
+ /** Insertion code, or `""` when the residue has none. */
76
+ insCode: string;
77
+ }
78
+ /**
79
+ * A chain the viewer found in the structure it loaded, reported through
80
+ * `onChainsChange` so a consumer can label, color or hide chains by name
81
+ * without parsing the structure itself.
82
+ *
83
+ * `chainId` is the file's own name for the chain, the same one `ResidueRef`
84
+ * reports, and the key every chain-keyed prop takes. A chain carrying several
85
+ * symmetry operators appears once, under the first.
86
+ *
87
+ * Describes the chain's polymer. The ligands and ions sitting on it are drawn
88
+ * and are hidden and selected with it, but are not counted here or spanned by
89
+ * the range below - they are no part of the sequence. A chain holding nothing
90
+ * but heteroatoms is left out altogether, having no sequence to describe.
91
+ */
92
+ interface ChainRef {
93
+ /** Chain as named in the file (`auth_asym_id`), e.g. `"A"`. */
94
+ chainId: string;
95
+ /** Chain as the sequence panel captions it. */
96
+ label: string;
97
+ /** Lowest 0-based residue index of the chain's polymer. */
98
+ startIndex: number;
99
+ /** Highest 0-based residue index of the chain's polymer. */
100
+ endIndex: number;
101
+ /** Polymer residues the chain holds. */
102
+ residueCount: number;
103
+ }
104
+ /**
105
+ * What is selected, in the two ways a caller might say it. `null` selects
106
+ * nothing.
107
+ *
108
+ * The two combine: `{ chains: ["A"], residues: [150] }` takes all of chain A
109
+ * plus one residue elsewhere. `chains` is kept as named rather than expanded
110
+ * into indices, so a whole-chain selection survives a round trip through a
111
+ * consumer's state at its original size.
112
+ */
113
+ interface StructureSelection {
114
+ /**
115
+ * 0-based residue indices, counting residues in file order across the whole
116
+ * structure - the same index `plddt` and `residueOverlay` are keyed by.
117
+ */
118
+ residues?: number[];
119
+ /** Whole chains by `chainId`, each standing for every residue on it. */
120
+ chains?: string[];
121
+ }
122
+ /**
123
+ * How large a downloaded image is, in pixels.
124
+ *
125
+ * Named rather than given as dimensions because the aspect is Mol*'s to
126
+ * choose: each of these is one of its own presets, and a size picked here
127
+ * would have to be reconciled with the canvas the image is rendered from.
128
+ */
129
+ type DownloadResolution = "low" | "medium" | "high" | "maximum";
130
+ /** Pixel dimensions each resolution produces, for documentation and labels. */
131
+ declare const DOWNLOAD_RESOLUTIONS: Record<DownloadResolution, string>;
132
+ /**
133
+ * Turns on the capture button under the reset-camera control, and says what it
134
+ * should produce. Omit it and no button is drawn.
135
+ *
136
+ * The image is rendered fresh at the size asked for rather than scaled up from
137
+ * the canvas, so a high resolution costs time rather than sharpness - which is
138
+ * why the default sits in the middle rather than at the top.
139
+ */
140
+ interface StructureDownload {
141
+ /**
142
+ * Size of the image. See `DOWNLOAD_RESOLUTIONS` for the pixel dimensions.
143
+ * @default "medium"
144
+ */
145
+ resolution?: DownloadResolution;
146
+ /**
147
+ * Background behind the structure, as `#RRGGBB`. Omit for a transparent
148
+ * one, which is what a figure usually wants - the viewer's own canvas color
149
+ * is deliberately not inherited, since a screenshot tends to outlive the
150
+ * theme it was taken under.
151
+ */
152
+ backgroundColor?: string;
153
+ /**
154
+ * Draw the orientation axes into the image. Independent of `showAxes`, which
155
+ * is about the view rather than the capture: the widget orients a reader who
156
+ * can turn the structure, and earns its place less in a still.
157
+ * @default false
158
+ */
159
+ showAxes?: boolean;
160
+ /**
161
+ * Name for the downloaded file, without an extension. Defaults to the one
162
+ * Mol* derives from the loaded structure.
163
+ */
164
+ filename?: string;
165
+ }
166
+ /** A whole-structure statistic shown along the bottom of the viewer. */
167
+ interface StructureStat {
168
+ value: string;
169
+ label: string;
170
+ }
171
+ interface ProteinStructureViewerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
172
+ /** Structure to render, as raw PDB or mmCIF (PDBx) text. */
173
+ structure: string;
174
+ /**
175
+ * Per-residue pLDDT confidence on a 0-1 scale, ordered by residue. When
176
+ * supplied the structure is colored by pLDDT unless `residueOverlay` takes
177
+ * over.
178
+ */
179
+ plddt?: number[] | null;
180
+ /**
181
+ * Canvas background, as `#RRGGBB`. Defaults to the SDS theme's base
182
+ * background, so the canvas follows the surrounding page in both modes.
183
+ */
184
+ backgroundColor?: string;
185
+ /**
186
+ * Sequence panel background, as any CSS color. Defaults to the SDS theme's
187
+ * primary surface, so the panel follows the surrounding page in both modes.
188
+ */
189
+ sequenceViewerBackgroundColor?: string;
190
+ /**
191
+ * Show the orientation axes widget and the reset-camera button.
192
+ * @default true
193
+ */
194
+ showAxes?: boolean;
195
+ /**
196
+ * Adds a capture button beneath the reset-camera control, which downloads a
197
+ * PNG of the structure as it currently stands. Omit for no button.
198
+ */
199
+ download?: StructureDownload | null;
200
+ /**
201
+ * Show the sequence panel pinned along the bottom of the viewer.
202
+ * @default true
203
+ */
204
+ showSequenceViewer?: boolean;
205
+ /**
206
+ * Show the stats and color scale legend overlaid on the viewer.
207
+ * @default true
208
+ */
209
+ showLegend?: boolean;
210
+ /** Per-residue values that override pLDDT coloring while set. */
211
+ residueOverlay?: ResidueValueOverlay | null;
212
+ /**
213
+ * What is selected, or null when nothing is. Controlled: the camera frames
214
+ * whatever the selection covers, and clearing it zooms back out to the
215
+ * default view.
216
+ *
217
+ * Residues are drawn in ball-and-stick over the cartoon; whole chains are
218
+ * left as they are and the chains around them dim, the same as hovering a
219
+ * chain's name.
220
+ */
221
+ selection?: StructureSelection | null;
222
+ /**
223
+ * Chains hidden from the 3D view, by `chainId`. Leave undefined to let the
224
+ * viewer own visibility itself, which is what the chain legend's toggles
225
+ * drive; passing it takes that over, and the toggles then only report.
226
+ */
227
+ hiddenChains?: string[];
228
+ /**
229
+ * Color per chain, by `chainId`, as `#RRGGBB`. Chains left out fall back to
230
+ * the viewer's palette. Only visible while chain coloring is what is on
231
+ * screen, which is when neither `plddt` nor `residueOverlay` is set.
232
+ */
233
+ chainColors?: Record<string, string>;
234
+ /**
235
+ * Show the chain legend, which lists each chain with its color and a
236
+ * visibility toggle. Ignored on a single-chain structure, where there is
237
+ * nothing to tell apart or hide.
238
+ * @default true
239
+ */
240
+ showChainLegend?: boolean;
241
+ /**
242
+ * Stop other chains from dimming in the 3D view while a chain's name is
243
+ * pointed at, in the legend or above its grid in the sequence panel.
244
+ *
245
+ * The dim is on by default, since on a complex it is how a reader finds out
246
+ * which chain is which. Turn it off where the movement is more distracting
247
+ * than the answer is useful - a grid of viewers a pointer crosses on its way
248
+ * somewhere else, or a page driving its own highlighting through `selection`.
249
+ * @default false
250
+ */
251
+ disableChainHighlightOnHover?: boolean;
252
+ /**
253
+ * Mol* plugin spec laid over the viewer's own, which is how the whole of
254
+ * Mol*'s configuration is reachable without a prop here for each setting.
255
+ * Anything named here wins, so `canvas3d.postprocessing`, a `PluginConfig`
256
+ * item, or `layout.initial` can all be set to something other than the
257
+ * default the viewer picked.
258
+ *
259
+ * List-valued keys - `behaviors`, `config`, `actions`, `animations`,
260
+ * `customFormats`, `customParamEditors` - are appended to rather than
261
+ * replaced. For `config` that is what lets an entry override the viewer's,
262
+ * since Mol* reads the list in order. It also means a behavior cannot be
263
+ * taken away: the ones the viewer drops stay dropped, and the ones it keeps
264
+ * cannot be removed from here.
265
+ *
266
+ * Read once, when the plugin is created, except for `canvas3d`, which is
267
+ * re-applied whenever it changes. Creating the plugin throws away the camera,
268
+ * so the rest is deliberately not reactive.
269
+ */
270
+ molstarSpec?: Partial<PluginUISpec>;
271
+ /**
272
+ * Up to three whole-structure stats shown along the bottom. A null entry
273
+ * reserves its column without rendering anything, so the columns never shift
274
+ * as values come and go.
275
+ */
276
+ stats?: (StructureStat | null)[];
277
+ /** Called with the clicked residue. */
278
+ onResidueClick?: (residue: ResidueRef) => void;
279
+ /**
280
+ * Called as the pointer moves over residues, and with `null` when it leaves
281
+ * the structure.
282
+ */
283
+ onResidueHover?: (residue: ResidueRef | null) => void;
284
+ /**
285
+ * Called with the new selection whenever the user makes one - clicking a
286
+ * residue, dragging across the sequence, clicking a chain caption - and with
287
+ * `null` when they click empty space to clear it.
288
+ *
289
+ * A whole-chain selection arrives as `{ chains: [id] }` rather than as every
290
+ * index on it, so echoing it straight back into `selection` costs nothing.
291
+ */
292
+ onSelectionChange?: (selection: StructureSelection | null) => void;
293
+ /**
294
+ * Called with the chains found in the structure, whenever a structure is
295
+ * loaded. Fires with `[]` when the structure holds none.
296
+ */
297
+ onChainsChange?: (chains: ChainRef[]) => void;
298
+ /**
299
+ * Called with the chains now hidden when a visibility toggle is used. Fires
300
+ * whether or not `hiddenChains` is controlled, so a consumer can follow the
301
+ * viewer's own state without owning it.
302
+ */
303
+ onChainVisibilityChange?: (hiddenChains: string[]) => void;
304
+ }
305
+ /**
306
+ * Readout that replaces the whole-structure stats while something is hovered
307
+ * or selected. Covers one residue or many: a drag across the sequence and a
308
+ * whole-chain selection report through this too, as a mean over what they
309
+ * cover.
310
+ */
311
+ interface ResidueReadout {
312
+ /** e.g. "PHE 17", "Chain A", or "24 residues". */
313
+ label: string;
314
+ /**
315
+ * pLDDT on a 0-1 scale, or null when unavailable. The mean across the
316
+ * residues covered when there is more than one, ignoring those without a
317
+ * score.
318
+ */
319
+ plddt: number | null;
320
+ /**
321
+ * Overlay value, or null when the overlay holds none - which is also what a
322
+ * structure paints neutral - or when no overlay is set. The mean across the
323
+ * residues covered when there is more than one, ignoring those the overlay
324
+ * says nothing about.
325
+ */
326
+ value: number | null;
327
+ /**
328
+ * Residues the readout covers, which is what makes the numbers above means
329
+ * rather than readings. 1 for a single residue.
330
+ */
331
+ residueCount: number;
332
+ }
333
+ //#endregion
334
+ //#region src/core/ProteinStructureViewer/utils/structureFormat.d.ts
335
+ /**
336
+ * Structure text formats Mol* can parse from the viewer's `structure` prop.
337
+ *
338
+ * `"mmcif"` covers both mmCIF and PDBx; they are the same text format, and
339
+ * that is the name Mol*'s trajectory parser uses. Binary CIF (`.bcif`) is not
340
+ * accepted: the prop is a string.
341
+ */
342
+ type StructureFormat = "pdb" | "mmcif";
343
+ /**
344
+ * Infers whether `text` is PDB or mmCIF (PDBx).
345
+ *
346
+ * mmCIF documents start with a `data_` block and name their coordinates
347
+ * `_atom_site.`. PDB never does either, so either marker is enough. A leading
348
+ * comment (`# ...`) before `data_` is still mmCIF.
349
+ */
350
+ declare function detectStructureFormat(text: string): StructureFormat;
351
+ //#endregion
352
+ //#region src/core/ProteinStructureViewer/utils/plddt.d.ts
353
+ /**
354
+ * AlphaFold's pLDDT confidence bands. Thresholds are on the 0-1 scale that
355
+ * `plddt` values use, ascending from lowest to highest confidence.
356
+ */
357
+ declare const PLDDT_COLOR_SCALE: ColorScale;
358
+ /**
359
+ * Rewrites a PDB file's B-factor column with pLDDT scores so Mol* can read them
360
+ * off the parsed model. B-factors occupy columns 60-66 of ATOM/HETATM lines;
361
+ * scores arrive on a 0-1 scale and are stored on the conventional 0-100 one.
362
+ * Residues past the end of `plddtValues` fall back to a mid-confidence 50.
363
+ *
364
+ * A residue is identified by chain, sequence number and insertion code. The
365
+ * code has to be part of that: `10` and `10A` are two residues, Mol* counts
366
+ * them as two, and treating them as one here would hand every residue after
367
+ * them its neighbour's score.
368
+ */
369
+ declare function injectPlddtIntoPdb(pdbData: string, plddtValues: number[]): string;
370
+ /**
371
+ * Rewrites an mmCIF (PDBx) file's `_atom_site.B_iso_or_equiv` column with
372
+ * pLDDT scores so Mol* can read them off the parsed model, the same way
373
+ * `injectPlddtIntoPdb` rewrites the PDB B-factor column. Scores arrive on a
374
+ * 0-1 scale and are stored on the conventional 0-100 one. Residues past the
375
+ * end of `plddtValues` fall back to a mid-confidence 50.
376
+ *
377
+ * If the file has no B-factor column, one is appended to the atom-site loop
378
+ * rather than leaving the scores behind.
379
+ */
380
+ declare function injectPlddtIntoMmcif(mmcifData: string, plddtValues: number[]): string;
381
+ /**
382
+ * Rewrites a structure file's B-factors with pLDDT scores. Dispatches to
383
+ * `injectPlddtIntoPdb` or `injectPlddtIntoMmcif` from `format`, or from
384
+ * detecting the format of `data` when `format` is omitted.
385
+ */
386
+ declare function injectPlddt(data: string, plddtValues: number[], format?: StructureFormat): string;
387
+ //#endregion
388
+ //#region src/core/ProteinStructureViewer/index.d.ts
389
+ declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<ProteinStructureViewerProps & import("react").RefAttributes<HTMLDivElement>>>;
390
+ //#endregion
391
+ export { StructureStat as _, injectPlddtIntoPdb as a, ChainRef as c, ProteinStructureViewerProps as d, ResidueReadout as f, StructureSelection as g, StructureDownload as h, injectPlddtIntoMmcif as i, DOWNLOAD_RESOLUTIONS as l, ResidueValueOverlay as m, PLDDT_COLOR_SCALE as n, StructureFormat as o, ResidueRef as p, injectPlddt as r, detectStructureFormat as s, _default as t, DownloadResolution as u };
@@ -0,0 +1,166 @@
1
+ /// <reference types="react" />
2
+ import { HTMLAttributes } from "react";
3
+ import { DiscreteColorGeneratorOptions, TooltipTableContentProps } from "@czi-sds/components";
4
+
5
+ //#region src/core/StackedBarChart/StackedBarChart.types.d.ts
6
+ interface StackedBarChartDataItem {
7
+ /**
8
+ * The segment's label in the legend, and the key the animations track it by.
9
+ * Must be unique within the chart.
10
+ */
11
+ name: string;
12
+ /**
13
+ * The quantity the segment stands for.
14
+ */
15
+ value: number;
16
+ /**
17
+ * Any CSS color. Without it the segment takes a generated palette color,
18
+ * which can shift as categories come and go.
19
+ */
20
+ color?: string;
21
+ /**
22
+ * A unit for this item's counted value, for data that mixes units across
23
+ * categories.
24
+ */
25
+ unit?: string;
26
+ /**
27
+ * Takes the segment and its legend item out of every interaction: no hover,
28
+ * no tooltip, no selection.
29
+ * @default false
30
+ */
31
+ disabled?: boolean;
32
+ /**
33
+ * Content for a TooltipTable shown above the segment on hover. Use it for the
34
+ * breakdown behind the number; a segment without it has no tooltip.
35
+ */
36
+ tooltip?: TooltipTableContentProps;
37
+ }
38
+ interface StackedBarChartProps extends HTMLAttributes<HTMLDivElement> {
39
+ /**
40
+ * A heading above the bar. It is also what makes room for the badge; with no
41
+ * title, no badge is drawn.
42
+ */
43
+ title?: string;
44
+ /**
45
+ * Overrides the badge text, which otherwise counts the data and the selection
46
+ * ("7", or "3 of 7").
47
+ */
48
+ badge?: string;
49
+ /**
50
+ * Removes the badge, leaving the title on its own.
51
+ * @default false
52
+ */
53
+ hideBadge?: boolean;
54
+ /**
55
+ * The segments, in the order they are drawn.
56
+ */
57
+ data: StackedBarChartDataItem[];
58
+ /**
59
+ * Any CSS width; a number is read as pixels. It sets the width of the whole
60
+ * chart, legend included.
61
+ * @default 100%
62
+ */
63
+ width?: number | string;
64
+ /**
65
+ * Height of the bar in pixels. Values below 1 are clamped to 1, so the bar
66
+ * cannot disappear.
67
+ * @default 16
68
+ */
69
+ barHeight?: number;
70
+ /**
71
+ * Draws the legend below the bar. It is the only place segment names appear,
72
+ * and the only part of the chart a keyboard can reach.
73
+ * @default true
74
+ */
75
+ showLegend?: boolean;
76
+ /**
77
+ * Shows each item's value beside its name in the legend.
78
+ * @default true
79
+ */
80
+ showLegendValues?: boolean;
81
+ /**
82
+ * "percentage" shows the segment's share of the bar, rounded. "count" shows
83
+ * the raw value followed by the item's unit, or the chart's unit if the item
84
+ * has none.
85
+ * @default "percentage"
86
+ */
87
+ legendValueFormat?: "percentage" | "count";
88
+ /**
89
+ * Indices into data that are currently selected. The chart is controlled: it
90
+ * draws this and never changes it.
91
+ */
92
+ selectedIndices?: number[];
93
+ /**
94
+ * Called with the next selection when a segment or legend item is clicked.
95
+ * Without it, clicking selects nothing.
96
+ */
97
+ onSelectionChange?: (selectedIndices: number[], selectedData: StackedBarChartDataItem[]) => void;
98
+ /**
99
+ * Called when the pointer enters a segment. The chart already syncs its own
100
+ * hover highlight between bar and legend, so this is for driving something
101
+ * outside it.
102
+ */
103
+ onSegmentMouseEnter?: (item: StackedBarChartDataItem, index: number) => void;
104
+ /**
105
+ * Called when the pointer leaves a segment.
106
+ */
107
+ onSegmentMouseLeave?: (item: StackedBarChartDataItem, index: number) => void;
108
+ /**
109
+ * Called when the pointer enters a legend item.
110
+ */
111
+ onLegendItemMouseEnter?: (item: StackedBarChartDataItem, index: number) => void;
112
+ /**
113
+ * Called when the pointer leaves a legend item.
114
+ */
115
+ onLegendItemMouseLeave?: (item: StackedBarChartDataItem, index: number) => void;
116
+ /**
117
+ * Fires on a segment click, alongside any selection change rather than
118
+ * instead of it.
119
+ */
120
+ onSegmentClick?: (item: StackedBarChartDataItem, index: number) => void;
121
+ /**
122
+ * The same, for a click on a legend item.
123
+ */
124
+ onLegendItemClick?: (item: StackedBarChartDataItem, index: number) => void;
125
+ /**
126
+ * What a selection does to the unselected segments: fade them to 20% opacity,
127
+ * or drop them from the bar and let the rest take the space.
128
+ * @default "dim"
129
+ */
130
+ selectionBehavior?: "dim" | "hide";
131
+ /**
132
+ * Whether the bar shows a breakdown of the data (segments always fill it) or
133
+ * progress towards maxAmount.
134
+ * @default "proportional"
135
+ */
136
+ mode?: "proportional" | "cumulative";
137
+ /**
138
+ * Cumulative mode only. The value the full bar represents. Any difference
139
+ * between it and the sum of the data is drawn as the Remaining segment.
140
+ */
141
+ maxAmount?: number;
142
+ /**
143
+ * Name of the grey gap segment in cumulative mode.
144
+ * @default "Remaining"
145
+ */
146
+ remainingLabel?: string;
147
+ /**
148
+ * A unit for the Remaining segment's value alone.
149
+ */
150
+ remainingUnit?: string;
151
+ /**
152
+ * The unit appended to counted values, for items that do not carry one of
153
+ * their own.
154
+ */
155
+ unit?: string;
156
+ /**
157
+ * Tunes the generated palette (start hue, rotations, lightness range, gamma).
158
+ * Items with their own color are untouched by it.
159
+ */
160
+ colorGeneratorOptions?: DiscreteColorGeneratorOptions;
161
+ }
162
+ //#endregion
163
+ //#region src/core/StackedBarChart/index.d.ts
164
+ declare const StackedBarChart: (props: StackedBarChartProps) => JSX.Element;
165
+ //#endregion
166
+ export { StackedBarChartDataItem as n, StackedBarChartProps as r, StackedBarChart as t };