react-cheminfo 0.21.0 → 0.23.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 (253) hide show
  1. package/README.md +14 -4
  2. package/lib/build/vite/gitHead.d.ts.map +1 -1
  3. package/lib/build/vite/gitHead.js +17 -2
  4. package/lib/build/vite/gitHead.js.map +1 -1
  5. package/lib/clipboard/ui/ClickToCopy.d.ts +69 -0
  6. package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -0
  7. package/lib/clipboard/ui/ClickToCopy.js +66 -0
  8. package/lib/clipboard/ui/ClickToCopy.js.map +1 -0
  9. package/lib/clipboard/ui/CopyButton.d.ts +1 -1
  10. package/lib/clipboard/ui/CopyButton.js +1 -1
  11. package/lib/clipboard/ui/CopyableValue.d.ts +3 -3
  12. package/lib/clipboard/ui/CopyableValue.d.ts.map +1 -1
  13. package/lib/clipboard/ui/CopyableValue.js +5 -5
  14. package/lib/clipboard/ui/CopyableValue.js.map +1 -1
  15. package/lib/clipboard/ui/index.d.ts +2 -0
  16. package/lib/clipboard/ui/index.d.ts.map +1 -1
  17. package/lib/clipboard/ui/index.js +1 -0
  18. package/lib/clipboard/ui/index.js.map +1 -1
  19. package/lib/ecosystem/core/groups.d.ts +4 -3
  20. package/lib/ecosystem/core/groups.d.ts.map +1 -1
  21. package/lib/ecosystem/core/groups.js +8 -2
  22. package/lib/ecosystem/core/groups.js.map +1 -1
  23. package/lib/ecosystem/core/sites.d.ts.map +1 -1
  24. package/lib/ecosystem/core/sites.js +39 -0
  25. package/lib/ecosystem/core/sites.js.map +1 -1
  26. package/lib/ecosystem/core/types.d.ts +1 -1
  27. package/lib/ecosystem/core/types.d.ts.map +1 -1
  28. package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
  29. package/lib/ecosystem/ui/glyphs.js +9 -0
  30. package/lib/ecosystem/ui/glyphs.js.map +1 -1
  31. package/lib/error/ui/ErrorFallback.d.ts.map +1 -1
  32. package/lib/error/ui/ErrorFallback.js +1 -1
  33. package/lib/error/ui/ErrorFallback.js.map +1 -1
  34. package/lib/overlay/core/index.d.ts +2 -2
  35. package/lib/overlay/core/index.d.ts.map +1 -1
  36. package/lib/overlay/core/index.js +1 -1
  37. package/lib/overlay/core/index.js.map +1 -1
  38. package/lib/overlay/core/overlayMarks.d.ts +20 -5
  39. package/lib/overlay/core/overlayMarks.d.ts.map +1 -1
  40. package/lib/overlay/core/overlayMarks.js +31 -5
  41. package/lib/overlay/core/overlayMarks.js.map +1 -1
  42. package/lib/overlay/ui/OverlayLegendMark.js +5 -0
  43. package/lib/overlay/ui/OverlayLegendMark.js.map +1 -1
  44. package/lib/pedagogy/ui/ReferenceSectionBlock.d.ts.map +1 -1
  45. package/lib/pedagogy/ui/ReferenceSectionBlock.js +2 -1
  46. package/lib/pedagogy/ui/ReferenceSectionBlock.js.map +1 -1
  47. package/lib/projection/core/index.d.ts +4 -4
  48. package/lib/projection/core/index.d.ts.map +1 -1
  49. package/lib/projection/core/index.js +2 -2
  50. package/lib/projection/core/index.js.map +1 -1
  51. package/lib/projection/core/projectionCopy.d.ts +2 -0
  52. package/lib/projection/core/projectionCopy.d.ts.map +1 -1
  53. package/lib/projection/core/projectionCopy.js +1 -0
  54. package/lib/projection/core/projectionCopy.js.map +1 -1
  55. package/lib/projection/core/projectionGroupings.d.ts +44 -0
  56. package/lib/projection/core/projectionGroupings.d.ts.map +1 -0
  57. package/lib/projection/core/projectionGroupings.js +132 -0
  58. package/lib/projection/core/projectionGroupings.js.map +1 -0
  59. package/lib/projection/core/projectionOptions.d.ts +16 -6
  60. package/lib/projection/core/projectionOptions.d.ts.map +1 -1
  61. package/lib/projection/core/projectionOptions.js +7 -1
  62. package/lib/projection/core/projectionOptions.js.map +1 -1
  63. package/lib/projection/core/projectionPanelWords.d.ts +6 -0
  64. package/lib/projection/core/projectionPanelWords.d.ts.map +1 -1
  65. package/lib/projection/core/projectionPanelWords.js +4 -0
  66. package/lib/projection/core/projectionPanelWords.js.map +1 -1
  67. package/lib/projection/core/projectionSamples.d.ts +63 -32
  68. package/lib/projection/core/projectionSamples.d.ts.map +1 -1
  69. package/lib/projection/core/projectionSamples.js +1 -80
  70. package/lib/projection/core/projectionSamples.js.map +1 -1
  71. package/lib/projection/core/projectionStrings.d.ts +2 -0
  72. package/lib/projection/core/projectionStrings.d.ts.map +1 -1
  73. package/lib/projection/core/projectionStrings.js +10 -1
  74. package/lib/projection/core/projectionStrings.js.map +1 -1
  75. package/lib/projection/core/resolveProjectionOptions.d.ts +8 -3
  76. package/lib/projection/core/resolveProjectionOptions.d.ts.map +1 -1
  77. package/lib/projection/core/resolveProjectionOptions.js +58 -5
  78. package/lib/projection/core/resolveProjectionOptions.js.map +1 -1
  79. package/lib/projection/ui/ProjectionBar.d.ts +1 -1
  80. package/lib/projection/ui/ProjectionBar.d.ts.map +1 -1
  81. package/lib/projection/ui/ProjectionBar.js +3 -1
  82. package/lib/projection/ui/ProjectionBar.js.map +1 -1
  83. package/lib/projection/ui/ProjectionGroupingPickers.d.ts +38 -0
  84. package/lib/projection/ui/ProjectionGroupingPickers.d.ts.map +1 -0
  85. package/lib/projection/ui/ProjectionGroupingPickers.js +33 -0
  86. package/lib/projection/ui/ProjectionGroupingPickers.js.map +1 -0
  87. package/lib/projection/ui/ProjectionMapControls.d.ts +6 -7
  88. package/lib/projection/ui/ProjectionMapControls.d.ts.map +1 -1
  89. package/lib/projection/ui/ProjectionMapControls.js +11 -9
  90. package/lib/projection/ui/ProjectionMapControls.js.map +1 -1
  91. package/lib/projection/ui/ProjectionMapLegend.d.ts.map +1 -1
  92. package/lib/projection/ui/ProjectionMapLegend.js +1 -1
  93. package/lib/projection/ui/ProjectionMapLegend.js.map +1 -1
  94. package/lib/projection/ui/ProjectionMapMore.d.ts +2 -2
  95. package/lib/projection/ui/ProjectionMapMore.d.ts.map +1 -1
  96. package/lib/projection/ui/ProjectionMapMore.js +7 -5
  97. package/lib/projection/ui/ProjectionMapMore.js.map +1 -1
  98. package/lib/projection/ui/ProjectionMapTab.d.ts +15 -6
  99. package/lib/projection/ui/ProjectionMapTab.d.ts.map +1 -1
  100. package/lib/projection/ui/ProjectionMapTab.js +11 -7
  101. package/lib/projection/ui/ProjectionMapTab.js.map +1 -1
  102. package/lib/projection/ui/ProjectionPairsMore.d.ts +3 -7
  103. package/lib/projection/ui/ProjectionPairsMore.d.ts.map +1 -1
  104. package/lib/projection/ui/ProjectionPairsMore.js +4 -5
  105. package/lib/projection/ui/ProjectionPairsMore.js.map +1 -1
  106. package/lib/projection/ui/ProjectionPairsTab.d.ts.map +1 -1
  107. package/lib/projection/ui/ProjectionPairsTab.js +2 -2
  108. package/lib/projection/ui/ProjectionPairsTab.js.map +1 -1
  109. package/lib/projection/ui/ProjectionPanel.d.ts +1 -1
  110. package/lib/projection/ui/ProjectionPanel.d.ts.map +1 -1
  111. package/lib/projection/ui/ProjectionPanel.js +1 -1
  112. package/lib/projection/ui/ProjectionPanel.js.map +1 -1
  113. package/lib/projection/ui/ProjectionReadout.d.ts +7 -1
  114. package/lib/projection/ui/ProjectionReadout.d.ts.map +1 -1
  115. package/lib/projection/ui/ProjectionReadout.js +19 -7
  116. package/lib/projection/ui/ProjectionReadout.js.map +1 -1
  117. package/lib/projection/ui/ProjectionSpaceControls.d.ts +3 -5
  118. package/lib/projection/ui/ProjectionSpaceControls.d.ts.map +1 -1
  119. package/lib/projection/ui/ProjectionSpaceControls.js +9 -7
  120. package/lib/projection/ui/ProjectionSpaceControls.js.map +1 -1
  121. package/lib/projection/ui/ProjectionSpaceMore.d.ts +2 -2
  122. package/lib/projection/ui/ProjectionSpaceMore.d.ts.map +1 -1
  123. package/lib/projection/ui/ProjectionSpaceMore.js +5 -4
  124. package/lib/projection/ui/ProjectionSpaceMore.js.map +1 -1
  125. package/lib/projection/ui/ProjectionSpaceTab.d.ts +11 -3
  126. package/lib/projection/ui/ProjectionSpaceTab.d.ts.map +1 -1
  127. package/lib/projection/ui/ProjectionSpaceTab.js +7 -4
  128. package/lib/projection/ui/ProjectionSpaceTab.js.map +1 -1
  129. package/lib/projection/ui/ProjectionViewer.d.ts.map +1 -1
  130. package/lib/projection/ui/ProjectionViewer.js +1 -0
  131. package/lib/projection/ui/ProjectionViewer.js.map +1 -1
  132. package/lib/projection/ui/projectionBarReadings.d.ts +4 -1
  133. package/lib/projection/ui/projectionBarReadings.d.ts.map +1 -1
  134. package/lib/projection/ui/projectionBarReadings.js +14 -4
  135. package/lib/projection/ui/projectionBarReadings.js.map +1 -1
  136. package/lib/projection/ui/projectionBarSlots.d.ts +4 -2
  137. package/lib/projection/ui/projectionBarSlots.d.ts.map +1 -1
  138. package/lib/projection/ui/projectionBarSlots.js +3 -7
  139. package/lib/projection/ui/projectionBarSlots.js.map +1 -1
  140. package/lib/projection/ui/projectionMapChoices.d.ts +31 -6
  141. package/lib/projection/ui/projectionMapChoices.d.ts.map +1 -1
  142. package/lib/projection/ui/projectionMapChoices.js +58 -9
  143. package/lib/projection/ui/projectionMapChoices.js.map +1 -1
  144. package/lib/projection/ui/projectionMapChrome.d.ts +3 -9
  145. package/lib/projection/ui/projectionMapChrome.d.ts.map +1 -1
  146. package/lib/projection/ui/projectionMapChrome.js +41 -27
  147. package/lib/projection/ui/projectionMapChrome.js.map +1 -1
  148. package/lib/projection/ui/projectionMapCorner.d.ts +25 -0
  149. package/lib/projection/ui/projectionMapCorner.d.ts.map +1 -0
  150. package/lib/projection/ui/projectionMapCorner.js +46 -0
  151. package/lib/projection/ui/projectionMapCorner.js.map +1 -0
  152. package/lib/projection/ui/projectionMapModel.d.ts +9 -18
  153. package/lib/projection/ui/projectionMapModel.d.ts.map +1 -1
  154. package/lib/projection/ui/projectionMapModel.js +14 -39
  155. package/lib/projection/ui/projectionMapModel.js.map +1 -1
  156. package/lib/projection/ui/projectionMapView.d.ts +3 -1
  157. package/lib/projection/ui/projectionMapView.d.ts.map +1 -1
  158. package/lib/projection/ui/projectionMapView.js +9 -4
  159. package/lib/projection/ui/projectionMapView.js.map +1 -1
  160. package/lib/projection/ui/projectionSelectionSentence.d.ts +10 -0
  161. package/lib/projection/ui/projectionSelectionSentence.d.ts.map +1 -0
  162. package/lib/projection/ui/projectionSelectionSentence.js +18 -0
  163. package/lib/projection/ui/projectionSelectionSentence.js.map +1 -0
  164. package/lib/projection/ui/projectionStateApi.d.ts +47 -0
  165. package/lib/projection/ui/projectionStateApi.d.ts.map +1 -0
  166. package/lib/projection/ui/projectionStateApi.js +9 -0
  167. package/lib/projection/ui/projectionStateApi.js.map +1 -0
  168. package/lib/projection/ui/projectionTabModels.js +1 -1
  169. package/lib/projection/ui/projectionTabModels.js.map +1 -1
  170. package/lib/projection/ui/useProjectionState.d.ts +1 -29
  171. package/lib/projection/ui/useProjectionState.d.ts.map +1 -1
  172. package/lib/projection/ui/useProjectionState.js +13 -5
  173. package/lib/projection/ui/useProjectionState.js.map +1 -1
  174. package/lib/scatter/core/index.d.ts +1 -0
  175. package/lib/scatter/core/index.d.ts.map +1 -1
  176. package/lib/scatter/core/index.js +1 -0
  177. package/lib/scatter/core/index.js.map +1 -1
  178. package/lib/scatter/core/pointShape.d.ts +18 -0
  179. package/lib/scatter/core/pointShape.d.ts.map +1 -0
  180. package/lib/scatter/core/pointShape.js +70 -0
  181. package/lib/scatter/core/pointShape.js.map +1 -0
  182. package/lib/scatter/ui/ScatterPlot.d.ts.map +1 -1
  183. package/lib/scatter/ui/ScatterPlot.js +3 -2
  184. package/lib/scatter/ui/ScatterPlot.js.map +1 -1
  185. package/lib/scatter/ui/ScatterPointLayer.d.ts +14 -1
  186. package/lib/scatter/ui/ScatterPointLayer.d.ts.map +1 -1
  187. package/lib/scatter/ui/ScatterPointLayer.js +15 -3
  188. package/lib/scatter/ui/ScatterPointLayer.js.map +1 -1
  189. package/lib/scatter/ui/scatterFigureProps.d.ts +13 -0
  190. package/lib/scatter/ui/scatterFigureProps.d.ts.map +1 -1
  191. package/lib/scatter/ui/scatterMarkGlyph.d.ts +2 -1
  192. package/lib/scatter/ui/scatterMarkGlyph.d.ts.map +1 -1
  193. package/lib/scatter/ui/scatterMarkGlyph.js +7 -1
  194. package/lib/scatter/ui/scatterMarkGlyph.js.map +1 -1
  195. package/lib/scatter3d/ui/ScatterCloud.d.ts.map +1 -1
  196. package/lib/scatter3d/ui/ScatterCloud.js +2 -1
  197. package/lib/scatter3d/ui/ScatterCloud.js.map +1 -1
  198. package/package.json +1 -1
  199. package/src/build/vite/gitHead.ts +17 -2
  200. package/src/clipboard/ui/ClickToCopy.tsx +190 -0
  201. package/src/clipboard/ui/CopyButton.tsx +2 -2
  202. package/src/clipboard/ui/CopyableValue.tsx +11 -6
  203. package/src/clipboard/ui/index.ts +2 -0
  204. package/src/ecosystem/core/groups.ts +10 -3
  205. package/src/ecosystem/core/sites.ts +39 -0
  206. package/src/ecosystem/core/types.ts +4 -1
  207. package/src/ecosystem/ui/glyphs.tsx +51 -0
  208. package/src/error/ui/ErrorFallback.tsx +3 -1
  209. package/src/overlay/core/index.ts +6 -2
  210. package/src/overlay/core/overlayMarks.ts +51 -6
  211. package/src/overlay/ui/OverlayLegendMark.tsx +5 -0
  212. package/src/pedagogy/ui/ReferenceSectionBlock.tsx +10 -1
  213. package/src/projection/core/index.ts +11 -3
  214. package/src/projection/core/projectionCopy.ts +3 -0
  215. package/src/projection/core/projectionGroupings.ts +174 -0
  216. package/src/projection/core/projectionOptions.ts +18 -7
  217. package/src/projection/core/projectionPanelWords.ts +10 -0
  218. package/src/projection/core/projectionSamples.ts +62 -120
  219. package/src/projection/core/projectionStrings.ts +12 -1
  220. package/src/projection/core/resolveProjectionOptions.ts +66 -4
  221. package/src/projection/ui/ProjectionBar.tsx +4 -2
  222. package/src/projection/ui/ProjectionGroupingPickers.tsx +91 -0
  223. package/src/projection/ui/ProjectionMapControls.tsx +29 -32
  224. package/src/projection/ui/ProjectionMapLegend.tsx +1 -1
  225. package/src/projection/ui/ProjectionMapMore.tsx +14 -4
  226. package/src/projection/ui/ProjectionMapTab.tsx +27 -9
  227. package/src/projection/ui/ProjectionPairsMore.tsx +12 -21
  228. package/src/projection/ui/ProjectionPairsTab.tsx +5 -2
  229. package/src/projection/ui/ProjectionPanel.tsx +7 -3
  230. package/src/projection/ui/ProjectionReadout.tsx +28 -8
  231. package/src/projection/ui/ProjectionSpaceControls.tsx +20 -27
  232. package/src/projection/ui/ProjectionSpaceMore.tsx +12 -3
  233. package/src/projection/ui/ProjectionSpaceTab.tsx +23 -6
  234. package/src/projection/ui/ProjectionViewer.tsx +1 -0
  235. package/src/projection/ui/projectionBarReadings.ts +24 -8
  236. package/src/projection/ui/projectionBarSlots.tsx +10 -9
  237. package/src/projection/ui/projectionMapChoices.ts +71 -14
  238. package/src/projection/ui/projectionMapChrome.ts +55 -30
  239. package/src/projection/ui/projectionMapCorner.ts +67 -0
  240. package/src/projection/ui/projectionMapModel.ts +20 -59
  241. package/src/projection/ui/projectionMapView.ts +15 -8
  242. package/src/projection/ui/projectionSelectionSentence.ts +22 -0
  243. package/src/projection/ui/projectionStateApi.ts +57 -0
  244. package/src/projection/ui/projectionTabModels.ts +1 -1
  245. package/src/projection/ui/useProjectionState.ts +33 -37
  246. package/src/scatter/core/index.ts +1 -0
  247. package/src/scatter/core/pointShape.ts +80 -0
  248. package/src/scatter/ui/ScatterPlot.tsx +4 -1
  249. package/src/scatter/ui/ScatterPointLayer.tsx +39 -11
  250. package/src/scatter/ui/scatterFigureProps.ts +13 -0
  251. package/src/scatter/ui/scatterMarkGlyph.tsx +9 -1
  252. package/src/scatter3d/ui/ScatterCloud.tsx +3 -0
  253. package/styles/chrome.css +163 -0
@@ -23,14 +23,12 @@ import { projectionPairsInfo, projectionSharesInfo, projectionVariablesInfo, } f
23
23
  */
24
24
  export function projectionBarSlots(input) {
25
25
  const { tab, result, copy, models, map, readings, tier } = input;
26
- const { options, groups, selected, width, onChange } = input;
27
- const hasGroups = groups.entries.length > 0;
28
- const colored = options.colorBy === 'group' && hasGroups;
29
- const shared = { options, onChange, copy, groupLabel: groups.label };
26
+ const { options, groups, groupings, selected, width, onChange } = input;
27
+ const colored = groups.entries.length > 0;
28
+ const shared = { options, onChange, copy, groupings };
30
29
  if (tab === 'pairs') {
31
30
  const pairs = {
32
31
  ...shared,
33
- hasGroups,
34
32
  axisCount: result.axes.length,
35
33
  width,
36
34
  };
@@ -44,7 +42,6 @@ export function projectionBarSlots(input) {
44
42
  const space = {
45
43
  ...shared,
46
44
  result,
47
- hasGroups,
48
45
  selectedCount: selected.length,
49
46
  onResetView: map.resetSpaceView,
50
47
  onClearSelection: map.clearSelection,
@@ -83,7 +80,6 @@ export function projectionBarSlots(input) {
83
80
  const forMap = {
84
81
  ...shared,
85
82
  result,
86
- hasGroups,
87
83
  selectedCount: selected.length,
88
84
  onZoomToSelection: map.zoomToSelection,
89
85
  onResetView: map.resetView,
@@ -1 +1 @@
1
- {"version":3,"file":"projectionBarSlots.js","sourceRoot":"","sources":["../../../src/projection/ui/projectionBarSlots.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA6B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA+B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAAgC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA4B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA+B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAmC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA+B,CAAC;AAGxE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAyChC;;;;;;;;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MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI;QAC1E,IAAI,EAAE,KAAC,iBAAiB,OAAK,MAAM,GAAI;QACvC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO;KACzB,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * What the map's two settings offer, in the two lengths the bar needs.
2
+ * What the map's settings offer, in the lengths the bar needs.
3
3
  *
4
4
  * The same choices are written twice — once as bare shares on a value menu
5
5
  * whose own heading already says what they are shares of, and once as whole
@@ -8,14 +8,39 @@
8
8
  */
9
9
  import type { OverlayOption } from '../../overlay/ui/OverlayRow.tsx';
10
10
  import type { ProjectionCopy } from '../core/projectionCopy.ts';
11
- import type { ProjectionColorBy, ProjectionOptions } from '../core/projectionOptions.ts';
11
+ import type { ProjectionOptions } from '../core/projectionOptions.ts';
12
+ import type { ProjectionGrouping } from '../core/projectionSamples.ts';
12
13
  /**
13
- * What the colour may stand for.
14
- * @param groupLabel - What the set of groups is called.
14
+ * What the colour may stand for: each grouping the samples carry, or nothing.
15
+ * @param groupings - The groupings the samples carry.
15
16
  * @param uncoloured - What "the colour stands for nothing" reads.
16
- * @returns The two choices.
17
+ * @returns The choices, in the order the groupings were handed in.
17
18
  */
18
- export declare function projectionColourChoices(groupLabel: string, uncoloured: string): ReadonlyArray<OverlayOption<ProjectionColorBy>>;
19
+ export declare function projectionColourChoices(groupings: readonly ProjectionGrouping[], uncoloured: string): readonly OverlayOption[];
20
+ /**
21
+ * What the shape may stand for: each grouping the samples carry, or nothing.
22
+ *
23
+ * A grouping the colour already stands for is kept in the list but greyed, as
24
+ * is one of more groups than there are shapes, so the reader sees why it cannot
25
+ * be picked rather than wondering where it went.
26
+ * @param groupings - The groupings the samples carry.
27
+ * @param options - What the figure is showing, whose colour is taken.
28
+ * @param rows - How many rows there are, which is what a grouping is cut over.
29
+ * @param copy - The words the viewer writes.
30
+ * @returns The choices, in the order the groupings were handed in.
31
+ */
32
+ export declare function projectionShapeChoices(groupings: readonly ProjectionGrouping[], options: ProjectionOptions, rows: number, copy: ProjectionCopy): readonly OverlayOption[];
33
+ /**
34
+ * What changes when the colour is given to another grouping.
35
+ *
36
+ * A grouping drawn as the shape that is picked for the colour swaps places
37
+ * with it rather than being dropped, so the reader never loses one of the two
38
+ * groupings they were comparing by trading them round.
39
+ * @param options - What the figure is showing.
40
+ * @param colorBy - The grouping picked for the colour.
41
+ * @returns The options that change.
42
+ */
43
+ export declare function projectionColourPatch(options: ProjectionOptions, colorBy: string): Partial<ProjectionOptions>;
19
44
  /**
20
45
  * How large the outlines may be, written as bare shares.
21
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"projectionMapChoices.d.ts","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapChoices.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AAQtC;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,aAAa,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAKjD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,cAAc,GACnB,SAAS,aAAa,EAAE,CAW1B"}
1
+ {"version":3,"file":"projectionMapChoices.d.ts","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapChoices.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAQvE;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,kBAAkB,EAAE,EACxC,UAAU,EAAE,MAAM,GACjB,SAAS,aAAa,EAAE,CAK1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,kBAAkB,EAAE,EACxC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,cAAc,GACnB,SAAS,aAAa,EAAE,CAmB1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC,CAI5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,cAAc,GACnB,SAAS,aAAa,EAAE,CAW1B"}
@@ -1,23 +1,72 @@
1
1
  /**
2
- * What the map's two settings offer, in the two lengths the bar needs.
2
+ * What the map's settings offer, in the lengths the bar needs.
3
3
  *
4
4
  * The same choices are written twice — once as bare shares on a value menu
5
5
  * whose own heading already says what they are shares of, and once as whole
6
6
  * sentences in the panel a reader opens with room to read them — so both are
7
7
  * built here and neither file spells the other's list for itself.
8
8
  */
9
+ import { resolveProjectionShapes } from "../core/projectionGroupings.js";
10
+ import { NO_GROUPING } from "../core/projectionOptions.js";
9
11
  import { ellipseChoices, ellipseCoverageText, ellipseSize, } from "./projectionEllipse.js";
10
12
  /**
11
- * What the colour may stand for.
12
- * @param groupLabel - What the set of groups is called.
13
+ * What the colour may stand for: each grouping the samples carry, or nothing.
14
+ * @param groupings - The groupings the samples carry.
13
15
  * @param uncoloured - What "the colour stands for nothing" reads.
14
- * @returns The two choices.
16
+ * @returns The choices, in the order the groupings were handed in.
15
17
  */
16
- export function projectionColourChoices(groupLabel, uncoloured) {
17
- return [
18
- { value: 'group', label: groupLabel },
19
- { value: 'none', label: uncoloured },
20
- ];
18
+ export function projectionColourChoices(groupings, uncoloured) {
19
+ const choices = [];
20
+ for (const { id, label } of groupings)
21
+ choices.push({ value: id, label });
22
+ choices.push({ value: NO_GROUPING, label: uncoloured });
23
+ return choices;
24
+ }
25
+ /**
26
+ * What the shape may stand for: each grouping the samples carry, or nothing.
27
+ *
28
+ * A grouping the colour already stands for is kept in the list but greyed, as
29
+ * is one of more groups than there are shapes, so the reader sees why it cannot
30
+ * be picked rather than wondering where it went.
31
+ * @param groupings - The groupings the samples carry.
32
+ * @param options - What the figure is showing, whose colour is taken.
33
+ * @param rows - How many rows there are, which is what a grouping is cut over.
34
+ * @param copy - The words the viewer writes.
35
+ * @returns The choices, in the order the groupings were handed in.
36
+ */
37
+ export function projectionShapeChoices(groupings, options, rows, copy) {
38
+ const choices = [];
39
+ for (const grouping of groupings) {
40
+ const { id, label } = grouping;
41
+ const reason = id === options.colorBy
42
+ ? copy.reason.shapeIsColour
43
+ : resolveProjectionShapes(grouping, rows) === null
44
+ ? copy.reason.tooManyShapes
45
+ : undefined;
46
+ choices.push({
47
+ value: id,
48
+ label,
49
+ disabled: reason !== undefined,
50
+ title: reason,
51
+ });
52
+ }
53
+ choices.push({ value: NO_GROUPING, label: copy.bar.unshaped });
54
+ return choices;
55
+ }
56
+ /**
57
+ * What changes when the colour is given to another grouping.
58
+ *
59
+ * A grouping drawn as the shape that is picked for the colour swaps places
60
+ * with it rather than being dropped, so the reader never loses one of the two
61
+ * groupings they were comparing by trading them round.
62
+ * @param options - What the figure is showing.
63
+ * @param colorBy - The grouping picked for the colour.
64
+ * @returns The options that change.
65
+ */
66
+ export function projectionColourPatch(options, colorBy) {
67
+ return colorBy !== NO_GROUPING && colorBy === options.shapeBy
68
+ ? { colorBy, shapeBy: options.colorBy }
69
+ : { colorBy };
21
70
  }
22
71
  /**
23
72
  * How large the outlines may be, written as bare shares.
@@ -1 +1 @@
1
- {"version":3,"file":"projectionMapChoices.js","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapChoices.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAAkB,EAClB,UAAkB;IAElB,OAAO;QACL,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE;QACrC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE;KACrC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAA0B,EAC1B,IAAoB;IAEpB,MAAM,OAAO,GAAoB,EAAE,CAAC;IACpC,KAAK,MAAM,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACnE,MAAM,KAAK,GAAG,mBAAmB,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK;YACjD,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"projectionMapChoices.js","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapChoices.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,WAA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AAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/D,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAA0B,EAC1B,OAAe;IAEf,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,OAAO,CAAC,OAAO;QAC3D,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;QACvC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAA0B,EAC1B,IAAoB;IAEpB,MAAM,OAAO,GAAoB,EAAE,CAAC;IACpC,KAAK,MAAM,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACnE,MAAM,KAAK,GAAG,mBAAmB,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK;YACjD,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -11,7 +11,7 @@ import type { OverlayLegendEntry } from '../../overlay/ui/OverlayLegend.tsx';
11
11
  import type { EllipseSize } from '../../scatter/core/confidenceEllipse.ts';
12
12
  import type { ProjectionCopy } from '../core/projectionCopy.ts';
13
13
  import type { ProjectionMarker } from '../core/projectionResult.ts';
14
- import type { ResolvedProjectionGroups } from '../core/projectionSamples.ts';
14
+ import type { ResolvedProjectionGroups, ResolvedProjectionShapes } from '../core/projectionSamples.ts';
15
15
  /** What the map's chrome is built from. */
16
16
  interface ProjectionMapChromeInput {
17
17
  /** The words the map writes, already merged over the defaults. */
@@ -20,6 +20,8 @@ interface ProjectionMapChromeInput {
20
20
  groups: ResolvedProjectionGroups;
21
21
  /** Whether colour stands for the group at all. */
22
22
  colored: boolean;
23
+ /** The grouping the dots are shaped by, or `null` while they are all discs. */
24
+ shapes: ResolvedProjectionShapes | null;
23
25
  /** How large the group outlines are, or `null` for none. */
24
26
  ellipse: EllipseSize | null;
25
27
  /** How many samples a group needs before it is outlined at all. */
@@ -70,13 +72,5 @@ export interface ProjectionMapChrome {
70
72
  * @returns The legend's title and entries, and the standing caption.
71
73
  */
72
74
  export declare function projectionMapChrome(input: ProjectionMapChromeInput): ProjectionMapChrome;
73
- /**
74
- * The sentence reporting what a gesture picked out.
75
- * @param copy - The words the map writes.
76
- * @param count - How many samples are selected.
77
- * @param total - How many there are in all.
78
- * @returns The sentence.
79
- */
80
- export declare function projectionSelectionSentence(copy: ProjectionCopy, count: number, total: number): string;
81
75
  export {};
82
76
  //# sourceMappingURL=projectionMapChrome.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"projectionMapChrome.d.ts","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapChrome.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAE3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAK7E,2CAA2C;AAC3C,UAAU,wBAAwB;IAChC,kEAAkE;IAClE,IAAI,EAAE,cAAc,CAAC;IACrB,0CAA0C;IAC1C,MAAM,EAAE,wBAAwB,CAAC;IACjC,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,mEAAmE;IACnE,aAAa,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,cAAc,EAAE,OAAO,CAAC;IACxB,iDAAiD;IACjD,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACrC,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAC1B;AAED,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IAClC;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,mBAAmB,CAqDrB;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,MAAM,CAMR"}
1
+ {"version":3,"file":"projectionMapChrome.d.ts","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapChrome.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAE3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAKtC,2CAA2C;AAC3C,UAAU,wBAAwB;IAChC,kEAAkE;IAClE,IAAI,EAAE,cAAc,CAAC;IACrB,0CAA0C;IAC1C,MAAM,EAAE,wBAAwB,CAAC;IACjC,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,+EAA+E;IAC/E,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACxC,4DAA4D;IAC5D,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,mEAAmE;IACnE,aAAa,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,cAAc,EAAE,OAAO,CAAC;IACxB,iDAAiD;IACjD,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACrC,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAC1B;AAED,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IAClC;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,mBAAmB,CAuDrB"}
@@ -7,7 +7,6 @@
7
7
  * only way a promise like "this outline covers 95 % of the group" stays
8
8
  * honest as the controls around it change.
9
9
  */
10
- import { formatInteger } from "../../format/core/numbers.js";
11
10
  import { fillCopy } from "../core/fillCopy.js";
12
11
  import { ellipseCoverageText } from "./projectionEllipse.js";
13
12
  import { UNGROUPED_INK } from "./projectionMapModel.js";
@@ -25,6 +24,7 @@ import { UNGROUPED_INK } from "./projectionMapModel.js";
25
24
  */
26
25
  export function projectionMapChrome(input) {
27
26
  const { copy, groups, colored, ellipse, showGroupMeans, markers } = input;
27
+ const { shapes } = input;
28
28
  const { minimumPoints, fittedCount, total, figure = 'map' } = input;
29
29
  const entries = [];
30
30
  const skipped = [];
@@ -51,6 +51,7 @@ export function projectionMapChrome(input) {
51
51
  });
52
52
  }
53
53
  }
54
+ appendShapeEntries(entries, shapes);
54
55
  appendMarkerEntries(entries, markers, groups);
55
56
  const hollow = fittedCount < total;
56
57
  if (hollow) {
@@ -62,43 +63,54 @@ export function projectionMapChrome(input) {
62
63
  });
63
64
  }
64
65
  return {
65
- title: legendTitle(copy, groups, colored),
66
+ title: legendTitle(copy, groups, colored, shapes),
66
67
  entries,
67
68
  caption: captionFor(copy, groups, colored, ellipse, skipped, hollow, figure),
68
69
  };
69
70
  }
70
71
  /**
71
- * The sentence reporting what a gesture picked out.
72
- * @param copy - The words the map writes.
73
- * @param count - How many samples are selected.
74
- * @param total - How many there are in all.
75
- * @returns The sentence.
76
- */
77
- export function projectionSelectionSentence(copy, count, total) {
78
- if (count === 0)
79
- return copy.sentence.selectionNone;
80
- return fillCopy(copy.sentence.selection, {
81
- count: formatInteger(count),
82
- total: formatInteger(total),
83
- });
84
- }
85
- /**
86
- * The sentence over the legend.
72
+ * The sentence over the legend, naming what the colour and the shape stand
73
+ * for.
87
74
  *
88
- * When colour stands for nothing the entries left are all shape, so the title
89
- * names the shape channel: a legend naming no encoding at all is the one fault
90
- * this title exists to prevent, and it is not fixed by leaving the title out.
75
+ * When neither stands for a grouping the entries left are all marks, so the
76
+ * title names the shape channel: a legend naming no encoding at all is the one
77
+ * fault this title exists to prevent, and it is not fixed by leaving it out.
91
78
  * @param copy - The words the map writes.
92
79
  * @param groups - The groups as the map colours them.
93
80
  * @param colored - Whether colour stands for the group at all.
81
+ * @param shapes - The grouping the dots are shaped by, or `null`.
94
82
  * @returns The title.
95
83
  */
96
- function legendTitle(copy, groups, colored) {
97
- if (!colored || groups.entries.length === 0)
98
- return copy.legend.shapes;
99
- return fillCopy(copy.legend.mapNoEllipse, {
100
- groups: groups.label.toLowerCase(),
101
- });
84
+ function legendTitle(copy, groups, colored, shapes) {
85
+ const parts = [];
86
+ if (colored && groups.entries.length > 0) {
87
+ parts.push(fillCopy(copy.legend.mapNoEllipse, {
88
+ groups: groups.label.toLowerCase(),
89
+ }));
90
+ }
91
+ if (shapes !== null) {
92
+ parts.push(fillCopy(copy.legend.shapedBy, { shapes: shapes.label.toLowerCase() }));
93
+ }
94
+ return parts.length === 0 ? copy.legend.shapes : parts.join(' ');
95
+ }
96
+ /**
97
+ * One entry per shape, drawn in the muted ink: a colour on a shape's entry
98
+ * would claim a group of the colour grouping it does not stand for.
99
+ * @param entries - The legend, appended to in place.
100
+ * @param shapes - The grouping the dots are shaped by, or `null`.
101
+ */
102
+ function appendShapeEntries(entries, shapes) {
103
+ if (shapes === null)
104
+ return;
105
+ for (const entry of shapes.entries) {
106
+ entries.push({
107
+ id: `shape-${entry.id}`,
108
+ label: entry.label,
109
+ color: SHAPE_INK,
110
+ shape: entry.shape,
111
+ count: entry.count,
112
+ });
113
+ }
102
114
  }
103
115
  function captionFor(copy, groups, colored, ellipse, skipped, hollow, figure) {
104
116
  const solid = figure === 'space';
@@ -134,4 +146,6 @@ function appendMarkerEntries(entries, markers, groups) {
134
146
  });
135
147
  }
136
148
  }
149
+ /** The ink a shape's entry is drawn in, the one the key uses for marks that name no colour. */
150
+ const SHAPE_INK = 'var(--text-muted)';
137
151
  //# sourceMappingURL=projectionMapChrome.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"projectionMapChrome.js","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapChrome.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAK/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAiDxD;;;;;;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,CAAC,IAAI,CAAC;YACX,EAAE,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE;YAC5B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,aAAa;YACjE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,OAAO;SAC/B,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,+FAA+F;AAC/F,MAAM,SAAS,GAAG,mBAAmB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Which corner of the map the floating key takes.
3
+ *
4
+ * It is a module of its own because it is the one piece of the map that has to
5
+ * know where the dots fall before anything is drawn over them, and it is all
6
+ * arithmetic that can be checked without rendering anything.
7
+ */
8
+ import type { OverlayCorner } from '../../overlay/core/overlayPlacement.ts';
9
+ import type { ProjectionMapCloud } from './projectionMapModel.ts';
10
+ /**
11
+ * The corner of the map with the fewest dots under it.
12
+ *
13
+ * All four are offered. The chrome that asks is laid out inside the plot
14
+ * rectangle rather than over the figure's box, so no corner of it costs the
15
+ * reader an axis label, and the only thing left to weigh is how many samples
16
+ * each one would cover.
17
+ * @param cloud - Where every sample sits, in data units.
18
+ * @param xDomain - The range the horizontal axis covers.
19
+ * @param yDomain - The range the vertical axis covers.
20
+ * @param width - Width of the plot rectangle, in pixels.
21
+ * @param height - Its height.
22
+ * @returns The corner the card sits in.
23
+ */
24
+ export declare function projectionMapCorner(cloud: ProjectionMapCloud, xDomain: readonly [number, number], yDomain: readonly [number, number], width: number, height: number): OverlayCorner;
25
+ //# sourceMappingURL=projectionMapCorner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectionMapCorner.d.ts","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapCorner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,aAAa,CAMf"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Which corner of the map the floating key takes.
3
+ *
4
+ * It is a module of its own because it is the one piece of the map that has to
5
+ * know where the dots fall before anything is drawn over them, and it is all
6
+ * arithmetic that can be checked without rendering anything.
7
+ */
8
+ import { emptiestCorner } from "../../overlay/core/emptiestCorner.js";
9
+ /**
10
+ * The corner of the map with the fewest dots under it.
11
+ *
12
+ * All four are offered. The chrome that asks is laid out inside the plot
13
+ * rectangle rather than over the figure's box, so no corner of it costs the
14
+ * reader an axis label, and the only thing left to weigh is how many samples
15
+ * each one would cover.
16
+ * @param cloud - Where every sample sits, in data units.
17
+ * @param xDomain - The range the horizontal axis covers.
18
+ * @param yDomain - The range the vertical axis covers.
19
+ * @param width - Width of the plot rectangle, in pixels.
20
+ * @param height - Its height.
21
+ * @returns The corner the card sits in.
22
+ */
23
+ export function projectionMapCorner(cloud, xDomain, yDomain, width, height) {
24
+ return emptiestCorner(placeAlong(cloud.x, xDomain, width, false), placeAlong(cloud.y, yDomain, height, true), { width, height, cardWidth: CARD_WIDTH, cardHeight: CARD_HEIGHT });
25
+ }
26
+ function placeAlong(values, domain, size, flip) {
27
+ const span = domain[1] - domain[0];
28
+ const factor = span === 0 ? 0 : size / span;
29
+ const pixels = new Float64Array(values.length);
30
+ for (let index = 0; index < values.length; index++) {
31
+ const along = ((values[index] ?? Number.NaN) - domain[0]) * factor;
32
+ pixels[index] = flip ? size - along : along;
33
+ }
34
+ return pixels;
35
+ }
36
+ /**
37
+ * How much of the plot the floating key is expected to cover.
38
+ *
39
+ * It is an estimate on purpose — the card has not been laid out when the
40
+ * corner is chosen — and it is the compact key's size rather than the roomier
41
+ * card the overlay domain assumes: a corner counted as three species wide
42
+ * would call a corner busy that the key never reaches.
43
+ */
44
+ const CARD_WIDTH = 170;
45
+ const CARD_HEIGHT = 84;
46
+ //# sourceMappingURL=projectionMapCorner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectionMapCorner.js","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapCorner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAKtE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAyB,EACzB,OAAkC,EAClC,OAAkC,EAClC,KAAa,EACb,MAAc;IAEd,OAAO,cAAc,CACnB,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,EAC1C,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAC1C,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,CAClE,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CACjB,MAAoB,EACpB,MAAiC,EACjC,IAAY,EACZ,IAAa;IAEb,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;IAC5C,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;QACnE,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IAC9C,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,GAAG,CAAC;AACvB,MAAM,WAAW,GAAG,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Where a map's samples land, and which corner of the picture is free.
2
+ * Where a map's samples land, and what a plot is handed to draw them.
3
3
  *
4
4
  * It sits beside the component rather than inside it because a plot has to
5
5
  * know where its dots fall before it can decide where its controls may sit,
@@ -8,11 +8,11 @@
8
8
  */
9
9
  import type { ChartViewport } from '../../chart/core/chartViewport.ts';
10
10
  import type { MatrixLike } from '../../chart/core/matrix.ts';
11
- import type { OverlayCorner } from '../../overlay/core/overlayPlacement.ts';
11
+ import type { OverlaySampleShape } from '../../overlay/core/overlayMarks.ts';
12
12
  import type { ScatterGroup } from '../../scatter/ui/scatterFigureProps.ts';
13
13
  import type { ScatterMarker } from '../../scatter/ui/scatterPlotProps.ts';
14
14
  import type { ProjectionMarker, ProjectionResult } from '../core/projectionResult.ts';
15
- import type { ResolvedProjectionGroups } from '../core/projectionSamples.ts';
15
+ import type { ResolvedProjectionGroups, ResolvedProjectionShapes } from '../core/projectionSamples.ts';
16
16
  /** Where every sample sits on the map, in the embedding's own units. */
17
17
  export interface ProjectionMapCloud {
18
18
  /** Horizontal coordinate of every sample, in row order. */
@@ -70,21 +70,6 @@ export declare function projectionMapDomain(scores: MatrixLike, column: number,
70
70
  * @returns The frame, in the embedding's own units.
71
71
  */
72
72
  export declare function projectionMapViewport(scores: MatrixLike, xColumn: number, yColumn: number, rows?: readonly number[], padding?: number): ChartViewport;
73
- /**
74
- * The corner of the map with the fewest dots under it.
75
- *
76
- * All four are offered. The chrome that asks is laid out inside the plot
77
- * rectangle rather than over the figure's box, so no corner of it costs the
78
- * reader an axis label, and the only thing left to weigh is how many samples
79
- * each one would cover.
80
- * @param cloud - Where every sample sits, in data units.
81
- * @param xDomain - The range the horizontal axis covers.
82
- * @param yDomain - The range the vertical axis covers.
83
- * @param width - Width of the plot rectangle, in pixels.
84
- * @param height - Its height.
85
- * @returns The corner the card sits in.
86
- */
87
- export declare function projectionMapCorner(cloud: ProjectionMapCloud, xDomain: readonly [number, number], yDomain: readonly [number, number], width: number, height: number): OverlayCorner;
88
73
  /**
89
74
  * The reference points of a result, placed on the two axes the map draws.
90
75
  * @param markers - The reference points, in the embedding's own units.
@@ -100,6 +85,12 @@ export declare function projectionMapMarkers(markers: readonly ProjectionMarker[
100
85
  * @returns One entry per group, in the order they are coloured.
101
86
  */
102
87
  export declare function projectionScatterGroups(groups: ResolvedProjectionGroups): ScatterGroup[];
88
+ /**
89
+ * The shapes in the order a plot names them by index.
90
+ * @param shapes - The grouping the dots are shaped by, or `null`.
91
+ * @returns One shape per group, or nothing while every dot is a disc.
92
+ */
93
+ export declare function projectionScatterShapes(shapes: ResolvedProjectionShapes | null): OverlaySampleShape[] | undefined;
103
94
  /**
104
95
  * What one axis of the map is called.
105
96
  *
@@ -1 +1 @@
1
- {"version":3,"file":"projectionMapModel.d.ts","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapModel.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;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AClC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,MAAM,EAAE,wBAAwB,EAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,aAAa,EAAE,CAejB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,wBAAwB,GAC/B,YAAY,EAAE,CAMhB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAIpB"}
1
+ {"version":3,"file":"projectionMapModel.d.ts","sourceRoot":"","sources":["../../../src/projection/ui/projectionMapModel.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAEtC,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,CAAC,EAAE,YAAY,CAAC;IAChB,8DAA8D;IAC9D,CAAC,EAAE,YAAY,CAAC;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,sBAAsB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,kBAAkB,CASpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GACvB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAI3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,SAAiB,GACvB,aAAa,CAKf;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,MAAM,EAAE,wBAAwB,EAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,aAAa,EAAE,CAejB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,wBAAwB,GAC/B,YAAY,EAAE,CAMhB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,wBAAwB,GAAG,IAAI,GACtC,kBAAkB,EAAE,GAAG,SAAS,CAKlC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAIpB"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Where a map's samples land, and which corner of the picture is free.
2
+ * Where a map's samples land, and what a plot is handed to draw them.
3
3
  *
4
4
  * It sits beside the component rather than inside it because a plot has to
5
5
  * know where its dots fall before it can decide where its controls may sit,
@@ -8,7 +8,6 @@
8
8
  */
9
9
  import { chartColumnExtent, chartPadExtent, } from "../../chart/core/chartExtent.js";
10
10
  import { chartAxisTitle } from "../../chart/core/chartLabels.js";
11
- import { emptiestCorner } from "../../overlay/core/emptiestCorner.js";
12
11
  /**
13
12
  * A dot, a marker or an average that stands for no group at all.
14
13
  *
@@ -77,23 +76,6 @@ export function projectionMapViewport(scores, xColumn, yColumn, rows, padding =
77
76
  y: withRoom(projectionMapDomain(scores, yColumn, rows), padding),
78
77
  };
79
78
  }
80
- /**
81
- * The corner of the map with the fewest dots under it.
82
- *
83
- * All four are offered. The chrome that asks is laid out inside the plot
84
- * rectangle rather than over the figure's box, so no corner of it costs the
85
- * reader an axis label, and the only thing left to weigh is how many samples
86
- * each one would cover.
87
- * @param cloud - Where every sample sits, in data units.
88
- * @param xDomain - The range the horizontal axis covers.
89
- * @param yDomain - The range the vertical axis covers.
90
- * @param width - Width of the plot rectangle, in pixels.
91
- * @param height - Its height.
92
- * @returns The corner the card sits in.
93
- */
94
- export function projectionMapCorner(cloud, xDomain, yDomain, width, height) {
95
- return emptiestCorner(placeAlong(cloud.x, xDomain, width, false), placeAlong(cloud.y, yDomain, height, true), { width, height, cardWidth: CARD_WIDTH, cardHeight: CARD_HEIGHT });
96
- }
97
79
  /**
98
80
  * The reference points of a result, placed on the two axes the map draws.
99
81
  * @param markers - The reference points, in the embedding's own units.
@@ -131,6 +113,19 @@ export function projectionScatterGroups(groups) {
131
113
  }
132
114
  return plotted;
133
115
  }
116
+ /**
117
+ * The shapes in the order a plot names them by index.
118
+ * @param shapes - The grouping the dots are shaped by, or `null`.
119
+ * @returns One shape per group, or nothing while every dot is a disc.
120
+ */
121
+ export function projectionScatterShapes(shapes) {
122
+ if (shapes === null)
123
+ return undefined;
124
+ const list = [];
125
+ for (const entry of shapes.entries)
126
+ list.push(entry.shape);
127
+ return list;
128
+ }
134
129
  /**
135
130
  * What one axis of the map is called.
136
131
  *
@@ -152,26 +147,6 @@ function withRoom(domain, padding) {
152
147
  const extent = chartPadExtent({ min: domain[0], max: domain[1] }, padding);
153
148
  return [extent.min, extent.max];
154
149
  }
155
- function placeAlong(values, domain, size, flip) {
156
- const span = domain[1] - domain[0];
157
- const factor = span === 0 ? 0 : size / span;
158
- const pixels = new Float64Array(values.length);
159
- for (let index = 0; index < values.length; index++) {
160
- const along = ((values[index] ?? Number.NaN) - domain[0]) * factor;
161
- pixels[index] = flip ? size - along : along;
162
- }
163
- return pixels;
164
- }
165
- /**
166
- * How much of the plot the floating key is expected to cover.
167
- *
168
- * It is an estimate on purpose — the card has not been laid out when the
169
- * corner is chosen — and it is the compact key's size rather than the roomier
170
- * card the overlay domain assumes: a corner counted as three species wide
171
- * would call a corner busy that the key never reaches.
172
- */
173
- const CARD_WIDTH = 170;
174
- const CARD_HEIGHT = 84;
175
150
  /** Room left around a framed selection, as a share of its own span. */
176
151
  const SELECTION_ROOM = 0.1;
177
152
  //# sourceMappingURL=projectionMapModel.js.map