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.
Files changed (207) hide show
  1. package/README.md +175 -21
  2. package/lib/about/core/about.d.ts +13 -7
  3. package/lib/about/core/about.d.ts.map +1 -1
  4. package/lib/about/core/about.js +4 -2
  5. package/lib/about/core/about.js.map +1 -1
  6. package/lib/about/ui/AboutBuild.d.ts +20 -0
  7. package/lib/about/ui/AboutBuild.d.ts.map +1 -0
  8. package/lib/about/ui/AboutBuild.js +38 -0
  9. package/lib/about/ui/AboutBuild.js.map +1 -0
  10. package/lib/about/ui/AboutPage.d.ts +7 -0
  11. package/lib/about/ui/AboutPage.d.ts.map +1 -1
  12. package/lib/about/ui/AboutPage.js +5 -2
  13. package/lib/about/ui/AboutPage.js.map +1 -1
  14. package/lib/about/ui/index.d.ts +2 -0
  15. package/lib/about/ui/index.d.ts.map +1 -1
  16. package/lib/about/ui/index.js +1 -0
  17. package/lib/about/ui/index.js.map +1 -1
  18. package/lib/build/core/buildInfo.d.ts +39 -0
  19. package/lib/build/core/buildInfo.d.ts.map +1 -0
  20. package/lib/build/core/buildInfo.js +20 -0
  21. package/lib/build/core/buildInfo.js.map +1 -0
  22. package/lib/build/core/current.d.ts +12 -0
  23. package/lib/build/core/current.d.ts.map +1 -0
  24. package/lib/build/core/current.js +11 -0
  25. package/lib/build/core/current.js.map +1 -0
  26. package/lib/build/core/index.d.ts +3 -0
  27. package/lib/build/core/index.d.ts.map +1 -0
  28. package/lib/build/core/index.js +2 -0
  29. package/lib/build/core/index.js.map +1 -0
  30. package/lib/build/vite/buildInfo.d.ts +57 -0
  31. package/lib/build/vite/buildInfo.d.ts.map +1 -0
  32. package/lib/build/vite/buildInfo.js +151 -0
  33. package/lib/build/vite/buildInfo.js.map +1 -0
  34. package/lib/build/vite/gitHead.d.ts +29 -0
  35. package/lib/build/vite/gitHead.d.ts.map +1 -0
  36. package/lib/build/vite/gitHead.js +102 -0
  37. package/lib/build/vite/gitHead.js.map +1 -0
  38. package/lib/build/vite/index.d.ts +4 -0
  39. package/lib/build/vite/index.d.ts.map +1 -0
  40. package/lib/build/vite/index.js +3 -0
  41. package/lib/build/vite/index.js.map +1 -0
  42. package/lib/build-info.d.ts +3 -0
  43. package/lib/build-info.d.ts.map +1 -0
  44. package/lib/build-info.js +2 -0
  45. package/lib/build-info.js.map +1 -0
  46. package/lib/core.d.ts +2 -0
  47. package/lib/core.d.ts.map +1 -1
  48. package/lib/core.js +2 -0
  49. package/lib/core.js.map +1 -1
  50. package/lib/credits/core/credits.d.ts +35 -0
  51. package/lib/credits/core/credits.d.ts.map +1 -1
  52. package/lib/credits/core/credits.js +41 -0
  53. package/lib/credits/core/credits.js.map +1 -1
  54. package/lib/ecosystem/core/sites.d.ts.map +1 -1
  55. package/lib/ecosystem/core/sites.js +40 -0
  56. package/lib/ecosystem/core/sites.js.map +1 -1
  57. package/lib/ecosystem/core/types.d.ts +1 -1
  58. package/lib/ecosystem/core/types.d.ts.map +1 -1
  59. package/lib/ecosystem/ui/Wordmark.d.ts +14 -3
  60. package/lib/ecosystem/ui/Wordmark.d.ts.map +1 -1
  61. package/lib/ecosystem/ui/Wordmark.js +8 -4
  62. package/lib/ecosystem/ui/Wordmark.js.map +1 -1
  63. package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
  64. package/lib/ecosystem/ui/glyphs.js +11 -0
  65. package/lib/ecosystem/ui/glyphs.js.map +1 -1
  66. package/lib/parallel/core/index.d.ts +27 -0
  67. package/lib/parallel/core/index.d.ts.map +1 -0
  68. package/lib/parallel/core/index.js +20 -0
  69. package/lib/parallel/core/index.js.map +1 -0
  70. package/lib/parallel/core/parallelAxes.d.ts +103 -0
  71. package/lib/parallel/core/parallelAxes.d.ts.map +1 -0
  72. package/lib/parallel/core/parallelAxes.js +146 -0
  73. package/lib/parallel/core/parallelAxes.js.map +1 -0
  74. package/lib/parallel/core/parallelBrush.d.ts +79 -0
  75. package/lib/parallel/core/parallelBrush.d.ts.map +1 -0
  76. package/lib/parallel/core/parallelBrush.js +99 -0
  77. package/lib/parallel/core/parallelBrush.js.map +1 -0
  78. package/lib/parallel/core/parallelExtent.d.ts +28 -0
  79. package/lib/parallel/core/parallelExtent.d.ts.map +1 -0
  80. package/lib/parallel/core/parallelExtent.js +47 -0
  81. package/lib/parallel/core/parallelExtent.js.map +1 -0
  82. package/lib/parallel/core/parallelFilter.d.ts +36 -0
  83. package/lib/parallel/core/parallelFilter.d.ts.map +1 -0
  84. package/lib/parallel/core/parallelFilter.js +74 -0
  85. package/lib/parallel/core/parallelFilter.js.map +1 -0
  86. package/lib/parallel/core/parallelHit.d.ts +47 -0
  87. package/lib/parallel/core/parallelHit.d.ts.map +1 -0
  88. package/lib/parallel/core/parallelHit.js +81 -0
  89. package/lib/parallel/core/parallelHit.js.map +1 -0
  90. package/lib/parallel/core/parallelPaint.d.ts +104 -0
  91. package/lib/parallel/core/parallelPaint.d.ts.map +1 -0
  92. package/lib/parallel/core/parallelPaint.js +160 -0
  93. package/lib/parallel/core/parallelPaint.js.map +1 -0
  94. package/lib/parallel/core/parallelPalette.d.ts +31 -0
  95. package/lib/parallel/core/parallelPalette.d.ts.map +1 -0
  96. package/lib/parallel/core/parallelPalette.js +68 -0
  97. package/lib/parallel/core/parallelPalette.js.map +1 -0
  98. package/lib/parallel/core/parallelTicks.d.ts +34 -0
  99. package/lib/parallel/core/parallelTicks.d.ts.map +1 -0
  100. package/lib/parallel/core/parallelTicks.js +116 -0
  101. package/lib/parallel/core/parallelTicks.js.map +1 -0
  102. package/lib/parallel/core/parallelTypes.d.ts +129 -0
  103. package/lib/parallel/core/parallelTypes.d.ts.map +1 -0
  104. package/lib/parallel/core/parallelTypes.js +29 -0
  105. package/lib/parallel/core/parallelTypes.js.map +1 -0
  106. package/lib/parallel/ui/ParallelAxesLayer.d.ts +28 -0
  107. package/lib/parallel/ui/ParallelAxesLayer.d.ts.map +1 -0
  108. package/lib/parallel/ui/ParallelAxesLayer.js +29 -0
  109. package/lib/parallel/ui/ParallelAxesLayer.js.map +1 -0
  110. package/lib/parallel/ui/ParallelCoordinates.d.ts +21 -0
  111. package/lib/parallel/ui/ParallelCoordinates.d.ts.map +1 -0
  112. package/lib/parallel/ui/ParallelCoordinates.js +109 -0
  113. package/lib/parallel/ui/ParallelCoordinates.js.map +1 -0
  114. package/lib/parallel/ui/ParallelLabels.d.ts +26 -0
  115. package/lib/parallel/ui/ParallelLabels.d.ts.map +1 -0
  116. package/lib/parallel/ui/ParallelLabels.js +25 -0
  117. package/lib/parallel/ui/ParallelLabels.js.map +1 -0
  118. package/lib/parallel/ui/ParallelTooltip.d.ts +26 -0
  119. package/lib/parallel/ui/ParallelTooltip.d.ts.map +1 -0
  120. package/lib/parallel/ui/ParallelTooltip.js +30 -0
  121. package/lib/parallel/ui/ParallelTooltip.js.map +1 -0
  122. package/lib/parallel/ui/index.d.ts +25 -0
  123. package/lib/parallel/ui/index.d.ts.map +1 -0
  124. package/lib/parallel/ui/index.js +18 -0
  125. package/lib/parallel/ui/index.js.map +1 -0
  126. package/lib/parallel/ui/parallelCoordinatesProps.d.ts +185 -0
  127. package/lib/parallel/ui/parallelCoordinatesProps.d.ts.map +1 -0
  128. package/lib/parallel/ui/parallelCoordinatesProps.js +11 -0
  129. package/lib/parallel/ui/parallelCoordinatesProps.js.map +1 -0
  130. package/lib/parallel/ui/parallelGestureModel.d.ts +52 -0
  131. package/lib/parallel/ui/parallelGestureModel.d.ts.map +1 -0
  132. package/lib/parallel/ui/parallelGestureModel.js +80 -0
  133. package/lib/parallel/ui/parallelGestureModel.js.map +1 -0
  134. package/lib/parallel/ui/parallelInk.d.ts +76 -0
  135. package/lib/parallel/ui/parallelInk.d.ts.map +1 -0
  136. package/lib/parallel/ui/parallelInk.js +113 -0
  137. package/lib/parallel/ui/parallelInk.js.map +1 -0
  138. package/lib/parallel/ui/parallelPlotModel.d.ts +55 -0
  139. package/lib/parallel/ui/parallelPlotModel.d.ts.map +1 -0
  140. package/lib/parallel/ui/parallelPlotModel.js +113 -0
  141. package/lib/parallel/ui/parallelPlotModel.js.map +1 -0
  142. package/lib/parallel/ui/parallelStyles.d.ts +83 -0
  143. package/lib/parallel/ui/parallelStyles.d.ts.map +1 -0
  144. package/lib/parallel/ui/parallelStyles.js +131 -0
  145. package/lib/parallel/ui/parallelStyles.js.map +1 -0
  146. package/lib/parallel/ui/useParallelCanvas.d.ts +49 -0
  147. package/lib/parallel/ui/useParallelCanvas.d.ts.map +1 -0
  148. package/lib/parallel/ui/useParallelCanvas.js +58 -0
  149. package/lib/parallel/ui/useParallelCanvas.js.map +1 -0
  150. package/lib/parallel/ui/useParallelGesture.d.ts +67 -0
  151. package/lib/parallel/ui/useParallelGesture.d.ts.map +1 -0
  152. package/lib/parallel/ui/useParallelGesture.js +139 -0
  153. package/lib/parallel/ui/useParallelGesture.js.map +1 -0
  154. package/lib/structure/ui/useToolbarFloor.d.ts.map +1 -1
  155. package/lib/structure/ui/useToolbarFloor.js +29 -22
  156. package/lib/structure/ui/useToolbarFloor.js.map +1 -1
  157. package/lib/ui.d.ts +1 -0
  158. package/lib/ui.d.ts.map +1 -1
  159. package/lib/ui.js +1 -0
  160. package/lib/ui.js.map +1 -1
  161. package/lib/vite.d.ts +1 -0
  162. package/lib/vite.d.ts.map +1 -1
  163. package/lib/vite.js +1 -0
  164. package/lib/vite.js.map +1 -1
  165. package/package.json +2 -1
  166. package/src/about/core/about.ts +18 -9
  167. package/src/about/ui/AboutBuild.tsx +83 -0
  168. package/src/about/ui/AboutPage.tsx +15 -7
  169. package/src/about/ui/index.ts +2 -0
  170. package/src/build/core/buildInfo.ts +48 -0
  171. package/src/build/core/current.ts +12 -0
  172. package/src/build/core/index.ts +2 -0
  173. package/src/build/vite/buildInfo.ts +178 -0
  174. package/src/build/vite/gitHead.ts +114 -0
  175. package/src/build/vite/index.ts +8 -0
  176. package/src/build-info.ts +2 -0
  177. package/src/core.ts +2 -0
  178. package/src/credits/core/credits.ts +42 -0
  179. package/src/ecosystem/core/sites.ts +40 -0
  180. package/src/ecosystem/core/types.ts +4 -1
  181. package/src/ecosystem/ui/Wordmark.tsx +22 -7
  182. package/src/ecosystem/ui/glyphs.tsx +46 -0
  183. package/src/parallel/core/index.ts +80 -0
  184. package/src/parallel/core/parallelAxes.ts +207 -0
  185. package/src/parallel/core/parallelBrush.ts +145 -0
  186. package/src/parallel/core/parallelExtent.ts +56 -0
  187. package/src/parallel/core/parallelFilter.ts +94 -0
  188. package/src/parallel/core/parallelHit.ts +106 -0
  189. package/src/parallel/core/parallelPaint.ts +231 -0
  190. package/src/parallel/core/parallelPalette.ts +80 -0
  191. package/src/parallel/core/parallelTicks.ts +164 -0
  192. package/src/parallel/core/parallelTypes.ts +147 -0
  193. package/src/parallel/ui/ParallelAxesLayer.tsx +123 -0
  194. package/src/parallel/ui/ParallelCoordinates.tsx +233 -0
  195. package/src/parallel/ui/ParallelLabels.tsx +56 -0
  196. package/src/parallel/ui/ParallelTooltip.tsx +55 -0
  197. package/src/parallel/ui/index.ts +50 -0
  198. package/src/parallel/ui/parallelCoordinatesProps.ts +199 -0
  199. package/src/parallel/ui/parallelGestureModel.ts +109 -0
  200. package/src/parallel/ui/parallelInk.ts +182 -0
  201. package/src/parallel/ui/parallelPlotModel.ts +130 -0
  202. package/src/parallel/ui/parallelStyles.ts +146 -0
  203. package/src/parallel/ui/useParallelCanvas.ts +104 -0
  204. package/src/parallel/ui/useParallelGesture.ts +227 -0
  205. package/src/structure/ui/useToolbarFloor.ts +27 -22
  206. package/src/ui.ts +1 -0
  207. package/src/vite.ts +1 -0
@@ -0,0 +1,160 @@
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 { PARALLEL_MARGIN, parallelPixelAt } from "./parallelAxes.js";
13
+ /** How strongly one kept line is drawn, so that the mass reads as a density. */
14
+ export const PARALLEL_INCLUDED_ALPHA = 0.35;
15
+ /** How wide a singled-out line's halo is, in pixels. */
16
+ const HALO_WIDTH = 5;
17
+ /** How wide a singled-out line itself is. */
18
+ const HIGHLIGHT_WIDTH = 2;
19
+ /** How large the dot at each of its axis crossings is. */
20
+ const HIGHLIGHT_DOT_RADIUS = 3;
21
+ const FULL_TURN = 2 * Math.PI;
22
+ /**
23
+ * Resize a canvas to the device pixel grid and move its origin to the drawing
24
+ * area, which also clears whatever it held.
25
+ * @param canvas - The canvas, or `null` before it is mounted.
26
+ * @param width - Width of the figure, in CSS pixels.
27
+ * @param height - Its height, in CSS pixels.
28
+ * @returns The context, or `null` when there is nothing to draw on.
29
+ */
30
+ export function preparePlotCanvas(canvas, width, height) {
31
+ if (canvas === null)
32
+ return null;
33
+ const context = canvas.getContext('2d');
34
+ if (context === null)
35
+ return null;
36
+ const pixelRatio = Math.max(globalThis.devicePixelRatio || 1, 1);
37
+ // Assigning the backing store is what clears it; there is no second clear.
38
+ canvas.width = Math.round(width * pixelRatio);
39
+ canvas.height = Math.round(height * pixelRatio);
40
+ context.resetTransform();
41
+ context.scale(pixelRatio, pixelRatio);
42
+ context.translate(PARALLEL_MARGIN.left, PARALLEL_MARGIN.top);
43
+ return context;
44
+ }
45
+ /**
46
+ * Draw one line per row: the ones a brush left out first, underneath, then the
47
+ * kept ones over them.
48
+ *
49
+ * The excluded rows are one single path stroked once, in a light grey rather
50
+ * than a translucent black: overlapping segments of one stroked path
51
+ * accumulate alpha, so a translucent black saturates to black wherever the
52
+ * library is dense, while a light grey is a colour the pile can only converge
53
+ * on.
54
+ * @param context - A context already scaled and moved to the drawing area by {@link preparePlotCanvas}.
55
+ * @param paint - See {@link ParallelPaint}.
56
+ */
57
+ export function paintParallelLines(context, paint) {
58
+ const { layouts, values, count, line, excluded, includedAlpha } = paint;
59
+ if (layouts.length < 2)
60
+ return;
61
+ const included = paint.included ?? null;
62
+ const steps = paint.steps ?? null;
63
+ const palette = paint.palette ?? [];
64
+ context.lineWidth = 1;
65
+ if (included !== null) {
66
+ context.strokeStyle = excluded;
67
+ context.beginPath();
68
+ for (let row = 0; row < count; row++) {
69
+ if (included[row] !== 0)
70
+ continue;
71
+ traceParallelRow(context, row, layouts, values);
72
+ }
73
+ context.stroke();
74
+ }
75
+ context.globalAlpha = includedAlpha ?? PARALLEL_INCLUDED_ALPHA;
76
+ context.strokeStyle = line;
77
+ let previousStep = -1;
78
+ for (let row = 0; row < count; row++) {
79
+ if (included !== null && included[row] === 0)
80
+ continue;
81
+ if (steps !== null) {
82
+ const step = steps[row];
83
+ if (step !== previousStep) {
84
+ const color = palette[step];
85
+ if (color !== undefined)
86
+ context.strokeStyle = color;
87
+ previousStep = step;
88
+ }
89
+ }
90
+ context.beginPath();
91
+ traceParallelRow(context, row, layouts, values);
92
+ context.stroke();
93
+ }
94
+ context.globalAlpha = 1;
95
+ }
96
+ /**
97
+ * Draw a few singled-out rows over the mass, each over a halo and dotted at
98
+ * every axis crossing.
99
+ * @param context - A context already scaled and moved to the drawing area.
100
+ * @param paint - See {@link ParallelHighlightPaint}.
101
+ */
102
+ export function paintParallelHighlights(context, paint) {
103
+ const { highlights, layouts, values, halo } = paint;
104
+ if (layouts.length < 2)
105
+ return;
106
+ context.lineJoin = 'round';
107
+ context.lineCap = 'round';
108
+ for (const { row, color } of highlights) {
109
+ context.beginPath();
110
+ traceParallelRow(context, row, layouts, values);
111
+ context.strokeStyle = halo;
112
+ context.lineWidth = HALO_WIDTH;
113
+ context.stroke();
114
+ context.strokeStyle = color;
115
+ context.lineWidth = HIGHLIGHT_WIDTH;
116
+ context.stroke();
117
+ context.fillStyle = color;
118
+ for (let index = 0; index < layouts.length; index++) {
119
+ const layout = layouts[index];
120
+ const column = values[index];
121
+ if (layout === undefined || column === undefined)
122
+ continue;
123
+ const y = parallelPixelAt(layout.pixels, column[row]);
124
+ if (!Number.isFinite(y))
125
+ continue;
126
+ context.beginPath();
127
+ context.arc(layout.x, y, HIGHLIGHT_DOT_RADIUS, 0, FULL_TURN);
128
+ context.fill();
129
+ }
130
+ }
131
+ }
132
+ /**
133
+ * Add one row's line to the path being built.
134
+ * @param context - A context already scaled and moved to the drawing area.
135
+ * @param row - The row to trace.
136
+ * @param layouts - The axes, from left to right.
137
+ * @param values - Each axis's column, in the same order.
138
+ */
139
+ export function traceParallelRow(context, row, layouts, values) {
140
+ let started = false;
141
+ for (let index = 0; index < layouts.length; index++) {
142
+ const layout = layouts[index];
143
+ const column = values[index];
144
+ if (layout === undefined || column === undefined)
145
+ continue;
146
+ const y = parallelPixelAt(layout.pixels, column[row]);
147
+ // A row whose value on this axis is not known yet has no point to draw:
148
+ // the line skips that axis rather than collapsing onto one of its ends.
149
+ if (!Number.isFinite(y))
150
+ continue;
151
+ if (started) {
152
+ context.lineTo(layout.x, y);
153
+ }
154
+ else {
155
+ context.moveTo(layout.x, y);
156
+ started = true;
157
+ }
158
+ }
159
+ }
160
+ //# sourceMappingURL=parallelPaint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelPaint.js","sourceRoot":"","sources":["../../../src/parallel/core/parallelPaint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAErE,gFAAgF;AAChF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,wDAAwD;AACxD,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,6CAA6C;AAC7C,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,0DAA0D;AAC1D,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,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AC,CAAC;gBAAE,SAAS;YAClC,OAAO,CAAC,SAAS,EAAE,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,oBAAoB,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAiC,EACjC,GAAW,EACX,OAAsC,EACtC,MAAwC;IAExC,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS;YAAE,SAAS;QAC3D,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAW,CAAC,CAAC;QAChE,wEAAwE;QACxE,wEAAwE;QACxE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,SAAS;QAClC,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5B,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The colour each line is drawn in, as a step into a sampled ramp.
3
+ *
4
+ * A canvas reassigns `strokeStyle` once per line, and a thousand different
5
+ * colours is a thousand style writes. Quantising the ramp to 121 steps and
6
+ * keeping the rows in the order they came means the style is written about
7
+ * 121 times for the whole figure — while no reader can tell a hundred-and-
8
+ * twenty-first of a ramp apart from its neighbour.
9
+ */
10
+ import type { ColorScale } from '../../color/core/interpolate.ts';
11
+ import type { ParallelColorBy } from './parallelTypes.ts';
12
+ /** How many steps the ramp is quantised into; there is one more colour than steps. */
13
+ export declare const PARALLEL_PALETTE_STEPS = 120;
14
+ /**
15
+ * The ramp, sampled into the steps a line's colour is looked up by.
16
+ * @param scale - The ramp, as the registry hands it over or as a plain list of colours. Defaults to viridis.
17
+ * @returns `PARALLEL_PALETTE_STEPS + 1` colours, from the low end to the high end.
18
+ */
19
+ export declare function parallelPalette(scale?: ColorScale | readonly string[]): readonly string[];
20
+ /**
21
+ * Which step of the ramp each row takes.
22
+ *
23
+ * Worked out once per data change rather than per repaint, and held as bytes:
24
+ * a library of ten thousand rows costs ten kilobytes and the painter's inner
25
+ * loop reads an integer instead of placing a value on a ramp.
26
+ * @param color - The quantity the lines are coloured by.
27
+ * @param count - How many rows there are.
28
+ * @returns One step per row, from `0` to {@link PARALLEL_PALETTE_STEPS}.
29
+ */
30
+ export declare function parallelColorSteps(color: ParallelColorBy, count: number): Uint8Array;
31
+ //# sourceMappingURL=parallelPalette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelPalette.d.ts","sourceRoot":"","sources":["../../../src/parallel/core/parallelPalette.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAOlE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,sFAAsF;AACtF,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,MAAM,EAAE,GACrC,SAAS,MAAM,EAAE,CAEnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,eAAe,EACtB,KAAK,EAAE,MAAM,GACZ,UAAU,CAkBZ"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The colour each line is drawn in, as a step into a sampled ramp.
3
+ *
4
+ * A canvas reassigns `strokeStyle` once per line, and a thousand different
5
+ * colours is a thousand style writes. Quantising the ramp to 121 steps and
6
+ * keeping the rows in the order they came means the style is written about
7
+ * 121 times for the whole figure — while no reader can tell a hundred-and-
8
+ * twenty-first of a ramp apart from its neighbour.
9
+ */
10
+ import { evenScale, sampleScale } from "../../color/core/interpolate.js";
11
+ import { positionInRange } from "../../color/core/scale.js";
12
+ import { resolveColorScale } from "../../color/core/scaleText.js";
13
+ import { DEFAULT_COLOR_SCALE_ID } from "../../color/core/scales.js";
14
+ import { parallelExtent } from "./parallelExtent.js";
15
+ /** How many steps the ramp is quantised into; there is one more colour than steps. */
16
+ export const PARALLEL_PALETTE_STEPS = 120;
17
+ /**
18
+ * The ramp, sampled into the steps a line's colour is looked up by.
19
+ * @param scale - The ramp, as the registry hands it over or as a plain list of colours. Defaults to viridis.
20
+ * @returns `PARALLEL_PALETTE_STEPS + 1` colours, from the low end to the high end.
21
+ */
22
+ export function parallelPalette(scale) {
23
+ return sampleScale(resolveRamp(scale), PARALLEL_PALETTE_STEPS + 1);
24
+ }
25
+ /**
26
+ * Which step of the ramp each row takes.
27
+ *
28
+ * Worked out once per data change rather than per repaint, and held as bytes:
29
+ * a library of ten thousand rows costs ten kilobytes and the painter's inner
30
+ * loop reads an integer instead of placing a value on a ramp.
31
+ * @param color - The quantity the lines are coloured by.
32
+ * @param count - How many rows there are.
33
+ * @returns One step per row, from `0` to {@link PARALLEL_PALETTE_STEPS}.
34
+ */
35
+ export function parallelColorSteps(color, count) {
36
+ const steps = new Uint8Array(count);
37
+ const extent = parallelExtent(color.values, count);
38
+ const min = color.min ?? extent.min;
39
+ const max = color.max ?? extent.max;
40
+ const logarithmic = color.logarithmic ?? false;
41
+ const span = max - min;
42
+ const rows = Math.min(count, color.values.length);
43
+ for (let row = 0; row < rows; row++) {
44
+ const value = color.values[row];
45
+ steps[row] = logarithmic
46
+ ? Math.round(positionInRange(value, min, max, { logarithmic: true }) *
47
+ PARALLEL_PALETTE_STEPS)
48
+ : colorStep(value, min, span);
49
+ }
50
+ return steps;
51
+ }
52
+ function resolveRamp(scale) {
53
+ if (scale === undefined) {
54
+ return resolveColorScale(DEFAULT_COLOR_SCALE_ID).scale;
55
+ }
56
+ return 'stops' in scale ? scale : evenScale(scale);
57
+ }
58
+ function colorStep(value, min, span) {
59
+ if (span <= 0)
60
+ return 0;
61
+ const ratio = (value - min) / span;
62
+ if (Number.isNaN(ratio) || ratio < 0)
63
+ return 0;
64
+ if (ratio > 1)
65
+ return PARALLEL_PALETTE_STEPS;
66
+ return Math.round(ratio * PARALLEL_PALETTE_STEPS);
67
+ }
68
+ //# sourceMappingURL=parallelPalette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelPalette.js","sourceRoot":"","sources":["../../../src/parallel/core/parallelPalette.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,sFAAsF;AACtF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAsC;IAEtC,OAAO,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,sBAAsB,GAAG,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;;GASG;AACH,MAA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CAAC,CAAC;AACrD,CAAC;AAED,SAAS,SAAS,CAAC,KAAa,EAAE,GAAW,EAAE,IAAY;IACzD,IAAI,IAAI,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACxB,MAAM,KAAK,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IAC/C,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,sBAAsB,CAAC;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,sBAAsB,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * How one axis is graduated.
3
+ *
4
+ * Five evenly spaced marks across the raw extent, not `chartAxisScale`'s nice
5
+ * ones: nicing moves the ends of the axis, and a figure whose whole job is to
6
+ * compare rows against each other must end exactly where the data does. A
7
+ * caller who wants round numbers asks for them with `nice`, per axis.
8
+ */
9
+ import type { ParallelAxis, ParallelTick } from './parallelTypes.ts';
10
+ /** How many graduations an axis carries when the caller asks for no number. */
11
+ export declare const PARALLEL_TICK_COUNT = 5;
12
+ /** An axis's ends and the graduations written along it. */
13
+ export interface ParallelGraduation {
14
+ /** The two ends of the axis, low first, after any nicing. */
15
+ domain: readonly [number, number];
16
+ /** The graduations, from the bottom of the axis to the top. */
17
+ ticks: readonly ParallelTick[];
18
+ }
19
+ /**
20
+ * The graduations of one axis, and the ends they are spread between.
21
+ *
22
+ * Three ways, in order: the caller's own list wins outright — a coded quantity
23
+ * reading `none`, `low`, `high` is nobody else's to invent; `nice` hands the
24
+ * axis to `chartAxisScale`, which rounds both ends outward to whole steps; and
25
+ * otherwise the extent is divided evenly and a mark whose label repeats the
26
+ * one below it is dropped, so an axis of whole numbers from 0 to 2 reads
27
+ * `0 1 2` rather than writing `1` twice.
28
+ * @param axis - The axis, for its formatting and how many marks it wants.
29
+ * @param min - The value at the bottom of the axis.
30
+ * @param max - The value at its top.
31
+ * @returns The ends and the graduations. See {@link ParallelGraduation}.
32
+ */
33
+ export declare function parallelTicks(axis: ParallelAxis, min: number, max: number): ParallelGraduation;
34
+ //# sourceMappingURL=parallelTicks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelTicks.d.ts","sourceRoot":"","sources":["../../../src/parallel/core/parallelTicks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAErE,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAQrC,2DAA2D;AAC3D,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,+DAA+D;IAC/D,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,kBAAkB,CAWpB"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * How one axis is graduated.
3
+ *
4
+ * Five evenly spaced marks across the raw extent, not `chartAxisScale`'s nice
5
+ * ones: nicing moves the ends of the axis, and a figure whose whole job is to
6
+ * compare rows against each other must end exactly where the data does. A
7
+ * caller who wants round numbers asks for them with `nice`, per axis.
8
+ */
9
+ import { chartAxisScale, chartTickDecimals, } from "../../chart/core/chartAxisScale.js";
10
+ import { formatDecimal } from "../../format/core/numbers.js";
11
+ import { roundTo } from "../../format/core/roundTo.js";
12
+ /** How many graduations an axis carries when the caller asks for no number. */
13
+ export const PARALLEL_TICK_COUNT = 5;
14
+ /** The most decimals a graduation is ever written with. */
15
+ const MOST_TICK_DECIMALS = 6;
16
+ /** How far a label may sit from its own value: a tenth of the spacing. */
17
+ const LABEL_TOLERANCE = 10;
18
+ /**
19
+ * The graduations of one axis, and the ends they are spread between.
20
+ *
21
+ * Three ways, in order: the caller's own list wins outright — a coded quantity
22
+ * reading `none`, `low`, `high` is nobody else's to invent; `nice` hands the
23
+ * axis to `chartAxisScale`, which rounds both ends outward to whole steps; and
24
+ * otherwise the extent is divided evenly and a mark whose label repeats the
25
+ * one below it is dropped, so an axis of whole numbers from 0 to 2 reads
26
+ * `0 1 2` rather than writing `1` twice.
27
+ * @param axis - The axis, for its formatting and how many marks it wants.
28
+ * @param min - The value at the bottom of the axis.
29
+ * @param max - The value at its top.
30
+ * @returns The ends and the graduations. See {@link ParallelGraduation}.
31
+ */
32
+ export function parallelTicks(axis, min, max) {
33
+ const domain = [min, max];
34
+ if (axis.ticks !== undefined)
35
+ return { domain, ticks: axis.ticks };
36
+ const wanted = Math.max(2, Math.trunc(axis.tickCount ?? PARALLEL_TICK_COUNT));
37
+ if (axis.nice === true && axis.scale !== 'log') {
38
+ return nicedGraduation(axis, min, max, wanted);
39
+ }
40
+ const values = evenValues(min, max, wanted, axis.scale === 'log');
41
+ return { domain, ticks: labelled(values, axis.format) };
42
+ }
43
+ function nicedGraduation(axis, min, max, wanted) {
44
+ const scale = chartAxisScale(min, max, { count: wanted, nice: true });
45
+ const ticks = [];
46
+ for (let index = 0; index < scale.values.length; index++) {
47
+ const value = scale.values[index];
48
+ const label = axis.format === undefined
49
+ ? (scale.labels[index] ?? formatDecimal(value, scale.decimals))
50
+ : axis.format(value);
51
+ if (ticks.at(-1)?.label === label)
52
+ continue;
53
+ ticks.push({ value, label });
54
+ }
55
+ return { domain: scale.domain, ticks };
56
+ }
57
+ function evenValues(min, max, wanted, logarithmic) {
58
+ const values = [];
59
+ const low = logarithmic ? Math.log10(Math.max(min, smallestStep(max))) : min;
60
+ const high = logarithmic ? Math.log10(Math.max(max, smallestStep(max))) : max;
61
+ const span = high - low;
62
+ for (let index = 0; index < wanted; index++) {
63
+ const placed = low + (span * index) / (wanted - 1);
64
+ values.push(logarithmic ? 10 ** placed : placed);
65
+ }
66
+ return values;
67
+ }
68
+ function labelled(values, format) {
69
+ const decimals = format === undefined ? tickDecimals(values) : 0;
70
+ const ticks = [];
71
+ for (const value of values) {
72
+ const label = format === undefined ? formatDecimal(value, decimals) : format(value);
73
+ if (ticks.at(-1)?.label === label)
74
+ continue;
75
+ ticks.push({ value, label });
76
+ }
77
+ return ticks;
78
+ }
79
+ /**
80
+ * As many decimals as the spacing needs, and one more whenever rounding would
81
+ * move a mark by more than a tenth of that spacing — which is what keeps an
82
+ * axis from 12.3 to 157 reading `12 48 85 121 157` while one from −1.5 to 2.5
83
+ * still reads `−1.5 −0.5 0.5 1.5 2.5` rather than rounding both away.
84
+ * @param values - The graduations, in the axis's own units.
85
+ * @returns How many decimals each of their labels carries.
86
+ */
87
+ function tickDecimals(values) {
88
+ const step = smallestGap(values);
89
+ const tolerance = step / LABEL_TOLERANCE;
90
+ let decimals = chartTickDecimals(step);
91
+ while (decimals < MOST_TICK_DECIMALS &&
92
+ !faithful(values, decimals, tolerance)) {
93
+ decimals++;
94
+ }
95
+ return decimals;
96
+ }
97
+ function faithful(values, decimals, tolerance) {
98
+ for (const value of values) {
99
+ if (Math.abs(value - roundTo(value, decimals)) > tolerance)
100
+ return false;
101
+ }
102
+ return true;
103
+ }
104
+ function smallestGap(values) {
105
+ let smallest = Number.POSITIVE_INFINITY;
106
+ for (let index = 1; index < values.length; index++) {
107
+ const gap = Math.abs(values[index] - values[index - 1]);
108
+ if (gap > 0 && gap < smallest)
109
+ smallest = gap;
110
+ }
111
+ return Number.isFinite(smallest) ? smallest : 1;
112
+ }
113
+ function smallestStep(max) {
114
+ return max > 0 ? max * 1e-12 : 1;
115
+ }
116
+ //# sourceMappingURL=parallelTicks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelTicks.js","sourceRoot":"","sources":["../../../src/parallel/core/parallelTicks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OA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, and the quantity the lines are
4
+ * coloured by.
5
+ *
6
+ * The figure itself is index-based — every axis hands over its column as an
7
+ * `ArrayLike<number>` read in place — so a repaint costs an indexed read per
8
+ * value rather than a call. {@link parallelAxisOf} is the one place a row type
9
+ * is named, and it is run once per data change rather than once per repaint.
10
+ */
11
+ import type { ColorScale } from '../../color/core/interpolate.ts';
12
+ /** How a value is placed along an axis. */
13
+ export type ParallelAxisScale = 'linear' | 'log';
14
+ /** One labelled graduation a caller writes itself. */
15
+ export interface ParallelTick {
16
+ /** Where it sits, in the axis's own units. */
17
+ value: number;
18
+ /** What is written beside it. */
19
+ label: string;
20
+ }
21
+ /** One vertical axis of a parallel-coordinates figure, and the column it draws. */
22
+ export interface ParallelAxis {
23
+ /**
24
+ * A stable key, which is how a brushed range is reported and how a caller
25
+ * names the axis the colour is read from. Never an index: axes are added and
26
+ * reordered, and a range keyed on a position outlives the axis it belonged
27
+ * to.
28
+ */
29
+ id: string;
30
+ /** What it is called, written over the axis. */
31
+ label: string;
32
+ /**
33
+ * Every row's value, in the figure's row order. Read in place — nothing is
34
+ * copied — so a `Float64Array` is the cheapest thing to pass.
35
+ */
36
+ values: ArrayLike<number>;
37
+ /**
38
+ * The two ends of the axis, low first. Left out, they are the column's own
39
+ * smallest and largest finite value, and a column with no spread at all is
40
+ * opened by half a unit on each side so that it still draws.
41
+ * @default undefined — the column's own range
42
+ */
43
+ domain?: readonly [number, number];
44
+ /**
45
+ * How values are placed between the ends. `log` needs a domain whose low end
46
+ * is above zero; a value at or below zero is pinned to the low end.
47
+ * @default 'linear'
48
+ */
49
+ scale?: ParallelAxisScale;
50
+ /**
51
+ * How a tick is written. Left out, the ticks carry as many decimals as the
52
+ * spacing needs.
53
+ * @default undefined
54
+ */
55
+ format?: (value: number) => string;
56
+ /**
57
+ * The graduations, written out by the caller — what a coded quantity needs,
58
+ * where `0`, `1`, `2` should read `none`, `low`, `high`.
59
+ * @default undefined — the figure graduates the axis itself
60
+ */
61
+ ticks?: readonly ParallelTick[];
62
+ /**
63
+ * Roughly how many graduations to aim for, when the figure picks them.
64
+ * @default 5
65
+ */
66
+ tickCount?: number;
67
+ /**
68
+ * Whether the ends are rounded outward to whole tick steps. Off, so the axis
69
+ * ends exactly on the data — a reader comparing two molecules on a drug
70
+ * score must see the best one touch the top of its axis, not float below a
71
+ * round number nothing reached.
72
+ * @default false
73
+ */
74
+ nice?: boolean;
75
+ /**
76
+ * The unit written after the axis name, e.g. `g/mol`.
77
+ * @default '' — nothing is written
78
+ */
79
+ unit?: string;
80
+ }
81
+ /** An interval kept on one axis, in that axis's own units, low first. */
82
+ export type ParallelRange = readonly [number, number];
83
+ /** Which rows a set of brushes keeps, keyed by axis id. */
84
+ export type ParallelRanges = Readonly<Record<string, ParallelRange | null>>;
85
+ /** How the lines are coloured. */
86
+ export interface ParallelColorBy {
87
+ /** The quantity read for each row, in the figure's row order. */
88
+ values: ArrayLike<number>;
89
+ /**
90
+ * The value at the low end of the ramp.
91
+ * @default the smallest finite value
92
+ */
93
+ min?: number;
94
+ /**
95
+ * The value at its high end.
96
+ * @default the largest finite value
97
+ */
98
+ max?: number;
99
+ /**
100
+ * The ramp, as the registry hands it over or as a plain list of colours.
101
+ * @default viridis — `resolveColorScale(DEFAULT_COLOR_SCALE_ID).scale`
102
+ */
103
+ scale?: ColorScale | readonly string[];
104
+ /**
105
+ * Whether the quantity is read on a base-10 logarithmic ramp.
106
+ * @default false
107
+ */
108
+ logarithmic?: boolean;
109
+ }
110
+ /** An axis described by the field to read off each row, rather than by its column. */
111
+ export type ParallelAxisSource<Row> = Omit<ParallelAxis, 'values'> & {
112
+ /**
113
+ * The value this axis reads off one row. Called once per row per data
114
+ * change, never per repaint.
115
+ */
116
+ readonly value: (row: Row) => number;
117
+ };
118
+ /**
119
+ * One axis built by reading a field off each row.
120
+ *
121
+ * The one place a row type is named: the figure itself reads numbers out of a
122
+ * typed array, so a repaint costs an indexed read rather than a call per
123
+ * value. Call it inside a `useMemo` keyed on the rows.
124
+ * @param rows - The rows, in the order the figure will index them.
125
+ * @param axis - The axis, with the field to read instead of its values.
126
+ * @returns The axis, with its values filled in.
127
+ */
128
+ export declare function parallelAxisOf<Row>(rows: readonly Row[], axis: ParallelAxisSource<Row>): ParallelAxis;
129
+ //# sourceMappingURL=parallelTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelTypes.d.ts","sourceRoot":"","sources":["../../../src/parallel/core/parallelTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEjD,sDAAsD;AACtD,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,mFAAmF;AACnF,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yEAAyE;AACzE,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtD,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC;AAE5E,kCAAkC;AAClC,MAAM,WAAW,eAAe;IAC9B,iEAAiE;IACjE,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,MAAM,EAAE,CAAC;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,sFAAsF;AACtF,MAAM,MAAM,kBAAkB,CAAC,GAAG,IAAI,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG;IACnE;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;CACtC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAChC,IAAI,EAAE,SAAS,GAAG,EAAE,EACpB,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAC5B,YAAY,CAOd"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * What a parallel-coordinates figure is asked to draw: one axis per column,
3
+ * the intervals the reader brushed on them, and the quantity the lines are
4
+ * coloured by.
5
+ *
6
+ * The figure itself is index-based — every axis hands over its column as an
7
+ * `ArrayLike<number>` read in place — so a repaint costs an indexed read per
8
+ * value rather than a call. {@link parallelAxisOf} is the one place a row type
9
+ * is named, and it is run once per data change rather than once per repaint.
10
+ */
11
+ /**
12
+ * One axis built by reading a field off each row.
13
+ *
14
+ * The one place a row type is named: the figure itself reads numbers out of a
15
+ * typed array, so a repaint costs an indexed read rather than a call per
16
+ * value. Call it inside a `useMemo` keyed on the rows.
17
+ * @param rows - The rows, in the order the figure will index them.
18
+ * @param axis - The axis, with the field to read instead of its values.
19
+ * @returns The axis, with its values filled in.
20
+ */
21
+ export function parallelAxisOf(rows, axis) {
22
+ const { value, ...rest } = axis;
23
+ const values = new Float64Array(rows.length);
24
+ for (let row = 0; row < rows.length; row++) {
25
+ values[row] = value(rows[row]);
26
+ }
27
+ return { ...rest, values };
28
+ }
29
+ //# sourceMappingURL=parallelTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelTypes.js","sourceRoot":"","sources":["../../../src/parallel/core/parallelTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAqHH;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAoB,EACpB,IAA6B;IAE7B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAChC,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;QAC3C,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAQ,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { ParallelAxisLayout } from '../core/parallelAxes.ts';
3
+ import type { ParallelBand } from '../core/parallelBrush.ts';
4
+ /** What {@link ParallelAxesLayer} draws. */
5
+ export interface ParallelAxesLayerProps {
6
+ /** The axes, from left to right, already placed and graduated. */
7
+ layouts: readonly ParallelAxisLayout[];
8
+ /** Height of the drawing area, in pixels. */
9
+ innerHeight: number;
10
+ /** The band each axis carries right now, the one being dragged included. */
11
+ bands: ReadonlyMap<string, ParallelBand>;
12
+ /** The ink the axes, their ticks and their labels are drawn in. */
13
+ axisInk: string;
14
+ /** The ink a band is filled and outlined in. */
15
+ bandInk: string;
16
+ }
17
+ /**
18
+ * The axes, their graduations and the intervals brushed on them.
19
+ *
20
+ * Every axis carries a `data-parallel-brush` rectangle over the strip a press
21
+ * on it reaches, which nothing points at: one surface over the whole figure
22
+ * takes every event, so the rectangle exists to be found — by a test driving
23
+ * a drag, and by a reader's eye, which is the same thing.
24
+ * @param props - See {@link ParallelAxesLayerProps}.
25
+ * @returns The axes.
26
+ */
27
+ export declare function ParallelAxesLayer(props: ParallelAxesLayerProps): ReactElement;
28
+ //# sourceMappingURL=ParallelAxesLayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParallelAxesLayer.d.ts","sourceRoot":"","sources":["../../../src/parallel/ui/ParallelAxesLayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAY7D,4CAA4C;AAC5C,MAAM,WAAW,sBAAsB;IACrC,kEAAkE;IAClE,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACvC,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAmD7E"}