react-cheminfo 0.15.0 → 0.17.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 (157) hide show
  1. package/README.md +96 -0
  2. package/lib/core.d.ts +1 -0
  3. package/lib/core.d.ts.map +1 -1
  4. package/lib/core.js +1 -0
  5. package/lib/core.js.map +1 -1
  6. package/lib/credits/core/credits.d.ts +17 -0
  7. package/lib/credits/core/credits.d.ts.map +1 -1
  8. package/lib/credits/core/credits.js +20 -0
  9. package/lib/credits/core/credits.js.map +1 -1
  10. package/lib/ecosystem/core/sites.d.ts.map +1 -1
  11. package/lib/ecosystem/core/sites.js +40 -0
  12. package/lib/ecosystem/core/sites.js.map +1 -1
  13. package/lib/ecosystem/core/types.d.ts +1 -1
  14. package/lib/ecosystem/core/types.d.ts.map +1 -1
  15. package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
  16. package/lib/ecosystem/ui/glyphs.js +11 -0
  17. package/lib/ecosystem/ui/glyphs.js.map +1 -1
  18. package/lib/parallel/core/index.d.ts +29 -0
  19. package/lib/parallel/core/index.d.ts.map +1 -0
  20. package/lib/parallel/core/index.js +22 -0
  21. package/lib/parallel/core/index.js.map +1 -0
  22. package/lib/parallel/core/parallelAxes.d.ts +103 -0
  23. package/lib/parallel/core/parallelAxes.d.ts.map +1 -0
  24. package/lib/parallel/core/parallelAxes.js +146 -0
  25. package/lib/parallel/core/parallelAxes.js.map +1 -0
  26. package/lib/parallel/core/parallelBrush.d.ts +100 -0
  27. package/lib/parallel/core/parallelBrush.d.ts.map +1 -0
  28. package/lib/parallel/core/parallelBrush.js +149 -0
  29. package/lib/parallel/core/parallelBrush.js.map +1 -0
  30. package/lib/parallel/core/parallelExtent.d.ts +28 -0
  31. package/lib/parallel/core/parallelExtent.d.ts.map +1 -0
  32. package/lib/parallel/core/parallelExtent.js +47 -0
  33. package/lib/parallel/core/parallelExtent.js.map +1 -0
  34. package/lib/parallel/core/parallelFilter.d.ts +49 -0
  35. package/lib/parallel/core/parallelFilter.d.ts.map +1 -0
  36. package/lib/parallel/core/parallelFilter.js +107 -0
  37. package/lib/parallel/core/parallelFilter.js.map +1 -0
  38. package/lib/parallel/core/parallelHit.d.ts +47 -0
  39. package/lib/parallel/core/parallelHit.d.ts.map +1 -0
  40. package/lib/parallel/core/parallelHit.js +81 -0
  41. package/lib/parallel/core/parallelHit.js.map +1 -0
  42. package/lib/parallel/core/parallelOrder.d.ts +36 -0
  43. package/lib/parallel/core/parallelOrder.d.ts.map +1 -0
  44. package/lib/parallel/core/parallelOrder.js +65 -0
  45. package/lib/parallel/core/parallelOrder.js.map +1 -0
  46. package/lib/parallel/core/parallelPaint.d.ts +108 -0
  47. package/lib/parallel/core/parallelPaint.d.ts.map +1 -0
  48. package/lib/parallel/core/parallelPaint.js +169 -0
  49. package/lib/parallel/core/parallelPaint.js.map +1 -0
  50. package/lib/parallel/core/parallelPalette.d.ts +40 -0
  51. package/lib/parallel/core/parallelPalette.d.ts.map +1 -0
  52. package/lib/parallel/core/parallelPalette.js +81 -0
  53. package/lib/parallel/core/parallelPalette.js.map +1 -0
  54. package/lib/parallel/core/parallelSelection.d.ts +43 -0
  55. package/lib/parallel/core/parallelSelection.d.ts.map +1 -0
  56. package/lib/parallel/core/parallelSelection.js +87 -0
  57. package/lib/parallel/core/parallelSelection.js.map +1 -0
  58. package/lib/parallel/core/parallelTicks.d.ts +34 -0
  59. package/lib/parallel/core/parallelTicks.d.ts.map +1 -0
  60. package/lib/parallel/core/parallelTicks.js +119 -0
  61. package/lib/parallel/core/parallelTicks.js.map +1 -0
  62. package/lib/parallel/core/parallelTypes.d.ts +140 -0
  63. package/lib/parallel/core/parallelTypes.d.ts.map +1 -0
  64. package/lib/parallel/core/parallelTypes.js +29 -0
  65. package/lib/parallel/core/parallelTypes.js.map +1 -0
  66. package/lib/parallel/ui/ParallelAxesLayer.d.ts +28 -0
  67. package/lib/parallel/ui/ParallelAxesLayer.d.ts.map +1 -0
  68. package/lib/parallel/ui/ParallelAxesLayer.js +29 -0
  69. package/lib/parallel/ui/ParallelAxesLayer.js.map +1 -0
  70. package/lib/parallel/ui/ParallelCoordinates.d.ts +21 -0
  71. package/lib/parallel/ui/ParallelCoordinates.d.ts.map +1 -0
  72. package/lib/parallel/ui/ParallelCoordinates.js +114 -0
  73. package/lib/parallel/ui/ParallelCoordinates.js.map +1 -0
  74. package/lib/parallel/ui/ParallelLabels.d.ts +32 -0
  75. package/lib/parallel/ui/ParallelLabels.d.ts.map +1 -0
  76. package/lib/parallel/ui/ParallelLabels.js +37 -0
  77. package/lib/parallel/ui/ParallelLabels.js.map +1 -0
  78. package/lib/parallel/ui/ParallelTooltip.d.ts +26 -0
  79. package/lib/parallel/ui/ParallelTooltip.d.ts.map +1 -0
  80. package/lib/parallel/ui/ParallelTooltip.js +30 -0
  81. package/lib/parallel/ui/ParallelTooltip.js.map +1 -0
  82. package/lib/parallel/ui/index.d.ts +29 -0
  83. package/lib/parallel/ui/index.d.ts.map +1 -0
  84. package/lib/parallel/ui/index.js +20 -0
  85. package/lib/parallel/ui/index.js.map +1 -0
  86. package/lib/parallel/ui/parallelCoordinatesProps.d.ts +203 -0
  87. package/lib/parallel/ui/parallelCoordinatesProps.d.ts.map +1 -0
  88. package/lib/parallel/ui/parallelCoordinatesProps.js +11 -0
  89. package/lib/parallel/ui/parallelCoordinatesProps.js.map +1 -0
  90. package/lib/parallel/ui/parallelGestureModel.d.ts +83 -0
  91. package/lib/parallel/ui/parallelGestureModel.d.ts.map +1 -0
  92. package/lib/parallel/ui/parallelGestureModel.js +110 -0
  93. package/lib/parallel/ui/parallelGestureModel.js.map +1 -0
  94. package/lib/parallel/ui/parallelInk.d.ts +76 -0
  95. package/lib/parallel/ui/parallelInk.d.ts.map +1 -0
  96. package/lib/parallel/ui/parallelInk.js +113 -0
  97. package/lib/parallel/ui/parallelInk.js.map +1 -0
  98. package/lib/parallel/ui/parallelPlotModel.d.ts +55 -0
  99. package/lib/parallel/ui/parallelPlotModel.d.ts.map +1 -0
  100. package/lib/parallel/ui/parallelPlotModel.js +113 -0
  101. package/lib/parallel/ui/parallelPlotModel.js.map +1 -0
  102. package/lib/parallel/ui/parallelStyles.d.ts +106 -0
  103. package/lib/parallel/ui/parallelStyles.d.ts.map +1 -0
  104. package/lib/parallel/ui/parallelStyles.js +153 -0
  105. package/lib/parallel/ui/parallelStyles.js.map +1 -0
  106. package/lib/parallel/ui/useParallelAxisDrag.d.ts +60 -0
  107. package/lib/parallel/ui/useParallelAxisDrag.d.ts.map +1 -0
  108. package/lib/parallel/ui/useParallelAxisDrag.js +96 -0
  109. package/lib/parallel/ui/useParallelAxisDrag.js.map +1 -0
  110. package/lib/parallel/ui/useParallelCanvas.d.ts +49 -0
  111. package/lib/parallel/ui/useParallelCanvas.d.ts.map +1 -0
  112. package/lib/parallel/ui/useParallelCanvas.js +58 -0
  113. package/lib/parallel/ui/useParallelCanvas.js.map +1 -0
  114. package/lib/parallel/ui/useParallelGesture.d.ts +72 -0
  115. package/lib/parallel/ui/useParallelGesture.d.ts.map +1 -0
  116. package/lib/parallel/ui/useParallelGesture.js +164 -0
  117. package/lib/parallel/ui/useParallelGesture.js.map +1 -0
  118. package/lib/structure/ui/useToolbarFloor.d.ts.map +1 -1
  119. package/lib/structure/ui/useToolbarFloor.js +29 -22
  120. package/lib/structure/ui/useToolbarFloor.js.map +1 -1
  121. package/lib/ui.d.ts +1 -0
  122. package/lib/ui.d.ts.map +1 -1
  123. package/lib/ui.js +1 -0
  124. package/lib/ui.js.map +1 -1
  125. package/package.json +1 -1
  126. package/src/core.ts +1 -0
  127. package/src/credits/core/credits.ts +21 -0
  128. package/src/ecosystem/core/sites.ts +40 -0
  129. package/src/ecosystem/core/types.ts +4 -1
  130. package/src/ecosystem/ui/glyphs.tsx +46 -0
  131. package/src/parallel/core/index.ts +96 -0
  132. package/src/parallel/core/parallelAxes.ts +207 -0
  133. package/src/parallel/core/parallelBrush.ts +211 -0
  134. package/src/parallel/core/parallelExtent.ts +56 -0
  135. package/src/parallel/core/parallelFilter.ts +131 -0
  136. package/src/parallel/core/parallelHit.ts +106 -0
  137. package/src/parallel/core/parallelOrder.ts +73 -0
  138. package/src/parallel/core/parallelPaint.ts +242 -0
  139. package/src/parallel/core/parallelPalette.ts +93 -0
  140. package/src/parallel/core/parallelSelection.ts +99 -0
  141. package/src/parallel/core/parallelTicks.ts +168 -0
  142. package/src/parallel/core/parallelTypes.ts +159 -0
  143. package/src/parallel/ui/ParallelAxesLayer.tsx +129 -0
  144. package/src/parallel/ui/ParallelCoordinates.tsx +252 -0
  145. package/src/parallel/ui/ParallelLabels.tsx +77 -0
  146. package/src/parallel/ui/ParallelTooltip.tsx +55 -0
  147. package/src/parallel/ui/index.ts +65 -0
  148. package/src/parallel/ui/parallelCoordinatesProps.ts +217 -0
  149. package/src/parallel/ui/parallelGestureModel.ts +159 -0
  150. package/src/parallel/ui/parallelInk.ts +182 -0
  151. package/src/parallel/ui/parallelPlotModel.ts +130 -0
  152. package/src/parallel/ui/parallelStyles.ts +188 -0
  153. package/src/parallel/ui/useParallelAxisDrag.ts +147 -0
  154. package/src/parallel/ui/useParallelCanvas.ts +104 -0
  155. package/src/parallel/ui/useParallelGesture.ts +260 -0
  156. package/src/structure/ui/useToolbarFloor.ts +27 -22
  157. package/src/ui.ts +1 -0
@@ -0,0 +1,21 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { ParallelCoordinatesProps } from './parallelCoordinatesProps.ts';
3
+ /**
4
+ * One vertical axis per column, one line per row, and a brush on every axis.
5
+ *
6
+ * It is told nothing about what the rows are: a library of molecules, a set of
7
+ * runs and a table of measurements all arrive as one `ArrayLike<number>` per
8
+ * axis, read in place. The lines are painted into a canvas because ten
9
+ * thousand of them are not ten thousand elements; everything the reader points
10
+ * at, brushes or reads is SVG and HTML over the top.
11
+ *
12
+ * The brush reports on release, never while the band is being dragged, so a
13
+ * table filtering on the same intervals re-renders once per gesture. What it
14
+ * keeps is `parallelIncludedMask`, which that table should filter with — two
15
+ * definitions of "kept" is how a figure and the list under it come to disagree.
16
+ * @param props - See {@link ParallelCoordinatesProps}.
17
+ * @returns The figure, or what the caller asked to show in its place when
18
+ * there is nothing to draw.
19
+ */
20
+ export declare function ParallelCoordinates(props: ParallelCoordinatesProps): ReactElement;
21
+ //# sourceMappingURL=ParallelCoordinates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParallelCoordinates.d.ts","sourceRoot":"","sources":["../../../src/parallel/ui/ParallelCoordinates.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAoB1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AA4B9E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,YAAY,CAkLd"}
@@ -0,0 +1,114 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useMemo, useState } from 'react';
3
+ import { OverlayLayer } from "../../overlay/ui/OverlayLayer.js";
4
+ import { joinClassNames } from "../../shared/ui/joinClassNames.js";
5
+ import { PARALLEL_MARGIN, parallelAxisLayouts } from "../core/parallelAxes.js";
6
+ import { parallelIncludedMask } from "../core/parallelFilter.js";
7
+ import { parallelColorSteps, parallelPalette, } from "../core/parallelPalette.js";
8
+ import { ParallelAxesLayer } from "./ParallelAxesLayer.js";
9
+ import { ParallelLabels } from "./ParallelLabels.js";
10
+ import { ParallelTooltip } from "./ParallelTooltip.js";
11
+ import { useParallelInk } from "./parallelInk.js";
12
+ import { parallelColorOf, parallelFigureLabel, parallelHighlightsOf, parallelIsBrushed, parallelRowCount, } from "./parallelPlotModel.js";
13
+ import { PARALLEL_SVG_STYLE, parallelCanvasStyle, parallelDropMarkStyle, parallelFigureStyle, } from "./parallelStyles.js";
14
+ import { useParallelAxisDrag } from "./useParallelAxisDrag.js";
15
+ import { useParallelCanvas } from "./useParallelCanvas.js";
16
+ import { useParallelGesture } from "./useParallelGesture.js";
17
+ /** Height the figure takes when the caller names none. */
18
+ const DEFAULT_HEIGHT = 320;
19
+ /** The smallest drawing area the figure will lay out, in pixels. */
20
+ const SMALLEST_SIDE = 10;
21
+ /** No axis is brushed, shared so an uncontrolled figure never rebuilds it. */
22
+ const NO_RANGES = Object.freeze({});
23
+ /**
24
+ * One vertical axis per column, one line per row, and a brush on every axis.
25
+ *
26
+ * It is told nothing about what the rows are: a library of molecules, a set of
27
+ * runs and a table of measurements all arrive as one `ArrayLike<number>` per
28
+ * axis, read in place. The lines are painted into a canvas because ten
29
+ * thousand of them are not ten thousand elements; everything the reader points
30
+ * at, brushes or reads is SVG and HTML over the top.
31
+ *
32
+ * The brush reports on release, never while the band is being dragged, so a
33
+ * table filtering on the same intervals re-renders once per gesture. What it
34
+ * keeps is `parallelIncludedMask`, which that table should filter with — two
35
+ * definitions of "kept" is how a figure and the list under it come to disagree.
36
+ * @param props - See {@link ParallelCoordinatesProps}.
37
+ * @returns The figure, or what the caller asked to show in its place when
38
+ * there is nothing to draw.
39
+ */
40
+ export function ParallelCoordinates(props) {
41
+ const { axes, width, height = DEFAULT_HEIGHT, empty, overlay } = props;
42
+ const { selected, renderTooltip, renderAxisLabel } = props;
43
+ const { className, testId, ink: inkProp, label: given } = props;
44
+ const { ranges: ownedRanges, defaultRanges, included: givenMask } = props;
45
+ const { color: givenColor, colorAxis, onRangeChange: report } = props;
46
+ const { onRangePreview, hovered, onHoverChange, onRowClick } = props;
47
+ const { several = false, onAxisOrder } = props;
48
+ const count = parallelRowCount(axes, props.count);
49
+ const innerWidth = Math.max(width - PARALLEL_MARGIN.left - PARALLEL_MARGIN.right, SMALLEST_SIDE);
50
+ const innerHeight = Math.max(height - PARALLEL_MARGIN.top - PARALLEL_MARGIN.bottom, SMALLEST_SIDE);
51
+ const [ownRanges, setOwnRanges] = useState(defaultRanges ?? NO_RANGES);
52
+ const ranges = ownedRanges ?? ownRanges;
53
+ const layouts = useMemo(() => parallelAxisLayouts(axes, count, innerWidth, innerHeight), [axes, count, innerWidth, innerHeight]);
54
+ const values = useMemo(() => columnsOf(axes), [axes]);
55
+ const { ink, ref: figure } = useParallelInk(inkProp);
56
+ const color = useMemo(() => parallelColorOf(givenColor, colorAxis, axes), [givenColor, colorAxis, axes]);
57
+ const steps = useMemo(() => (color === undefined ? null : parallelColorSteps(color, count)), [color, count]);
58
+ const palette = useMemo(() => (color === undefined ? [] : parallelPalette(color.scale)), [color]);
59
+ const included = useMemo(() => {
60
+ if (givenMask !== undefined)
61
+ return givenMask;
62
+ if (!parallelIsBrushed(axes, ranges))
63
+ return null;
64
+ return parallelIncludedMask(axes, ranges, count);
65
+ }, [givenMask, axes, ranges, count]);
66
+ function commitRange(axisId, kept) {
67
+ if (ownedRanges === undefined) {
68
+ setOwnRanges((previous) => ({ ...previous, [axisId]: kept }));
69
+ }
70
+ report?.(axisId, kept);
71
+ }
72
+ const gesture = useParallelGesture({
73
+ layouts,
74
+ values,
75
+ count,
76
+ innerHeight,
77
+ included,
78
+ ranges,
79
+ several,
80
+ onRangeChange: commitRange,
81
+ onRangePreview,
82
+ hovered,
83
+ onHoverChange,
84
+ onRowClick,
85
+ });
86
+ const highlights = useMemo(() => parallelHighlightsOf(selected, gesture.hovered, ink.selection, ink.hover), [selected, gesture.hovered, ink.selection, ink.hover]);
87
+ const { lines: lineCanvas, marks: markCanvas } = useParallelCanvas({
88
+ width,
89
+ height,
90
+ layouts,
91
+ values,
92
+ count,
93
+ included,
94
+ steps,
95
+ palette,
96
+ highlights,
97
+ ink,
98
+ });
99
+ const axisDrag = useParallelAxisDrag({ layouts, onAxisOrder });
100
+ const dropAt = axisDrag.active === null ? undefined : layouts[axisDrag.active.to];
101
+ const label = given ?? parallelFigureLabel(axes, count);
102
+ const canvasStyle = parallelCanvasStyle(height);
103
+ const hover = gesture.pointer === null || gesture.hovered < 0
104
+ ? null
105
+ : { index: gesture.hovered, ...gesture.pointer };
106
+ return (_jsxs("div", { ref: figure, className: joinClassNames('parallel-coordinates', className), style: parallelFigureStyle(height), "data-testid": testId, children: [count === 0 || layouts.length === 0 ? (empty) : (_jsxs(_Fragment, { children: [_jsx("canvas", { ref: lineCanvas, className: "parallel-coordinates-canvas", style: canvasStyle }), _jsx("canvas", { ref: markCanvas, className: "parallel-coordinates-canvas", style: canvasStyle }), _jsxs("svg", { width: Math.max(0, width), height: Math.max(0, height), style: PARALLEL_SVG_STYLE, role: "img", "aria-label": label, children: [_jsx(ParallelAxesLayer, { layouts: layouts, innerHeight: innerHeight, bands: gesture.bands, axisInk: ink.axis, bandInk: ink.selection }), _jsx("rect", { x: 0, y: 0, width: Math.max(0, width), height: Math.max(0, height), fill: "transparent", onClick: gesture.onClick, ...gesture.surface }), dropAt === undefined ? null : (_jsx("line", { "data-parallel-drop": dropAt.id, x1: PARALLEL_MARGIN.left + dropAt.x, x2: PARALLEL_MARGIN.left + dropAt.x, y1: PARALLEL_MARGIN.top, y2: PARALLEL_MARGIN.top + innerHeight, style: parallelDropMarkStyle(ink.selection) }))] }), _jsx(ParallelLabels, { axes: axes, layouts: layouts, render: renderAxisLabel, drag: axisDrag }), hover === null || renderTooltip === undefined ? null : (_jsx(ParallelTooltip, { x: hover.x, y: hover.y, boxWidth: width, boxHeight: height, children: renderTooltip(hover) }))] })), overlay === undefined ? null : (_jsx(OverlayLayer, { width: width, busy: gesture.brushing, children: overlay }))] }));
107
+ }
108
+ function columnsOf(axes) {
109
+ const columns = [];
110
+ for (const axis of axes)
111
+ columns.push(axis.values);
112
+ return columns;
113
+ }
114
+ //# sourceMappingURL=ParallelCoordinates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParallelCoordinates.js","sourceRoot":"","sources":["../../../src/parallel/ui/ParallelCoordinates.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,YAAY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+ import type { ParallelAxisLayout } from '../core/parallelAxes.ts';
3
+ import type { ParallelAxis } from '../core/parallelTypes.ts';
4
+ import type { ParallelAxisDrag } from './useParallelAxisDrag.ts';
5
+ /** What {@link ParallelLabels} writes. */
6
+ export interface ParallelLabelsProps {
7
+ /** The axes as the caller described them, for a caller's own renderer. */
8
+ axes: readonly ParallelAxis[];
9
+ /** The same axes, placed, so each name sits over its own axis. */
10
+ layouts: readonly ParallelAxisLayout[];
11
+ /**
12
+ * How a name is written. Left out, it is the label and the unit after it.
13
+ * @default undefined
14
+ */
15
+ render?: ((axis: ParallelAxis, index: number) => ReactNode) | undefined;
16
+ /**
17
+ * The gesture that moves an axis by its name.
18
+ * @default undefined — the axes are fixed
19
+ */
20
+ drag?: ParallelAxisDrag | undefined;
21
+ }
22
+ /**
23
+ * The axis names, as HTML over the figure.
24
+ *
25
+ * HTML rather than SVG text so that a name can carry a tooltip explaining what
26
+ * the axis measures. The layer lets every pointer event through and only the
27
+ * names themselves take it back, so a brush started under a name still starts.
28
+ * @param props - See {@link ParallelLabelsProps}.
29
+ * @returns The names.
30
+ */
31
+ export declare function ParallelLabels(props: ParallelLabelsProps): ReactElement;
32
+ //# sourceMappingURL=ParallelLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParallelLabels.d.ts","sourceRoot":"","sources":["../../../src/parallel/ui/ParallelLabels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC;IAC9B,kEAAkE;IAClE,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACvC;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;IACxE;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAoCvE"}
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PARALLEL_MARGIN } from "../core/parallelAxes.js";
3
+ import { PARALLEL_LABELS_STYLE, parallelLabelStyle } from "./parallelStyles.js";
4
+ /**
5
+ * The axis names, as HTML over the figure.
6
+ *
7
+ * HTML rather than SVG text so that a name can carry a tooltip explaining what
8
+ * the axis measures. The layer lets every pointer event through and only the
9
+ * names themselves take it back, so a brush started under a name still starts.
10
+ * @param props - See {@link ParallelLabelsProps}.
11
+ * @returns The names.
12
+ */
13
+ export function ParallelLabels(props) {
14
+ const { axes, layouts, render, drag } = props;
15
+ const draggable = drag?.enabled ?? false;
16
+ const active = drag?.active ?? null;
17
+ return (_jsx("div", { className: "parallel-coordinates-labels", style: PARALLEL_LABELS_STYLE, children: layouts.map((layout, index) => {
18
+ const axis = axes[index];
19
+ const moving = active !== null && active.from === index;
20
+ return (_jsx("div", { className: "parallel-axis-label", "data-parallel-label": layout.id, style: parallelLabelStyle({
21
+ left: PARALLEL_MARGIN.left + layout.x,
22
+ draggable,
23
+ dx: moving ? active.dx : null,
24
+ }), ...drag?.propsFor(index), ...(draggable
25
+ ? {
26
+ role: 'button',
27
+ 'aria-label': `${layout.label}: move this axis with the left and right arrow keys`,
28
+ }
29
+ : null), children: axis !== undefined && render !== undefined
30
+ ? render(axis, index)
31
+ : defaultLabel(layout) }, layout.id));
32
+ }) }));
33
+ }
34
+ function defaultLabel(layout) {
35
+ return layout.unit === '' ? layout.label : `${layout.label} (${layout.unit})`;
36
+ }
37
+ //# sourceMappingURL=ParallelLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParallelLabels.js","sourceRoot":"","sources":["../../../src/parallel/ui/ParallelLabels.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAqBhF;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAI,EAAE,OAAO,IAAI,KAAK,CAAC;IACzC,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC;IAEpC,OAAO,CACL,cAAK,SAAS,EAAC,6BAA6B,EAAC,KAAK,EAAE,qBAAqB,YACtE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;YACzB,MAAM,MAAM,GAAG,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC;YACxD,OAAO,CACL,cAEE,SAAS,EAAC,qBAAqB,yBACV,MAAM,CAAC,EAAE,EAC9B,KAAK,EAAE,kBAAkB,CAAC;oBACxB,IAAI,EAAE,eAAe,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;oBACrC,SAAS;oBACT,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;iBAC9B,CAAC,KACE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,KACrB,CAAC,SAAS;oBACZ,CAAC,CAAC;wBACE,IAAI,EAAE,QAAQ;wBACd,YAAY,EAAE,GAAG,MAAM,CAAC,KAAK,qDAAqD;qBACnF;oBACH,CAAC,CAAC,IAAI,CAAC,YAER,IAAI,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS;oBACzC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC;oBACrB,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,IAlBnB,MAAM,CAAC,EAAE,CAmBV,CACP,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,MAA0B;IAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC;AAChF,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ /** What {@link ParallelTooltip} shows, and where. */
3
+ export interface ParallelTooltipProps {
4
+ /** Where the pointer is, in pixels from the figure's left edge. */
5
+ x: number;
6
+ /** Where it is, in pixels from its top edge. */
7
+ y: number;
8
+ /** Width of the figure, so the card is flipped rather than clipped. */
9
+ boxWidth: number;
10
+ /** Its height. */
11
+ boxHeight: number;
12
+ /** What the card says, written by the caller. */
13
+ children: ReactNode;
14
+ }
15
+ /**
16
+ * The card over the row under the pointer.
17
+ *
18
+ * It measures itself and flips rather than being clipped, because a card that
19
+ * runs off the bottom right of a figure is exactly where a reader points last
20
+ * — and it never takes the pointer, so moving towards it never dismisses it by
21
+ * moving off the line underneath.
22
+ * @param props - See {@link ParallelTooltipProps}.
23
+ * @returns The card.
24
+ */
25
+ export declare function ParallelTooltip(props: ParallelTooltipProps): ReactElement;
26
+ //# sourceMappingURL=ParallelTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParallelTooltip.d.ts","sourceRoot":"","sources":["../../../src/parallel/ui/ParallelTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQrD,qDAAqD;AACrD,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,CAAC,EAAE,MAAM,CAAC;IACV,gDAAgD;IAChD,CAAC,EAAE,MAAM,CAAC;IACV,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAsBzE"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
3
+ import { useContainerSize } from "../../hooks/ui/useContainerSize.js";
4
+ import { placeOverlayCard } from "../../overlay/core/placeOverlayCard.js";
5
+ import { parallelTooltipStyle } from "./parallelStyles.js";
6
+ /**
7
+ * The card over the row under the pointer.
8
+ *
9
+ * It measures itself and flips rather than being clipped, because a card that
10
+ * runs off the bottom right of a figure is exactly where a reader points last
11
+ * — and it never takes the pointer, so moving towards it never dismisses it by
12
+ * moving off the line underneath.
13
+ * @param props - See {@link ParallelTooltipProps}.
14
+ * @returns The card.
15
+ */
16
+ export function ParallelTooltip(props) {
17
+ const { x, y, boxWidth, boxHeight, children } = props;
18
+ const card = useRef(null);
19
+ const size = useContainerSize(card);
20
+ const placed = placeOverlayCard({
21
+ pointerX: x,
22
+ pointerY: y,
23
+ cardWidth: size.width,
24
+ cardHeight: size.height,
25
+ boxWidth,
26
+ boxHeight,
27
+ });
28
+ return (_jsx("div", { ref: card, className: "parallel-coordinates-tooltip", style: parallelTooltipStyle(placed.left, placed.top), children: children }));
29
+ }
30
+ //# sourceMappingURL=ParallelTooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParallelTooltip.js","sourceRoot":"","sources":["../../../src/parallel/ui/ParallelTooltip.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAgB3D;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACtD,MAAM,IAAI,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,gBAAgB,CAAC;QAC9B,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,IAAI,CAAC,KAAK;QACrB,UAAU,EAAE,IAAI,CAAC,MAAM;QACvB,QAAQ;QACR,SAAS;KACV,CAAC,CAAC;IAEH,OAAO,CACL,cACE,GAAG,EAAE,IAAI,EACT,SAAS,EAAC,8BAA8B,EACxC,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,YAEnD,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * A parallel-coordinates figure the reader can interrogate: brush any axis to
3
+ * keep an interval of it, rest on a line for what is known about that row, and
4
+ * colour every line by whichever column answers the question being asked.
5
+ *
6
+ * Nothing here knows what the rows are. The same figure draws a library of
7
+ * molecules, a set of experimental runs and a table of measurements, which is
8
+ * why it is its own domain rather than part of the first viewer to want one.
9
+ */
10
+ export { ParallelAxesLayer } from './ParallelAxesLayer.tsx';
11
+ export type { ParallelAxesLayerProps } from './ParallelAxesLayer.tsx';
12
+ export { ParallelCoordinates } from './ParallelCoordinates.tsx';
13
+ export type { ParallelCoordinatesProps, ParallelHover, ParallelInk, } from './parallelCoordinatesProps.ts';
14
+ export type { ParallelInkBinding, ParallelInkValues, ParallelTokenInk, } from './parallelInk.ts';
15
+ export { parallelInkFrom, readParallelInk, readParallelTokens, useParallelInk, } from './parallelInk.ts';
16
+ export { ParallelLabels } from './ParallelLabels.tsx';
17
+ export type { ParallelLabelsProps } from './ParallelLabels.tsx';
18
+ export type { ParallelCommit, ParallelDraft } from './parallelGestureModel.ts';
19
+ export { parallelAxisById, parallelAxisNear, parallelBandsOf, parallelCommitOf, parallelPointOf, } from './parallelGestureModel.ts';
20
+ export { parallelColorOf, parallelFigureLabel, parallelHighlightsOf, parallelIsBrushed, parallelRowCount, } from './parallelPlotModel.ts';
21
+ export { ParallelTooltip } from './ParallelTooltip.tsx';
22
+ export type { ParallelTooltipProps } from './ParallelTooltip.tsx';
23
+ export type { ParallelCanvasOptions, ParallelCanvases, } from './useParallelCanvas.ts';
24
+ export { useParallelCanvas } from './useParallelCanvas.ts';
25
+ export type { ParallelAxisDrag, ParallelAxisDragOptions, ParallelAxisDragState, ParallelAxisHandleProps, } from './useParallelAxisDrag.ts';
26
+ export { useParallelAxisDrag } from './useParallelAxisDrag.ts';
27
+ export type { ParallelGesture, ParallelGestureOptions, } from './useParallelGesture.ts';
28
+ export { useParallelGesture } from './useParallelGesture.ts';
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parallel/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EACV,wBAAwB,EACxB,aAAa,EACb,WAAW,GACZ,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,YAAY,EACV,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EACV,eAAe,EACf,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A parallel-coordinates figure the reader can interrogate: brush any axis to
3
+ * keep an interval of it, rest on a line for what is known about that row, and
4
+ * colour every line by whichever column answers the question being asked.
5
+ *
6
+ * Nothing here knows what the rows are. The same figure draws a library of
7
+ * molecules, a set of experimental runs and a table of measurements, which is
8
+ * why it is its own domain rather than part of the first viewer to want one.
9
+ */
10
+ export { ParallelAxesLayer } from "./ParallelAxesLayer.js";
11
+ export { ParallelCoordinates } from "./ParallelCoordinates.js";
12
+ export { parallelInkFrom, readParallelInk, readParallelTokens, useParallelInk, } from "./parallelInk.js";
13
+ export { ParallelLabels } from "./ParallelLabels.js";
14
+ export { parallelAxisById, parallelAxisNear, parallelBandsOf, parallelCommitOf, parallelPointOf, } from "./parallelGestureModel.js";
15
+ export { parallelColorOf, parallelFigureLabel, parallelHighlightsOf, parallelIsBrushed, parallelRowCount, } from "./parallelPlotModel.js";
16
+ export { ParallelTooltip } from "./ParallelTooltip.js";
17
+ export { useParallelCanvas } from "./useParallelCanvas.js";
18
+ export { useParallelAxisDrag } from "./useParallelAxisDrag.js";
19
+ export { useParallelGesture } from "./useParallelGesture.js";
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/parallel/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAWhE,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AAGtD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AAMxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAO3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAK/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,203 @@
1
+ /**
2
+ * What a caller hands a `ParallelCoordinates`.
3
+ *
4
+ * The types the figure is *told* about — an axis, an interval, a colour ramp —
5
+ * live in `parallel/core`, because the same words describe the mask a table
6
+ * beside the figure filters on and the layout the painter reads. What is left
7
+ * here is what only a React component has: the render props, the inks a canvas
8
+ * cannot read off a stylesheet, and the controlled pairs.
9
+ */
10
+ import type { ReactNode } from 'react';
11
+ import type { ParallelAxis, ParallelColorBy, ParallelRange, ParallelRanges } from '../core/parallelTypes.ts';
12
+ /** What the pointer is over, and where. */
13
+ export interface ParallelHover {
14
+ /** The row, as an index into the axes' value arrays. */
15
+ index: number;
16
+ /** Where the pointer is, in pixels from the figure's left edge. */
17
+ x: number;
18
+ /** Where it is, in pixels from its top edge. */
19
+ y: number;
20
+ }
21
+ /** The colours a canvas is painted with, which cannot read a custom property. */
22
+ export interface ParallelInk {
23
+ /**
24
+ * The rows a brush left out, drawn under the rest.
25
+ * @default a light grey the dense mass can only converge on
26
+ */
27
+ excluded?: string;
28
+ /**
29
+ * The rows nothing is colouring, when no quantity was given.
30
+ * @default the value of `--text-muted` on the figure
31
+ */
32
+ line?: string;
33
+ /**
34
+ * The row under the pointer.
35
+ * @default the value of `--text` on the figure
36
+ */
37
+ hover?: string;
38
+ /**
39
+ * The rows singled out elsewhere — picked in a table, pinned by the reader.
40
+ * @default the value of `--accent` on the figure
41
+ */
42
+ selection?: string;
43
+ /**
44
+ * The halo a singled-out line is drawn over, so it reads against the mass.
45
+ * @default the value of `--surface`, at 85%
46
+ */
47
+ halo?: string;
48
+ /**
49
+ * The axis lines, their ticks and their labels.
50
+ * @default the value of `--text-muted`
51
+ */
52
+ axis?: string;
53
+ /**
54
+ * How strongly a kept line is drawn. Turn it down for a dense library.
55
+ * @default 0.35
56
+ */
57
+ includedAlpha?: number;
58
+ }
59
+ /** What `ParallelCoordinates` needs. */
60
+ export interface ParallelCoordinatesProps {
61
+ /** The axes, from left to right. Fewer than two draws no lines. */
62
+ axes: readonly ParallelAxis[];
63
+ /**
64
+ * How many rows to draw.
65
+ * @default the shortest axis's value count
66
+ */
67
+ count?: number;
68
+ /** Total width, in pixels, normally from `useContainerSize`. */
69
+ width: number;
70
+ /**
71
+ * Total height, axis names and tick labels included.
72
+ * @default 320
73
+ */
74
+ height?: number;
75
+ /**
76
+ * What each axis keeps, keyed by axis id: one interval, several, or `null`.
77
+ * Present, the caller owns the brushes — which is what lets a table beside
78
+ * the figure filter on the same ranges. The band being dragged stays inside
79
+ * the component either way, so a controlled parent is never asked to
80
+ * re-render sixty times a second.
81
+ * @default undefined — the figure keeps its own
82
+ */
83
+ ranges?: ParallelRanges;
84
+ /**
85
+ * The intervals in force before the reader touches anything.
86
+ * @default undefined — no axis is brushed
87
+ */
88
+ defaultRanges?: ParallelRanges;
89
+ /**
90
+ * Whether one axis may keep several intervals at once — the light molecules
91
+ * and the heavy ones, with nothing in between. A reader brushes a second
92
+ * interval by dragging on a bare part of an axis that already carries one,
93
+ * and takes one away by clicking it.
94
+ * @default false — a new brush replaces the one the axis carried
95
+ */
96
+ several?: boolean;
97
+ /**
98
+ * Called when a brush is released, with every interval that axis now keeps —
99
+ * empty when the reader cleared it, and never while a band is being dragged.
100
+ * @default undefined
101
+ */
102
+ onRangeChange?: (axisId: string, ranges: readonly ParallelRange[]) => void;
103
+ /**
104
+ * Called on every frame a band grows, for a caption saying what letting go
105
+ * would keep. Nothing else should be wired to it.
106
+ * @default undefined
107
+ */
108
+ onRangePreview?: (axisId: string, ranges: readonly ParallelRange[]) => void;
109
+ /**
110
+ * Which rows the brushes keep, one entry per row, a zero meaning excluded.
111
+ * Left out, it is worked out from the ranges with `parallelIncludedMask`,
112
+ * which is exported so a table beside the figure filters on the same answer
113
+ * rather than on a second definition of "kept".
114
+ * @default undefined — worked out from the ranges
115
+ */
116
+ included?: Uint8Array;
117
+ /**
118
+ * The row under the pointer, or `-1`. Present, the caller owns it, which is
119
+ * what lets a table hovered elsewhere light up its line here.
120
+ * @default undefined — the figure keeps its own
121
+ */
122
+ hovered?: number;
123
+ /**
124
+ * Called with the row under the pointer, or `-1`, whenever that changes.
125
+ * @default undefined
126
+ */
127
+ onHoverChange?: (index: number) => void;
128
+ /**
129
+ * The rows singled out elsewhere, drawn over the mass in the selection ink.
130
+ * A row that is also the hovered one is drawn once, in the hover ink.
131
+ * @default undefined — nothing is singled out
132
+ */
133
+ selected?: readonly number[];
134
+ /**
135
+ * Called when a line is clicked, with the row, or `-1` for empty ground.
136
+ * @default undefined — the lines are not clickable
137
+ */
138
+ onRowClick?: (index: number) => void;
139
+ /**
140
+ * The quantity the lines are coloured by.
141
+ * @default undefined — every line takes one ink
142
+ */
143
+ color?: ParallelColorBy;
144
+ /**
145
+ * The id of the axis the lines are coloured by, for the common case where it
146
+ * is one of the axes already drawn. Ignored when `color` is given.
147
+ * @default undefined
148
+ */
149
+ colorAxis?: string;
150
+ /**
151
+ * The canvas colours, merged over the ones read off the figure's own tokens.
152
+ * @default {}
153
+ */
154
+ ink?: ParallelInk;
155
+ /**
156
+ * The card shown over the row under the pointer. It is placed by the figure,
157
+ * flipped rather than clipped at either edge, so a caller writes only what
158
+ * it says.
159
+ * @default undefined — no card is shown
160
+ */
161
+ renderTooltip?: (hover: ParallelHover) => ReactNode;
162
+ /**
163
+ * How an axis is named. The default writes the label and its unit; a caller
164
+ * wraps it to hang a help tooltip off the name.
165
+ * @default the axis label, and its unit after it
166
+ */
167
+ renderAxisLabel?: (axis: ParallelAxis, index: number) => ReactNode;
168
+ /**
169
+ * Called with the axis ids in the order the reader dragged them into.
170
+ * Present, every axis name becomes a handle: drag it, or focus it and press
171
+ * the left and right arrow keys. Two columns only show their relationship
172
+ * when they stand next to each other, so this is how a reader asks a
173
+ * different question of the same figure.
174
+ * @default undefined — the axes stand in the order the caller gave them
175
+ */
176
+ onAxisOrder?: (ids: readonly string[]) => void;
177
+ /**
178
+ * What is shown in place of the figure when there is nothing to draw.
179
+ * @default undefined — an empty figure of the given height
180
+ */
181
+ empty?: ReactNode;
182
+ /**
183
+ * What floats over the figure — a legend, a colour scale key, a caption.
184
+ * @default undefined
185
+ */
186
+ overlay?: ReactNode;
187
+ /**
188
+ * What a screen reader is told the figure shows.
189
+ * @default a sentence naming the axes and the row count
190
+ */
191
+ label?: string;
192
+ /**
193
+ * A class for the figure's outermost element, for a site placing it.
194
+ * @default undefined
195
+ */
196
+ className?: string;
197
+ /**
198
+ * Value of the `data-testid` attribute of the wrapper.
199
+ * @default undefined
200
+ */
201
+ testId?: string;
202
+ }
203
+ //# sourceMappingURL=parallelCoordinatesProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelCoordinatesProps.d.ts","sourceRoot":"","sources":["../../../src/parallel/ui/parallelCoordinatesProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,0BAA0B,CAAC;AAElC,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,CAAC,EAAE,MAAM,CAAC;IACV,gDAAgD;IAChD,CAAC,EAAE,MAAM,CAAC;CACX;AAED,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE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;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,CAAC;IACpD;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IACnE;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * What a caller hands a `ParallelCoordinates`.
3
+ *
4
+ * The types the figure is *told* about — an axis, an interval, a colour ramp —
5
+ * live in `parallel/core`, because the same words describe the mask a table
6
+ * beside the figure filters on and the layout the painter reads. What is left
7
+ * here is what only a React component has: the render props, the inks a canvas
8
+ * cannot read off a stylesheet, and the controlled pairs.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=parallelCoordinatesProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelCoordinatesProps.js","sourceRoot":"","sources":["../../../src/parallel/ui/parallelCoordinatesProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}