react-cheminfo 0.22.0 → 0.24.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 (464) hide show
  1. package/README.md +51 -28
  2. package/lib/chrome/ui/HeaderToggle.d.ts +52 -0
  3. package/lib/chrome/ui/HeaderToggle.d.ts.map +1 -0
  4. package/lib/chrome/ui/HeaderToggle.js +31 -0
  5. package/lib/chrome/ui/HeaderToggle.js.map +1 -0
  6. package/lib/chrome/ui/index.d.ts +2 -0
  7. package/lib/chrome/ui/index.d.ts.map +1 -1
  8. package/lib/chrome/ui/index.js +1 -0
  9. package/lib/chrome/ui/index.js.map +1 -1
  10. package/lib/citation/core/gfn2Paper.d.ts +10 -0
  11. package/lib/citation/core/gfn2Paper.d.ts.map +1 -0
  12. package/lib/citation/core/gfn2Paper.js +28 -0
  13. package/lib/citation/core/gfn2Paper.js.map +1 -0
  14. package/lib/citation/core/index.d.ts +1 -0
  15. package/lib/citation/core/index.d.ts.map +1 -1
  16. package/lib/citation/core/index.js +1 -0
  17. package/lib/citation/core/index.js.map +1 -1
  18. package/lib/clipboard/ui/ClickToCopy.d.ts +8 -7
  19. package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
  20. package/lib/clipboard/ui/ClickToCopy.js +3 -3
  21. package/lib/clipboard/ui/ClickToCopy.js.map +1 -1
  22. package/lib/conformers.d.ts +27 -0
  23. package/lib/conformers.d.ts.map +1 -0
  24. package/lib/conformers.js +19 -0
  25. package/lib/conformers.js.map +1 -0
  26. package/lib/core.d.ts +1 -0
  27. package/lib/core.d.ts.map +1 -1
  28. package/lib/core.js +1 -0
  29. package/lib/core.js.map +1 -1
  30. package/lib/credits/core/credits.d.ts +12 -0
  31. package/lib/credits/core/credits.d.ts.map +1 -1
  32. package/lib/credits/core/credits.js +14 -0
  33. package/lib/credits/core/credits.js.map +1 -1
  34. package/lib/ecosystem/core/index.d.ts +1 -1
  35. package/lib/ecosystem/core/index.d.ts.map +1 -1
  36. package/lib/ecosystem/core/index.js.map +1 -1
  37. package/lib/ecosystem/core/sites.d.ts +11 -1
  38. package/lib/ecosystem/core/sites.d.ts.map +1 -1
  39. package/lib/ecosystem/core/sites.js +7 -2
  40. package/lib/ecosystem/core/sites.js.map +1 -1
  41. package/lib/ecosystem/ui/EcosystemLinks.d.ts.map +1 -1
  42. package/lib/ecosystem/ui/EcosystemLinks.js +3 -1
  43. package/lib/ecosystem/ui/EcosystemLinks.js.map +1 -1
  44. package/lib/ecosystem/ui/SiteTile.d.ts.map +1 -1
  45. package/lib/ecosystem/ui/SiteTile.js +3 -1
  46. package/lib/ecosystem/ui/SiteTile.js.map +1 -1
  47. package/lib/format/core/index.d.ts +1 -1
  48. package/lib/format/core/index.d.ts.map +1 -1
  49. package/lib/format/core/index.js +1 -1
  50. package/lib/format/core/index.js.map +1 -1
  51. package/lib/format/core/words.d.ts +9 -0
  52. package/lib/format/core/words.d.ts.map +1 -1
  53. package/lib/format/core/words.js +16 -0
  54. package/lib/format/core/words.js.map +1 -1
  55. package/lib/language/core/index.d.ts +3 -0
  56. package/lib/language/core/index.d.ts.map +1 -0
  57. package/lib/language/core/index.js +3 -0
  58. package/lib/language/core/index.js.map +1 -0
  59. package/lib/language/core/languageName.d.ts +8 -0
  60. package/lib/language/core/languageName.d.ts.map +1 -0
  61. package/lib/language/core/languageName.js +16 -0
  62. package/lib/language/core/languageName.js.map +1 -0
  63. package/lib/language/core/languageParam.d.ts +35 -0
  64. package/lib/language/core/languageParam.d.ts.map +1 -0
  65. package/lib/language/core/languageParam.js +67 -0
  66. package/lib/language/core/languageParam.js.map +1 -0
  67. package/lib/language/ui/SiteLanguage.d.ts +20 -0
  68. package/lib/language/ui/SiteLanguage.d.ts.map +1 -0
  69. package/lib/language/ui/SiteLanguage.js +14 -0
  70. package/lib/language/ui/SiteLanguage.js.map +1 -0
  71. package/lib/language/ui/index.d.ts +4 -0
  72. package/lib/language/ui/index.d.ts.map +1 -0
  73. package/lib/language/ui/index.js +3 -0
  74. package/lib/language/ui/index.js.map +1 -0
  75. package/lib/language/ui/siteLanguageContext.d.ts +12 -0
  76. package/lib/language/ui/siteLanguageContext.d.ts.map +1 -0
  77. package/lib/language/ui/siteLanguageContext.js +19 -0
  78. package/lib/language/ui/siteLanguageContext.js.map +1 -0
  79. package/lib/orbital/core/atomicOrbitals.d.ts +9 -1
  80. package/lib/orbital/core/atomicOrbitals.d.ts.map +1 -1
  81. package/lib/orbital/core/atomicOrbitals.js +7 -0
  82. package/lib/orbital/core/atomicOrbitals.js.map +1 -1
  83. package/lib/orbital/core/hydrogenic.d.ts +2 -1
  84. package/lib/orbital/core/hydrogenic.d.ts.map +1 -1
  85. package/lib/orbital/core/hydrogenic.js +2 -1
  86. package/lib/orbital/core/hydrogenic.js.map +1 -1
  87. package/lib/orbital/core/index.d.ts +1 -0
  88. package/lib/orbital/core/index.d.ts.map +1 -1
  89. package/lib/orbital/core/index.js +1 -0
  90. package/lib/orbital/core/index.js.map +1 -1
  91. package/lib/orbital/core/slaterEnergy.d.ts +35 -0
  92. package/lib/orbital/core/slaterEnergy.d.ts.map +1 -0
  93. package/lib/orbital/core/slaterEnergy.js +66 -0
  94. package/lib/orbital/core/slaterEnergy.js.map +1 -0
  95. package/lib/overlay/core/index.d.ts +2 -2
  96. package/lib/overlay/core/index.d.ts.map +1 -1
  97. package/lib/overlay/core/index.js +1 -1
  98. package/lib/overlay/core/index.js.map +1 -1
  99. package/lib/overlay/core/overlayMarks.d.ts +20 -5
  100. package/lib/overlay/core/overlayMarks.d.ts.map +1 -1
  101. package/lib/overlay/core/overlayMarks.js +31 -5
  102. package/lib/overlay/core/overlayMarks.js.map +1 -1
  103. package/lib/overlay/ui/OverlayLegendMark.js +5 -0
  104. package/lib/overlay/ui/OverlayLegendMark.js.map +1 -1
  105. package/lib/projection/core/index.d.ts +4 -4
  106. package/lib/projection/core/index.d.ts.map +1 -1
  107. package/lib/projection/core/index.js +2 -2
  108. package/lib/projection/core/index.js.map +1 -1
  109. package/lib/projection/core/projectionCopy.d.ts +2 -0
  110. package/lib/projection/core/projectionCopy.d.ts.map +1 -1
  111. package/lib/projection/core/projectionCopy.js +1 -0
  112. package/lib/projection/core/projectionCopy.js.map +1 -1
  113. package/lib/projection/core/projectionGroupings.d.ts +44 -0
  114. package/lib/projection/core/projectionGroupings.d.ts.map +1 -0
  115. package/lib/projection/core/projectionGroupings.js +132 -0
  116. package/lib/projection/core/projectionGroupings.js.map +1 -0
  117. package/lib/projection/core/projectionOptions.d.ts +16 -6
  118. package/lib/projection/core/projectionOptions.d.ts.map +1 -1
  119. package/lib/projection/core/projectionOptions.js +7 -1
  120. package/lib/projection/core/projectionOptions.js.map +1 -1
  121. package/lib/projection/core/projectionPanelWords.d.ts +6 -0
  122. package/lib/projection/core/projectionPanelWords.d.ts.map +1 -1
  123. package/lib/projection/core/projectionPanelWords.js +4 -0
  124. package/lib/projection/core/projectionPanelWords.js.map +1 -1
  125. package/lib/projection/core/projectionSamples.d.ts +63 -32
  126. package/lib/projection/core/projectionSamples.d.ts.map +1 -1
  127. package/lib/projection/core/projectionSamples.js +1 -80
  128. package/lib/projection/core/projectionSamples.js.map +1 -1
  129. package/lib/projection/core/projectionStrings.d.ts +2 -0
  130. package/lib/projection/core/projectionStrings.d.ts.map +1 -1
  131. package/lib/projection/core/projectionStrings.js +10 -1
  132. package/lib/projection/core/projectionStrings.js.map +1 -1
  133. package/lib/projection/core/resolveProjectionOptions.d.ts +8 -3
  134. package/lib/projection/core/resolveProjectionOptions.d.ts.map +1 -1
  135. package/lib/projection/core/resolveProjectionOptions.js +58 -5
  136. package/lib/projection/core/resolveProjectionOptions.js.map +1 -1
  137. package/lib/projection/ui/ProjectionBar.d.ts +1 -1
  138. package/lib/projection/ui/ProjectionBar.d.ts.map +1 -1
  139. package/lib/projection/ui/ProjectionBar.js +3 -1
  140. package/lib/projection/ui/ProjectionBar.js.map +1 -1
  141. package/lib/projection/ui/ProjectionGroupingPickers.d.ts +38 -0
  142. package/lib/projection/ui/ProjectionGroupingPickers.d.ts.map +1 -0
  143. package/lib/projection/ui/ProjectionGroupingPickers.js +33 -0
  144. package/lib/projection/ui/ProjectionGroupingPickers.js.map +1 -0
  145. package/lib/projection/ui/ProjectionMapControls.d.ts +6 -7
  146. package/lib/projection/ui/ProjectionMapControls.d.ts.map +1 -1
  147. package/lib/projection/ui/ProjectionMapControls.js +11 -9
  148. package/lib/projection/ui/ProjectionMapControls.js.map +1 -1
  149. package/lib/projection/ui/ProjectionMapLegend.d.ts.map +1 -1
  150. package/lib/projection/ui/ProjectionMapLegend.js +1 -1
  151. package/lib/projection/ui/ProjectionMapLegend.js.map +1 -1
  152. package/lib/projection/ui/ProjectionMapMore.d.ts +2 -2
  153. package/lib/projection/ui/ProjectionMapMore.d.ts.map +1 -1
  154. package/lib/projection/ui/ProjectionMapMore.js +7 -5
  155. package/lib/projection/ui/ProjectionMapMore.js.map +1 -1
  156. package/lib/projection/ui/ProjectionMapTab.d.ts +15 -6
  157. package/lib/projection/ui/ProjectionMapTab.d.ts.map +1 -1
  158. package/lib/projection/ui/ProjectionMapTab.js +11 -7
  159. package/lib/projection/ui/ProjectionMapTab.js.map +1 -1
  160. package/lib/projection/ui/ProjectionPairsMore.d.ts +3 -7
  161. package/lib/projection/ui/ProjectionPairsMore.d.ts.map +1 -1
  162. package/lib/projection/ui/ProjectionPairsMore.js +4 -5
  163. package/lib/projection/ui/ProjectionPairsMore.js.map +1 -1
  164. package/lib/projection/ui/ProjectionPairsTab.d.ts.map +1 -1
  165. package/lib/projection/ui/ProjectionPairsTab.js +2 -2
  166. package/lib/projection/ui/ProjectionPairsTab.js.map +1 -1
  167. package/lib/projection/ui/ProjectionPanel.d.ts +1 -1
  168. package/lib/projection/ui/ProjectionPanel.d.ts.map +1 -1
  169. package/lib/projection/ui/ProjectionPanel.js +1 -1
  170. package/lib/projection/ui/ProjectionPanel.js.map +1 -1
  171. package/lib/projection/ui/ProjectionReadout.d.ts +7 -1
  172. package/lib/projection/ui/ProjectionReadout.d.ts.map +1 -1
  173. package/lib/projection/ui/ProjectionReadout.js +19 -7
  174. package/lib/projection/ui/ProjectionReadout.js.map +1 -1
  175. package/lib/projection/ui/ProjectionSpaceControls.d.ts +3 -5
  176. package/lib/projection/ui/ProjectionSpaceControls.d.ts.map +1 -1
  177. package/lib/projection/ui/ProjectionSpaceControls.js +9 -7
  178. package/lib/projection/ui/ProjectionSpaceControls.js.map +1 -1
  179. package/lib/projection/ui/ProjectionSpaceMore.d.ts +2 -2
  180. package/lib/projection/ui/ProjectionSpaceMore.d.ts.map +1 -1
  181. package/lib/projection/ui/ProjectionSpaceMore.js +5 -4
  182. package/lib/projection/ui/ProjectionSpaceMore.js.map +1 -1
  183. package/lib/projection/ui/ProjectionSpaceTab.d.ts +11 -3
  184. package/lib/projection/ui/ProjectionSpaceTab.d.ts.map +1 -1
  185. package/lib/projection/ui/ProjectionSpaceTab.js +7 -4
  186. package/lib/projection/ui/ProjectionSpaceTab.js.map +1 -1
  187. package/lib/projection/ui/ProjectionViewer.d.ts.map +1 -1
  188. package/lib/projection/ui/ProjectionViewer.js +1 -0
  189. package/lib/projection/ui/ProjectionViewer.js.map +1 -1
  190. package/lib/projection/ui/projectionBarReadings.d.ts +4 -1
  191. package/lib/projection/ui/projectionBarReadings.d.ts.map +1 -1
  192. package/lib/projection/ui/projectionBarReadings.js +14 -4
  193. package/lib/projection/ui/projectionBarReadings.js.map +1 -1
  194. package/lib/projection/ui/projectionBarSlots.d.ts +4 -2
  195. package/lib/projection/ui/projectionBarSlots.d.ts.map +1 -1
  196. package/lib/projection/ui/projectionBarSlots.js +3 -7
  197. package/lib/projection/ui/projectionBarSlots.js.map +1 -1
  198. package/lib/projection/ui/projectionMapChoices.d.ts +31 -6
  199. package/lib/projection/ui/projectionMapChoices.d.ts.map +1 -1
  200. package/lib/projection/ui/projectionMapChoices.js +58 -9
  201. package/lib/projection/ui/projectionMapChoices.js.map +1 -1
  202. package/lib/projection/ui/projectionMapChrome.d.ts +3 -9
  203. package/lib/projection/ui/projectionMapChrome.d.ts.map +1 -1
  204. package/lib/projection/ui/projectionMapChrome.js +41 -27
  205. package/lib/projection/ui/projectionMapChrome.js.map +1 -1
  206. package/lib/projection/ui/projectionMapCorner.d.ts +25 -0
  207. package/lib/projection/ui/projectionMapCorner.d.ts.map +1 -0
  208. package/lib/projection/ui/projectionMapCorner.js +46 -0
  209. package/lib/projection/ui/projectionMapCorner.js.map +1 -0
  210. package/lib/projection/ui/projectionMapModel.d.ts +9 -18
  211. package/lib/projection/ui/projectionMapModel.d.ts.map +1 -1
  212. package/lib/projection/ui/projectionMapModel.js +14 -39
  213. package/lib/projection/ui/projectionMapModel.js.map +1 -1
  214. package/lib/projection/ui/projectionMapView.d.ts +3 -1
  215. package/lib/projection/ui/projectionMapView.d.ts.map +1 -1
  216. package/lib/projection/ui/projectionMapView.js +9 -4
  217. package/lib/projection/ui/projectionMapView.js.map +1 -1
  218. package/lib/projection/ui/projectionSelectionSentence.d.ts +10 -0
  219. package/lib/projection/ui/projectionSelectionSentence.d.ts.map +1 -0
  220. package/lib/projection/ui/projectionSelectionSentence.js +18 -0
  221. package/lib/projection/ui/projectionSelectionSentence.js.map +1 -0
  222. package/lib/projection/ui/projectionStateApi.d.ts +47 -0
  223. package/lib/projection/ui/projectionStateApi.d.ts.map +1 -0
  224. package/lib/projection/ui/projectionStateApi.js +9 -0
  225. package/lib/projection/ui/projectionStateApi.js.map +1 -0
  226. package/lib/projection/ui/projectionTabModels.js +1 -1
  227. package/lib/projection/ui/projectionTabModels.js.map +1 -1
  228. package/lib/projection/ui/useProjectionState.d.ts +1 -29
  229. package/lib/projection/ui/useProjectionState.d.ts.map +1 -1
  230. package/lib/projection/ui/useProjectionState.js +13 -5
  231. package/lib/projection/ui/useProjectionState.js.map +1 -1
  232. package/lib/scatter/core/index.d.ts +1 -0
  233. package/lib/scatter/core/index.d.ts.map +1 -1
  234. package/lib/scatter/core/index.js +1 -0
  235. package/lib/scatter/core/index.js.map +1 -1
  236. package/lib/scatter/core/pointShape.d.ts +18 -0
  237. package/lib/scatter/core/pointShape.d.ts.map +1 -0
  238. package/lib/scatter/core/pointShape.js +70 -0
  239. package/lib/scatter/core/pointShape.js.map +1 -0
  240. package/lib/scatter/ui/ScatterPlot.d.ts.map +1 -1
  241. package/lib/scatter/ui/ScatterPlot.js +3 -2
  242. package/lib/scatter/ui/ScatterPlot.js.map +1 -1
  243. package/lib/scatter/ui/ScatterPointLayer.d.ts +14 -1
  244. package/lib/scatter/ui/ScatterPointLayer.d.ts.map +1 -1
  245. package/lib/scatter/ui/ScatterPointLayer.js +15 -3
  246. package/lib/scatter/ui/ScatterPointLayer.js.map +1 -1
  247. package/lib/scatter/ui/scatterFigureProps.d.ts +13 -0
  248. package/lib/scatter/ui/scatterFigureProps.d.ts.map +1 -1
  249. package/lib/scatter/ui/scatterMarkGlyph.d.ts +2 -1
  250. package/lib/scatter/ui/scatterMarkGlyph.d.ts.map +1 -1
  251. package/lib/scatter/ui/scatterMarkGlyph.js +7 -1
  252. package/lib/scatter/ui/scatterMarkGlyph.js.map +1 -1
  253. package/lib/scatter3d/ui/ScatterCloud.d.ts.map +1 -1
  254. package/lib/scatter3d/ui/ScatterCloud.js +2 -1
  255. package/lib/scatter3d/ui/ScatterCloud.js.map +1 -1
  256. package/lib/shared/ui/MenuButton.d.ts +3 -2
  257. package/lib/shared/ui/MenuButton.d.ts.map +1 -1
  258. package/lib/shared/ui/MenuButton.js +1 -1
  259. package/lib/shared/ui/MenuButton.js.map +1 -1
  260. package/lib/structure/core/conformerMinimise.d.ts +36 -0
  261. package/lib/structure/core/conformerMinimise.d.ts.map +1 -0
  262. package/lib/structure/core/conformerMinimise.js +81 -0
  263. package/lib/structure/core/conformerMinimise.js.map +1 -0
  264. package/lib/structure/core/conformerMinimum.d.ts +62 -0
  265. package/lib/structure/core/conformerMinimum.d.ts.map +1 -0
  266. package/lib/structure/core/conformerMinimum.js +90 -0
  267. package/lib/structure/core/conformerMinimum.js.map +1 -0
  268. package/lib/structure/core/conformerOptions.d.ts +62 -0
  269. package/lib/structure/core/conformerOptions.d.ts.map +1 -0
  270. package/lib/structure/core/conformerOptions.js +83 -0
  271. package/lib/structure/core/conformerOptions.js.map +1 -0
  272. package/lib/structure/core/conformerRefine.d.ts +104 -0
  273. package/lib/structure/core/conformerRefine.d.ts.map +1 -0
  274. package/lib/structure/core/conformerRefine.js +130 -0
  275. package/lib/structure/core/conformerRefine.js.map +1 -0
  276. package/lib/structure/core/conformerRefineRank.d.ts +36 -0
  277. package/lib/structure/core/conformerRefineRank.d.ts.map +1 -0
  278. package/lib/structure/core/conformerRefineRank.js +69 -0
  279. package/lib/structure/core/conformerRefineRank.js.map +1 -0
  280. package/lib/structure/core/conformerSession.d.ts +50 -0
  281. package/lib/structure/core/conformerSession.d.ts.map +1 -0
  282. package/lib/structure/core/conformerSession.js +88 -0
  283. package/lib/structure/core/conformerSession.js.map +1 -0
  284. package/lib/structure/core/conformerShape.d.ts +36 -0
  285. package/lib/structure/core/conformerShape.d.ts.map +1 -0
  286. package/lib/structure/core/conformerShape.js +150 -0
  287. package/lib/structure/core/conformerShape.js.map +1 -0
  288. package/lib/structure/core/conformers.d.ts +107 -0
  289. package/lib/structure/core/conformers.d.ts.map +1 -0
  290. package/lib/structure/core/conformers.js +149 -0
  291. package/lib/structure/core/conformers.js.map +1 -0
  292. package/lib/structure/core/geometryRelaxer.d.ts +66 -0
  293. package/lib/structure/core/geometryRelaxer.d.ts.map +1 -0
  294. package/lib/structure/core/geometryRelaxer.js +2 -0
  295. package/lib/structure/core/geometryRelaxer.js.map +1 -0
  296. package/lib/structure/core/index.d.ts +4 -0
  297. package/lib/structure/core/index.d.ts.map +1 -1
  298. package/lib/structure/core/index.js +2 -0
  299. package/lib/structure/core/index.js.map +1 -1
  300. package/lib/structure/core/moleculeCoordinates.d.ts +31 -0
  301. package/lib/structure/core/moleculeCoordinates.d.ts.map +1 -0
  302. package/lib/structure/core/moleculeCoordinates.js +80 -0
  303. package/lib/structure/core/moleculeCoordinates.js.map +1 -0
  304. package/lib/structure/core/molfileExport.d.ts +42 -0
  305. package/lib/structure/core/molfileExport.d.ts.map +1 -0
  306. package/lib/structure/core/molfileExport.js +47 -0
  307. package/lib/structure/core/molfileExport.js.map +1 -0
  308. package/lib/structure/core/oclResources.d.ts +12 -0
  309. package/lib/structure/core/oclResources.d.ts.map +1 -0
  310. package/lib/structure/core/oclResources.js +35 -0
  311. package/lib/structure/core/oclResources.js.map +1 -0
  312. package/lib/translate/core/catalog.d.ts +61 -0
  313. package/lib/translate/core/catalog.d.ts.map +1 -0
  314. package/lib/translate/core/catalog.js +49 -0
  315. package/lib/translate/core/catalog.js.map +1 -0
  316. package/lib/translate/core/checkTranslation.d.ts +32 -0
  317. package/lib/translate/core/checkTranslation.d.ts.map +1 -0
  318. package/lib/translate/core/checkTranslation.js +98 -0
  319. package/lib/translate/core/checkTranslation.js.map +1 -0
  320. package/lib/translate/core/contribution.d.ts +88 -0
  321. package/lib/translate/core/contribution.d.ts.map +1 -0
  322. package/lib/translate/core/contribution.js +14 -0
  323. package/lib/translate/core/contribution.js.map +1 -0
  324. package/lib/translate/core/index.d.ts +19 -0
  325. package/lib/translate/core/index.d.ts.map +1 -0
  326. package/lib/translate/core/index.js +15 -0
  327. package/lib/translate/core/index.js.map +1 -0
  328. package/lib/translate/core/marker.d.ts +45 -0
  329. package/lib/translate/core/marker.d.ts.map +1 -0
  330. package/lib/translate/core/marker.js +79 -0
  331. package/lib/translate/core/marker.js.map +1 -0
  332. package/lib/translate/core/mergeMessages.d.ts +35 -0
  333. package/lib/translate/core/mergeMessages.d.ts.map +1 -0
  334. package/lib/translate/core/mergeMessages.js +69 -0
  335. package/lib/translate/core/mergeMessages.js.map +1 -0
  336. package/lib/translate/core/session.d.ts +102 -0
  337. package/lib/translate/core/session.d.ts.map +1 -0
  338. package/lib/translate/core/session.js +162 -0
  339. package/lib/translate/core/session.js.map +1 -0
  340. package/lib/translate/core/start.d.ts +70 -0
  341. package/lib/translate/core/start.d.ts.map +1 -0
  342. package/lib/translate/core/start.js +73 -0
  343. package/lib/translate/core/start.js.map +1 -0
  344. package/lib/translate/core/suggestions.d.ts +77 -0
  345. package/lib/translate/core/suggestions.d.ts.map +1 -0
  346. package/lib/translate/core/suggestions.js +143 -0
  347. package/lib/translate/core/suggestions.js.map +1 -0
  348. package/lib/translate/core/tables.d.ts +100 -0
  349. package/lib/translate/core/tables.d.ts.map +1 -0
  350. package/lib/translate/core/tables.js +51 -0
  351. package/lib/translate/core/tables.js.map +1 -0
  352. package/lib/translate.d.ts +2 -0
  353. package/lib/translate.d.ts.map +1 -0
  354. package/lib/translate.js +6 -0
  355. package/lib/translate.js.map +1 -0
  356. package/lib/ui.d.ts +1 -0
  357. package/lib/ui.d.ts.map +1 -1
  358. package/lib/ui.js +1 -0
  359. package/lib/ui.js.map +1 -1
  360. package/lib/xtb/core/xtbRelaxer.d.ts +61 -0
  361. package/lib/xtb/core/xtbRelaxer.d.ts.map +1 -0
  362. package/lib/xtb/core/xtbRelaxer.js +108 -0
  363. package/lib/xtb/core/xtbRelaxer.js.map +1 -0
  364. package/lib/xtb.d.ts +11 -0
  365. package/lib/xtb.d.ts.map +1 -0
  366. package/lib/xtb.js +10 -0
  367. package/lib/xtb.js.map +1 -0
  368. package/package.json +18 -11
  369. package/src/chrome/ui/HeaderToggle.tsx +100 -0
  370. package/src/chrome/ui/index.ts +2 -0
  371. package/src/citation/core/gfn2Paper.ts +32 -0
  372. package/src/citation/core/index.ts +1 -0
  373. package/src/clipboard/ui/ClickToCopy.tsx +8 -7
  374. package/src/conformers.ts +87 -0
  375. package/src/core.ts +1 -0
  376. package/src/credits/core/credits.ts +16 -0
  377. package/src/ecosystem/core/index.ts +1 -0
  378. package/src/ecosystem/core/sites.ts +20 -2
  379. package/src/ecosystem/ui/EcosystemLinks.tsx +3 -1
  380. package/src/ecosystem/ui/SiteTile.tsx +3 -1
  381. package/src/format/core/index.ts +1 -1
  382. package/src/format/core/words.ts +19 -0
  383. package/src/language/core/index.ts +7 -0
  384. package/src/language/core/languageName.ts +16 -0
  385. package/src/language/core/languageParam.ts +70 -0
  386. package/src/language/ui/SiteLanguage.tsx +26 -0
  387. package/src/language/ui/index.ts +3 -0
  388. package/src/language/ui/siteLanguageContext.ts +20 -0
  389. package/src/orbital/core/atomicOrbitals.ts +17 -1
  390. package/src/orbital/core/hydrogenic.ts +2 -1
  391. package/src/orbital/core/index.ts +1 -0
  392. package/src/orbital/core/slaterEnergy.ts +83 -0
  393. package/src/overlay/core/index.ts +6 -2
  394. package/src/overlay/core/overlayMarks.ts +51 -6
  395. package/src/overlay/ui/OverlayLegendMark.tsx +5 -0
  396. package/src/projection/core/index.ts +11 -3
  397. package/src/projection/core/projectionCopy.ts +3 -0
  398. package/src/projection/core/projectionGroupings.ts +174 -0
  399. package/src/projection/core/projectionOptions.ts +18 -7
  400. package/src/projection/core/projectionPanelWords.ts +10 -0
  401. package/src/projection/core/projectionSamples.ts +62 -120
  402. package/src/projection/core/projectionStrings.ts +12 -1
  403. package/src/projection/core/resolveProjectionOptions.ts +66 -4
  404. package/src/projection/ui/ProjectionBar.tsx +4 -2
  405. package/src/projection/ui/ProjectionGroupingPickers.tsx +91 -0
  406. package/src/projection/ui/ProjectionMapControls.tsx +29 -32
  407. package/src/projection/ui/ProjectionMapLegend.tsx +1 -1
  408. package/src/projection/ui/ProjectionMapMore.tsx +14 -4
  409. package/src/projection/ui/ProjectionMapTab.tsx +27 -9
  410. package/src/projection/ui/ProjectionPairsMore.tsx +12 -21
  411. package/src/projection/ui/ProjectionPairsTab.tsx +5 -2
  412. package/src/projection/ui/ProjectionPanel.tsx +7 -3
  413. package/src/projection/ui/ProjectionReadout.tsx +28 -8
  414. package/src/projection/ui/ProjectionSpaceControls.tsx +20 -27
  415. package/src/projection/ui/ProjectionSpaceMore.tsx +12 -3
  416. package/src/projection/ui/ProjectionSpaceTab.tsx +23 -6
  417. package/src/projection/ui/ProjectionViewer.tsx +1 -0
  418. package/src/projection/ui/projectionBarReadings.ts +24 -8
  419. package/src/projection/ui/projectionBarSlots.tsx +10 -9
  420. package/src/projection/ui/projectionMapChoices.ts +71 -14
  421. package/src/projection/ui/projectionMapChrome.ts +55 -30
  422. package/src/projection/ui/projectionMapCorner.ts +67 -0
  423. package/src/projection/ui/projectionMapModel.ts +20 -59
  424. package/src/projection/ui/projectionMapView.ts +15 -8
  425. package/src/projection/ui/projectionSelectionSentence.ts +22 -0
  426. package/src/projection/ui/projectionStateApi.ts +57 -0
  427. package/src/projection/ui/projectionTabModels.ts +1 -1
  428. package/src/projection/ui/useProjectionState.ts +33 -37
  429. package/src/scatter/core/index.ts +1 -0
  430. package/src/scatter/core/pointShape.ts +80 -0
  431. package/src/scatter/ui/ScatterPlot.tsx +4 -1
  432. package/src/scatter/ui/ScatterPointLayer.tsx +39 -11
  433. package/src/scatter/ui/scatterFigureProps.ts +13 -0
  434. package/src/scatter/ui/scatterMarkGlyph.tsx +9 -1
  435. package/src/scatter3d/ui/ScatterCloud.tsx +3 -0
  436. package/src/shared/ui/MenuButton.tsx +4 -3
  437. package/src/structure/core/conformerMinimise.ts +99 -0
  438. package/src/structure/core/conformerMinimum.ts +125 -0
  439. package/src/structure/core/conformerOptions.ts +125 -0
  440. package/src/structure/core/conformerRefine.ts +234 -0
  441. package/src/structure/core/conformerRefineRank.ts +89 -0
  442. package/src/structure/core/conformerSession.ts +123 -0
  443. package/src/structure/core/conformerShape.ts +181 -0
  444. package/src/structure/core/conformers.ts +282 -0
  445. package/src/structure/core/geometryRelaxer.ts +71 -0
  446. package/src/structure/core/index.ts +13 -0
  447. package/src/structure/core/moleculeCoordinates.ts +93 -0
  448. package/src/structure/core/molfileExport.ts +62 -0
  449. package/src/structure/core/oclResources.ts +41 -0
  450. package/src/translate/core/catalog.ts +83 -0
  451. package/src/translate/core/checkTranslation.ts +128 -0
  452. package/src/translate/core/contribution.ts +99 -0
  453. package/src/translate/core/index.ts +72 -0
  454. package/src/translate/core/marker.ts +85 -0
  455. package/src/translate/core/mergeMessages.ts +74 -0
  456. package/src/translate/core/session.ts +250 -0
  457. package/src/translate/core/start.ts +121 -0
  458. package/src/translate/core/suggestions.ts +211 -0
  459. package/src/translate/core/tables.ts +120 -0
  460. package/src/translate.ts +5 -0
  461. package/src/ui.ts +1 -0
  462. package/src/xtb/core/xtbRelaxer.ts +160 -0
  463. package/src/xtb.ts +16 -0
  464. package/styles/chrome.css +61 -30
@@ -19,8 +19,14 @@ interface ProjectionReadoutProps {
19
19
  result: ProjectionResult;
20
20
  /** Who the rows are. */
21
21
  samples: ProjectionSamples;
22
- /** The groups as the figure draws them, for the row's group and its colour. */
22
+ /** The grouping the figure is coloured by, for the colour of the row's group. */
23
23
  groups: ResolvedProjectionGroups;
24
+ /**
25
+ * Which grouping colours the figure, so the row of that grouping carries the
26
+ * colour its dot is drawn in.
27
+ * @default undefined — no row carries a colour
28
+ */
29
+ colorBy?: string;
24
30
  /** Which axis is drawn horizontally, from 0. */
25
31
  xAxis: number;
26
32
  /** Which axis is drawn vertically. */
@@ -85,6 +91,7 @@ export function ProjectionReadout(props: ProjectionReadoutProps): ReactElement {
85
91
  result,
86
92
  samples,
87
93
  groups,
94
+ colorBy,
88
95
  xAxis,
89
96
  yAxis,
90
97
  zAxis,
@@ -104,8 +111,12 @@ export function ProjectionReadout(props: ProjectionReadoutProps): ReactElement {
104
111
  [xAxis, yAxis, zAxis],
105
112
  );
106
113
  const rows = useMemo(
107
- () => readoutRows(index, result, samples, groups, drawn, formatValue),
108
- [drawn, formatValue, groups, index, result, samples],
114
+ () =>
115
+ readoutRows(index, result, samples, drawn, formatValue, {
116
+ groups,
117
+ colorBy,
118
+ }),
119
+ [colorBy, drawn, formatValue, groups, index, result, samples],
109
120
  );
110
121
 
111
122
  return (
@@ -114,7 +125,7 @@ export function ProjectionReadout(props: ProjectionReadoutProps): ReactElement {
114
125
  y={y}
115
126
  boxWidth={boxWidth}
116
127
  boxHeight={boxHeight}
117
- title={samples.ids[index] ?? ''}
128
+ title={samples.labels?.[index] ?? samples.ids[index] ?? ''}
118
129
  rows={rows}
119
130
  maxRows={maxRows}
120
131
  pinned={pinned}
@@ -128,9 +139,9 @@ function readoutRows(
128
139
  index: number,
129
140
  result: ProjectionResult,
130
141
  samples: ProjectionSamples,
131
- groups: ResolvedProjectionGroups,
132
142
  drawn: readonly number[],
133
143
  formatValue: (value: number) => string,
144
+ coloured: { groups: ResolvedProjectionGroups; colorBy?: string },
134
145
  ): OverlayReadoutRow[] {
135
146
  const rows: OverlayReadoutRow[] = [];
136
147
  const { axes, scores } = result;
@@ -145,9 +156,18 @@ function readoutRows(
145
156
  });
146
157
  }
147
158
 
148
- const group = groups.entries[groups.groupOf[index] ?? -1];
149
- if (group !== undefined) {
150
- rows.push({ label: groups.label, value: group.label, color: group.color });
159
+ // Every grouping is written, the one the dots are coloured by with its
160
+ // colour: a card naming only the colour's group would hide the very
161
+ // grouping the shapes stand for.
162
+ const { groups, colorBy } = coloured;
163
+ for (const grouping of samples.groupings ?? []) {
164
+ const value = grouping.groups[index];
165
+ if (value === undefined) continue;
166
+ const group =
167
+ grouping.id === colorBy
168
+ ? groups.entries[groups.groupOf[index] ?? -1]
169
+ : undefined;
170
+ rows.push({ label: grouping.label, value, color: group?.color });
151
171
  }
152
172
 
153
173
  if (known && samples.fields !== undefined) {
@@ -8,11 +8,11 @@ import { OverlayToggle } from '../../overlay/ui/OverlayToggle.tsx';
8
8
  import { OverlayValueMenu } from '../../overlay/ui/OverlayValueMenu.tsx';
9
9
  import type { CloudGesture } from '../../scatter3d/core/cloudGesture.ts';
10
10
  import type { ProjectionCopy } from '../core/projectionCopy.ts';
11
- import type {
12
- ProjectionColorBy,
13
- ProjectionOptions,
14
- } from '../core/projectionOptions.ts';
11
+ import type { ProjectionOptions } from '../core/projectionOptions.ts';
12
+ import { NO_GROUPING } from '../core/projectionOptions.ts';
13
+ import type { ProjectionGrouping } from '../core/projectionSamples.ts';
15
14
 
15
+ import { ProjectionColourPicker } from './ProjectionGroupingPickers.tsx';
16
16
  import type { ProjectionReading } from './projectionBarReadings.ts';
17
17
  import { projectionChipSettings } from './projectionBarReadings.ts';
18
18
  import {
@@ -20,7 +20,6 @@ import {
20
20
  ellipseKey,
21
21
  ellipseSize,
22
22
  } from './projectionEllipse.ts';
23
- import { projectionColourChoices } from './projectionMapChoices.ts';
24
23
  import { projectionCloudGestureChoices } from './projectionWordChoices.ts';
25
24
 
26
25
  /** What the cloud's controls are drawn from, wherever in the bar they sit. */
@@ -31,14 +30,11 @@ export interface ProjectionSpaceControlsProps {
31
30
  onChange: (patch: Partial<ProjectionOptions>) => void;
32
31
  /** The words the bar writes, already merged over the defaults. */
33
32
  copy: ProjectionCopy;
34
- /** What the set of groups is called. */
35
- groupLabel: string;
36
33
  /**
37
- * Whether the samples carry groups at all. Without them the shells stand for
34
+ * Every grouping the samples carry. Without one the shells stand for
38
35
  * nothing, so their control is greyed rather than removed.
39
- * @default false
40
36
  */
41
- hasGroups?: boolean;
37
+ groupings: readonly ProjectionGrouping[];
42
38
  /**
43
39
  * What the settings currently read, built once for the bar and handed down.
44
40
  * @default [] — nothing is written, which is what the cog's panel wants
@@ -71,11 +67,12 @@ export interface ProjectionSpaceControlsProps {
71
67
  export function ProjectionSpaceControls(
72
68
  props: ProjectionSpaceControlsProps,
73
69
  ): ReactElement {
74
- const { options, onChange, copy, groupLabel, hasGroups = false } = props;
70
+ const { options, onChange, copy, groupings } = props;
75
71
  const { readings = NO_READINGS, tier = 'full' } = props;
76
72
  const { bar, help, outline, reason } = copy;
77
73
 
78
- const uncoloured = !hasGroups || options.colorBy === 'none';
74
+ const hasGroups = groupings.length > 0;
75
+ const uncoloured = !hasGroups || options.colorBy === NO_GROUPING;
79
76
  const names = (
80
77
  <>
81
78
  <OverlayToggle
@@ -109,8 +106,7 @@ export function ProjectionSpaceControls(
109
106
  options={options}
110
107
  onChange={onChange}
111
108
  copy={copy}
112
- groupLabel={groupLabel}
113
- hasGroups={hasGroups}
109
+ groupings={groupings}
114
110
  />
115
111
  </OverlayChip>
116
112
  {names}
@@ -151,10 +147,8 @@ interface SpaceSettingsProps {
151
147
  onChange: (patch: Partial<ProjectionOptions>) => void;
152
148
  /** The words the panel writes. */
153
149
  copy: ProjectionCopy;
154
- /** What the set of groups is called, which is what `Colour by` offers. */
155
- groupLabel: string;
156
- /** Whether the samples carry groups at all. */
157
- hasGroups: boolean;
150
+ /** Every grouping the samples carry. */
151
+ groupings: readonly ProjectionGrouping[];
158
152
  }
159
153
 
160
154
  /**
@@ -163,8 +157,8 @@ interface SpaceSettingsProps {
163
157
  * @returns The captioned controls.
164
158
  */
165
159
  function SpaceSettings(props: SpaceSettingsProps): ReactElement {
166
- const { options, onChange, copy, groupLabel, hasGroups } = props;
167
- const { bar, help, outline } = copy;
160
+ const { options, onChange, copy, groupings } = props;
161
+ const { help, outline } = copy;
168
162
 
169
163
  return (
170
164
  <>
@@ -175,19 +169,18 @@ function SpaceSettings(props: SpaceSettingsProps): ReactElement {
175
169
  options={projectionCloudGestureChoices(copy)}
176
170
  onChange={(cloudGesture) => onChange({ cloudGesture })}
177
171
  />
178
- <OverlaySegmented<ProjectionColorBy>
172
+ <ProjectionColourPicker
179
173
  label={help.colorBy.title}
180
- help={help.colorBy}
181
- value={options.colorBy}
182
- disabled={!hasGroups}
183
- options={projectionColourChoices(groupLabel, bar.uncoloured)}
184
- onChange={(colorBy) => onChange({ colorBy })}
174
+ options={options}
175
+ onChange={onChange}
176
+ copy={copy}
177
+ groupings={groupings}
185
178
  />
186
179
  <OverlaySelect
187
180
  label={help.ellipse.title}
188
181
  help={help.ellipse}
189
182
  value={ellipseKey(options.ellipse)}
190
- disabled={!hasGroups || options.colorBy === 'none'}
183
+ disabled={groupings.length === 0 || options.colorBy === NO_GROUPING}
191
184
  options={ellipseChoices(options.ellipse, outline, 'space')}
192
185
  onChange={(value) => onChange({ ellipse: ellipseSize(value) })}
193
186
  />
@@ -11,6 +11,7 @@ import type { CloudGesture } from '../../scatter3d/core/cloudGesture.ts';
11
11
  import type { ProjectionResult } from '../core/projectionResult.ts';
12
12
  import { PROJECTION_TAB_DEFAULTS } from '../core/projectionTabDefaults.ts';
13
13
 
14
+ import { ProjectionShapePicker } from './ProjectionGroupingPickers.tsx';
14
15
  import type { ProjectionSpaceControlsProps } from './ProjectionSpaceControls.tsx';
15
16
  import { projectionAxisChoices } from './projectionAxisChoices.ts';
16
17
  import {
@@ -35,8 +36,8 @@ interface ProjectionSpaceMoreProps extends ProjectionSpaceControlsProps {
35
36
  }
36
37
 
37
38
  /**
38
- * What the cloud keeps behind the cog: its three axes, the dot size, and what
39
- * the two drags do.
39
+ * What the cloud keeps behind the cog: its three axes, the dot size and shape,
40
+ * and what the two drags do.
40
41
  *
41
42
  * It is the map's panel with one picker more and one action fewer. There is no
42
43
  * "zoom to selection" here, because a box has no frame to draw round a crowd:
@@ -49,7 +50,7 @@ interface ProjectionSpaceMoreProps extends ProjectionSpaceControlsProps {
49
50
  export function ProjectionSpaceMore(
50
51
  props: ProjectionSpaceMoreProps,
51
52
  ): ReactElement {
52
- const { result, options, onChange, copy } = props;
53
+ const { result, options, onChange, copy, groupings } = props;
53
54
  const { selectedCount = 0, onResetView, onClearSelection } = props;
54
55
  const { action, help, panel, reason, tab } = copy;
55
56
 
@@ -122,6 +123,14 @@ export function ProjectionSpaceMore(
122
123
  unit="px"
123
124
  onChange={(pointRadius) => onChange({ pointRadius })}
124
125
  />
126
+ <ProjectionShapePicker
127
+ label={panel.name.shapeBy}
128
+ options={options}
129
+ onChange={onChange}
130
+ copy={copy}
131
+ groupings={groupings}
132
+ rows={result.scores.rows}
133
+ />
125
134
  </OverlayGroup>
126
135
  <OverlayGroup label={panel.section.handling}>
127
136
  <OverlaySegmented<CloudGesture>
@@ -7,8 +7,12 @@ import type { OrbitCamera } from '../../scatter3d/core/orbitCamera.ts';
7
7
  import { ScatterCloud } from '../../scatter3d/ui/ScatterCloud.tsx';
8
8
  import type { ProjectionCopy } from '../core/projectionCopy.ts';
9
9
  import type { ProjectionOptions } from '../core/projectionOptions.ts';
10
+ import { NO_GROUPING } from '../core/projectionOptions.ts';
10
11
  import type { ProjectionResult } from '../core/projectionResult.ts';
11
- import type { ResolvedProjectionGroups } from '../core/projectionSamples.ts';
12
+ import type {
13
+ ResolvedProjectionGroups,
14
+ ResolvedProjectionShapes,
15
+ } from '../core/projectionSamples.ts';
12
16
 
13
17
  import type { SelectionReport } from './ProjectionMapCaption.tsx';
14
18
  import { ProjectionMapCaption } from './ProjectionMapCaption.tsx';
@@ -19,6 +23,7 @@ import {
19
23
  projectionAxisTitle,
20
24
  projectionMapCloud,
21
25
  projectionScatterGroups,
26
+ projectionScatterShapes,
22
27
  } from './projectionMapModel.ts';
23
28
  import { MINIMUM_SHELL_POINTS } from './projectionSpaceModel.ts';
24
29
 
@@ -26,8 +31,16 @@ import { MINIMUM_SHELL_POINTS } from './projectionSpaceModel.ts';
26
31
  interface ProjectionSpaceTabProps {
27
32
  /** What the run produced, whatever produced it. */
28
33
  result: ProjectionResult;
29
- /** The groups, resolved once by the viewer so every tab colours alike. */
34
+ /**
35
+ * The grouping the dots are coloured by, resolved once by the viewer so every
36
+ * tab colours alike; empty while the colour stands for nothing.
37
+ */
30
38
  groups: ResolvedProjectionGroups;
39
+ /**
40
+ * The grouping the dots are shaped by, resolved once by the viewer.
41
+ * @default null — every dot is a disc
42
+ */
43
+ shapes?: ResolvedProjectionShapes | null;
31
44
  /** What the cloud is showing, already resolved against `result`. */
32
45
  options: ProjectionOptions;
33
46
  /** The words the cloud writes, already merged over the defaults. */
@@ -38,7 +51,7 @@ interface ProjectionSpaceTabProps {
38
51
  * What each sample is called, in the score matrix's row order.
39
52
  * @default undefined — the setting has nothing to write and draws nothing
40
53
  */
41
- ids?: readonly string[];
54
+ names?: readonly string[];
42
55
  /** Width of the figure, in pixels. */
43
56
  width: number;
44
57
  /** Height of the figure, in pixels. */
@@ -113,7 +126,8 @@ export function ProjectionSpaceTab(
113
126
  props: ProjectionSpaceTabProps,
114
127
  ): ReactElement {
115
128
  const { result, groups, options, copy, chrome, width, height } = props;
116
- const { ids, selected, report = null, camera, zoom } = props;
129
+ const { names, shapes = null, selected } = props;
130
+ const { report = null, camera, zoom } = props;
117
131
  const { onCameraChange, onZoomChange, wheelZoom } = props;
118
132
  const { onSelectionChange, onHoverChange, hoverCard, testId } = props;
119
133
  const { onPointDoubleClick } = props;
@@ -131,7 +145,8 @@ export function ProjectionSpaceTab(
131
145
  [scores, zAxis],
132
146
  );
133
147
 
134
- const colored = colorBy === 'group' && groups.entries.length > 0;
148
+ const shapeList = useMemo(() => projectionScatterShapes(shapes), [shapes]);
149
+ const colored = colorBy !== NO_GROUPING && groups.entries.length > 0;
135
150
 
136
151
  return (
137
152
  <div style={{ position: 'relative' }} data-testid={testId}>
@@ -146,10 +161,12 @@ export function ProjectionSpaceTab(
146
161
  zLabel={axisName(result, zAxis)}
147
162
  groupOf={colored ? groups.groupOf : undefined}
148
163
  groups={colored ? projectionScatterGroups(groups) : undefined}
164
+ shapeOf={shapes?.shapeOf}
165
+ shapes={shapeList}
149
166
  ellipsoid={colored ? shells : null}
150
167
  ellipsoidMinimumPoints={MINIMUM_SHELL_POINTS}
151
168
  showGroupLabels={colored && showGroupLabels}
152
- pointLabels={showIds ? ids : undefined}
169
+ pointLabels={showIds ? names : undefined}
153
170
  pointRadius={pointRadius}
154
171
  outlinedFrom={fittedCount}
155
172
  selected={selected}
@@ -64,6 +64,7 @@ export function ProjectionViewer(props: ProjectionViewerProps): ReactElement {
64
64
  result,
65
65
  copy,
66
66
  groups: state.groups,
67
+ shapes: state.shapes,
67
68
  options: state.options,
68
69
  selected: state.selected,
69
70
  onSettle: state.settleSelection,
@@ -13,6 +13,7 @@ import type { OverlayMetrics } from '../../overlay/core/overlayMetrics.ts';
13
13
  import type { OverlayChipSetting } from '../../overlay/ui/OverlayChip.tsx';
14
14
  import type { ProjectionCopy } from '../core/projectionCopy.ts';
15
15
  import type { ProjectionOptions } from '../core/projectionOptions.ts';
16
+ import { NO_GROUPING } from '../core/projectionOptions.ts';
16
17
  import type { ResolvedProjectionGroups } from '../core/projectionSamples.ts';
17
18
  import type { ProjectionTab } from '../core/projectionTabs.ts';
18
19
 
@@ -48,7 +49,10 @@ interface ProjectionReadingsInput {
48
49
  copy: ProjectionCopy;
49
50
  /** What the figure is showing, already made safe against the result. */
50
51
  options: ProjectionOptions;
51
- /** The groups as every figure draws them, whose colours the map writes. */
52
+ /**
53
+ * The grouping the figures are coloured by, whose colours the map writes;
54
+ * empty while nothing colours them.
55
+ */
52
56
  groups: ResolvedProjectionGroups;
53
57
  }
54
58
 
@@ -83,10 +87,9 @@ export function projectionBarReadings(
83
87
  ];
84
88
  }
85
89
  if (tab === 'space') {
86
- const coverage =
87
- options.colorBy === 'group' && groups.entries.length > 0
88
- ? ellipseCoverageText(options.ellipse, 'space')
89
- : '';
90
+ const coverage = isColoured(options, groups)
91
+ ? ellipseCoverageText(options.ellipse, 'space')
92
+ : '';
90
93
  return [
91
94
  {
92
95
  key: bar.key.cloudGesture,
@@ -163,14 +166,14 @@ export function projectionChipSettings(
163
166
  * Empty while the colour stands for nothing, so a bar that says `Nothing`
164
167
  * does not carry a row of dots contradicting it.
165
168
  * @param options - What the figure is showing.
166
- * @param groups - The groups as every figure draws them.
169
+ * @param groups - The grouping the figures are coloured by.
167
170
  * @returns The colours, in the order the figure draws them.
168
171
  */
169
172
  function projectionGroupColors(
170
173
  options: ProjectionOptions,
171
174
  groups: ResolvedProjectionGroups,
172
175
  ): readonly string[] {
173
- if (options.colorBy !== 'group') return NO_COLORS;
176
+ if (!isColoured(options, groups)) return NO_COLORS;
174
177
  const colors: string[] = [];
175
178
  for (const entry of groups.entries) colors.push(entry.color);
176
179
  return colors;
@@ -195,7 +198,7 @@ function mapReadings(
195
198
  groups: ResolvedProjectionGroups,
196
199
  ): readonly ProjectionReading[] {
197
200
  const { bar, help } = copy;
198
- const colored = options.colorBy === 'group';
201
+ const colored = isColoured(options, groups);
199
202
  const coverage = ellipseCoverageText(options.ellipse);
200
203
  return [
201
204
  {
@@ -212,5 +215,18 @@ function mapReadings(
212
215
  ];
213
216
  }
214
217
 
218
+ /**
219
+ * Whether the colour stands for a grouping at all.
220
+ * @param options - What the figure is showing.
221
+ * @param groups - The grouping the figures are coloured by.
222
+ * @returns `true` when the dots are painted by group.
223
+ */
224
+ function isColoured(
225
+ options: ProjectionOptions,
226
+ groups: ResolvedProjectionGroups,
227
+ ): boolean {
228
+ return options.colorBy !== NO_GROUPING && groups.entries.length > 0;
229
+ }
230
+
215
231
  /** No colours at all, which is what an uncoloured map paints. */
216
232
  const NO_COLORS: readonly string[] = [];
@@ -4,7 +4,10 @@ import type { OverlayTier } from '../../overlay/core/overlayTiers.ts';
4
4
  import type { ProjectionCopy } from '../core/projectionCopy.ts';
5
5
  import type { ProjectionOptions } from '../core/projectionOptions.ts';
6
6
  import type { ProjectionResult } from '../core/projectionResult.ts';
7
- import type { ResolvedProjectionGroups } from '../core/projectionSamples.ts';
7
+ import type {
8
+ ProjectionGrouping,
9
+ ResolvedProjectionGroups,
10
+ } from '../core/projectionSamples.ts';
8
11
  import type { ProjectionTab } from '../core/projectionTabs.ts';
9
12
 
10
13
  import { ProjectionMapControls } from './ProjectionMapControls.tsx';
@@ -50,8 +53,10 @@ interface ProjectionBarSlotsInput {
50
53
  map: ProjectionMapView;
51
54
  /** Every option, already made safe against the result. */
52
55
  options: ProjectionOptions;
53
- /** The groups as every figure draws them. */
56
+ /** The grouping the figures are coloured by; empty while nothing colours them. */
54
57
  groups: ResolvedProjectionGroups;
58
+ /** Every grouping the samples carry, which the pickers choose between. */
59
+ groupings: readonly ProjectionGrouping[];
55
60
  /** The selected rows, as indices. */
56
61
  selected: readonly number[];
57
62
  /** Width of the viewer, in pixels. */
@@ -79,16 +84,14 @@ export function projectionBarSlots(
79
84
  input: ProjectionBarSlotsInput,
80
85
  ): ProjectionBarSlots {
81
86
  const { tab, result, copy, models, map, readings, tier } = input;
82
- const { options, groups, selected, width, onChange } = input;
87
+ const { options, groups, groupings, selected, width, onChange } = input;
83
88
 
84
- const hasGroups = groups.entries.length > 0;
85
- const colored = options.colorBy === 'group' && hasGroups;
86
- const shared = { options, onChange, copy, groupLabel: groups.label };
89
+ const colored = groups.entries.length > 0;
90
+ const shared = { options, onChange, copy, groupings };
87
91
 
88
92
  if (tab === 'pairs') {
89
93
  const pairs = {
90
94
  ...shared,
91
- hasGroups,
92
95
  axisCount: result.axes.length,
93
96
  width,
94
97
  };
@@ -102,7 +105,6 @@ export function projectionBarSlots(
102
105
  const space = {
103
106
  ...shared,
104
107
  result,
105
- hasGroups,
106
108
  selectedCount: selected.length,
107
109
  onResetView: map.resetSpaceView,
108
110
  onClearSelection: map.clearSelection,
@@ -144,7 +146,6 @@ export function projectionBarSlots(
144
146
  const forMap = {
145
147
  ...shared,
146
148
  result,
147
- hasGroups,
148
149
  selectedCount: selected.length,
149
150
  onZoomToSelection: map.zoomToSelection,
150
151
  onResetView: map.resetView,
@@ -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
@@ -9,10 +9,10 @@
9
9
 
10
10
  import type { OverlayOption } from '../../overlay/ui/OverlayRow.tsx';
11
11
  import type { ProjectionCopy } from '../core/projectionCopy.ts';
12
- import type {
13
- ProjectionColorBy,
14
- ProjectionOptions,
15
- } from '../core/projectionOptions.ts';
12
+ import { resolveProjectionShapes } from '../core/projectionGroupings.ts';
13
+ import type { ProjectionOptions } from '../core/projectionOptions.ts';
14
+ import { NO_GROUPING } from '../core/projectionOptions.ts';
15
+ import type { ProjectionGrouping } from '../core/projectionSamples.ts';
16
16
 
17
17
  import {
18
18
  ellipseChoices,
@@ -21,19 +21,76 @@ import {
21
21
  } from './projectionEllipse.ts';
22
22
 
23
23
  /**
24
- * What the colour may stand for.
25
- * @param groupLabel - What the set of groups is called.
24
+ * What the colour may stand for: each grouping the samples carry, or nothing.
25
+ * @param groupings - The groupings the samples carry.
26
26
  * @param uncoloured - What "the colour stands for nothing" reads.
27
- * @returns The two choices.
27
+ * @returns The choices, in the order the groupings were handed in.
28
28
  */
29
29
  export function projectionColourChoices(
30
- groupLabel: string,
30
+ groupings: readonly ProjectionGrouping[],
31
31
  uncoloured: string,
32
- ): ReadonlyArray<OverlayOption<ProjectionColorBy>> {
33
- return [
34
- { value: 'group', label: groupLabel },
35
- { value: 'none', label: uncoloured },
36
- ];
32
+ ): readonly OverlayOption[] {
33
+ const choices: OverlayOption[] = [];
34
+ for (const { id, label } of groupings) choices.push({ value: id, label });
35
+ choices.push({ value: NO_GROUPING, label: uncoloured });
36
+ return choices;
37
+ }
38
+
39
+ /**
40
+ * What the shape may stand for: each grouping the samples carry, or nothing.
41
+ *
42
+ * A grouping the colour already stands for is kept in the list but greyed, as
43
+ * is one of more groups than there are shapes, so the reader sees why it cannot
44
+ * be picked rather than wondering where it went.
45
+ * @param groupings - The groupings the samples carry.
46
+ * @param options - What the figure is showing, whose colour is taken.
47
+ * @param rows - How many rows there are, which is what a grouping is cut over.
48
+ * @param copy - The words the viewer writes.
49
+ * @returns The choices, in the order the groupings were handed in.
50
+ */
51
+ export function projectionShapeChoices(
52
+ groupings: readonly ProjectionGrouping[],
53
+ options: ProjectionOptions,
54
+ rows: number,
55
+ copy: ProjectionCopy,
56
+ ): readonly OverlayOption[] {
57
+ const choices: OverlayOption[] = [];
58
+ for (const grouping of groupings) {
59
+ const { id, label } = grouping;
60
+ const reason =
61
+ id === options.colorBy
62
+ ? copy.reason.shapeIsColour
63
+ : resolveProjectionShapes(grouping, rows) === null
64
+ ? copy.reason.tooManyShapes
65
+ : undefined;
66
+ choices.push({
67
+ value: id,
68
+ label,
69
+ disabled: reason !== undefined,
70
+ title: reason,
71
+ });
72
+ }
73
+ choices.push({ value: NO_GROUPING, label: copy.bar.unshaped });
74
+ return choices;
75
+ }
76
+
77
+ /**
78
+ * What changes when the colour is given to another grouping.
79
+ *
80
+ * A grouping drawn as the shape that is picked for the colour swaps places
81
+ * with it rather than being dropped, so the reader never loses one of the two
82
+ * groupings they were comparing by trading them round.
83
+ * @param options - What the figure is showing.
84
+ * @param colorBy - The grouping picked for the colour.
85
+ * @returns The options that change.
86
+ */
87
+ export function projectionColourPatch(
88
+ options: ProjectionOptions,
89
+ colorBy: string,
90
+ ): Partial<ProjectionOptions> {
91
+ return colorBy !== NO_GROUPING && colorBy === options.shapeBy
92
+ ? { colorBy, shapeBy: options.colorBy }
93
+ : { colorBy };
37
94
  }
38
95
 
39
96
  /**