react-cheminfo 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +175 -21
- package/lib/about/core/about.d.ts +13 -7
- package/lib/about/core/about.d.ts.map +1 -1
- package/lib/about/core/about.js +4 -2
- package/lib/about/core/about.js.map +1 -1
- package/lib/about/ui/AboutBuild.d.ts +20 -0
- package/lib/about/ui/AboutBuild.d.ts.map +1 -0
- package/lib/about/ui/AboutBuild.js +38 -0
- package/lib/about/ui/AboutBuild.js.map +1 -0
- package/lib/about/ui/AboutPage.d.ts +7 -0
- package/lib/about/ui/AboutPage.d.ts.map +1 -1
- package/lib/about/ui/AboutPage.js +5 -2
- package/lib/about/ui/AboutPage.js.map +1 -1
- package/lib/about/ui/index.d.ts +2 -0
- package/lib/about/ui/index.d.ts.map +1 -1
- package/lib/about/ui/index.js +1 -0
- package/lib/about/ui/index.js.map +1 -1
- package/lib/build/core/buildInfo.d.ts +39 -0
- package/lib/build/core/buildInfo.d.ts.map +1 -0
- package/lib/build/core/buildInfo.js +20 -0
- package/lib/build/core/buildInfo.js.map +1 -0
- package/lib/build/core/current.d.ts +12 -0
- package/lib/build/core/current.d.ts.map +1 -0
- package/lib/build/core/current.js +11 -0
- package/lib/build/core/current.js.map +1 -0
- package/lib/build/core/index.d.ts +3 -0
- package/lib/build/core/index.d.ts.map +1 -0
- package/lib/build/core/index.js +2 -0
- package/lib/build/core/index.js.map +1 -0
- package/lib/build/vite/buildInfo.d.ts +57 -0
- package/lib/build/vite/buildInfo.d.ts.map +1 -0
- package/lib/build/vite/buildInfo.js +151 -0
- package/lib/build/vite/buildInfo.js.map +1 -0
- package/lib/build/vite/gitHead.d.ts +29 -0
- package/lib/build/vite/gitHead.d.ts.map +1 -0
- package/lib/build/vite/gitHead.js +102 -0
- package/lib/build/vite/gitHead.js.map +1 -0
- package/lib/build/vite/index.d.ts +4 -0
- package/lib/build/vite/index.d.ts.map +1 -0
- package/lib/build/vite/index.js +3 -0
- package/lib/build/vite/index.js.map +1 -0
- package/lib/build-info.d.ts +3 -0
- package/lib/build-info.d.ts.map +1 -0
- package/lib/build-info.js +2 -0
- package/lib/build-info.js.map +1 -0
- package/lib/core.d.ts +2 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +2 -0
- package/lib/core.js.map +1 -1
- package/lib/credits/core/credits.d.ts +35 -0
- package/lib/credits/core/credits.d.ts.map +1 -1
- package/lib/credits/core/credits.js +41 -0
- package/lib/credits/core/credits.js.map +1 -1
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +40 -0
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/core/types.d.ts +1 -1
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/ecosystem/ui/Wordmark.d.ts +14 -3
- package/lib/ecosystem/ui/Wordmark.d.ts.map +1 -1
- package/lib/ecosystem/ui/Wordmark.js +8 -4
- package/lib/ecosystem/ui/Wordmark.js.map +1 -1
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +11 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -1
- package/lib/parallel/core/index.d.ts +27 -0
- package/lib/parallel/core/index.d.ts.map +1 -0
- package/lib/parallel/core/index.js +20 -0
- package/lib/parallel/core/index.js.map +1 -0
- package/lib/parallel/core/parallelAxes.d.ts +103 -0
- package/lib/parallel/core/parallelAxes.d.ts.map +1 -0
- package/lib/parallel/core/parallelAxes.js +146 -0
- package/lib/parallel/core/parallelAxes.js.map +1 -0
- package/lib/parallel/core/parallelBrush.d.ts +79 -0
- package/lib/parallel/core/parallelBrush.d.ts.map +1 -0
- package/lib/parallel/core/parallelBrush.js +99 -0
- package/lib/parallel/core/parallelBrush.js.map +1 -0
- package/lib/parallel/core/parallelExtent.d.ts +28 -0
- package/lib/parallel/core/parallelExtent.d.ts.map +1 -0
- package/lib/parallel/core/parallelExtent.js +47 -0
- package/lib/parallel/core/parallelExtent.js.map +1 -0
- package/lib/parallel/core/parallelFilter.d.ts +36 -0
- package/lib/parallel/core/parallelFilter.d.ts.map +1 -0
- package/lib/parallel/core/parallelFilter.js +74 -0
- package/lib/parallel/core/parallelFilter.js.map +1 -0
- package/lib/parallel/core/parallelHit.d.ts +47 -0
- package/lib/parallel/core/parallelHit.d.ts.map +1 -0
- package/lib/parallel/core/parallelHit.js +81 -0
- package/lib/parallel/core/parallelHit.js.map +1 -0
- package/lib/parallel/core/parallelPaint.d.ts +104 -0
- package/lib/parallel/core/parallelPaint.d.ts.map +1 -0
- package/lib/parallel/core/parallelPaint.js +160 -0
- package/lib/parallel/core/parallelPaint.js.map +1 -0
- package/lib/parallel/core/parallelPalette.d.ts +31 -0
- package/lib/parallel/core/parallelPalette.d.ts.map +1 -0
- package/lib/parallel/core/parallelPalette.js +68 -0
- package/lib/parallel/core/parallelPalette.js.map +1 -0
- package/lib/parallel/core/parallelTicks.d.ts +34 -0
- package/lib/parallel/core/parallelTicks.d.ts.map +1 -0
- package/lib/parallel/core/parallelTicks.js +116 -0
- package/lib/parallel/core/parallelTicks.js.map +1 -0
- package/lib/parallel/core/parallelTypes.d.ts +129 -0
- package/lib/parallel/core/parallelTypes.d.ts.map +1 -0
- package/lib/parallel/core/parallelTypes.js +29 -0
- package/lib/parallel/core/parallelTypes.js.map +1 -0
- package/lib/parallel/ui/ParallelAxesLayer.d.ts +28 -0
- package/lib/parallel/ui/ParallelAxesLayer.d.ts.map +1 -0
- package/lib/parallel/ui/ParallelAxesLayer.js +29 -0
- package/lib/parallel/ui/ParallelAxesLayer.js.map +1 -0
- package/lib/parallel/ui/ParallelCoordinates.d.ts +21 -0
- package/lib/parallel/ui/ParallelCoordinates.d.ts.map +1 -0
- package/lib/parallel/ui/ParallelCoordinates.js +109 -0
- package/lib/parallel/ui/ParallelCoordinates.js.map +1 -0
- package/lib/parallel/ui/ParallelLabels.d.ts +26 -0
- package/lib/parallel/ui/ParallelLabels.d.ts.map +1 -0
- package/lib/parallel/ui/ParallelLabels.js +25 -0
- package/lib/parallel/ui/ParallelLabels.js.map +1 -0
- package/lib/parallel/ui/ParallelTooltip.d.ts +26 -0
- package/lib/parallel/ui/ParallelTooltip.d.ts.map +1 -0
- package/lib/parallel/ui/ParallelTooltip.js +30 -0
- package/lib/parallel/ui/ParallelTooltip.js.map +1 -0
- package/lib/parallel/ui/index.d.ts +25 -0
- package/lib/parallel/ui/index.d.ts.map +1 -0
- package/lib/parallel/ui/index.js +18 -0
- package/lib/parallel/ui/index.js.map +1 -0
- package/lib/parallel/ui/parallelCoordinatesProps.d.ts +185 -0
- package/lib/parallel/ui/parallelCoordinatesProps.d.ts.map +1 -0
- package/lib/parallel/ui/parallelCoordinatesProps.js +11 -0
- package/lib/parallel/ui/parallelCoordinatesProps.js.map +1 -0
- package/lib/parallel/ui/parallelGestureModel.d.ts +52 -0
- package/lib/parallel/ui/parallelGestureModel.d.ts.map +1 -0
- package/lib/parallel/ui/parallelGestureModel.js +80 -0
- package/lib/parallel/ui/parallelGestureModel.js.map +1 -0
- package/lib/parallel/ui/parallelInk.d.ts +76 -0
- package/lib/parallel/ui/parallelInk.d.ts.map +1 -0
- package/lib/parallel/ui/parallelInk.js +113 -0
- package/lib/parallel/ui/parallelInk.js.map +1 -0
- package/lib/parallel/ui/parallelPlotModel.d.ts +55 -0
- package/lib/parallel/ui/parallelPlotModel.d.ts.map +1 -0
- package/lib/parallel/ui/parallelPlotModel.js +113 -0
- package/lib/parallel/ui/parallelPlotModel.js.map +1 -0
- package/lib/parallel/ui/parallelStyles.d.ts +83 -0
- package/lib/parallel/ui/parallelStyles.d.ts.map +1 -0
- package/lib/parallel/ui/parallelStyles.js +131 -0
- package/lib/parallel/ui/parallelStyles.js.map +1 -0
- package/lib/parallel/ui/useParallelCanvas.d.ts +49 -0
- package/lib/parallel/ui/useParallelCanvas.d.ts.map +1 -0
- package/lib/parallel/ui/useParallelCanvas.js +58 -0
- package/lib/parallel/ui/useParallelCanvas.js.map +1 -0
- package/lib/parallel/ui/useParallelGesture.d.ts +67 -0
- package/lib/parallel/ui/useParallelGesture.d.ts.map +1 -0
- package/lib/parallel/ui/useParallelGesture.js +139 -0
- package/lib/parallel/ui/useParallelGesture.js.map +1 -0
- package/lib/structure/ui/useToolbarFloor.d.ts.map +1 -1
- package/lib/structure/ui/useToolbarFloor.js +29 -22
- package/lib/structure/ui/useToolbarFloor.js.map +1 -1
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/lib/vite.d.ts +1 -0
- package/lib/vite.d.ts.map +1 -1
- package/lib/vite.js +1 -0
- package/lib/vite.js.map +1 -1
- package/package.json +2 -1
- package/src/about/core/about.ts +18 -9
- package/src/about/ui/AboutBuild.tsx +83 -0
- package/src/about/ui/AboutPage.tsx +15 -7
- package/src/about/ui/index.ts +2 -0
- package/src/build/core/buildInfo.ts +48 -0
- package/src/build/core/current.ts +12 -0
- package/src/build/core/index.ts +2 -0
- package/src/build/vite/buildInfo.ts +178 -0
- package/src/build/vite/gitHead.ts +114 -0
- package/src/build/vite/index.ts +8 -0
- package/src/build-info.ts +2 -0
- package/src/core.ts +2 -0
- package/src/credits/core/credits.ts +42 -0
- package/src/ecosystem/core/sites.ts +40 -0
- package/src/ecosystem/core/types.ts +4 -1
- package/src/ecosystem/ui/Wordmark.tsx +22 -7
- package/src/ecosystem/ui/glyphs.tsx +46 -0
- package/src/parallel/core/index.ts +80 -0
- package/src/parallel/core/parallelAxes.ts +207 -0
- package/src/parallel/core/parallelBrush.ts +145 -0
- package/src/parallel/core/parallelExtent.ts +56 -0
- package/src/parallel/core/parallelFilter.ts +94 -0
- package/src/parallel/core/parallelHit.ts +106 -0
- package/src/parallel/core/parallelPaint.ts +231 -0
- package/src/parallel/core/parallelPalette.ts +80 -0
- package/src/parallel/core/parallelTicks.ts +164 -0
- package/src/parallel/core/parallelTypes.ts +147 -0
- package/src/parallel/ui/ParallelAxesLayer.tsx +123 -0
- package/src/parallel/ui/ParallelCoordinates.tsx +233 -0
- package/src/parallel/ui/ParallelLabels.tsx +56 -0
- package/src/parallel/ui/ParallelTooltip.tsx +55 -0
- package/src/parallel/ui/index.ts +50 -0
- package/src/parallel/ui/parallelCoordinatesProps.ts +199 -0
- package/src/parallel/ui/parallelGestureModel.ts +109 -0
- package/src/parallel/ui/parallelInk.ts +182 -0
- package/src/parallel/ui/parallelPlotModel.ts +130 -0
- package/src/parallel/ui/parallelStyles.ts +146 -0
- package/src/parallel/ui/useParallelCanvas.ts +104 -0
- package/src/parallel/ui/useParallelGesture.ts +227 -0
- package/src/structure/ui/useToolbarFloor.ts +27 -22
- package/src/ui.ts +1 -0
- package/src/vite.ts +1 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every rule the figure is drawn with.
|
|
3
|
+
*
|
|
4
|
+
* The library ships no stylesheet for a figure — a chart writes inline style
|
|
5
|
+
* objects, so a site that never renders one pays nothing and a site that does
|
|
6
|
+
* cannot forget to import a file. The two colours that are not fixed here, the
|
|
7
|
+
* axis ink and the band's, are resolved off the page by `parallelInk.ts` and
|
|
8
|
+
* written onto the elements, so an override applies to the canvas and to the
|
|
9
|
+
* markup alike.
|
|
10
|
+
*/
|
|
11
|
+
import { TOKEN } from "../../tokens/core/familyTokens.js";
|
|
12
|
+
/** A layer covering the whole figure, stacked over the ones before it. */
|
|
13
|
+
export const PARALLEL_LAYER_STYLE = {
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
inset: 0,
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The block the figure occupies, which every layer is positioned against.
|
|
19
|
+
* @param height - Total height of the figure, in pixels.
|
|
20
|
+
* @returns The wrapper's rules.
|
|
21
|
+
*/
|
|
22
|
+
export function parallelFigureStyle(height) {
|
|
23
|
+
return {
|
|
24
|
+
position: 'relative',
|
|
25
|
+
height: Math.max(0, height),
|
|
26
|
+
minWidth: 0,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* One of the two canvases, stretched over the figure.
|
|
31
|
+
* @param height - Total height of the figure, in pixels.
|
|
32
|
+
* @returns The canvas's rules.
|
|
33
|
+
*/
|
|
34
|
+
export function parallelCanvasStyle(height) {
|
|
35
|
+
return {
|
|
36
|
+
...PARALLEL_LAYER_STYLE,
|
|
37
|
+
width: '100%',
|
|
38
|
+
height: Math.max(0, height),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** The drawing surface the axes, the bands and the pointer target live in. */
|
|
42
|
+
export const PARALLEL_SVG_STYLE = {
|
|
43
|
+
...PARALLEL_LAYER_STYLE,
|
|
44
|
+
display: 'block',
|
|
45
|
+
overflow: 'visible',
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The layer the axis names sit in. It is HTML rather than SVG text so that a
|
|
49
|
+
* name can carry a tooltip, and it lets every pointer event through so that a
|
|
50
|
+
* brush started under a name still starts.
|
|
51
|
+
*/
|
|
52
|
+
export const PARALLEL_LABELS_STYLE = {
|
|
53
|
+
...PARALLEL_LAYER_STYLE,
|
|
54
|
+
pointerEvents: 'none',
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* One axis name, centred over its axis and taking the pointer back.
|
|
58
|
+
* @param left - Where the axis stands, in pixels from the figure's left edge.
|
|
59
|
+
* @returns The name's rules.
|
|
60
|
+
*/
|
|
61
|
+
export function parallelLabelStyle(left) {
|
|
62
|
+
return {
|
|
63
|
+
position: 'absolute',
|
|
64
|
+
top: 2,
|
|
65
|
+
left,
|
|
66
|
+
transform: 'translateX(-50%)',
|
|
67
|
+
color: TOKEN.text,
|
|
68
|
+
fontSize: 11,
|
|
69
|
+
fontWeight: 600,
|
|
70
|
+
whiteSpace: 'nowrap',
|
|
71
|
+
pointerEvents: 'auto',
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** One tick written out, tabular so a column of them lines up on the point. */
|
|
75
|
+
export const PARALLEL_TICK_LABEL_STYLE = {
|
|
76
|
+
fontSize: 10,
|
|
77
|
+
fontVariantNumeric: 'tabular-nums',
|
|
78
|
+
userSelect: 'none',
|
|
79
|
+
};
|
|
80
|
+
/** How far a tick mark reaches out of the axis, in pixels. */
|
|
81
|
+
export const PARALLEL_TICK_LENGTH = 4;
|
|
82
|
+
/** How far a tick label ends before its axis. */
|
|
83
|
+
export const PARALLEL_TICK_LABEL_INSET = 7;
|
|
84
|
+
/**
|
|
85
|
+
* The interval one brush keeps, filled in the site's own colour.
|
|
86
|
+
* @param ink - The colour to fill and outline it in.
|
|
87
|
+
* @returns The band's rules.
|
|
88
|
+
*/
|
|
89
|
+
export function parallelBandStyle(ink) {
|
|
90
|
+
return {
|
|
91
|
+
fill: ink,
|
|
92
|
+
fillOpacity: 0.16,
|
|
93
|
+
stroke: ink,
|
|
94
|
+
strokeOpacity: 0.55,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Either edge of a band, drawn so the reader can see it can be dragged.
|
|
99
|
+
* @param ink - The colour to draw it in.
|
|
100
|
+
* @returns The handle's rules.
|
|
101
|
+
*/
|
|
102
|
+
export function parallelHandleStyle(ink) {
|
|
103
|
+
return { fill: ink, fillOpacity: 0.9 };
|
|
104
|
+
}
|
|
105
|
+
/** How tall an edge handle is drawn, in pixels. */
|
|
106
|
+
export const PARALLEL_HANDLE_HEIGHT = 3;
|
|
107
|
+
/**
|
|
108
|
+
* The card over the row under the pointer.
|
|
109
|
+
* @param left - Where it sits, in pixels from the figure's left edge.
|
|
110
|
+
* @param top - Where it sits, in pixels from its top edge.
|
|
111
|
+
* @returns The card's rules.
|
|
112
|
+
*/
|
|
113
|
+
export function parallelTooltipStyle(left, top) {
|
|
114
|
+
return {
|
|
115
|
+
position: 'absolute',
|
|
116
|
+
zIndex: 5,
|
|
117
|
+
left,
|
|
118
|
+
top,
|
|
119
|
+
padding: '4px 8px',
|
|
120
|
+
borderRadius: 6,
|
|
121
|
+
background: TOKEN.text,
|
|
122
|
+
color: TOKEN.surface,
|
|
123
|
+
fontSize: 11,
|
|
124
|
+
fontVariantNumeric: 'tabular-nums',
|
|
125
|
+
lineHeight: 1.4,
|
|
126
|
+
pointerEvents: 'none',
|
|
127
|
+
whiteSpace: 'nowrap',
|
|
128
|
+
boxShadow: TOKEN.shadowMedium,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=parallelStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelStyles.js","sourceRoot":"","sources":["../../../src/parallel/ui/parallelStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAE1D,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,CAAC;CACwB,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,OAAO;QACL,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC;QAC3B,QAAQ,EAAE,CAAC;KACZ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,OAAO;QACL,GAAG,oBAAoB;QACvB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,GAAG,oBAAoB;IACvB,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,SAAS;CACa,CAAC;AAEnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,GAAG,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,CAAC,IAAI;QACtB,KAAK,EAAE,KAAK,CAAC,OAAO;QACpB,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,cAAc;QAClC,UAAU,EAAE,GAAG;QACf,aAAa,EAAE,MAAM;QACrB,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,KAAK,CAAC,YAAY;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two canvases, and when they are repainted.
|
|
3
|
+
*
|
|
4
|
+
* Two rather than one, because the mass of lines changes when the data or the
|
|
5
|
+
* brushes do, while the row under the pointer changes on every frame the
|
|
6
|
+
* pointer moves. Repainting ten thousand lines to move one highlight is the
|
|
7
|
+
* difference between a figure that follows the pointer and one that lags it.
|
|
8
|
+
*/
|
|
9
|
+
import type { RefObject } from 'react';
|
|
10
|
+
import type { ParallelAxisLayout } from '../core/parallelAxes.ts';
|
|
11
|
+
import type { ParallelHighlight } from '../core/parallelPaint.ts';
|
|
12
|
+
import type { ParallelInkValues } from './parallelInk.ts';
|
|
13
|
+
/** What {@link useParallelCanvas} needs. */
|
|
14
|
+
export interface ParallelCanvasOptions {
|
|
15
|
+
/** Total width of the figure, in CSS pixels. */
|
|
16
|
+
width: number;
|
|
17
|
+
/** Its total height. */
|
|
18
|
+
height: number;
|
|
19
|
+
/** The axes, from left to right. */
|
|
20
|
+
layouts: readonly ParallelAxisLayout[];
|
|
21
|
+
/** Each axis's column, in the same order. */
|
|
22
|
+
values: ReadonlyArray<ArrayLike<number>>;
|
|
23
|
+
/** How many rows are drawn. */
|
|
24
|
+
count: number;
|
|
25
|
+
/** Which rows the brushes keep, or `null` when they keep every one. */
|
|
26
|
+
included: Uint8Array | null;
|
|
27
|
+
/** Which colour each row takes, or `null` when nothing is colouring them. */
|
|
28
|
+
steps: Uint8Array | null;
|
|
29
|
+
/** The colours a step indexes. */
|
|
30
|
+
palette: readonly string[];
|
|
31
|
+
/** The rows drawn over the mass, the last one on top. */
|
|
32
|
+
highlights: readonly ParallelHighlight[];
|
|
33
|
+
/** The colours to paint with. */
|
|
34
|
+
ink: ParallelInkValues;
|
|
35
|
+
}
|
|
36
|
+
/** The two canvases a figure stacks. */
|
|
37
|
+
export interface ParallelCanvases {
|
|
38
|
+
/** The mass of lines, underneath. */
|
|
39
|
+
lines: RefObject<HTMLCanvasElement | null>;
|
|
40
|
+
/** The singled-out rows, over them. */
|
|
41
|
+
marks: RefObject<HTMLCanvasElement | null>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Keep both canvases sized to the device pixel grid and painted.
|
|
45
|
+
* @param options - See {@link ParallelCanvasOptions}.
|
|
46
|
+
* @returns The two refs to hand to the `<canvas>` elements.
|
|
47
|
+
*/
|
|
48
|
+
export declare function useParallelCanvas(options: ParallelCanvasOptions): ParallelCanvases;
|
|
49
|
+
//# sourceMappingURL=useParallelCanvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useParallelCanvas.d.ts","sourceRoot":"","sources":["../../../src/parallel/ui/useParallelCanvas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAOlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,4CAA4C;AAC5C,MAAM,WAAW,qBAAqB;IACpC,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACvC,6CAA6C;IAC7C,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAC;IAC5B,6EAA6E;IAC7E,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,kCAAkC;IAClC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,yDAAyD;IACzD,UAAU,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACzC,iCAAiC;IACjC,GAAG,EAAE,iBAAiB,CAAC;CACxB;AAED,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,KAAK,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC3C,uCAAuC;IACvC,KAAK,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAC5C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,qBAAqB,GAC7B,gBAAgB,CA0ClB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two canvases, and when they are repainted.
|
|
3
|
+
*
|
|
4
|
+
* Two rather than one, because the mass of lines changes when the data or the
|
|
5
|
+
* brushes do, while the row under the pointer changes on every frame the
|
|
6
|
+
* pointer moves. Repainting ten thousand lines to move one highlight is the
|
|
7
|
+
* difference between a figure that follows the pointer and one that lags it.
|
|
8
|
+
*/
|
|
9
|
+
import { useEffect, useRef } from 'react';
|
|
10
|
+
import { paintParallelHighlights, paintParallelLines, preparePlotCanvas, } from "../core/parallelPaint.js";
|
|
11
|
+
/**
|
|
12
|
+
* Keep both canvases sized to the device pixel grid and painted.
|
|
13
|
+
* @param options - See {@link ParallelCanvasOptions}.
|
|
14
|
+
* @returns The two refs to hand to the `<canvas>` elements.
|
|
15
|
+
*/
|
|
16
|
+
export function useParallelCanvas(options) {
|
|
17
|
+
const { width, height, layouts, values, count } = options;
|
|
18
|
+
const { included, steps, palette, highlights, ink } = options;
|
|
19
|
+
const lines = useRef(null);
|
|
20
|
+
const marks = useRef(null);
|
|
21
|
+
const { line, excluded, includedAlpha, halo } = ink;
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const context = preparePlotCanvas(lines.current, width, height);
|
|
24
|
+
if (context === null)
|
|
25
|
+
return;
|
|
26
|
+
paintParallelLines(context, {
|
|
27
|
+
layouts,
|
|
28
|
+
values,
|
|
29
|
+
count,
|
|
30
|
+
included,
|
|
31
|
+
steps,
|
|
32
|
+
palette,
|
|
33
|
+
line,
|
|
34
|
+
excluded,
|
|
35
|
+
includedAlpha,
|
|
36
|
+
});
|
|
37
|
+
}, [
|
|
38
|
+
width,
|
|
39
|
+
height,
|
|
40
|
+
layouts,
|
|
41
|
+
values,
|
|
42
|
+
count,
|
|
43
|
+
included,
|
|
44
|
+
steps,
|
|
45
|
+
palette,
|
|
46
|
+
line,
|
|
47
|
+
excluded,
|
|
48
|
+
includedAlpha,
|
|
49
|
+
]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const context = preparePlotCanvas(marks.current, width, height);
|
|
52
|
+
if (context === null)
|
|
53
|
+
return;
|
|
54
|
+
paintParallelHighlights(context, { highlights, layouts, values, halo });
|
|
55
|
+
}, [width, height, highlights, layouts, values, halo]);
|
|
56
|
+
return { lines, marks };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=useParallelCanvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useParallelCanvas.js","sourceRoot":"","sources":["../../../src/parallel/ui/useParallelCanvas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAoClC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAA8B;IAE9B,MAAM,EAAE,KAAK,EAAE,M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AAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One pointer over the whole figure, serving both the brush and the hover.
|
|
3
|
+
*
|
|
4
|
+
* A hook cannot be called inside a `map`, so a brush per axis would have to
|
|
5
|
+
* live in refs and be attached by hand; one surface that works out from the
|
|
6
|
+
* press which axis was grabbed has no such problem, and it gives the hover
|
|
7
|
+
* search the same once-a-frame coalescing the drag already pays for.
|
|
8
|
+
*
|
|
9
|
+
* The band follows the pointer live and the interval is reported on release
|
|
10
|
+
* only: a table filtering on the reported interval is asked to re-render once
|
|
11
|
+
* per gesture rather than sixty times a second.
|
|
12
|
+
*/
|
|
13
|
+
import type { MouseEvent as ReactMouseEvent } from 'react';
|
|
14
|
+
import type { ScatterSurfaceProps } from '../../scatter/ui/lassoGesture.ts';
|
|
15
|
+
import type { ParallelAxisLayout } from '../core/parallelAxes.ts';
|
|
16
|
+
import type { ParallelBand } from '../core/parallelBrush.ts';
|
|
17
|
+
import type { ParallelRange, ParallelRanges } from '../core/parallelTypes.ts';
|
|
18
|
+
/** What {@link useParallelGesture} needs. */
|
|
19
|
+
export interface ParallelGestureOptions {
|
|
20
|
+
/** The axes, from left to right. */
|
|
21
|
+
layouts: readonly ParallelAxisLayout[];
|
|
22
|
+
/** Each axis's column, in the same order. */
|
|
23
|
+
values: ReadonlyArray<ArrayLike<number>>;
|
|
24
|
+
/** How many rows are drawn. */
|
|
25
|
+
count: number;
|
|
26
|
+
/** Height of the drawing area, in pixels. */
|
|
27
|
+
innerHeight: number;
|
|
28
|
+
/** Which rows a brush keeps, so an excluded line cannot be pointed at. */
|
|
29
|
+
included: Uint8Array | null;
|
|
30
|
+
/** The intervals in force, whoever owns them. */
|
|
31
|
+
ranges: ParallelRanges;
|
|
32
|
+
/** Called when a brush is released, with the interval it keeps or `null`. */
|
|
33
|
+
onRangeChange: (axisId: string, range: ParallelRange | null) => void;
|
|
34
|
+
/** Called on every frame a band grows. */
|
|
35
|
+
onRangePreview?: ((axisId: string, range: ParallelRange | null) => void) | undefined;
|
|
36
|
+
/** The row the caller says is hovered, if it owns that. */
|
|
37
|
+
hovered?: number | undefined;
|
|
38
|
+
/** Called with the row under the pointer, or `-1`. */
|
|
39
|
+
onHoverChange?: ((index: number) => void) | undefined;
|
|
40
|
+
/** Called when a line is clicked, with the row, or `-1` for empty ground. */
|
|
41
|
+
onRowClick?: ((index: number) => void) | undefined;
|
|
42
|
+
}
|
|
43
|
+
/** The gesture, as the figure renders it. */
|
|
44
|
+
export interface ParallelGesture {
|
|
45
|
+
/** Spread onto the transparent rectangle laid over the figure. */
|
|
46
|
+
surface: ScatterSurfaceProps;
|
|
47
|
+
/** Put on the same rectangle, for the click that picks a line. */
|
|
48
|
+
onClick: (event: ReactMouseEvent<Element>) => void;
|
|
49
|
+
/** The band to draw on each axis, the one being dragged included. */
|
|
50
|
+
bands: ReadonlyMap<string, ParallelBand>;
|
|
51
|
+
/** The row under the pointer, or `-1`. */
|
|
52
|
+
hovered: number;
|
|
53
|
+
/** Where the pointer is in the figure, or `null` when it is away. */
|
|
54
|
+
pointer: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
} | null;
|
|
58
|
+
/** Whether a band is being dragged right now. */
|
|
59
|
+
brushing: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The brush and the hover, over one surface.
|
|
63
|
+
* @param options - See {@link ParallelGestureOptions}.
|
|
64
|
+
* @returns The gesture. See {@link ParallelGesture}.
|
|
65
|
+
*/
|
|
66
|
+
export declare function useParallelGesture(options: ParallelGestureOptions): ParallelGesture;
|
|
67
|
+
//# sourceMappingURL=useParallelGesture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useParallelGesture.d.ts","sourceRoot":"","sources":["../../../src/parallel/ui/useParallelGesture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO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7C,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,OAAO,EAAE,mBAAmB,CAAC;IAC7B,kEAAkE;IAClE,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACnD,qEAAqE;IACrE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,OAAO,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzC,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,sBAAsB,GAC9B,eAAe,CAsIjB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One pointer over the whole figure, serving both the brush and the hover.
|
|
3
|
+
*
|
|
4
|
+
* A hook cannot be called inside a `map`, so a brush per axis would have to
|
|
5
|
+
* live in refs and be attached by hand; one surface that works out from the
|
|
6
|
+
* press which axis was grabbed has no such problem, and it gives the hover
|
|
7
|
+
* search the same once-a-frame coalescing the drag already pays for.
|
|
8
|
+
*
|
|
9
|
+
* The band follows the pointer live and the interval is reported on release
|
|
10
|
+
* only: a table filtering on the reported interval is asked to re-render once
|
|
11
|
+
* per gesture rather than sixty times a second.
|
|
12
|
+
*/
|
|
13
|
+
import { useMemo, useRef, useState } from 'react';
|
|
14
|
+
import { useCapturedPointer } from "../../scatter/ui/useCapturedPointer.js";
|
|
15
|
+
import { PARALLEL_MARGIN } from "../core/parallelAxes.js";
|
|
16
|
+
import { parallelBandAt, parallelBandOf, parallelBrushGrip, parallelIsBand, parallelRangeOf, } from "../core/parallelBrush.js";
|
|
17
|
+
import { parallelNearestRow } from "../core/parallelHit.js";
|
|
18
|
+
import { parallelAxisById, parallelAxisNear, parallelBandsOf, parallelPointOf, } from "./parallelGestureModel.js";
|
|
19
|
+
/**
|
|
20
|
+
* The brush and the hover, over one surface.
|
|
21
|
+
* @param options - See {@link ParallelGestureOptions}.
|
|
22
|
+
* @returns The gesture. See {@link ParallelGesture}.
|
|
23
|
+
*/
|
|
24
|
+
export function useParallelGesture(options) {
|
|
25
|
+
const { layouts, values, count, innerHeight, included, ranges } = options;
|
|
26
|
+
const { onRangeChange, onRangePreview, onHoverChange, onRowClick } = options;
|
|
27
|
+
const [draft, setDraft] = useState(null);
|
|
28
|
+
const [ownHovered, setOwnHovered] = useState(-1);
|
|
29
|
+
const [pointer, setPointer] = useState(null);
|
|
30
|
+
const hovered = options.hovered ?? ownHovered;
|
|
31
|
+
const dragRef = useRef(null);
|
|
32
|
+
const pointRef = useRef({ x: 0, y: 0 });
|
|
33
|
+
const reportedRef = useRef(-1);
|
|
34
|
+
const claimedRef = useRef(false);
|
|
35
|
+
function rangeOf(axisId, band) {
|
|
36
|
+
const layout = parallelAxisById(layouts, axisId);
|
|
37
|
+
if (layout === undefined || !parallelIsBand(band))
|
|
38
|
+
return null;
|
|
39
|
+
return parallelRangeOf(band, layout);
|
|
40
|
+
}
|
|
41
|
+
function report(index) {
|
|
42
|
+
if (index === reportedRef.current)
|
|
43
|
+
return;
|
|
44
|
+
reportedRef.current = index;
|
|
45
|
+
setOwnHovered(index);
|
|
46
|
+
onHoverChange?.(index);
|
|
47
|
+
}
|
|
48
|
+
function findRow(point) {
|
|
49
|
+
return parallelNearestRow(point, layouts, values, count, included ?? undefined);
|
|
50
|
+
}
|
|
51
|
+
function press(event) {
|
|
52
|
+
const point = parallelPointOf(event);
|
|
53
|
+
const index = parallelAxisNear(point.x, layouts);
|
|
54
|
+
const layout = layouts[index];
|
|
55
|
+
if (layout === undefined || point.y < 0 || point.y > innerHeight) {
|
|
56
|
+
claimedRef.current = false;
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const current = ranges[layout.id];
|
|
60
|
+
const band = current === null || current === undefined
|
|
61
|
+
? null
|
|
62
|
+
: parallelBandOf(current, layout);
|
|
63
|
+
const drag = {
|
|
64
|
+
axis: layout.id,
|
|
65
|
+
grip: parallelBrushGrip(point.y, band),
|
|
66
|
+
originY: point.y,
|
|
67
|
+
origin: band ?? { top: point.y, bottom: point.y },
|
|
68
|
+
};
|
|
69
|
+
dragRef.current = drag;
|
|
70
|
+
pointRef.current = point;
|
|
71
|
+
claimedRef.current = true;
|
|
72
|
+
setDraft({
|
|
73
|
+
axis: layout.id,
|
|
74
|
+
band: parallelBandAt(drag, point.y, innerHeight),
|
|
75
|
+
});
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
function frame(claimed) {
|
|
79
|
+
const point = pointRef.current;
|
|
80
|
+
const drag = dragRef.current;
|
|
81
|
+
if (claimed && drag !== null) {
|
|
82
|
+
const band = parallelBandAt(drag, point.y, innerHeight);
|
|
83
|
+
setDraft({ axis: drag.axis, band });
|
|
84
|
+
onRangePreview?.(drag.axis, rangeOf(drag.axis, band));
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
setPointer({
|
|
88
|
+
x: point.x + PARALLEL_MARGIN.left,
|
|
89
|
+
y: point.y + PARALLEL_MARGIN.top,
|
|
90
|
+
});
|
|
91
|
+
report(findRow(point));
|
|
92
|
+
}
|
|
93
|
+
function release(event, commit) {
|
|
94
|
+
const drag = dragRef.current;
|
|
95
|
+
dragRef.current = null;
|
|
96
|
+
setDraft(null);
|
|
97
|
+
if (drag === null)
|
|
98
|
+
return;
|
|
99
|
+
if (event !== null)
|
|
100
|
+
pointRef.current = parallelPointOf(event);
|
|
101
|
+
if (!commit) {
|
|
102
|
+
onRangePreview?.(drag.axis, ranges[drag.axis] ?? null);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const range = rangeOf(drag.axis, parallelBandAt(drag, pointRef.current.y, innerHeight));
|
|
106
|
+
onRangePreview?.(drag.axis, range);
|
|
107
|
+
onRangeChange(drag.axis, range);
|
|
108
|
+
}
|
|
109
|
+
const { surface } = useCapturedPointer({
|
|
110
|
+
touch: false,
|
|
111
|
+
cursor: 'crosshair',
|
|
112
|
+
onPress: press,
|
|
113
|
+
onMove: (event) => {
|
|
114
|
+
pointRef.current = parallelPointOf(event);
|
|
115
|
+
return true;
|
|
116
|
+
},
|
|
117
|
+
onFrame: frame,
|
|
118
|
+
onRelease: release,
|
|
119
|
+
onLeave: () => {
|
|
120
|
+
setPointer(null);
|
|
121
|
+
report(-1);
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
const bands = useMemo(() => parallelBandsOf(layouts, ranges, draft), [layouts, ranges, draft]);
|
|
125
|
+
function handleClick(event) {
|
|
126
|
+
if (claimedRef.current || onRowClick === undefined)
|
|
127
|
+
return;
|
|
128
|
+
onRowClick(findRow(parallelPointOf(event)));
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
surface,
|
|
132
|
+
onClick: handleClick,
|
|
133
|
+
bands,
|
|
134
|
+
hovered,
|
|
135
|
+
pointer,
|
|
136
|
+
brushing: draft !== null,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=useParallelGesture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useParallelGesture.js","sourceRoot":"","sources":["../../../src/parallel/ui/useParallelGesture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACL,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAI5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AAK,SAAS;YAAE,OAAO;QAC3D,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO;QACL,OAAO;QACP,OAAO,EAAE,WAAW;QACpB,KAAK;QACL,OAAO;QACP,OAAO;QACP,QAAQ,EAAE,KAAK,KAAK,IAAI;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarFloor.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/useToolbarFloor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,mBAAwB,GAChC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"useToolbarFloor.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/useToolbarFloor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,mBAAwB,GAChC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAiDlC"}
|
|
@@ -16,40 +16,47 @@ export function useToolbarFloor(options = {}) {
|
|
|
16
16
|
const container = containerRef.current;
|
|
17
17
|
if (container === null)
|
|
18
18
|
return;
|
|
19
|
-
let
|
|
20
|
-
let
|
|
21
|
-
let attempts = 0;
|
|
22
|
-
// The editor builds itself asynchronously, so the toolbar is usually not
|
|
23
|
-
// there yet on the first look; watching for it is what keeps a slow first
|
|
24
|
-
// paint from leaving the container at its unmeasured height for good.
|
|
19
|
+
let toolbar = null;
|
|
20
|
+
let size = null;
|
|
25
21
|
const attach = () => {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
attempts++;
|
|
29
|
-
if (attempts > MAX_ATTEMPTS)
|
|
30
|
-
return;
|
|
31
|
-
frame = globalThis.requestAnimationFrame(attach);
|
|
22
|
+
const found = findToolbar(container);
|
|
23
|
+
if (found === null)
|
|
32
24
|
return;
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
size?.disconnect();
|
|
26
|
+
toolbar = found;
|
|
27
|
+
size = new ResizeObserver(() => {
|
|
35
28
|
// offsetHeight, because a dialog opens under a scaling transform and a
|
|
36
29
|
// measured rectangle would be that of the half drawn toolbar.
|
|
37
|
-
const
|
|
38
|
-
|
|
30
|
+
const height = found.offsetHeight;
|
|
31
|
+
// Zero is a toolbar being torn down or not yet laid out, never a
|
|
32
|
+
// toolbar that needs no room: writing the fallback for it would undo a
|
|
33
|
+
// correct floor and leave the palette cut off.
|
|
34
|
+
if (height === 0)
|
|
35
|
+
return;
|
|
36
|
+
container.style.minHeight = `${toolbarFloorHeight(height, minHeight)}px`;
|
|
39
37
|
});
|
|
40
|
-
|
|
38
|
+
size.observe(found);
|
|
41
39
|
};
|
|
40
|
+
// The editor is imported lazily and builds itself asynchronously, so it is
|
|
41
|
+
// almost never there on the first look, and how long it takes is a cold
|
|
42
|
+
// module graph and a network away from anything this code can predict. So
|
|
43
|
+
// the arrival is watched for rather than waited out: a deadline that
|
|
44
|
+
// expires leaves the toolbar cut off for the life of the page, with
|
|
45
|
+
// nothing on screen to say why.
|
|
46
|
+
const arrivals = new MutationObserver(() => {
|
|
47
|
+
if (toolbar?.isConnected === true)
|
|
48
|
+
return;
|
|
49
|
+
attach();
|
|
50
|
+
});
|
|
51
|
+
arrivals.observe(container, { childList: true, subtree: true });
|
|
42
52
|
attach();
|
|
43
53
|
return () => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
observer?.disconnect();
|
|
54
|
+
arrivals.disconnect();
|
|
55
|
+
size?.disconnect();
|
|
47
56
|
};
|
|
48
57
|
}, [minHeight, revision]);
|
|
49
58
|
return containerRef;
|
|
50
59
|
}
|
|
51
|
-
/** Roughly two seconds of frames, after which the editor is not coming. */
|
|
52
|
-
const MAX_ATTEMPTS = 120;
|
|
53
60
|
/**
|
|
54
61
|
* Find the toolbar canvas of the editor.
|
|
55
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarFloor.js","sourceRoot":"","sources":["../../../src/structure/ui/useToolbarFloor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAkB7D;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,UAA+B,EAAE;IAEjC,MAAM,EAAE,SAAS,GAAG,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC;IAClD,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,eAAe,CAAC,GAAG,EAAE;QACnB,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC;QACvC,IAAI,SAAS,KAAK,IAAI;YAAE,OAAO;QAE/B,IAAI,
|
|
1
|
+
{"version":3,"file":"useToolbarFloor.js","sourceRoot":"","sources":["../../../src/structure/ui/useToolbarFloor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAkB7D;;;;;;;;GAQG;AACH,MAAM,UAAU,e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ACH,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,MAAM,EAAE,CAAC;QAET,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,UAAU,EAAE,CAAC;YACtB,IAAI,EAAE,UAAU,EAAE,CAAC;QACrB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE1B,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,WAAW,CAAC,SAAsB;IACzC,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;QACtD,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,UAAU,EAAE,QAAQ,IAAI,EAAE,EAAE,CAAC;YACvD,IAAI,KAAK,YAAY,iBAAiB;gBAAE,OAAO,KAAK,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/lib/ui.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './error/ui/index.ts';
|
|
|
15
15
|
export * from './help/ui/index.ts';
|
|
16
16
|
export * from './hooks/ui/index.ts';
|
|
17
17
|
export * from './overlay/ui/index.ts';
|
|
18
|
+
export * from './parallel/ui/index.ts';
|
|
18
19
|
export * from './pedagogy/ui/index.ts';
|
|
19
20
|
export * from './periodic/ui/index.ts';
|
|
20
21
|
export * from './projection/ui/index.ts';
|
package/lib/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc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ACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
package/lib/ui.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./error/ui/index.js";
|
|
|
15
15
|
export * from "./help/ui/index.js";
|
|
16
16
|
export * from "./hooks/ui/index.js";
|
|
17
17
|
export * from "./overlay/ui/index.js";
|
|
18
|
+
export * from "./parallel/ui/index.js";
|
|
18
19
|
export * from "./pedagogy/ui/index.js";
|
|
19
20
|
export * from "./periodic/ui/index.js";
|
|
20
21
|
export * from "./projection/ui/index.js";
|
package/lib/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
package/lib/vite.d.ts
CHANGED
package/lib/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
|
package/lib/vite.js
CHANGED
package/lib/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cheminfo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React components, hooks and framework-free helpers shared by the cheminfo sites: site chrome, citations, sharing, routing, pedagogy, charts, and the structure, orbital and 3D molecule viewers",
|
|
6
6
|
"author": "Luc Patiny",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"./styles/*.css"
|
|
16
16
|
],
|
|
17
17
|
"exports": {
|
|
18
|
+
"./build-info": "./lib/build-info.js",
|
|
18
19
|
"./core": "./lib/core.js",
|
|
19
20
|
"./molecule3d": "./lib/molecule3d.js",
|
|
20
21
|
"./orbital": "./lib/orbital.js",
|