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,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The brush, as arithmetic rather than as a library.
|
|
3
|
+
*
|
|
4
|
+
* Everything a vertical brush does — create by dragging on a bare axis, move
|
|
5
|
+
* the band, drag either edge, clear by pressing outside it — is four answers
|
|
6
|
+
* to one question: which part of the axis the press landed on. Written this
|
|
7
|
+
* way it is a pure function of a press and a pointer, so the whole gesture is
|
|
8
|
+
* covered by tests in a runtime with no DOM at all, which is the one thing a
|
|
9
|
+
* DOM-mutating brush could never be.
|
|
10
|
+
*/
|
|
11
|
+
import type { ParallelAxisLayout } from './parallelAxes.ts';
|
|
12
|
+
import type { ParallelRange } from './parallelTypes.ts';
|
|
13
|
+
/** A band kept on one axis, in pixels from the top of the drawing area. */
|
|
14
|
+
export interface ParallelBand {
|
|
15
|
+
/** The upper edge, which is the higher value. */
|
|
16
|
+
top: number;
|
|
17
|
+
/** The lower edge, which is the lower value. */
|
|
18
|
+
bottom: number;
|
|
19
|
+
}
|
|
20
|
+
/** Which part of an axis a press landed on. */
|
|
21
|
+
export type ParallelBrushGrip = 'create' | 'move' | 'top' | 'bottom';
|
|
22
|
+
/** A drag in progress on one axis. */
|
|
23
|
+
export interface ParallelBrushDrag {
|
|
24
|
+
/** The axis being brushed, by its id. */
|
|
25
|
+
axis: string;
|
|
26
|
+
/** What the press took hold of. */
|
|
27
|
+
grip: ParallelBrushGrip;
|
|
28
|
+
/** Where the press landed, in pixels from the top of the drawing area. */
|
|
29
|
+
originY: number;
|
|
30
|
+
/** The band as it stood when the press landed. */
|
|
31
|
+
origin: ParallelBand;
|
|
32
|
+
}
|
|
33
|
+
/** How close to an edge a press has to land to take hold of it, in pixels. */
|
|
34
|
+
export declare const PARALLEL_BRUSH_HANDLE_REACH = 4;
|
|
35
|
+
/** How tall a released band has to be to count as a band rather than a click. */
|
|
36
|
+
export declare const PARALLEL_BRUSH_SMALLEST = 1;
|
|
37
|
+
/** How far either side of an axis a press still reaches it, in pixels. */
|
|
38
|
+
export declare const PARALLEL_BRUSH_HALF_WIDTH = 9;
|
|
39
|
+
/**
|
|
40
|
+
* What a press at that height takes hold of.
|
|
41
|
+
* @param y - Where the press landed, in pixels from the top of the drawing area.
|
|
42
|
+
* @param band - The band already on that axis, or `null` when it carries none.
|
|
43
|
+
* @returns The grip. A press within {@link PARALLEL_BRUSH_HANDLE_REACH} of an
|
|
44
|
+
* edge takes that edge, a press inside the band moves it, and anything else —
|
|
45
|
+
* including a press on a bare axis — starts a new one.
|
|
46
|
+
*/
|
|
47
|
+
export declare function parallelBrushGrip(y: number, band: ParallelBand | null): ParallelBrushGrip;
|
|
48
|
+
/**
|
|
49
|
+
* The band a drag stands at, now that the pointer is there.
|
|
50
|
+
* @param drag - The drag, as it began.
|
|
51
|
+
* @param y - Where the pointer is, in pixels from the top of the drawing area.
|
|
52
|
+
* @param height - Height of the drawing area, in pixels.
|
|
53
|
+
* @returns The band, held inside the drawing area at both ends. Dragging one
|
|
54
|
+
* edge past the other swaps them rather than inverting the band, and a band
|
|
55
|
+
* being moved keeps its height rather than being squashed against an end.
|
|
56
|
+
*/
|
|
57
|
+
export declare function parallelBandAt(drag: ParallelBrushDrag, y: number, height: number): ParallelBand;
|
|
58
|
+
/**
|
|
59
|
+
* Whether a released band keeps anything, or was a click that clears the axis.
|
|
60
|
+
* @param band - The band, as the pointer left it.
|
|
61
|
+
* @returns Whether it is tall enough to be an interval.
|
|
62
|
+
*/
|
|
63
|
+
export declare function parallelIsBand(band: ParallelBand): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Where an interval sits on its axis, in pixels.
|
|
66
|
+
* @param range - The interval, low value first.
|
|
67
|
+
* @param axis - The axis it belongs to.
|
|
68
|
+
* @returns The band.
|
|
69
|
+
*/
|
|
70
|
+
export declare function parallelBandOf(range: ParallelRange, axis: ParallelAxisLayout): ParallelBand;
|
|
71
|
+
/**
|
|
72
|
+
* What interval a band keeps, in the axis's own units.
|
|
73
|
+
* @param band - The band, in pixels from the top of the drawing area.
|
|
74
|
+
* @param axis - The axis it belongs to.
|
|
75
|
+
* @returns The interval, low value first — which is the order every filter in
|
|
76
|
+
* the family reads, and getting it backwards keeps nothing at all.
|
|
77
|
+
*/
|
|
78
|
+
export declare function parallelRangeOf(band: ParallelBand, axis: ParallelAxisLayout): ParallelRange;
|
|
79
|
+
//# sourceMappingURL=parallelBrush.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelBrush.d.ts","sourceRoot":"","sources":["../../../src/parallel/core/parallelBrush.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,+CAA+C;AAC/C,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAErE,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,IAAI,EAAE,iBAAiB,CAAC;IACxB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,8EAA8E;AAC9E,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,0EAA0E;AAC1E,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,MAAM,EACT,IAAI,EAAE,YAAY,GAAG,IAAI,GACxB,iBAAiB,CAMnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,iBAAiB,EACvB,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,GACb,YAAY,CAcd;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,kBAAkB,GACvB,YAAY,CAKd;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,kBAAkB,GACvB,aAAa,CAIf"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The brush, as arithmetic rather than as a library.
|
|
3
|
+
*
|
|
4
|
+
* Everything a vertical brush does — create by dragging on a bare axis, move
|
|
5
|
+
* the band, drag either edge, clear by pressing outside it — is four answers
|
|
6
|
+
* to one question: which part of the axis the press landed on. Written this
|
|
7
|
+
* way it is a pure function of a press and a pointer, so the whole gesture is
|
|
8
|
+
* covered by tests in a runtime with no DOM at all, which is the one thing a
|
|
9
|
+
* DOM-mutating brush could never be.
|
|
10
|
+
*/
|
|
11
|
+
import { parallelValueToY, parallelYToValue } from "./parallelAxes.js";
|
|
12
|
+
/** How close to an edge a press has to land to take hold of it, in pixels. */
|
|
13
|
+
export const PARALLEL_BRUSH_HANDLE_REACH = 4;
|
|
14
|
+
/** How tall a released band has to be to count as a band rather than a click. */
|
|
15
|
+
export const PARALLEL_BRUSH_SMALLEST = 1;
|
|
16
|
+
/** How far either side of an axis a press still reaches it, in pixels. */
|
|
17
|
+
export const PARALLEL_BRUSH_HALF_WIDTH = 9;
|
|
18
|
+
/**
|
|
19
|
+
* What a press at that height takes hold of.
|
|
20
|
+
* @param y - Where the press landed, in pixels from the top of the drawing area.
|
|
21
|
+
* @param band - The band already on that axis, or `null` when it carries none.
|
|
22
|
+
* @returns The grip. A press within {@link PARALLEL_BRUSH_HANDLE_REACH} of an
|
|
23
|
+
* edge takes that edge, a press inside the band moves it, and anything else —
|
|
24
|
+
* including a press on a bare axis — starts a new one.
|
|
25
|
+
*/
|
|
26
|
+
export function parallelBrushGrip(y, band) {
|
|
27
|
+
if (band === null)
|
|
28
|
+
return 'create';
|
|
29
|
+
if (Math.abs(y - band.top) <= PARALLEL_BRUSH_HANDLE_REACH)
|
|
30
|
+
return 'top';
|
|
31
|
+
if (Math.abs(y - band.bottom) <= PARALLEL_BRUSH_HANDLE_REACH)
|
|
32
|
+
return 'bottom';
|
|
33
|
+
if (y > band.top && y < band.bottom)
|
|
34
|
+
return 'move';
|
|
35
|
+
return 'create';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The band a drag stands at, now that the pointer is there.
|
|
39
|
+
* @param drag - The drag, as it began.
|
|
40
|
+
* @param y - Where the pointer is, in pixels from the top of the drawing area.
|
|
41
|
+
* @param height - Height of the drawing area, in pixels.
|
|
42
|
+
* @returns The band, held inside the drawing area at both ends. Dragging one
|
|
43
|
+
* edge past the other swaps them rather than inverting the band, and a band
|
|
44
|
+
* being moved keeps its height rather than being squashed against an end.
|
|
45
|
+
*/
|
|
46
|
+
export function parallelBandAt(drag, y, height) {
|
|
47
|
+
const to = clamp(y, 0, height);
|
|
48
|
+
if (drag.grip === 'create')
|
|
49
|
+
return order(drag.originY, to);
|
|
50
|
+
if (drag.grip === 'top')
|
|
51
|
+
return order(to, drag.origin.bottom);
|
|
52
|
+
if (drag.grip === 'bottom')
|
|
53
|
+
return order(drag.origin.top, to);
|
|
54
|
+
const shift = clamp(to - drag.originY, -drag.origin.top, height - drag.origin.bottom);
|
|
55
|
+
return {
|
|
56
|
+
top: drag.origin.top + shift,
|
|
57
|
+
bottom: drag.origin.bottom + shift,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Whether a released band keeps anything, or was a click that clears the axis.
|
|
62
|
+
* @param band - The band, as the pointer left it.
|
|
63
|
+
* @returns Whether it is tall enough to be an interval.
|
|
64
|
+
*/
|
|
65
|
+
export function parallelIsBand(band) {
|
|
66
|
+
return band.bottom - band.top >= PARALLEL_BRUSH_SMALLEST;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Where an interval sits on its axis, in pixels.
|
|
70
|
+
* @param range - The interval, low value first.
|
|
71
|
+
* @param axis - The axis it belongs to.
|
|
72
|
+
* @returns The band.
|
|
73
|
+
*/
|
|
74
|
+
export function parallelBandOf(range, axis) {
|
|
75
|
+
return order(parallelValueToY(range[1], axis), parallelValueToY(range[0], axis));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* What interval a band keeps, in the axis's own units.
|
|
79
|
+
* @param band - The band, in pixels from the top of the drawing area.
|
|
80
|
+
* @param axis - The axis it belongs to.
|
|
81
|
+
* @returns The interval, low value first — which is the order every filter in
|
|
82
|
+
* the family reads, and getting it backwards keeps nothing at all.
|
|
83
|
+
*/
|
|
84
|
+
export function parallelRangeOf(band, axis) {
|
|
85
|
+
const low = parallelYToValue(band.bottom, axis);
|
|
86
|
+
const high = parallelYToValue(band.top, axis);
|
|
87
|
+
return low <= high ? [low, high] : [high, low];
|
|
88
|
+
}
|
|
89
|
+
function order(a, b) {
|
|
90
|
+
return a <= b ? { top: a, bottom: b } : { top: b, bottom: a };
|
|
91
|
+
}
|
|
92
|
+
function clamp(value, low, high) {
|
|
93
|
+
if (value < low)
|
|
94
|
+
return low;
|
|
95
|
+
if (value > high)
|
|
96
|
+
return high;
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=parallelBrush.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelBrush.js","sourceRoot":"","sources":["../../../src/parallel/core/parallelBrush.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AA0BvE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAE7C,iFAAiF;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,CAAS,EACT,IAAyB;IAEzB,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,QAAQ,CAAC;IACnC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,2BAA2B;QAAE,OAAO,KAAK,CAAC;IACxE,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,2BAA2B;QAAE,OAAO,QAAQ,CAAC;IAC9E,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IACnD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UA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EAClB,IAAwB;IAExB,MAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9C,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,KAAK,CAAC,CAAS,EAAE,CAAS;IACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAChE,CAAC;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,IAAY;IACrD,IAAI,KAAK,GAAG,GAAG;QAAE,OAAO,GAAG,CAAC;IAC5B,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two ends of one axis, read off its own column.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately not `chartPadExtent`: a parallel-coordinates axis ends exactly
|
|
5
|
+
* on the data, because the reader compares rows against each other rather than
|
|
6
|
+
* against a round number, and the best row has to touch the top of its axis.
|
|
7
|
+
* The only opening is for a column with no spread at all, which would
|
|
8
|
+
* otherwise draw no axis and place every row on one pixel.
|
|
9
|
+
*/
|
|
10
|
+
/** How far a column with no spread at all is opened, on each side. */
|
|
11
|
+
export declare const PARALLEL_DEGENERATE_PADDING = 0.5;
|
|
12
|
+
/** The two ends of an axis, low first. */
|
|
13
|
+
export interface ParallelExtent {
|
|
14
|
+
/** The value at the bottom of the axis. */
|
|
15
|
+
min: number;
|
|
16
|
+
/** The value at its top. */
|
|
17
|
+
max: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The smallest and the largest finite value of one column.
|
|
21
|
+
* @param values - The column, read in place.
|
|
22
|
+
* @param count - How many rows to read, from the start.
|
|
23
|
+
* @returns The extent. A column holding no finite value at all comes back as
|
|
24
|
+
* half a unit either side of zero, and a constant one as half a unit either
|
|
25
|
+
* side of its value, so that both still draw an axis.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parallelExtent(values: ArrayLike<number>, count: number): ParallelExtent;
|
|
28
|
+
//# sourceMappingURL=parallelExtent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelExtent.d.ts","sourceRoot":"","sources":["../../../src/parallel/core/parallelExtent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,sEAAsE;AACtE,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,0CAA0C;AAC1C,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,EACzB,KAAK,EAAE,MAAM,GACZ,cAAc,CAuBhB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two ends of one axis, read off its own column.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately not `chartPadExtent`: a parallel-coordinates axis ends exactly
|
|
5
|
+
* on the data, because the reader compares rows against each other rather than
|
|
6
|
+
* against a round number, and the best row has to touch the top of its axis.
|
|
7
|
+
* The only opening is for a column with no spread at all, which would
|
|
8
|
+
* otherwise draw no axis and place every row on one pixel.
|
|
9
|
+
*/
|
|
10
|
+
/** How far a column with no spread at all is opened, on each side. */
|
|
11
|
+
export const PARALLEL_DEGENERATE_PADDING = 0.5;
|
|
12
|
+
/**
|
|
13
|
+
* The smallest and the largest finite value of one column.
|
|
14
|
+
* @param values - The column, read in place.
|
|
15
|
+
* @param count - How many rows to read, from the start.
|
|
16
|
+
* @returns The extent. A column holding no finite value at all comes back as
|
|
17
|
+
* half a unit either side of zero, and a constant one as half a unit either
|
|
18
|
+
* side of its value, so that both still draw an axis.
|
|
19
|
+
*/
|
|
20
|
+
export function parallelExtent(values, count) {
|
|
21
|
+
const rows = Math.min(count, values.length);
|
|
22
|
+
let min = Number.POSITIVE_INFINITY;
|
|
23
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
24
|
+
for (let row = 0; row < rows; row++) {
|
|
25
|
+
const value = values[row];
|
|
26
|
+
if (!Number.isFinite(value))
|
|
27
|
+
continue;
|
|
28
|
+
if (value < min)
|
|
29
|
+
min = value;
|
|
30
|
+
if (value > max)
|
|
31
|
+
max = value;
|
|
32
|
+
}
|
|
33
|
+
if (min > max) {
|
|
34
|
+
return {
|
|
35
|
+
min: -PARALLEL_DEGENERATE_PADDING,
|
|
36
|
+
max: PARALLEL_DEGENERATE_PADDING,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (min === max) {
|
|
40
|
+
return {
|
|
41
|
+
min: min - PARALLEL_DEGENERATE_PADDING,
|
|
42
|
+
max: max + PARALLEL_DEGENERATE_PADDING,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return { min, max };
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=parallelExtent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelExtent.js","sourceRoot":"","sources":["../../../src/parallel/core/parallelExtent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,sEAAsE;AACtE,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAU/C;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAyB,EACzB,KAAa;IAEb,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnC,IAAI,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnC,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAW,CAAC;QACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,SAAS;QACtC,IAAI,KAAK,GAAG,GAAG;YAAE,GAAG,GAAG,KAAK,CAAC;QAC7B,IAAI,KAAK,GAAG,GAAG;YAAE,GAAG,GAAG,KAAK,CAAC;IAC/B,CAAC;IACD,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;QACd,OAAO;YACL,GAAG,EAAE,CAAC,2BAA2B;YACjC,GAAG,EAAE,2BAA2B;SACjC,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;QAChB,OAAO;YACL,GAAG,EAAE,GAAG,GAAG,2BAA2B;YACtC,GAAG,EAAE,GAAG,GAAG,2BAA2B;SACvC,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which rows the brushes keep.
|
|
3
|
+
*
|
|
4
|
+
* Exported rather than kept inside the figure, because a table beside the
|
|
5
|
+
* figure has to filter on the same answer. Two definitions of "kept" is the
|
|
6
|
+
* fault this file exists to prevent: a table showing fourteen rows under a
|
|
7
|
+
* plot drawing one is not a rounding error, it is two different programs.
|
|
8
|
+
*/
|
|
9
|
+
import type { ParallelAxis, ParallelRange, ParallelRanges } from './parallelTypes.ts';
|
|
10
|
+
/**
|
|
11
|
+
* Whether one value falls inside an interval.
|
|
12
|
+
* @param range - The interval, low value first.
|
|
13
|
+
* @param value - The value to test.
|
|
14
|
+
* @returns Whether it is kept. Both ends are inclusive, and a value that is
|
|
15
|
+
* not a number is kept by no interval at all — a row whose property has not
|
|
16
|
+
* been worked out yet cannot be said to be in range.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parallelRangeKeeps(range: ParallelRange, value: number): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Which rows every brush keeps at once.
|
|
21
|
+
* @param axes - The axes, whose ids the intervals are keyed by.
|
|
22
|
+
* @param ranges - The interval each axis keeps, or `null` for none.
|
|
23
|
+
* @param count - How many rows there are.
|
|
24
|
+
* @returns One byte per row, `1` for kept. An interval keyed on an axis that
|
|
25
|
+
* is not drawn is ignored rather than emptying the figure, so a range left
|
|
26
|
+
* over from a column the reader has since hidden does not silently filter
|
|
27
|
+
* everything away.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parallelIncludedMask(axes: readonly ParallelAxis[], ranges: ParallelRanges, count: number): Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* How many rows a mask keeps.
|
|
32
|
+
* @param included - One byte per row, `1` for kept.
|
|
33
|
+
* @returns The count.
|
|
34
|
+
*/
|
|
35
|
+
export declare function parallelKeptCount(included: Uint8Array): number;
|
|
36
|
+
//# sourceMappingURL=parallelFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelFilter.d.ts","sourceRoot":"","sources":["../../../src/parallel/core/parallelFilter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACf,MAAM,oBAAoB,CAAC;AAY5B;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,MAAM,GACZ,OAAO,CAET;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,YAAY,EAAE,EAC7B,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,GACZ,UAAU,CA0BZ;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAM9D"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which rows the brushes keep.
|
|
3
|
+
*
|
|
4
|
+
* Exported rather than kept inside the figure, because a table beside the
|
|
5
|
+
* figure has to filter on the same answer. Two definitions of "kept" is the
|
|
6
|
+
* fault this file exists to prevent: a table showing fourteen rows under a
|
|
7
|
+
* plot drawing one is not a rounding error, it is two different programs.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Whether one value falls inside an interval.
|
|
11
|
+
* @param range - The interval, low value first.
|
|
12
|
+
* @param value - The value to test.
|
|
13
|
+
* @returns Whether it is kept. Both ends are inclusive, and a value that is
|
|
14
|
+
* not a number is kept by no interval at all — a row whose property has not
|
|
15
|
+
* been worked out yet cannot be said to be in range.
|
|
16
|
+
*/
|
|
17
|
+
export function parallelRangeKeeps(range, value) {
|
|
18
|
+
return value >= range[0] && value <= range[1];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Which rows every brush keeps at once.
|
|
22
|
+
* @param axes - The axes, whose ids the intervals are keyed by.
|
|
23
|
+
* @param ranges - The interval each axis keeps, or `null` for none.
|
|
24
|
+
* @param count - How many rows there are.
|
|
25
|
+
* @returns One byte per row, `1` for kept. An interval keyed on an axis that
|
|
26
|
+
* is not drawn is ignored rather than emptying the figure, so a range left
|
|
27
|
+
* over from a column the reader has since hidden does not silently filter
|
|
28
|
+
* everything away.
|
|
29
|
+
*/
|
|
30
|
+
export function parallelIncludedMask(axes, ranges, count) {
|
|
31
|
+
const included = new Uint8Array(count).fill(1);
|
|
32
|
+
const active = [];
|
|
33
|
+
for (const axis of axes) {
|
|
34
|
+
const range = ranges[axis.id];
|
|
35
|
+
if (range === null || range === undefined)
|
|
36
|
+
continue;
|
|
37
|
+
active.push({
|
|
38
|
+
values: axis.values,
|
|
39
|
+
minimum: Math.min(range[0], range[1]),
|
|
40
|
+
maximum: Math.max(range[0], range[1]),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (active.length === 0)
|
|
44
|
+
return included;
|
|
45
|
+
for (const range of active) {
|
|
46
|
+
const rows = Math.min(count, range.values.length);
|
|
47
|
+
for (let row = 0; row < rows; row++) {
|
|
48
|
+
if (included[row] === 0)
|
|
49
|
+
continue;
|
|
50
|
+
const value = range.values[row];
|
|
51
|
+
if (value >= range.minimum && value <= range.maximum)
|
|
52
|
+
continue;
|
|
53
|
+
included[row] = 0;
|
|
54
|
+
}
|
|
55
|
+
// A row the figure has no value for on a brushed axis is not in range.
|
|
56
|
+
for (let row = rows; row < count; row++)
|
|
57
|
+
included[row] = 0;
|
|
58
|
+
}
|
|
59
|
+
return included;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* How many rows a mask keeps.
|
|
63
|
+
* @param included - One byte per row, `1` for kept.
|
|
64
|
+
* @returns The count.
|
|
65
|
+
*/
|
|
66
|
+
export function parallelKeptCount(included) {
|
|
67
|
+
let kept = 0;
|
|
68
|
+
for (const row of included) {
|
|
69
|
+
if (row !== 0)
|
|
70
|
+
kept++;
|
|
71
|
+
}
|
|
72
|
+
return kept;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=parallelFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelFilter.js","sourceRoot":"","sources":["../../../src/parallel/core/parallelFilter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAkBH;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAoB,EACpB,KAAa;IAEb,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;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C,GAAG,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;QACD,uEAAuE;QACvE,KAAK,IAAI,GAAG,GAAG,IAAI,EAAE,GAAG,GAAG,KAAK,EAAE,GAAG,EAAE;YAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAoB;IACpD,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,IAAI,GAAG,KAAK,CAAC;YAAE,IAAI,EAAE,CAAC;IACxB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which row the pointer is over.
|
|
3
|
+
*
|
|
4
|
+
* Only the segment between the two axes the pointer sits between is tested, so
|
|
5
|
+
* the cost is one distance per row whatever the number of axes. The vertical
|
|
6
|
+
* gap to the segment is projected onto its normal, so a steep line is no
|
|
7
|
+
* harder to pick than a flat one — without which the only rows a reader can
|
|
8
|
+
* ever point at are the uninteresting ones.
|
|
9
|
+
*/
|
|
10
|
+
import type { ParallelAxisLayout } from './parallelAxes.ts';
|
|
11
|
+
/** How far the pointer may sit from a line and still pick it, in pixels. */
|
|
12
|
+
export declare const PARALLEL_HOVER_TOLERANCE = 6;
|
|
13
|
+
/** A pointer position, relative to the top left of the drawing area. */
|
|
14
|
+
export interface ParallelPoint {
|
|
15
|
+
/** Pixels from the left of the drawing area. */
|
|
16
|
+
x: number;
|
|
17
|
+
/** Pixels from its top. */
|
|
18
|
+
y: number;
|
|
19
|
+
}
|
|
20
|
+
/** The pair of axes a pointer sits between, as indices into the layouts. */
|
|
21
|
+
export interface ParallelSegment {
|
|
22
|
+
/** The axis to the left of the pointer. */
|
|
23
|
+
left: number;
|
|
24
|
+
/** The axis to its right. */
|
|
25
|
+
right: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The pair of axes a horizontal position sits between.
|
|
29
|
+
* @param x - Pixels from the left of the drawing area.
|
|
30
|
+
* @param axes - The axes, from left to right.
|
|
31
|
+
* @param tolerance - How far past the first and the last axis still counts. Defaults to {@link PARALLEL_HOVER_TOLERANCE}.
|
|
32
|
+
* @returns The pair, or `null` when there are fewer than two axes or the
|
|
33
|
+
* position is past either end of the figure.
|
|
34
|
+
*/
|
|
35
|
+
export declare function parallelSegmentAt(x: number, axes: readonly ParallelAxisLayout[], tolerance?: number): ParallelSegment | null;
|
|
36
|
+
/**
|
|
37
|
+
* The row whose line runs closest to the pointer.
|
|
38
|
+
* @param point - Where the pointer is, relative to the drawing area.
|
|
39
|
+
* @param axes - The axes, from left to right.
|
|
40
|
+
* @param values - Each axis's column, in the same order.
|
|
41
|
+
* @param count - How many rows are drawn.
|
|
42
|
+
* @param included - Which rows a brush keeps, a zero meaning the row is not pickable. Defaults to every row.
|
|
43
|
+
* @param tolerance - How far the pointer may sit from a line. Defaults to {@link PARALLEL_HOVER_TOLERANCE}.
|
|
44
|
+
* @returns The row, or `-1` when the pointer is over no line.
|
|
45
|
+
*/
|
|
46
|
+
export declare function parallelNearestRow(point: ParallelPoint, axes: readonly ParallelAxisLayout[], values: ReadonlyArray<ArrayLike<number>>, count: number, included?: Uint8Array, tolerance?: number): number;
|
|
47
|
+
//# sourceMappingURL=parallelHit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelHit.d.ts","sourceRoot":"","sources":["../../../src/parallel/core/parallelHit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,wEAAwE;AACxE,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;CACX;AAED,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,MAAM,EACT,IAAI,EAAE,SAAS,kBAAkB,EAAE,EACnC,SAAS,GAAE,MAAiC,GAC3C,eAAe,GAAG,IAAI,CAaxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,SAAS,kBAAkB,EAAE,EACnC,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EACxC,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,UAAU,EACrB,SAAS,GAAE,MAAiC,GAC3C,MAAM,CA6BR"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which row the pointer is over.
|
|
3
|
+
*
|
|
4
|
+
* Only the segment between the two axes the pointer sits between is tested, so
|
|
5
|
+
* the cost is one distance per row whatever the number of axes. The vertical
|
|
6
|
+
* gap to the segment is projected onto its normal, so a steep line is no
|
|
7
|
+
* harder to pick than a flat one — without which the only rows a reader can
|
|
8
|
+
* ever point at are the uninteresting ones.
|
|
9
|
+
*/
|
|
10
|
+
import { parallelPixelAt } from "./parallelAxes.js";
|
|
11
|
+
/** How far the pointer may sit from a line and still pick it, in pixels. */
|
|
12
|
+
export const PARALLEL_HOVER_TOLERANCE = 6;
|
|
13
|
+
/**
|
|
14
|
+
* The pair of axes a horizontal position sits between.
|
|
15
|
+
* @param x - Pixels from the left of the drawing area.
|
|
16
|
+
* @param axes - The axes, from left to right.
|
|
17
|
+
* @param tolerance - How far past the first and the last axis still counts. Defaults to {@link PARALLEL_HOVER_TOLERANCE}.
|
|
18
|
+
* @returns The pair, or `null` when there are fewer than two axes or the
|
|
19
|
+
* position is past either end of the figure.
|
|
20
|
+
*/
|
|
21
|
+
export function parallelSegmentAt(x, axes, tolerance = PARALLEL_HOVER_TOLERANCE) {
|
|
22
|
+
const first = axes[0];
|
|
23
|
+
const last = axes.at(-1);
|
|
24
|
+
if (first === undefined || last === undefined || axes.length < 2)
|
|
25
|
+
return null;
|
|
26
|
+
if (x < first.x - tolerance || x > last.x + tolerance)
|
|
27
|
+
return null;
|
|
28
|
+
for (let index = 1; index < axes.length; index++) {
|
|
29
|
+
const right = axes[index];
|
|
30
|
+
if (right === undefined)
|
|
31
|
+
continue;
|
|
32
|
+
if (x <= right.x || index === axes.length - 1) {
|
|
33
|
+
return { left: index - 1, right: index };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The row whose line runs closest to the pointer.
|
|
40
|
+
* @param point - Where the pointer is, relative to the drawing area.
|
|
41
|
+
* @param axes - The axes, from left to right.
|
|
42
|
+
* @param values - Each axis's column, in the same order.
|
|
43
|
+
* @param count - How many rows are drawn.
|
|
44
|
+
* @param included - Which rows a brush keeps, a zero meaning the row is not pickable. Defaults to every row.
|
|
45
|
+
* @param tolerance - How far the pointer may sit from a line. Defaults to {@link PARALLEL_HOVER_TOLERANCE}.
|
|
46
|
+
* @returns The row, or `-1` when the pointer is over no line.
|
|
47
|
+
*/
|
|
48
|
+
export function parallelNearestRow(point, axes, values, count, included, tolerance = PARALLEL_HOVER_TOLERANCE) {
|
|
49
|
+
const segment = parallelSegmentAt(point.x, axes, tolerance);
|
|
50
|
+
if (segment === null)
|
|
51
|
+
return -1;
|
|
52
|
+
const left = axes[segment.left];
|
|
53
|
+
const right = axes[segment.right];
|
|
54
|
+
const leftColumn = values[segment.left];
|
|
55
|
+
const rightColumn = values[segment.right];
|
|
56
|
+
if (left === undefined || right === undefined)
|
|
57
|
+
return -1;
|
|
58
|
+
if (leftColumn === undefined || rightColumn === undefined)
|
|
59
|
+
return -1;
|
|
60
|
+
const width = right.x - left.x;
|
|
61
|
+
if (width <= 0)
|
|
62
|
+
return -1;
|
|
63
|
+
const ratio = (point.x - left.x) / width;
|
|
64
|
+
const rows = Math.min(count, leftColumn.length, rightColumn.length);
|
|
65
|
+
let nearest = -1;
|
|
66
|
+
let nearestDistance = tolerance;
|
|
67
|
+
for (let row = 0; row < rows; row++) {
|
|
68
|
+
if (included?.[row] === 0)
|
|
69
|
+
continue;
|
|
70
|
+
const leftY = parallelPixelAt(left.pixels, leftColumn[row]);
|
|
71
|
+
const rightY = parallelPixelAt(right.pixels, rightColumn[row]);
|
|
72
|
+
const gap = Math.abs(leftY + (rightY - leftY) * ratio - point.y);
|
|
73
|
+
const distance = (gap * width) / Math.hypot(width, rightY - leftY);
|
|
74
|
+
if (distance < nearestDistance) {
|
|
75
|
+
nearestDistance = distance;
|
|
76
|
+
nearest = row;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return nearest;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=parallelHit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelHit.js","sourceRoot":"","sources":["../../../src/parallel/core/parallelHit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAkB1C;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,CAAS,EACT,IAAmC,EACnC,YAAoB,wBAAwB;IAE5C,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACtB,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACzB,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,IAAI,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AC3B,OAAO,GAAG,GAAG,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The lines, painted into a canvas.
|
|
3
|
+
*
|
|
4
|
+
* The first canvas figure in the family, and for one reason: ten thousand
|
|
5
|
+
* polylines of a dozen points each is a hundred and twenty thousand SVG
|
|
6
|
+
* coordinates the browser would keep as elements. Everything a reader points
|
|
7
|
+
* at, brushes or reads is still SVG or HTML over the top, so only the mass of
|
|
8
|
+
* lines is pixels — which is also why saving the figure keeps the axes and
|
|
9
|
+
* loses the lines, and why a site that needs a downloadable figure should say
|
|
10
|
+
* so before choosing this one.
|
|
11
|
+
*/
|
|
12
|
+
import type { ParallelAxisLayout } from './parallelAxes.ts';
|
|
13
|
+
/** How strongly one kept line is drawn, so that the mass reads as a density. */
|
|
14
|
+
export declare const PARALLEL_INCLUDED_ALPHA = 0.35;
|
|
15
|
+
/** What one pass of the line painter needs. */
|
|
16
|
+
export interface ParallelPaint {
|
|
17
|
+
/** The axes, from left to right, already placed and measured. */
|
|
18
|
+
layouts: readonly ParallelAxisLayout[];
|
|
19
|
+
/** Each axis's column, in the same order. */
|
|
20
|
+
values: ReadonlyArray<ArrayLike<number>>;
|
|
21
|
+
/** How many rows to draw. */
|
|
22
|
+
count: number;
|
|
23
|
+
/**
|
|
24
|
+
* Which rows the brushes keep, a zero meaning the row is drawn underneath in
|
|
25
|
+
* the excluded ink.
|
|
26
|
+
* @default null — every row is kept and nothing is drawn underneath
|
|
27
|
+
*/
|
|
28
|
+
included?: Uint8Array | null;
|
|
29
|
+
/**
|
|
30
|
+
* Which colour each row takes, as a step into `palette`.
|
|
31
|
+
* @default null — every line takes `line`
|
|
32
|
+
*/
|
|
33
|
+
steps?: Uint8Array | null;
|
|
34
|
+
/**
|
|
35
|
+
* The colours a step indexes, from `parallelPalette`.
|
|
36
|
+
* @default [] — nothing to index
|
|
37
|
+
*/
|
|
38
|
+
palette?: readonly string[];
|
|
39
|
+
/** The ink a line takes when no quantity is colouring the lines. */
|
|
40
|
+
line: string;
|
|
41
|
+
/** The ink the rows a brush left out are drawn in. */
|
|
42
|
+
excluded: string;
|
|
43
|
+
/**
|
|
44
|
+
* How strongly a kept line is drawn. Turn it down for a dense library.
|
|
45
|
+
* @default PARALLEL_INCLUDED_ALPHA
|
|
46
|
+
*/
|
|
47
|
+
includedAlpha?: number;
|
|
48
|
+
}
|
|
49
|
+
/** One row drawn over the mass, and the ink it is drawn in. */
|
|
50
|
+
export interface ParallelHighlight {
|
|
51
|
+
/** The row. */
|
|
52
|
+
row: number;
|
|
53
|
+
/** Its ink. */
|
|
54
|
+
color: string;
|
|
55
|
+
}
|
|
56
|
+
/** What the highlight pass needs. */
|
|
57
|
+
export interface ParallelHighlightPaint {
|
|
58
|
+
/** The rows to draw, the last one on top. */
|
|
59
|
+
highlights: readonly ParallelHighlight[];
|
|
60
|
+
/** The axes, from left to right. */
|
|
61
|
+
layouts: readonly ParallelAxisLayout[];
|
|
62
|
+
/** Each axis's column, in the same order. */
|
|
63
|
+
values: ReadonlyArray<ArrayLike<number>>;
|
|
64
|
+
/** The ink the halo under each line is drawn in. */
|
|
65
|
+
halo: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resize a canvas to the device pixel grid and move its origin to the drawing
|
|
69
|
+
* area, which also clears whatever it held.
|
|
70
|
+
* @param canvas - The canvas, or `null` before it is mounted.
|
|
71
|
+
* @param width - Width of the figure, in CSS pixels.
|
|
72
|
+
* @param height - Its height, in CSS pixels.
|
|
73
|
+
* @returns The context, or `null` when there is nothing to draw on.
|
|
74
|
+
*/
|
|
75
|
+
export declare function preparePlotCanvas(canvas: HTMLCanvasElement | null, width: number, height: number): CanvasRenderingContext2D | null;
|
|
76
|
+
/**
|
|
77
|
+
* Draw one line per row: the ones a brush left out first, underneath, then the
|
|
78
|
+
* kept ones over them.
|
|
79
|
+
*
|
|
80
|
+
* The excluded rows are one single path stroked once, in a light grey rather
|
|
81
|
+
* than a translucent black: overlapping segments of one stroked path
|
|
82
|
+
* accumulate alpha, so a translucent black saturates to black wherever the
|
|
83
|
+
* library is dense, while a light grey is a colour the pile can only converge
|
|
84
|
+
* on.
|
|
85
|
+
* @param context - A context already scaled and moved to the drawing area by {@link preparePlotCanvas}.
|
|
86
|
+
* @param paint - See {@link ParallelPaint}.
|
|
87
|
+
*/
|
|
88
|
+
export declare function paintParallelLines(context: CanvasRenderingContext2D, paint: ParallelPaint): void;
|
|
89
|
+
/**
|
|
90
|
+
* Draw a few singled-out rows over the mass, each over a halo and dotted at
|
|
91
|
+
* every axis crossing.
|
|
92
|
+
* @param context - A context already scaled and moved to the drawing area.
|
|
93
|
+
* @param paint - See {@link ParallelHighlightPaint}.
|
|
94
|
+
*/
|
|
95
|
+
export declare function paintParallelHighlights(context: CanvasRenderingContext2D, paint: ParallelHighlightPaint): void;
|
|
96
|
+
/**
|
|
97
|
+
* Add one row's line to the path being built.
|
|
98
|
+
* @param context - A context already scaled and moved to the drawing area.
|
|
99
|
+
* @param row - The row to trace.
|
|
100
|
+
* @param layouts - The axes, from left to right.
|
|
101
|
+
* @param values - Each axis's column, in the same order.
|
|
102
|
+
*/
|
|
103
|
+
export declare function traceParallelRow(context: CanvasRenderingContext2D, row: number, layouts: readonly ParallelAxisLayout[], values: ReadonlyArray<ArrayLike<number>>): void;
|
|
104
|
+
//# sourceMappingURL=parallelPaint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelPaint.d.ts","sourceRoot":"","sources":["../../../src/parallel/core/parallelPaint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,gFAAgF;AAChF,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAa5C,+CAA+C;AAC/C,MAAM,WAAW,aAAa;IAC5B,iEAA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