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
@@ -10,25 +10,62 @@
10
10
 
11
11
  /** Which mark a legend entry, a marker or a series stands for. */
12
12
  export type OverlayMarkShape =
13
- 'dot' | 'ring' | 'square' | 'line' | 'dashed' | 'cross';
13
+ | 'dot'
14
+ | 'ring'
15
+ | 'square'
16
+ | 'triangle'
17
+ | 'diamond'
18
+ | 'triangle-down'
19
+ | 'line'
20
+ | 'dashed'
21
+ | 'cross';
22
+
23
+ /**
24
+ * The shapes a sample's own dot can take, which is how a second grouping of
25
+ * the same samples is drawn while colour keeps the first.
26
+ */
27
+ export type OverlaySampleShape = Extract<
28
+ OverlayMarkShape,
29
+ 'dot' | 'square' | 'triangle' | 'diamond' | 'triangle-down'
30
+ >;
14
31
 
15
32
  /**
16
33
  * Every mark, in the order a picker offers them.
17
34
  *
18
- * The first three separate one filled thing from another by colour alone; the
19
- * last three carry a second meaning on one figure — a line for a component
20
- * beside dots for the samples — which is what keeps a figure readable when the
21
- * colours run out or the reader does not separate two of them.
35
+ * The filled ones come first and separate one thing from another by colour or
36
+ * by outline alone; the last three carry a second meaning on one figure — a
37
+ * line for a component beside dots for the samples — which is what keeps a
38
+ * figure readable when the colours run out or the reader does not separate two
39
+ * of them.
22
40
  */
23
41
  export const OVERLAY_MARK_SHAPES: readonly OverlayMarkShape[] = [
24
42
  'dot',
25
43
  'ring',
26
44
  'square',
45
+ 'triangle',
46
+ 'diamond',
47
+ 'triangle-down',
27
48
  'line',
28
49
  'dashed',
29
50
  'cross',
30
51
  ];
31
52
 
53
+ /**
54
+ * The shapes a second grouping is given, in the order its groups are listed.
55
+ *
56
+ * Five, because that is about where a reader stops telling small shapes apart
57
+ * at a glance. None of them is a ring or a cross: a ring is a sample placed
58
+ * into a finished model and a cross is a group's average, and a sample drawn
59
+ * as either would be read as one of those.
60
+ */
61
+ export const OVERLAY_SAMPLE_SHAPES: readonly OverlaySampleShape[] = [
62
+ 'dot',
63
+ 'square',
64
+ 'triangle',
65
+ 'diamond',
66
+ 'triangle-down',
67
+ ];
68
+
32
69
  /**
33
70
  * Whether a mark is drawn as a solid area rather than as a stroke.
34
71
  *
@@ -39,5 +76,13 @@ export const OVERLAY_MARK_SHAPES: readonly OverlayMarkShape[] = [
39
76
  * @returns `true` for the filled marks, `false` for the drawn ones.
40
77
  */
41
78
  export function isFilledMark(shape: OverlayMarkShape): boolean {
42
- return shape === 'dot' || shape === 'square';
79
+ return FILLED_MARKS.has(shape);
43
80
  }
81
+
82
+ const FILLED_MARKS: ReadonlySet<OverlayMarkShape> = new Set<OverlayMarkShape>([
83
+ 'dot',
84
+ 'square',
85
+ 'triangle',
86
+ 'diamond',
87
+ 'triangle-down',
88
+ ]);
@@ -73,6 +73,11 @@ const MARK_GEOMETRY: Record<OverlayMarkShape, ReactElement> = {
73
73
  dot: <circle cx="6" cy="6" r="4.2" />,
74
74
  ring: <circle cx="6" cy="6" r="3.4" strokeWidth="2.2" />,
75
75
  square: <rect x="2" y="2" width="8" height="8" rx="1.5" />,
76
+ // Balanced on the centre of the box, as the dots they name are balanced on
77
+ // their samples.
78
+ triangle: <path d="M6 0.8L10.5 8.6L1.5 8.6Z" />,
79
+ diamond: <path d="M6 1L11 6L6 11L1 6Z" />,
80
+ 'triangle-down': <path d="M1.5 3.4L10.5 3.4L6 11.2Z" />,
76
81
  line: <line x1="0.5" y1="6" x2="11.5" y2="6" strokeWidth="2.8" />,
77
82
  dashed: (
78
83
  <line
@@ -35,13 +35,15 @@ export type { ProjectionCopy } from './projectionCopy.ts';
35
35
  export { PROJECTION_COPY } from './projectionCopy.ts';
36
36
  export type { ProjectionCopyPatch } from './projectionCopyPatch.ts';
37
37
  export type {
38
- ProjectionColorBy,
39
38
  ProjectionOptionId,
40
39
  ProjectionOptions,
41
40
  ProjectionVariablesView,
42
41
  } from './projectionOptions.ts';
43
42
  export { mergeProjectionCopy } from './mergeProjectionCopy.ts';
44
- export { DEFAULT_PROJECTION_OPTIONS } from './projectionOptions.ts';
43
+ export {
44
+ DEFAULT_PROJECTION_OPTIONS,
45
+ NO_GROUPING,
46
+ } from './projectionOptions.ts';
45
47
  export type {
46
48
  ProjectionChoiceWords,
47
49
  ProjectionOutlineWords,
@@ -56,10 +58,16 @@ export type {
56
58
  } from './projectionResult.ts';
57
59
  export type {
58
60
  ProjectionField,
61
+ ProjectionGrouping,
59
62
  ProjectionSamples,
60
63
  ResolvedProjectionGroups,
64
+ ResolvedProjectionShapes,
61
65
  } from './projectionSamples.ts';
62
- export { resolveProjectionGroups } from './projectionSamples.ts';
66
+ export {
67
+ projectionGrouping,
68
+ resolveProjectionGroups,
69
+ resolveProjectionShapes,
70
+ } from './projectionGroupings.ts';
63
71
  export type {
64
72
  ProjectionBarWords,
65
73
  ProjectionHelp,
@@ -86,6 +86,8 @@ export interface ProjectionCopy {
86
86
  projected: string;
87
87
  /** The title of a key whose colour stands for nothing, so only shape is left. */
88
88
  shapes: string;
89
+ /** What the shape stands for, after what the colour does. Carries `{shapes}`. */
90
+ shapedBy: string;
89
91
  };
90
92
  /** The sentences the viewer builds from the data. */
91
93
  sentence: {
@@ -208,6 +210,7 @@ export const PROJECTION_COPY: ProjectionCopy = {
208
210
  notOutlined: 'Not outlined: too few samples.',
209
211
  projected: 'Hollow = added after the map was built',
210
212
  shapes: 'Shape = what each mark is.',
213
+ shapedBy: 'Shape = {shapes}.',
211
214
  },
212
215
  sentence: {
213
216
  sharesFirst:
@@ -0,0 +1,174 @@
1
+ /**
2
+ * How the groupings a page hands in become what a figure draws: the one that
3
+ * colours the dots, painted from the shared palette, and the one that shapes
4
+ * them, given one shape per group.
5
+ *
6
+ * Both are cut the same way — the page's own order first, then every group in
7
+ * the order its first row names it — so a group keeps its colour and its shape
8
+ * however the rows are filtered.
9
+ */
10
+
11
+ import {
12
+ CHART_SERIES_COLORS,
13
+ chartSeriesColor,
14
+ } from '../../chart/core/chartPalette.ts';
15
+ import { OVERLAY_SAMPLE_SHAPES } from '../../overlay/core/overlayMarks.ts';
16
+
17
+ import type {
18
+ ProjectionGrouping,
19
+ ProjectionSamples,
20
+ ResolvedProjectionGroups,
21
+ ResolvedProjectionShapes,
22
+ } from './projectionSamples.ts';
23
+
24
+ /**
25
+ * The grouping a set of samples is coloured by, in a shape a legend and a plot
26
+ * can both read.
27
+ *
28
+ * A group named in `order` but held by no row is kept, so a legend does not
29
+ * reshuffle when a filter empties one; a row naming a group that is not in
30
+ * `order` is appended in the order it appears.
31
+ * @param grouping - The grouping, or nothing when the dots are not coloured.
32
+ * @param count - How many rows there are, which is the score matrix's height.
33
+ * @returns The resolved groups. No grouping gives no entries at all, and every
34
+ * row lands at `-1`.
35
+ */
36
+ export function resolveProjectionGroups(
37
+ grouping: ProjectionGrouping | undefined,
38
+ count: number,
39
+ ): ResolvedProjectionGroups {
40
+ const { label, entries, rowOf } = partition(grouping, count);
41
+ const colored = entries.map((entry) => ({ ...entry, color: '' }));
42
+ paintGroups(colored, grouping?.colors);
43
+ return { label, entries: colored, groupOf: rowOf };
44
+ }
45
+
46
+ /**
47
+ * The grouping a set of samples is shaped by, one shape per group.
48
+ *
49
+ * A grouping of more groups than there are shapes is refused as a whole rather
50
+ * than drawn with two groups sharing a shape, or with the last ones falling
51
+ * back to a disc: either would put two groups under one mark, which is the one
52
+ * thing a key cannot undo.
53
+ * @param grouping - The grouping, or nothing when the dots are not shaped.
54
+ * @param count - How many rows there are, which is the score matrix's height.
55
+ * @returns The resolved shapes, or `null` when there is no grouping or its
56
+ * groups outnumber the shapes.
57
+ */
58
+ export function resolveProjectionShapes(
59
+ grouping: ProjectionGrouping | undefined,
60
+ count: number,
61
+ ): ResolvedProjectionShapes | null {
62
+ if (grouping === undefined) return null;
63
+ const { label, entries, rowOf } = partition(grouping, count);
64
+ if (entries.length > OVERLAY_SAMPLE_SHAPES.length) return null;
65
+ const shaped = entries.map((entry, index) => ({
66
+ ...entry,
67
+ shape: OVERLAY_SAMPLE_SHAPES[index] ?? 'dot',
68
+ }));
69
+ return { label, entries: shaped, shapeOf: rowOf };
70
+ }
71
+
72
+ /**
73
+ * The grouping carrying an id.
74
+ * @param samples - Who the rows are.
75
+ * @param id - The id asked for.
76
+ * @returns The grouping, or `undefined` when none carries it.
77
+ */
78
+ export function projectionGrouping(
79
+ samples: ProjectionSamples,
80
+ id: string,
81
+ ): ProjectionGrouping | undefined {
82
+ for (const grouping of samples.groupings ?? NO_GROUPINGS) {
83
+ if (grouping.id === id) return grouping;
84
+ }
85
+ return undefined;
86
+ }
87
+
88
+ const NO_GROUP = -1;
89
+ const DEFAULT_GROUP_LABEL = 'Group';
90
+ const NO_GROUPINGS: readonly ProjectionGrouping[] = [];
91
+
92
+ interface GroupEntry {
93
+ id: string;
94
+ label: string;
95
+ count: number;
96
+ }
97
+
98
+ interface ColoredEntry extends GroupEntry {
99
+ color: string;
100
+ }
101
+
102
+ function partition(
103
+ grouping: ProjectionGrouping | undefined,
104
+ count: number,
105
+ ): { label: string; entries: GroupEntry[]; rowOf: Int32Array } {
106
+ const rowCount = Number.isFinite(count) ? Math.max(0, Math.floor(count)) : 0;
107
+ const label = grouping?.label ?? DEFAULT_GROUP_LABEL;
108
+ const rowOf = new Int32Array(rowCount).fill(NO_GROUP);
109
+ const entries: GroupEntry[] = [];
110
+ if (grouping === undefined) return { label, entries, rowOf };
111
+
112
+ const indexOfGroup = new Map<string, number>();
113
+ for (const id of grouping.order ?? []) {
114
+ appendGroup(entries, indexOfGroup, id);
115
+ }
116
+ for (let row = 0; row < rowCount; row++) {
117
+ const id = grouping.groups[row];
118
+ if (id === undefined) continue;
119
+ const at = appendGroup(entries, indexOfGroup, id);
120
+ rowOf[row] = at;
121
+ const entry = entries[at];
122
+ if (entry !== undefined) entry.count++;
123
+ }
124
+ return { label, entries, rowOf };
125
+ }
126
+
127
+ function appendGroup(
128
+ entries: GroupEntry[],
129
+ indexOfGroup: Map<string, number>,
130
+ id: string,
131
+ ): number {
132
+ const known = indexOfGroup.get(id);
133
+ if (known !== undefined) return known;
134
+ const at = entries.length;
135
+ indexOfGroup.set(id, at);
136
+ entries.push({ id, label: id, count: 0 });
137
+ return at;
138
+ }
139
+
140
+ function paintGroups(
141
+ entries: ColoredEntry[],
142
+ pinned: Readonly<Record<string, string>> | undefined,
143
+ ): void {
144
+ // Every pinned colour is taken out of the palette before any group draws
145
+ // from it, so pinning the third group's hue onto the first does not leave
146
+ // two groups wearing it.
147
+ const taken = new Set<string>();
148
+ if (pinned !== undefined) {
149
+ for (const entry of entries) {
150
+ const color = pinned[entry.id];
151
+ if (color !== undefined) taken.add(color.toLowerCase());
152
+ }
153
+ }
154
+
155
+ let cursor = 0;
156
+ for (const entry of entries) {
157
+ const own = pinned?.[entry.id];
158
+ if (own !== undefined) {
159
+ entry.color = own;
160
+ continue;
161
+ }
162
+ let color = chartSeriesColor(cursor, 'group');
163
+ while (
164
+ cursor < CHART_SERIES_COLORS.length &&
165
+ taken.has(color.toLowerCase())
166
+ ) {
167
+ cursor++;
168
+ color = chartSeriesColor(cursor, 'group');
169
+ }
170
+ cursor++;
171
+ taken.add(color.toLowerCase());
172
+ entry.color = color;
173
+ }
174
+ }
@@ -14,10 +14,10 @@ export type ProjectionVariablesView =
14
14
  | 'sample';
15
15
 
16
16
  /**
17
- * What decides a dot's colour on the map: `'group'`, `'none'`, or nothing else
18
- * in this release.
17
+ * The word for "no grouping" wherever an option names one, which is why no
18
+ * grouping may be called it.
19
19
  */
20
- export type ProjectionColorBy = 'group' | 'none';
20
+ export const NO_GROUPING = 'none';
21
21
 
22
22
  /** What the figure is currently showing. Every field is a control in the floating bar. */
23
23
  export interface ProjectionOptions {
@@ -43,10 +43,20 @@ export interface ProjectionOptions {
43
43
  */
44
44
  cloudGesture: CloudGesture;
45
45
  /**
46
- * What decides a dot's colour.
47
- * @default 'group'
46
+ * Which grouping colours the dots, by its id, or `'none'`. An id no grouping
47
+ * carries — the empty string, or one saved on other data — takes the first
48
+ * grouping.
49
+ * @default ''
48
50
  */
49
- colorBy: ProjectionColorBy;
51
+ colorBy: string;
52
+ /**
53
+ * Which grouping gives the dots their shapes, by its id, or `'none'`. An id
54
+ * no grouping carries takes the second grouping — the first when the colour
55
+ * has taken the second — and a grouping of more groups than there are
56
+ * shapes is not drawn.
57
+ * @default ''
58
+ */
59
+ shapeBy: string;
50
60
  /**
51
61
  * How large the group outlines are, or `null` for none.
52
62
  * @default { kind: 'coverage', probability: 0.95 }
@@ -134,7 +144,8 @@ export const DEFAULT_PROJECTION_OPTIONS: ProjectionOptions = {
134
144
  yAxis: 1,
135
145
  zAxis: 2,
136
146
  cloudGesture: 'turn',
137
- colorBy: 'group',
147
+ colorBy: '',
148
+ shapeBy: '',
138
149
  ellipse: { kind: 'coverage', probability: 0.95 },
139
150
  pointRadius: 3.5,
140
151
  showGroupMeans: false,
@@ -44,6 +44,12 @@ export interface ProjectionPanelWords {
44
44
  export interface ProjectionReasonWords {
45
45
  /** Why the colour cannot be set: the samples carry no groups. */
46
46
  noGroups: string;
47
+ /** Why the shape cannot be set: the samples carry no groups. */
48
+ noGroupsToShape: string;
49
+ /** Why a grouping is greyed in the shape picker: the colour already draws it. */
50
+ shapeIsColour: string;
51
+ /** Why a grouping is greyed in the shape picker: it has more groups than shapes. */
52
+ tooManyShapes: string;
47
53
  /** Why the map's outlines cannot be set while nothing is coloured. */
48
54
  uncolouredOutlines: string;
49
55
  /** Why the cloud's shells cannot be set while nothing is coloured. */
@@ -97,6 +103,7 @@ export const PROJECTION_PANEL_WORDS: ProjectionPanelWords = {
97
103
  zAxis: 'Into',
98
104
  cloudGesture: 'Drag does',
99
105
  colorBy: 'Colour by',
106
+ shapeBy: 'Shape by',
100
107
  ellipse: 'Outlines',
101
108
  pointRadius: 'Dot size',
102
109
  showGroupMeans: 'Averages',
@@ -124,6 +131,9 @@ export const PROJECTION_PANEL_WORDS: ProjectionPanelWords = {
124
131
  /** The reasons a greyed control gives when a site overrides nothing. */
125
132
  export const PROJECTION_REASON_WORDS: ProjectionReasonWords = {
126
133
  noGroups: 'These samples carry no groups to colour by.',
134
+ noGroupsToShape: 'These samples carry no groups to shape by.',
135
+ shapeIsColour: 'The colour already stands for these groups.',
136
+ tooManyShapes: 'More groups than there are shapes to tell apart.',
127
137
  uncolouredOutlines:
128
138
  'Outlines follow the groups, so colour the map by them first.',
129
139
  uncolouredShells:
@@ -1,7 +1,4 @@
1
- import {
2
- CHART_SERIES_COLORS,
3
- chartSeriesColor,
4
- } from '../../chart/core/chartPalette.ts';
1
+ import type { OverlaySampleShape } from '../../overlay/core/overlayMarks.ts';
5
2
 
6
3
  /** One line of the card that appears when the pointer rests on a sample. */
7
4
  export interface ProjectionField {
@@ -11,46 +8,72 @@ export interface ProjectionField {
11
8
  value: string;
12
9
  }
13
10
 
14
- /** Who the rows are: what they are called, what they belong to, what is known. */
15
- export interface ProjectionSamples {
11
+ /**
12
+ * One way of sorting the rows into groups — a species, a batch, the cluster a
13
+ * run put each sample in.
14
+ */
15
+ export interface ProjectionGrouping {
16
16
  /**
17
- * A stable name per row, in the score matrix's row order. It is the currency
18
- * of the selection callbacks, so a caller never has to keep a second index.
17
+ * What the options name it by, e.g. `species`. It is kept apart from the
18
+ * label so that a saved choice still finds the grouping once its label is
19
+ * reworded, and it may not be `none`, which is the word for no grouping.
19
20
  */
20
- ids: readonly string[];
21
+ id: string;
22
+ /** What the set of groups is called, for the key and the hover card: `Species`. */
23
+ label: string;
21
24
  /**
22
- * What each row belongs to — a species, a batch, a cluster. A row with no
25
+ * Which group each row is in, in the score matrix's row order. A row with no
23
26
  * group is drawn in the muted ink and left out of every outline.
24
- * @default undefined — every row is one crowd
25
27
  */
26
- groups?: ReadonlyArray<string | undefined>;
28
+ groups: ReadonlyArray<string | undefined>;
27
29
  /**
28
- * The order the groups are listed and coloured in.
30
+ * The order the groups are listed, coloured and shaped in.
29
31
  * @default the order the groups first appear in `groups`
30
32
  */
31
- groupOrder?: readonly string[];
32
- /**
33
- * What the set of groups is called, for the legend's heading and the hover
34
- * card — `Species`, `Cluster`, `Batch`.
35
- * @default 'Group'
36
- */
37
- groupLabel?: string;
33
+ order?: readonly string[];
38
34
  /**
39
35
  * A colour per group. Anything not named here takes the next unused colour
40
36
  * of the shared palette, so two groups never share one.
41
37
  * @default undefined — every group is coloured from the palette
42
38
  */
43
- groupColors?: Readonly<Record<string, string>>;
39
+ colors?: Readonly<Record<string, string>>;
40
+ }
41
+
42
+ /** Who the rows are: what they are called, what they belong to, what is known. */
43
+ export interface ProjectionSamples {
44
+ /**
45
+ * A stable key per row, in the score matrix's row order. It is the currency
46
+ * of the selection callbacks, so a caller never has to keep a second index.
47
+ */
48
+ ids: readonly string[];
49
+ /**
50
+ * What each row is written as: the title of its hover card and the name
51
+ * beside its dot. A page whose keys are not names a reader should read — a
52
+ * database id, a spectrum's uuid — writes its names here and keeps `ids`
53
+ * stable, and two samples may then share a name without either becoming
54
+ * impossible to select.
55
+ * @default the ids
56
+ */
57
+ labels?: readonly string[];
58
+ /**
59
+ * The ways the rows are grouped. The first colours the dots until the reader
60
+ * picks another, and the next one gives them their shapes, so two groupings
61
+ * of the same samples — the clusters a run found and the classes the reader
62
+ * gave — are compared on one picture. Every one of them is written on the
63
+ * hover card.
64
+ * @default undefined — every row is one crowd
65
+ */
66
+ groupings?: readonly ProjectionGrouping[];
44
67
  /**
45
68
  * Everything else worth showing about one row. A callback rather than an
46
69
  * array, so a table of ten thousand rows builds one record when a reader
47
70
  * points at one row, and none otherwise.
48
- * @default undefined — the card shows the id, the group and the two axes
71
+ * @default undefined — the card shows the id, the groups and the two axes
49
72
  */
50
73
  fields?: (index: number) => readonly ProjectionField[];
51
74
  }
52
75
 
53
- /** The groups as the viewer draws them, resolved once per change. */
76
+ /** The grouping that colours the dots, as the viewer draws it. */
54
77
  export interface ResolvedProjectionGroups {
55
78
  /** What the set of groups is called. */
56
79
  label: string;
@@ -69,102 +92,21 @@ export interface ResolvedProjectionGroups {
69
92
  groupOf: Int32Array;
70
93
  }
71
94
 
72
- const NO_GROUP = -1;
73
- const DEFAULT_GROUP_LABEL = 'Group';
74
-
75
- interface GroupEntry {
76
- id: string;
95
+ /** The grouping that shapes the dots, as the viewer draws it. */
96
+ export interface ResolvedProjectionShapes {
97
+ /** What the set of groups is called. */
77
98
  label: string;
78
- color: string;
79
- count: number;
80
- }
81
-
82
- /**
83
- * The groups a set of samples has, in a shape a legend and a plot can both
84
- * read.
85
- *
86
- * A group named in `groupOrder` but held by no row is kept, so a legend does
87
- * not reshuffle when a filter empties one; a row naming a group that is not in
88
- * `groupOrder` is appended in the order it appears.
89
- * @param samples - Who the rows are.
90
- * @param count - How many rows there are, which is the score matrix's height.
91
- * @returns The resolved groups. A set of samples with no `groups` gives no
92
- * entries at all, and every row lands at `-1`.
93
- */
94
- export function resolveProjectionGroups(
95
- samples: ProjectionSamples,
96
- count: number,
97
- ): ResolvedProjectionGroups {
98
- const rowCount = Number.isFinite(count) ? Math.max(0, Math.floor(count)) : 0;
99
- const label = samples.groupLabel ?? DEFAULT_GROUP_LABEL;
100
- const groupOf = new Int32Array(rowCount).fill(NO_GROUP);
101
- const { groups, groupColors, groupOrder } = samples;
102
- if (groups === undefined) return { label, entries: [], groupOf };
103
-
104
- const entries: GroupEntry[] = [];
105
- const indexOfGroup = new Map<string, number>();
106
- if (groupOrder !== undefined) {
107
- for (const id of groupOrder) appendGroup(entries, indexOfGroup, id);
108
- }
109
-
110
- for (let row = 0; row < rowCount; row++) {
111
- const id = groups[row];
112
- if (id === undefined) continue;
113
- const at = appendGroup(entries, indexOfGroup, id);
114
- groupOf[row] = at;
115
- const entry = entries[at];
116
- if (entry !== undefined) entry.count++;
117
- }
118
-
119
- paintGroups(entries, groupColors);
120
- return { label, entries, groupOf };
121
- }
122
-
123
- function appendGroup(
124
- entries: GroupEntry[],
125
- indexOfGroup: Map<string, number>,
126
- id: string,
127
- ): number {
128
- const known = indexOfGroup.get(id);
129
- if (known !== undefined) return known;
130
- const at = entries.length;
131
- indexOfGroup.set(id, at);
132
- entries.push({ id, label: id, color: '', count: 0 });
133
- return at;
134
- }
135
-
136
- function paintGroups(
137
- entries: GroupEntry[],
138
- pinned: Readonly<Record<string, string>> | undefined,
139
- ): void {
140
- // Every pinned colour is taken out of the palette before any group draws
141
- // from it, so pinning the third group's hue onto the first does not leave
142
- // two groups wearing it.
143
- const taken = new Set<string>();
144
- if (pinned !== undefined) {
145
- for (const entry of entries) {
146
- const color = pinned[entry.id];
147
- if (color !== undefined) taken.add(color.toLowerCase());
148
- }
149
- }
150
-
151
- let cursor = 0;
152
- for (const entry of entries) {
153
- const own = pinned?.[entry.id];
154
- if (own !== undefined) {
155
- entry.color = own;
156
- continue;
157
- }
158
- let color = chartSeriesColor(cursor, 'group');
159
- while (
160
- cursor < CHART_SERIES_COLORS.length &&
161
- taken.has(color.toLowerCase())
162
- ) {
163
- cursor++;
164
- color = chartSeriesColor(cursor, 'group');
165
- }
166
- cursor++;
167
- taken.add(color.toLowerCase());
168
- entry.color = color;
169
- }
99
+ /** The groups, in the order they are listed and given their shapes. */
100
+ entries: ReadonlyArray<{
101
+ /** The group's own name, which is also its id. */
102
+ id: string;
103
+ /** What it is called. */
104
+ label: string;
105
+ /** Its shape. */
106
+ shape: OverlaySampleShape;
107
+ /** How many rows are in it. */
108
+ count: number;
109
+ }>;
110
+ /** Which group each row is in, as an index into `entries`, or `-1`. */
111
+ shapeOf: Int32Array;
170
112
  }
@@ -70,6 +70,14 @@ export const PROJECTION_HELP: Record<ProjectionOptionId, ProjectionHelp> = {
70
70
  title: 'Colour by',
71
71
  body: 'What a dot’s colour stands for. Colouring by nothing is useful when the groups are what you are trying to find rather than what you already know.',
72
72
  },
73
+ shapeBy: {
74
+ title: 'Shape by',
75
+ body: 'What a dot’s shape stands for. With colour for one grouping and shape for another, you see at a glance where two ways of sorting the same samples disagree — the clusters a run found against the classes you gave. Past five groups the shapes stop being told apart, so a grouping that large is not offered.',
76
+ example: {
77
+ code: 'Colour = cluster · Shape = class',
78
+ note: 'A square among circles of the same colour is a sample the clustering put with another class.',
79
+ },
80
+ },
73
81
  ellipse: {
74
82
  title: 'Group outlines',
75
83
  body: 'Each outline is drawn to cover about that share of its group’s samples, assuming the group is roughly bell-shaped. It is a summary of where a group sits, not a boundary.',
@@ -95,7 +103,7 @@ export const PROJECTION_HELP: Record<ProjectionOptionId, ProjectionHelp> = {
95
103
  body: 'Writes every sample’s own name beside its dot. It is what turns a dot sitting on its own into something you can go and look up. In a crowd there is only room for some of the names, so the ones that do not fit are left out rather than written over each other.',
96
104
  example: {
97
105
  code: '0326_3a',
98
- note: 'The name is whatever you handed in as the sample’s id, so it is the one you can find again in your own files.',
106
+ note: 'The name is the one the sample was loaded with, so it is the one you can find again in your own files.',
99
107
  },
100
108
  },
101
109
  pairCount: {
@@ -189,6 +197,8 @@ export interface ProjectionBarWords {
189
197
  };
190
198
  /** What "the colour stands for nothing" reads. */
191
199
  uncoloured: string;
200
+ /** What "the shape stands for nothing" reads. */
201
+ unshaped: string;
192
202
  /** What "no outlines at all" reads where there is no room for a sentence. */
193
203
  noOutlines: string;
194
204
  /** What the settings gathered into one chip are called together. */
@@ -218,6 +228,7 @@ export const PROJECTION_BAR_WORDS: ProjectionBarWords = {
218
228
  showIds: 'Show sample ID',
219
229
  },
220
230
  uncoloured: 'Nothing',
231
+ unshaped: 'Nothing',
221
232
  noOutlines: 'None',
222
233
  settings: 'How this is drawn',
223
234
  view: {