react-cheminfo 0.28.0 → 0.30.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 (742) hide show
  1. package/README.md +79 -26
  2. package/lib/chart/core/axisLabels.d.ts +82 -0
  3. package/lib/chart/core/axisLabels.d.ts.map +1 -0
  4. package/lib/chart/core/axisLabels.js +111 -0
  5. package/lib/chart/core/axisLabels.js.map +1 -0
  6. package/lib/chart/core/boxLayout.d.ts +53 -0
  7. package/lib/chart/core/boxLayout.d.ts.map +1 -0
  8. package/lib/chart/core/boxLayout.js +112 -0
  9. package/lib/chart/core/boxLayout.js.map +1 -0
  10. package/lib/chart/core/chartAxisScale.d.ts +23 -2
  11. package/lib/chart/core/chartAxisScale.d.ts.map +1 -1
  12. package/lib/chart/core/chartAxisScale.js +64 -13
  13. package/lib/chart/core/chartAxisScale.js.map +1 -1
  14. package/lib/chart/core/chartDomain.d.ts +160 -0
  15. package/lib/chart/core/chartDomain.d.ts.map +1 -0
  16. package/lib/chart/core/chartDomain.js +46 -0
  17. package/lib/chart/core/chartDomain.js.map +1 -0
  18. package/lib/chart/core/chartGeometry.d.ts +131 -0
  19. package/lib/chart/core/chartGeometry.d.ts.map +1 -0
  20. package/lib/chart/core/chartGeometry.js +101 -0
  21. package/lib/chart/core/chartGeometry.js.map +1 -0
  22. package/lib/chart/core/chartPane.d.ts +11 -0
  23. package/lib/chart/core/chartPane.d.ts.map +1 -0
  24. package/lib/chart/core/chartPane.js +11 -0
  25. package/lib/chart/core/chartPane.js.map +1 -0
  26. package/lib/chart/core/chartScale.d.ts +4 -1
  27. package/lib/chart/core/chartScale.d.ts.map +1 -1
  28. package/lib/chart/core/chartScale.js +8 -4
  29. package/lib/chart/core/chartScale.js.map +1 -1
  30. package/lib/chart/core/chartTheme.d.ts +156 -0
  31. package/lib/chart/core/chartTheme.d.ts.map +1 -0
  32. package/lib/chart/core/chartTheme.js +156 -0
  33. package/lib/chart/core/chartTheme.js.map +1 -0
  34. package/lib/chart/core/chartViewport.d.ts +32 -5
  35. package/lib/chart/core/chartViewport.d.ts.map +1 -1
  36. package/lib/chart/core/chartViewport.js +40 -11
  37. package/lib/chart/core/chartViewport.js.map +1 -1
  38. package/lib/chart/core/guidePlacement.d.ts +52 -0
  39. package/lib/chart/core/guidePlacement.d.ts.map +1 -0
  40. package/lib/chart/core/guidePlacement.js +52 -0
  41. package/lib/chart/core/guidePlacement.js.map +1 -0
  42. package/lib/chart/core/index.d.ts +29 -2
  43. package/lib/chart/core/index.d.ts.map +1 -1
  44. package/lib/chart/core/index.js +19 -2
  45. package/lib/chart/core/index.js.map +1 -1
  46. package/lib/chart/core/labelStack.d.ts +27 -0
  47. package/lib/chart/core/labelStack.d.ts.map +1 -0
  48. package/lib/chart/core/labelStack.js +62 -0
  49. package/lib/chart/core/labelStack.js.map +1 -0
  50. package/lib/chart/core/legendBox.d.ts +152 -0
  51. package/lib/chart/core/legendBox.d.ts.map +1 -0
  52. package/lib/chart/core/legendBox.js +169 -0
  53. package/lib/chart/core/legendBox.js.map +1 -0
  54. package/lib/chart/core/selectionGeometry.d.ts +45 -0
  55. package/lib/chart/core/selectionGeometry.d.ts.map +1 -0
  56. package/lib/chart/core/selectionGeometry.js +49 -0
  57. package/lib/chart/core/selectionGeometry.js.map +1 -0
  58. package/lib/chart/core/spectrumColor.d.ts +80 -0
  59. package/lib/chart/core/spectrumColor.d.ts.map +1 -0
  60. package/lib/chart/core/spectrumColor.js +120 -0
  61. package/lib/chart/core/spectrumColor.js.map +1 -0
  62. package/lib/chart/core/stackCapacity.d.ts +136 -0
  63. package/lib/chart/core/stackCapacity.d.ts.map +1 -0
  64. package/lib/chart/core/stackCapacity.js +153 -0
  65. package/lib/chart/core/stackCapacity.js.map +1 -0
  66. package/lib/chart/core/svgPoint.d.ts +62 -0
  67. package/lib/chart/core/svgPoint.d.ts.map +1 -0
  68. package/lib/chart/core/svgPoint.js +43 -0
  69. package/lib/chart/core/svgPoint.js.map +1 -0
  70. package/lib/chart/core/tracePath.d.ts +94 -0
  71. package/lib/chart/core/tracePath.d.ts.map +1 -0
  72. package/lib/chart/core/tracePath.js +191 -0
  73. package/lib/chart/core/tracePath.js.map +1 -0
  74. package/lib/chart/core/trackerReadout.d.ts +55 -0
  75. package/lib/chart/core/trackerReadout.d.ts.map +1 -0
  76. package/lib/chart/core/trackerReadout.js +53 -0
  77. package/lib/chart/core/trackerReadout.js.map +1 -0
  78. package/lib/chart/core/viewTransform.d.ts +167 -0
  79. package/lib/chart/core/viewTransform.d.ts.map +1 -0
  80. package/lib/chart/core/viewTransform.js +188 -0
  81. package/lib/chart/core/viewTransform.js.map +1 -0
  82. package/lib/chart/core/zoomDomain.d.ts +127 -0
  83. package/lib/chart/core/zoomDomain.d.ts.map +1 -0
  84. package/lib/chart/core/zoomDomain.js +175 -0
  85. package/lib/chart/core/zoomDomain.js.map +1 -0
  86. package/lib/chart/ui/Axes.d.ts +104 -0
  87. package/lib/chart/ui/Axes.d.ts.map +1 -0
  88. package/lib/chart/ui/Axes.js +155 -0
  89. package/lib/chart/ui/Axes.js.map +1 -0
  90. package/lib/chart/ui/AxisGuide.d.ts +60 -0
  91. package/lib/chart/ui/AxisGuide.d.ts.map +1 -0
  92. package/lib/chart/ui/AxisGuide.js +111 -0
  93. package/lib/chart/ui/AxisGuide.js.map +1 -0
  94. package/lib/chart/ui/ChartStack.d.ts +81 -0
  95. package/lib/chart/ui/ChartStack.d.ts.map +1 -0
  96. package/lib/chart/ui/ChartStack.js +42 -0
  97. package/lib/chart/ui/ChartStack.js.map +1 -0
  98. package/lib/chart/ui/ChartTracker.d.ts +36 -0
  99. package/lib/chart/ui/ChartTracker.d.ts.map +1 -0
  100. package/lib/chart/ui/ChartTracker.js +27 -0
  101. package/lib/chart/ui/ChartTracker.js.map +1 -0
  102. package/lib/chart/ui/PlotCaption.d.ts +44 -0
  103. package/lib/chart/ui/PlotCaption.d.ts.map +1 -0
  104. package/lib/chart/ui/PlotCaption.js +68 -0
  105. package/lib/chart/ui/PlotCaption.js.map +1 -0
  106. package/lib/chart/ui/SelectionRect.d.ts +27 -0
  107. package/lib/chart/ui/SelectionRect.d.ts.map +1 -0
  108. package/lib/chart/ui/SelectionRect.js +31 -0
  109. package/lib/chart/ui/SelectionRect.js.map +1 -0
  110. package/lib/chart/ui/TraceLegend.d.ts +99 -0
  111. package/lib/chart/ui/TraceLegend.d.ts.map +1 -0
  112. package/lib/chart/ui/TraceLegend.js +45 -0
  113. package/lib/chart/ui/TraceLegend.js.map +1 -0
  114. package/lib/chart/ui/chartGestures.d.ts +158 -0
  115. package/lib/chart/ui/chartGestures.d.ts.map +1 -0
  116. package/lib/chart/ui/chartGestures.js +145 -0
  117. package/lib/chart/ui/chartGestures.js.map +1 -0
  118. package/lib/chart/ui/chartStackLevel.d.ts +115 -0
  119. package/lib/chart/ui/chartStackLevel.d.ts.map +1 -0
  120. package/lib/chart/ui/chartStackLevel.js +96 -0
  121. package/lib/chart/ui/chartStackLevel.js.map +1 -0
  122. package/lib/chart/ui/chartSurface.d.ts +35 -0
  123. package/lib/chart/ui/chartSurface.d.ts.map +1 -0
  124. package/lib/chart/ui/chartSurface.js +58 -0
  125. package/lib/chart/ui/chartSurface.js.map +1 -0
  126. package/lib/chart/ui/index.d.ts +24 -0
  127. package/lib/chart/ui/index.d.ts.map +1 -1
  128. package/lib/chart/ui/index.js +13 -0
  129. package/lib/chart/ui/index.js.map +1 -1
  130. package/lib/chart/ui/useChartPointer.d.ts +124 -0
  131. package/lib/chart/ui/useChartPointer.d.ts.map +1 -0
  132. package/lib/chart/ui/useChartPointer.js +152 -0
  133. package/lib/chart/ui/useChartPointer.js.map +1 -0
  134. package/lib/chart/ui/useChartSize.d.ts +49 -0
  135. package/lib/chart/ui/useChartSize.d.ts.map +1 -0
  136. package/lib/chart/ui/useChartSize.js +91 -0
  137. package/lib/chart/ui/useChartSize.js.map +1 -0
  138. package/lib/chart/ui/useChartWindow.d.ts +147 -0
  139. package/lib/chart/ui/useChartWindow.d.ts.map +1 -0
  140. package/lib/chart/ui/useChartWindow.js +135 -0
  141. package/lib/chart/ui/useChartWindow.js.map +1 -0
  142. package/lib/chart/ui/useChartZoom.d.ts +88 -0
  143. package/lib/chart/ui/useChartZoom.d.ts.map +1 -0
  144. package/lib/chart/ui/useChartZoom.js +142 -0
  145. package/lib/chart/ui/useChartZoom.js.map +1 -0
  146. package/lib/chart/ui/useWheelListener.d.ts +30 -0
  147. package/lib/chart/ui/useWheelListener.d.ts.map +1 -0
  148. package/lib/chart/ui/useWheelListener.js +57 -0
  149. package/lib/chart/ui/useWheelListener.js.map +1 -0
  150. package/lib/chrome/ui/AccountButton.d.ts +76 -0
  151. package/lib/chrome/ui/AccountButton.d.ts.map +1 -0
  152. package/lib/chrome/ui/AccountButton.js +66 -0
  153. package/lib/chrome/ui/AccountButton.js.map +1 -0
  154. package/lib/chrome/ui/index.d.ts +2 -0
  155. package/lib/chrome/ui/index.d.ts.map +1 -1
  156. package/lib/chrome/ui/index.js +1 -0
  157. package/lib/chrome/ui/index.js.map +1 -1
  158. package/lib/clipboard/core/copyPng.d.ts +13 -0
  159. package/lib/clipboard/core/copyPng.d.ts.map +1 -0
  160. package/lib/clipboard/core/copyPng.js +19 -0
  161. package/lib/clipboard/core/copyPng.js.map +1 -0
  162. package/lib/clipboard/core/index.d.ts +1 -0
  163. package/lib/clipboard/core/index.d.ts.map +1 -1
  164. package/lib/clipboard/core/index.js +1 -0
  165. package/lib/clipboard/core/index.js.map +1 -1
  166. package/lib/clipboard/ui/ClickToCopy.d.ts +6 -0
  167. package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
  168. package/lib/clipboard/ui/ClickToCopy.js +3 -3
  169. package/lib/clipboard/ui/ClickToCopy.js.map +1 -1
  170. package/lib/core.d.ts +1 -0
  171. package/lib/core.d.ts.map +1 -1
  172. package/lib/core.js +1 -0
  173. package/lib/core.js.map +1 -1
  174. package/lib/download/core/exportStyles.d.ts +22 -0
  175. package/lib/download/core/exportStyles.d.ts.map +1 -0
  176. package/lib/download/core/exportStyles.js +19 -0
  177. package/lib/download/core/exportStyles.js.map +1 -0
  178. package/lib/download/core/imageResolution.d.ts +88 -0
  179. package/lib/download/core/imageResolution.d.ts.map +1 -0
  180. package/lib/download/core/imageResolution.js +77 -0
  181. package/lib/download/core/imageResolution.js.map +1 -0
  182. package/lib/download/core/index.d.ts +13 -0
  183. package/lib/download/core/index.d.ts.map +1 -1
  184. package/lib/download/core/index.js +8 -0
  185. package/lib/download/core/index.js.map +1 -1
  186. package/lib/download/core/pictureExport.d.ts +93 -0
  187. package/lib/download/core/pictureExport.d.ts.map +1 -0
  188. package/lib/download/core/pictureExport.js +116 -0
  189. package/lib/download/core/pictureExport.js.map +1 -0
  190. package/lib/download/core/stackedDrawing.d.ts +36 -0
  191. package/lib/download/core/stackedDrawing.d.ts.map +1 -0
  192. package/lib/download/core/stackedDrawing.js +98 -0
  193. package/lib/download/core/stackedDrawing.js.map +1 -0
  194. package/lib/download/core/svgBounds.d.ts +44 -0
  195. package/lib/download/core/svgBounds.d.ts.map +1 -0
  196. package/lib/download/core/svgBounds.js +69 -0
  197. package/lib/download/core/svgBounds.js.map +1 -0
  198. package/lib/download/core/svgNamespace.d.ts +9 -0
  199. package/lib/download/core/svgNamespace.d.ts.map +1 -0
  200. package/lib/download/core/svgNamespace.js +10 -0
  201. package/lib/download/core/svgNamespace.js.map +1 -0
  202. package/lib/download/core/svgToPng.d.ts +43 -0
  203. package/lib/download/core/svgToPng.d.ts.map +1 -0
  204. package/lib/download/core/svgToPng.js +79 -0
  205. package/lib/download/core/svgToPng.js.map +1 -0
  206. package/lib/download/core/svgToString.d.ts +45 -0
  207. package/lib/download/core/svgToString.d.ts.map +1 -0
  208. package/lib/download/core/svgToString.js +58 -0
  209. package/lib/download/core/svgToString.js.map +1 -0
  210. package/lib/download/ui/ExportDialogFrame.d.ts +46 -0
  211. package/lib/download/ui/ExportDialogFrame.d.ts.map +1 -0
  212. package/lib/download/ui/ExportDialogFrame.js +24 -0
  213. package/lib/download/ui/ExportDialogFrame.js.map +1 -0
  214. package/lib/download/ui/ExportImageDialog.d.ts +47 -0
  215. package/lib/download/ui/ExportImageDialog.d.ts.map +1 -0
  216. package/lib/download/ui/ExportImageDialog.js +25 -0
  217. package/lib/download/ui/ExportImageDialog.js.map +1 -0
  218. package/lib/download/ui/ExportNameField.d.ts +29 -0
  219. package/lib/download/ui/ExportNameField.d.ts.map +1 -0
  220. package/lib/download/ui/ExportNameField.js +99 -0
  221. package/lib/download/ui/ExportNameField.js.map +1 -0
  222. package/lib/download/ui/ExportPictureSection.d.ts +38 -0
  223. package/lib/download/ui/ExportPictureSection.d.ts.map +1 -0
  224. package/lib/download/ui/ExportPictureSection.js +48 -0
  225. package/lib/download/ui/ExportPictureSection.js.map +1 -0
  226. package/lib/download/ui/index.d.ts +10 -0
  227. package/lib/download/ui/index.d.ts.map +1 -1
  228. package/lib/download/ui/index.js +5 -0
  229. package/lib/download/ui/index.js.map +1 -1
  230. package/lib/download/ui/useDrawingBox.d.ts +23 -0
  231. package/lib/download/ui/useDrawingBox.d.ts.map +1 -0
  232. package/lib/download/ui/useDrawingBox.js +21 -0
  233. package/lib/download/ui/useDrawingBox.js.map +1 -0
  234. package/lib/error/core/describeSource.d.ts +17 -0
  235. package/lib/error/core/describeSource.d.ts.map +1 -0
  236. package/lib/error/core/describeSource.js +19 -0
  237. package/lib/error/core/describeSource.js.map +1 -0
  238. package/lib/error/core/index.d.ts +1 -0
  239. package/lib/error/core/index.d.ts.map +1 -1
  240. package/lib/error/core/index.js +1 -0
  241. package/lib/error/core/index.js.map +1 -1
  242. package/lib/help/ui/HelpBody.d.ts +10 -1
  243. package/lib/help/ui/HelpBody.d.ts.map +1 -1
  244. package/lib/help/ui/HelpBody.js +24 -1
  245. package/lib/help/ui/HelpBody.js.map +1 -1
  246. package/lib/help/ui/index.d.ts +1 -1
  247. package/lib/help/ui/index.d.ts.map +1 -1
  248. package/lib/help/ui/index.js.map +1 -1
  249. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  250. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  251. package/lib/ir/core/analysisSpectra.d.ts +46 -0
  252. package/lib/ir/core/analysisSpectra.d.ts.map +1 -0
  253. package/lib/ir/core/analysisSpectra.js +187 -0
  254. package/lib/ir/core/analysisSpectra.js.map +1 -0
  255. package/lib/ir/core/assignBands.d.ts +83 -0
  256. package/lib/ir/core/assignBands.d.ts.map +1 -0
  257. package/lib/ir/core/assignBands.js +83 -0
  258. package/lib/ir/core/assignBands.js.map +1 -0
  259. package/lib/ir/core/bandAssignments.d.ts +47 -0
  260. package/lib/ir/core/bandAssignments.d.ts.map +1 -0
  261. package/lib/ir/core/bandAssignments.js +305 -0
  262. package/lib/ir/core/bandAssignments.js.map +1 -0
  263. package/lib/ir/core/bandLabelPlan.d.ts +93 -0
  264. package/lib/ir/core/bandLabelPlan.d.ts.map +1 -0
  265. package/lib/ir/core/bandLabelPlan.js +104 -0
  266. package/lib/ir/core/bandLabelPlan.js.map +1 -0
  267. package/lib/ir/core/detectIrFormat.d.ts +23 -0
  268. package/lib/ir/core/detectIrFormat.d.ts.map +1 -0
  269. package/lib/ir/core/detectIrFormat.js +133 -0
  270. package/lib/ir/core/detectIrFormat.js.map +1 -0
  271. package/lib/ir/core/downloadSpectra.d.ts +26 -0
  272. package/lib/ir/core/downloadSpectra.d.ts.map +1 -0
  273. package/lib/ir/core/downloadSpectra.js +37 -0
  274. package/lib/ir/core/downloadSpectra.js.map +1 -0
  275. package/lib/ir/core/fromJcamp.d.ts +35 -0
  276. package/lib/ir/core/fromJcamp.d.ts.map +1 -0
  277. package/lib/ir/core/fromJcamp.js +48 -0
  278. package/lib/ir/core/fromJcamp.js.map +1 -0
  279. package/lib/ir/core/fromSpc.d.ts +30 -0
  280. package/lib/ir/core/fromSpc.d.ts.map +1 -0
  281. package/lib/ir/core/fromSpc.js +40 -0
  282. package/lib/ir/core/fromSpc.js.map +1 -0
  283. package/lib/ir/core/index.d.ts +51 -0
  284. package/lib/ir/core/index.d.ts.map +1 -0
  285. package/lib/ir/core/index.js +35 -0
  286. package/lib/ir/core/index.js.map +1 -0
  287. package/lib/ir/core/irBand.d.ts +45 -0
  288. package/lib/ir/core/irBand.d.ts.map +1 -0
  289. package/lib/ir/core/irBand.js +30 -0
  290. package/lib/ir/core/irBand.js.map +1 -0
  291. package/lib/ir/core/irCommands.d.ts +168 -0
  292. package/lib/ir/core/irCommands.d.ts.map +1 -0
  293. package/lib/ir/core/irCommands.js +94 -0
  294. package/lib/ir/core/irCommands.js.map +1 -0
  295. package/lib/ir/core/irDomain.d.ts +63 -0
  296. package/lib/ir/core/irDomain.d.ts.map +1 -0
  297. package/lib/ir/core/irDomain.js +136 -0
  298. package/lib/ir/core/irDomain.js.map +1 -0
  299. package/lib/ir/core/irEditorApi.d.ts +42 -0
  300. package/lib/ir/core/irEditorApi.d.ts.map +1 -0
  301. package/lib/ir/core/irEditorApi.js +10 -0
  302. package/lib/ir/core/irEditorApi.js.map +1 -0
  303. package/lib/ir/core/irFormat.d.ts +42 -0
  304. package/lib/ir/core/irFormat.d.ts.map +1 -0
  305. package/lib/ir/core/irFormat.js +51 -0
  306. package/lib/ir/core/irFormat.js.map +1 -0
  307. package/lib/ir/core/irMode.d.ts +160 -0
  308. package/lib/ir/core/irMode.d.ts.map +1 -0
  309. package/lib/ir/core/irMode.js +175 -0
  310. package/lib/ir/core/irMode.js.map +1 -0
  311. package/lib/ir/core/irReducer.d.ts +101 -0
  312. package/lib/ir/core/irReducer.d.ts.map +1 -0
  313. package/lib/ir/core/irReducer.js +207 -0
  314. package/lib/ir/core/irReducer.js.map +1 -0
  315. package/lib/ir/core/irSidePanels.d.ts +22 -0
  316. package/lib/ir/core/irSidePanels.d.ts.map +1 -0
  317. package/lib/ir/core/irSidePanels.js +12 -0
  318. package/lib/ir/core/irSidePanels.js.map +1 -0
  319. package/lib/ir/core/irSpectrum.d.ts +140 -0
  320. package/lib/ir/core/irSpectrum.d.ts.map +1 -0
  321. package/lib/ir/core/irSpectrum.js +34 -0
  322. package/lib/ir/core/irSpectrum.js.map +1 -0
  323. package/lib/ir/core/irState.d.ts +119 -0
  324. package/lib/ir/core/irState.d.ts.map +1 -0
  325. package/lib/ir/core/irState.js +92 -0
  326. package/lib/ir/core/irState.js.map +1 -0
  327. package/lib/ir/core/loadIrSpectra.d.ts +36 -0
  328. package/lib/ir/core/loadIrSpectra.d.ts.map +1 -0
  329. package/lib/ir/core/loadIrSpectra.js +44 -0
  330. package/lib/ir/core/loadIrSpectra.js.map +1 -0
  331. package/lib/ir/core/nearestBand.d.ts +35 -0
  332. package/lib/ir/core/nearestBand.d.ts.map +1 -0
  333. package/lib/ir/core/nearestBand.js +47 -0
  334. package/lib/ir/core/nearestBand.js.map +1 -0
  335. package/lib/ir/core/pickBands.d.ts +70 -0
  336. package/lib/ir/core/pickBands.d.ts.map +1 -0
  337. package/lib/ir/core/pickBands.js +125 -0
  338. package/lib/ir/core/pickBands.js.map +1 -0
  339. package/lib/ir/core/spectrumJcamp.d.ts +58 -0
  340. package/lib/ir/core/spectrumJcamp.d.ts.map +1 -0
  341. package/lib/ir/core/spectrumJcamp.js +156 -0
  342. package/lib/ir/core/spectrumJcamp.js.map +1 -0
  343. package/lib/ir/core/toIrSpectrum.d.ts +59 -0
  344. package/lib/ir/core/toIrSpectrum.d.ts.map +1 -0
  345. package/lib/ir/core/toIrSpectrum.js +56 -0
  346. package/lib/ir/core/toIrSpectrum.js.map +1 -0
  347. package/lib/ir/ui/BandMarks.d.ts +52 -0
  348. package/lib/ir/ui/BandMarks.d.ts.map +1 -0
  349. package/lib/ir/ui/BandMarks.js +71 -0
  350. package/lib/ir/ui/BandMarks.js.map +1 -0
  351. package/lib/ir/ui/BandsPanel.d.ts +31 -0
  352. package/lib/ir/ui/BandsPanel.d.ts.map +1 -0
  353. package/lib/ir/ui/BandsPanel.js +94 -0
  354. package/lib/ir/ui/BandsPanel.js.map +1 -0
  355. package/lib/ir/ui/IrAboutDialog.d.ts +18 -0
  356. package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -0
  357. package/lib/ir/ui/IrAboutDialog.js +32 -0
  358. package/lib/ir/ui/IrAboutDialog.js.map +1 -0
  359. package/lib/ir/ui/IrCanvas.d.ts +38 -0
  360. package/lib/ir/ui/IrCanvas.d.ts.map +1 -0
  361. package/lib/ir/ui/IrCanvas.js +41 -0
  362. package/lib/ir/ui/IrCanvas.js.map +1 -0
  363. package/lib/ir/ui/IrChart.d.ts +28 -0
  364. package/lib/ir/ui/IrChart.d.ts.map +1 -0
  365. package/lib/ir/ui/IrChart.js +114 -0
  366. package/lib/ir/ui/IrChart.js.map +1 -0
  367. package/lib/ir/ui/IrCommandProvider.d.ts +15 -0
  368. package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -0
  369. package/lib/ir/ui/IrCommandProvider.js +14 -0
  370. package/lib/ir/ui/IrCommandProvider.js.map +1 -0
  371. package/lib/ir/ui/IrCommandTooltip.d.ts +16 -0
  372. package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -0
  373. package/lib/ir/ui/IrCommandTooltip.js +22 -0
  374. package/lib/ir/ui/IrCommandTooltip.js.map +1 -0
  375. package/lib/ir/ui/IrDocumentationDialog.d.ts +18 -0
  376. package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -0
  377. package/lib/ir/ui/IrDocumentationDialog.js +68 -0
  378. package/lib/ir/ui/IrDocumentationDialog.js.map +1 -0
  379. package/lib/ir/ui/IrEditor.d.ts +60 -0
  380. package/lib/ir/ui/IrEditor.d.ts.map +1 -0
  381. package/lib/ir/ui/IrEditor.js +42 -0
  382. package/lib/ir/ui/IrEditor.js.map +1 -0
  383. package/lib/ir/ui/IrHeader.d.ts +13 -0
  384. package/lib/ir/ui/IrHeader.d.ts.map +1 -0
  385. package/lib/ir/ui/IrHeader.js +21 -0
  386. package/lib/ir/ui/IrHeader.js.map +1 -0
  387. package/lib/ir/ui/IrLogo.d.ts +20 -0
  388. package/lib/ir/ui/IrLogo.d.ts.map +1 -0
  389. package/lib/ir/ui/IrLogo.js +17 -0
  390. package/lib/ir/ui/IrLogo.js.map +1 -0
  391. package/lib/ir/ui/IrPointerTracker.d.ts +29 -0
  392. package/lib/ir/ui/IrPointerTracker.d.ts.map +1 -0
  393. package/lib/ir/ui/IrPointerTracker.js +47 -0
  394. package/lib/ir/ui/IrPointerTracker.js.map +1 -0
  395. package/lib/ir/ui/IrShell.d.ts +25 -0
  396. package/lib/ir/ui/IrShell.d.ts.map +1 -0
  397. package/lib/ir/ui/IrShell.js +178 -0
  398. package/lib/ir/ui/IrShell.js.map +1 -0
  399. package/lib/ir/ui/IrSidePanel.d.ts +26 -0
  400. package/lib/ir/ui/IrSidePanel.d.ts.map +1 -0
  401. package/lib/ir/ui/IrSidePanel.js +39 -0
  402. package/lib/ir/ui/IrSidePanel.js.map +1 -0
  403. package/lib/ir/ui/IrStateProvider.d.ts +19 -0
  404. package/lib/ir/ui/IrStateProvider.d.ts.map +1 -0
  405. package/lib/ir/ui/IrStateProvider.js +16 -0
  406. package/lib/ir/ui/IrStateProvider.js.map +1 -0
  407. package/lib/ir/ui/IrStatusBar.d.ts +14 -0
  408. package/lib/ir/ui/IrStatusBar.d.ts.map +1 -0
  409. package/lib/ir/ui/IrStatusBar.js +48 -0
  410. package/lib/ir/ui/IrStatusBar.js.map +1 -0
  411. package/lib/ir/ui/IrToolbar.d.ts +18 -0
  412. package/lib/ir/ui/IrToolbar.d.ts.map +1 -0
  413. package/lib/ir/ui/IrToolbar.js +32 -0
  414. package/lib/ir/ui/IrToolbar.js.map +1 -0
  415. package/lib/ir/ui/IrTraces.d.ts +63 -0
  416. package/lib/ir/ui/IrTraces.d.ts.map +1 -0
  417. package/lib/ir/ui/IrTraces.js +72 -0
  418. package/lib/ir/ui/IrTraces.js.map +1 -0
  419. package/lib/ir/ui/MetadataPanel.d.ts +15 -0
  420. package/lib/ir/ui/MetadataPanel.d.ts.map +1 -0
  421. package/lib/ir/ui/MetadataPanel.js +49 -0
  422. package/lib/ir/ui/MetadataPanel.js.map +1 -0
  423. package/lib/ir/ui/SpectraPanel.d.ts +20 -0
  424. package/lib/ir/ui/SpectraPanel.d.ts.map +1 -0
  425. package/lib/ir/ui/SpectraPanel.js +42 -0
  426. package/lib/ir/ui/SpectraPanel.js.map +1 -0
  427. package/lib/ir/ui/SpectrumRow.d.ts +26 -0
  428. package/lib/ir/ui/SpectrumRow.d.ts.map +1 -0
  429. package/lib/ir/ui/SpectrumRow.js +41 -0
  430. package/lib/ir/ui/SpectrumRow.js.map +1 -0
  431. package/lib/ir/ui/index.d.ts +56 -0
  432. package/lib/ir/ui/index.d.ts.map +1 -0
  433. package/lib/ir/ui/index.js +36 -0
  434. package/lib/ir/ui/index.js.map +1 -0
  435. package/lib/ir/ui/irActions.d.ts +52 -0
  436. package/lib/ir/ui/irActions.d.ts.map +1 -0
  437. package/lib/ir/ui/irActions.js +62 -0
  438. package/lib/ir/ui/irActions.js.map +1 -0
  439. package/lib/ir/ui/irChartProps.d.ts +116 -0
  440. package/lib/ir/ui/irChartProps.d.ts.map +1 -0
  441. package/lib/ir/ui/irChartProps.js +14 -0
  442. package/lib/ir/ui/irChartProps.js.map +1 -0
  443. package/lib/ir/ui/irCommandContext.d.ts +35 -0
  444. package/lib/ir/ui/irCommandContext.d.ts.map +1 -0
  445. package/lib/ir/ui/irCommandContext.js +44 -0
  446. package/lib/ir/ui/irCommandContext.js.map +1 -0
  447. package/lib/ir/ui/irStateContext.d.ts +26 -0
  448. package/lib/ir/ui/irStateContext.d.ts.map +1 -0
  449. package/lib/ir/ui/irStateContext.js +37 -0
  450. package/lib/ir/ui/irStateContext.js.map +1 -0
  451. package/lib/ir/ui/useIrEditor.d.ts +51 -0
  452. package/lib/ir/ui/useIrEditor.d.ts.map +1 -0
  453. package/lib/ir/ui/useIrEditor.js +88 -0
  454. package/lib/ir/ui/useIrEditor.js.map +1 -0
  455. package/lib/ir/ui/useIrPointer.d.ts +66 -0
  456. package/lib/ir/ui/useIrPointer.d.ts.map +1 -0
  457. package/lib/ir/ui/useIrPointer.js +53 -0
  458. package/lib/ir/ui/useIrPointer.js.map +1 -0
  459. package/lib/ir/ui/useIrShortcuts.d.ts +24 -0
  460. package/lib/ir/ui/useIrShortcuts.d.ts.map +1 -0
  461. package/lib/ir/ui/useIrShortcuts.js +73 -0
  462. package/lib/ir/ui/useIrShortcuts.js.map +1 -0
  463. package/lib/ir/ui/useIrZoom.d.ts +51 -0
  464. package/lib/ir/ui/useIrZoom.d.ts.map +1 -0
  465. package/lib/ir/ui/useIrZoom.js +46 -0
  466. package/lib/ir/ui/useIrZoom.js.map +1 -0
  467. package/lib/ir.d.ts +13 -0
  468. package/lib/ir.d.ts.map +1 -0
  469. package/lib/ir.js +13 -0
  470. package/lib/ir.js.map +1 -0
  471. package/lib/locales/de.json +3 -0
  472. package/lib/locales/en.json +3 -0
  473. package/lib/locales/es.json +3 -0
  474. package/lib/locales/fr.json +3 -0
  475. package/lib/panel/core/dialogStyles.d.ts +13 -0
  476. package/lib/panel/core/dialogStyles.d.ts.map +1 -0
  477. package/lib/panel/core/dialogStyles.js +11 -0
  478. package/lib/panel/core/dialogStyles.js.map +1 -0
  479. package/lib/panel/core/index.d.ts +19 -0
  480. package/lib/panel/core/index.d.ts.map +1 -0
  481. package/lib/panel/core/index.js +18 -0
  482. package/lib/panel/core/index.js.map +1 -0
  483. package/lib/panel/core/isEditingField.d.ts +17 -0
  484. package/lib/panel/core/isEditingField.d.ts.map +1 -0
  485. package/lib/panel/core/isEditingField.js +25 -0
  486. package/lib/panel/core/isEditingField.js.map +1 -0
  487. package/lib/panel/core/panelStyles.d.ts +242 -0
  488. package/lib/panel/core/panelStyles.d.ts.map +1 -0
  489. package/lib/panel/core/panelStyles.js +228 -0
  490. package/lib/panel/core/panelStyles.js.map +1 -0
  491. package/lib/panel/core/rowSpacers.d.ts +38 -0
  492. package/lib/panel/core/rowSpacers.d.ts.map +1 -0
  493. package/lib/panel/core/rowSpacers.js +31 -0
  494. package/lib/panel/core/rowSpacers.js.map +1 -0
  495. package/lib/panel/core/statusBar.d.ts +44 -0
  496. package/lib/panel/core/statusBar.d.ts.map +1 -0
  497. package/lib/panel/core/statusBar.js +40 -0
  498. package/lib/panel/core/statusBar.js.map +1 -0
  499. package/lib/panel/core/textFilter.d.ts +22 -0
  500. package/lib/panel/core/textFilter.d.ts.map +1 -0
  501. package/lib/panel/core/textFilter.js +32 -0
  502. package/lib/panel/core/textFilter.js.map +1 -0
  503. package/lib/panel/core/yieldToPainting.d.ts +17 -0
  504. package/lib/panel/core/yieldToPainting.d.ts.map +1 -0
  505. package/lib/panel/core/yieldToPainting.js +21 -0
  506. package/lib/panel/core/yieldToPainting.js.map +1 -0
  507. package/lib/panel/ui/AboutDialogFrame.d.ts +36 -0
  508. package/lib/panel/ui/AboutDialogFrame.d.ts.map +1 -0
  509. package/lib/panel/ui/AboutDialogFrame.js +43 -0
  510. package/lib/panel/ui/AboutDialogFrame.js.map +1 -0
  511. package/lib/panel/ui/ClearButton.d.ts +28 -0
  512. package/lib/panel/ui/ClearButton.d.ts.map +1 -0
  513. package/lib/panel/ui/ClearButton.js +23 -0
  514. package/lib/panel/ui/ClearButton.js.map +1 -0
  515. package/lib/panel/ui/DocumentationDialogFrame.d.ts +39 -0
  516. package/lib/panel/ui/DocumentationDialogFrame.d.ts.map +1 -0
  517. package/lib/panel/ui/DocumentationDialogFrame.js +29 -0
  518. package/lib/panel/ui/DocumentationDialogFrame.js.map +1 -0
  519. package/lib/panel/ui/FilterInput.d.ts +31 -0
  520. package/lib/panel/ui/FilterInput.d.ts.map +1 -0
  521. package/lib/panel/ui/FilterInput.js +23 -0
  522. package/lib/panel/ui/FilterInput.js.map +1 -0
  523. package/lib/panel/ui/HelpLabel.d.ts +24 -0
  524. package/lib/panel/ui/HelpLabel.d.ts.map +1 -0
  525. package/lib/panel/ui/HelpLabel.js +23 -0
  526. package/lib/panel/ui/HelpLabel.js.map +1 -0
  527. package/lib/panel/ui/PanelMessage.d.ts +41 -0
  528. package/lib/panel/ui/PanelMessage.d.ts.map +1 -0
  529. package/lib/panel/ui/PanelMessage.js +30 -0
  530. package/lib/panel/ui/PanelMessage.js.map +1 -0
  531. package/lib/panel/ui/PanelRail.d.ts +41 -0
  532. package/lib/panel/ui/PanelRail.d.ts.map +1 -0
  533. package/lib/panel/ui/PanelRail.js +12 -0
  534. package/lib/panel/ui/PanelRail.js.map +1 -0
  535. package/lib/panel/ui/Section.d.ts +25 -0
  536. package/lib/panel/ui/Section.d.ts.map +1 -0
  537. package/lib/panel/ui/Section.js +41 -0
  538. package/lib/panel/ui/Section.js.map +1 -0
  539. package/lib/panel/ui/SidePanelStack.d.ts +62 -0
  540. package/lib/panel/ui/SidePanelStack.d.ts.map +1 -0
  541. package/lib/panel/ui/SidePanelStack.js +40 -0
  542. package/lib/panel/ui/SidePanelStack.js.map +1 -0
  543. package/lib/panel/ui/SpectrumColorSwatch.d.ts +33 -0
  544. package/lib/panel/ui/SpectrumColorSwatch.d.ts.map +1 -0
  545. package/lib/panel/ui/SpectrumColorSwatch.js +76 -0
  546. package/lib/panel/ui/SpectrumColorSwatch.js.map +1 -0
  547. package/lib/panel/ui/index.d.ts +37 -0
  548. package/lib/panel/ui/index.d.ts.map +1 -0
  549. package/lib/panel/ui/index.js +24 -0
  550. package/lib/panel/ui/index.js.map +1 -0
  551. package/lib/panel/ui/useConfirmOnEnter.d.ts +19 -0
  552. package/lib/panel/ui/useConfirmOnEnter.d.ts.map +1 -0
  553. package/lib/panel/ui/useConfirmOnEnter.js +64 -0
  554. package/lib/panel/ui/useConfirmOnEnter.js.map +1 -0
  555. package/lib/panel/ui/useFilterBox.d.ts +23 -0
  556. package/lib/panel/ui/useFilterBox.d.ts.map +1 -0
  557. package/lib/panel/ui/useFilterBox.js +22 -0
  558. package/lib/panel/ui/useFilterBox.js.map +1 -0
  559. package/lib/panel/ui/useVirtualRows.d.ts +46 -0
  560. package/lib/panel/ui/useVirtualRows.d.ts.map +1 -0
  561. package/lib/panel/ui/useVirtualRows.js +56 -0
  562. package/lib/panel/ui/useVirtualRows.js.map +1 -0
  563. package/lib/panel/ui/useVirtualWindowRows.d.ts +40 -0
  564. package/lib/panel/ui/useVirtualWindowRows.d.ts.map +1 -0
  565. package/lib/panel/ui/useVirtualWindowRows.js +65 -0
  566. package/lib/panel/ui/useVirtualWindowRows.js.map +1 -0
  567. package/lib/structure/core/conformerBoltzmann.d.ts +56 -0
  568. package/lib/structure/core/conformerBoltzmann.d.ts.map +1 -0
  569. package/lib/structure/core/conformerBoltzmann.js +96 -0
  570. package/lib/structure/core/conformerBoltzmann.js.map +1 -0
  571. package/lib/structure/core/conformerEnergy.d.ts +69 -0
  572. package/lib/structure/core/conformerEnergy.d.ts.map +1 -0
  573. package/lib/structure/core/conformerEnergy.js +47 -0
  574. package/lib/structure/core/conformerEnergy.js.map +1 -0
  575. package/lib/structure/core/index.d.ts +3 -0
  576. package/lib/structure/core/index.d.ts.map +1 -1
  577. package/lib/structure/core/index.js +2 -0
  578. package/lib/structure/core/index.js.map +1 -1
  579. package/lib/structure/ui/ConformerTable.d.ts +73 -0
  580. package/lib/structure/ui/ConformerTable.d.ts.map +1 -0
  581. package/lib/structure/ui/ConformerTable.js +259 -0
  582. package/lib/structure/ui/ConformerTable.js.map +1 -0
  583. package/lib/structure/ui/conformerColumns.d.ts +30 -0
  584. package/lib/structure/ui/conformerColumns.d.ts.map +1 -0
  585. package/lib/structure/ui/conformerColumns.js +37 -0
  586. package/lib/structure/ui/conformerColumns.js.map +1 -0
  587. package/lib/ui.d.ts +5 -0
  588. package/lib/ui.d.ts.map +1 -1
  589. package/lib/ui.js +3 -0
  590. package/lib/ui.js.map +1 -1
  591. package/package.json +8 -1
  592. package/src/chart/core/axisLabels.ts +117 -0
  593. package/src/chart/core/boxLayout.ts +126 -0
  594. package/src/chart/core/chartAxisScale.ts +92 -10
  595. package/src/chart/core/chartDomain.ts +185 -0
  596. package/src/chart/core/chartGeometry.ts +159 -0
  597. package/src/chart/core/chartPane.ts +10 -0
  598. package/src/chart/core/chartScale.ts +7 -4
  599. package/src/chart/core/chartTheme.ts +161 -0
  600. package/src/chart/core/chartViewport.ts +40 -13
  601. package/src/chart/core/guidePlacement.ts +66 -0
  602. package/src/chart/core/index.ts +121 -2
  603. package/src/chart/core/labelStack.ts +72 -0
  604. package/src/chart/core/legendBox.ts +263 -0
  605. package/src/chart/core/selectionGeometry.ts +68 -0
  606. package/src/chart/core/spectrumColor.ts +129 -0
  607. package/src/chart/core/stackCapacity.ts +162 -0
  608. package/src/chart/core/svgPoint.ts +77 -0
  609. package/src/chart/core/tracePath.ts +228 -0
  610. package/src/chart/core/trackerReadout.ts +78 -0
  611. package/src/chart/core/viewTransform.ts +287 -0
  612. package/src/chart/core/zoomDomain.ts +235 -0
  613. package/src/chart/ui/Axes.tsx +361 -0
  614. package/src/chart/ui/AxisGuide.tsx +187 -0
  615. package/src/chart/ui/ChartStack.tsx +130 -0
  616. package/src/chart/ui/ChartTracker.tsx +101 -0
  617. package/src/chart/ui/PlotCaption.tsx +108 -0
  618. package/src/chart/ui/SelectionRect.tsx +52 -0
  619. package/src/chart/ui/TraceLegend.tsx +193 -0
  620. package/src/chart/ui/chartGestures.ts +270 -0
  621. package/src/chart/ui/chartStackLevel.tsx +210 -0
  622. package/src/chart/ui/chartSurface.ts +66 -0
  623. package/src/chart/ui/index.ts +35 -0
  624. package/src/chart/ui/useChartPointer.ts +223 -0
  625. package/src/chart/ui/useChartSize.ts +115 -0
  626. package/src/chart/ui/useChartWindow.ts +240 -0
  627. package/src/chart/ui/useChartZoom.ts +255 -0
  628. package/src/chart/ui/useWheelListener.ts +62 -0
  629. package/src/chrome/ui/AccountButton.tsx +185 -0
  630. package/src/chrome/ui/index.ts +2 -0
  631. package/src/clipboard/core/copyPng.ts +20 -0
  632. package/src/clipboard/core/index.ts +1 -0
  633. package/src/clipboard/ui/ClickToCopy.tsx +9 -1
  634. package/src/core.ts +1 -0
  635. package/src/download/core/exportStyles.ts +20 -0
  636. package/src/download/core/imageResolution.ts +118 -0
  637. package/src/download/core/index.ts +34 -0
  638. package/src/download/core/pictureExport.ts +207 -0
  639. package/src/download/core/stackedDrawing.ts +108 -0
  640. package/src/download/core/svgBounds.ts +80 -0
  641. package/src/download/core/svgNamespace.ts +9 -0
  642. package/src/download/core/svgToPng.ts +121 -0
  643. package/src/download/core/svgToString.ts +95 -0
  644. package/src/download/ui/ExportDialogFrame.tsx +86 -0
  645. package/src/download/ui/ExportImageDialog.tsx +91 -0
  646. package/src/download/ui/ExportNameField.tsx +148 -0
  647. package/src/download/ui/ExportPictureSection.tsx +142 -0
  648. package/src/download/ui/index.ts +11 -0
  649. package/src/download/ui/useDrawingBox.ts +37 -0
  650. package/src/error/core/describeSource.ts +18 -0
  651. package/src/error/core/index.ts +1 -0
  652. package/src/help/ui/HelpBody.tsx +41 -2
  653. package/src/help/ui/index.ts +6 -1
  654. package/src/ir/core/analysisSpectra.ts +231 -0
  655. package/src/ir/core/assignBands.ts +144 -0
  656. package/src/ir/core/bandAssignments.ts +329 -0
  657. package/src/ir/core/bandLabelPlan.ts +194 -0
  658. package/src/ir/core/detectIrFormat.ts +139 -0
  659. package/src/ir/core/downloadSpectra.ts +57 -0
  660. package/src/ir/core/fromJcamp.ts +70 -0
  661. package/src/ir/core/fromSpc.ts +61 -0
  662. package/src/ir/core/index.ts +113 -0
  663. package/src/ir/core/irBand.ts +57 -0
  664. package/src/ir/core/irCommands.ts +154 -0
  665. package/src/ir/core/irDomain.ts +163 -0
  666. package/src/ir/core/irEditorApi.ts +44 -0
  667. package/src/ir/core/irFormat.ts +57 -0
  668. package/src/ir/core/irMode.ts +203 -0
  669. package/src/ir/core/irReducer.ts +273 -0
  670. package/src/ir/core/irSidePanels.ts +20 -0
  671. package/src/ir/core/irSpectrum.ts +155 -0
  672. package/src/ir/core/irState.ts +173 -0
  673. package/src/ir/core/loadIrSpectra.ts +79 -0
  674. package/src/ir/core/nearestBand.ts +57 -0
  675. package/src/ir/core/pickBands.ts +181 -0
  676. package/src/ir/core/spectrumJcamp.ts +178 -0
  677. package/src/ir/core/toIrSpectrum.ts +102 -0
  678. package/src/ir/ui/BandMarks.tsx +166 -0
  679. package/src/ir/ui/BandsPanel.tsx +271 -0
  680. package/src/ir/ui/IrAboutDialog.tsx +121 -0
  681. package/src/ir/ui/IrCanvas.tsx +91 -0
  682. package/src/ir/ui/IrChart.tsx +215 -0
  683. package/src/ir/ui/IrCommandProvider.tsx +32 -0
  684. package/src/ir/ui/IrCommandTooltip.tsx +36 -0
  685. package/src/ir/ui/IrDocumentationDialog.tsx +174 -0
  686. package/src/ir/ui/IrEditor.tsx +99 -0
  687. package/src/ir/ui/IrHeader.tsx +39 -0
  688. package/src/ir/ui/IrLogo.tsx +49 -0
  689. package/src/ir/ui/IrPointerTracker.tsx +102 -0
  690. package/src/ir/ui/IrShell.tsx +285 -0
  691. package/src/ir/ui/IrSidePanel.tsx +78 -0
  692. package/src/ir/ui/IrStateProvider.tsx +32 -0
  693. package/src/ir/ui/IrStatusBar.tsx +97 -0
  694. package/src/ir/ui/IrToolbar.tsx +102 -0
  695. package/src/ir/ui/IrTraces.tsx +134 -0
  696. package/src/ir/ui/MetadataPanel.tsx +88 -0
  697. package/src/ir/ui/SpectraPanel.tsx +114 -0
  698. package/src/ir/ui/SpectrumRow.tsx +127 -0
  699. package/src/ir/ui/index.ts +56 -0
  700. package/src/ir/ui/irActions.ts +103 -0
  701. package/src/ir/ui/irChartProps.ts +118 -0
  702. package/src/ir/ui/irCommandContext.tsx +62 -0
  703. package/src/ir/ui/irStateContext.ts +48 -0
  704. package/src/ir/ui/useIrEditor.ts +139 -0
  705. package/src/ir/ui/useIrPointer.ts +109 -0
  706. package/src/ir/ui/useIrShortcuts.ts +95 -0
  707. package/src/ir/ui/useIrZoom.ts +86 -0
  708. package/src/ir.ts +13 -0
  709. package/src/locales/de.json +3 -0
  710. package/src/locales/en.json +3 -0
  711. package/src/locales/es.json +3 -0
  712. package/src/locales/fr.json +3 -0
  713. package/src/panel/core/dialogStyles.ts +11 -0
  714. package/src/panel/core/index.ts +47 -0
  715. package/src/panel/core/isEditingField.ts +23 -0
  716. package/src/panel/core/panelStyles.ts +248 -0
  717. package/src/panel/core/rowSpacers.ts +50 -0
  718. package/src/panel/core/statusBar.ts +48 -0
  719. package/src/panel/core/textFilter.ts +33 -0
  720. package/src/panel/core/yieldToPainting.ts +20 -0
  721. package/src/panel/ui/AboutDialogFrame.tsx +100 -0
  722. package/src/panel/ui/ClearButton.tsx +42 -0
  723. package/src/panel/ui/DocumentationDialogFrame.tsx +86 -0
  724. package/src/panel/ui/FilterInput.tsx +60 -0
  725. package/src/panel/ui/HelpLabel.tsx +43 -0
  726. package/src/panel/ui/PanelMessage.tsx +64 -0
  727. package/src/panel/ui/PanelRail.tsx +64 -0
  728. package/src/panel/ui/Section.tsx +66 -0
  729. package/src/panel/ui/SidePanelStack.tsx +109 -0
  730. package/src/panel/ui/SpectrumColorSwatch.tsx +119 -0
  731. package/src/panel/ui/index.ts +47 -0
  732. package/src/panel/ui/useConfirmOnEnter.ts +68 -0
  733. package/src/panel/ui/useFilterBox.ts +35 -0
  734. package/src/panel/ui/useVirtualRows.ts +82 -0
  735. package/src/panel/ui/useVirtualWindowRows.ts +86 -0
  736. package/src/structure/core/conformerBoltzmann.ts +102 -0
  737. package/src/structure/core/conformerEnergy.ts +97 -0
  738. package/src/structure/core/index.ts +15 -0
  739. package/src/structure/ui/ConformerTable.tsx +429 -0
  740. package/src/structure/ui/conformerColumns.ts +55 -0
  741. package/src/ui.ts +13 -0
  742. package/styles/chrome.css +55 -0
@@ -0,0 +1,263 @@
1
+ /**
2
+ * Where a legend sits, and where every one of its rows sits inside it.
3
+ *
4
+ * A legend whose rows carry a control is drawn **twice, in two technologies**,
5
+ * and that is what this module exists for. The picture has to be SVG, because
6
+ * an export clones the chart's own `SVGSVGElement` and anything living beside
7
+ * it in a `<div>` is missing from every figure while looking perfectly right on
8
+ * screen; a close cross has to be HTML, because an SVG `×` would be cloned into
9
+ * that same figure as a dead glyph, and a `pointerdown` on the SVG root is read
10
+ * as a chart gesture rather than as a click on a row. Two renderings of one box
11
+ * are two chances to place a row differently, so the arithmetic has exactly one
12
+ * owner and neither of them does any of its own — a cross half a row off the
13
+ * name beside it is a cross that closes the wrong trace.
14
+ *
15
+ * Everything is measured from character counts rather than from the DOM. The
16
+ * box is worked out during render, where a `getComputedTextLength` would need a
17
+ * layout pass that has not happened yet, and the exported clone gets no layout
18
+ * at all — so a legend that measured itself would come out a different size in
19
+ * the figure than on screen. `CHARACTER_WIDTH` is a conservative average
20
+ * advance for the face at `FONT_SIZE`: a name that overruns it by a character
21
+ * is a smaller problem than a picture that disagrees with itself.
22
+ */
23
+
24
+ import type { PlotRect } from './chartGeometry.ts';
25
+
26
+ /** Where a legend sits, and where each of its rows sits inside it. */
27
+ export interface LegendBox {
28
+ /** The box's left edge, in the plot's own pixels. */
29
+ left: number;
30
+ /** Its top edge. */
31
+ top: number;
32
+ /** How wide it is. */
33
+ width: number;
34
+ /** How tall it is. */
35
+ height: number;
36
+ /** The rows it draws, in order. */
37
+ rows: readonly LegendRow[];
38
+ /** How many entries were left out, counted on a final row. 0 when none were. */
39
+ hidden: number;
40
+ }
41
+
42
+ /** One row of a legend, placed. */
43
+ export interface LegendRow {
44
+ /** Identity of the entry it draws. */
45
+ id: string;
46
+ /** The row's own top edge. */
47
+ top: number;
48
+ /** How tall it is. */
49
+ height: number;
50
+ /** The vertical middle of the row, which is what a swatch and a baseline sit on. */
51
+ middle: number;
52
+ }
53
+
54
+ /** What a legend has to know about an entry to give it room. */
55
+ export interface LegendBoxEntry {
56
+ /** Identity, which is what the list is keyed on. */
57
+ id: string;
58
+ /** What it is called. */
59
+ name: string;
60
+ /**
61
+ * A 1-based number written before the name.
62
+ * @default undefined
63
+ */
64
+ index?: number;
65
+ /**
66
+ * A short remark written at the right of the row.
67
+ * @default undefined
68
+ */
69
+ note?: string;
70
+ }
71
+
72
+ /** How a legend is measured. */
73
+ export interface LegendBoxOptions {
74
+ /**
75
+ * How many entries are named before the rest are counted instead.
76
+ * @default 8
77
+ */
78
+ limit?: number;
79
+ /**
80
+ * Whether a column is left at the right of each row for a control.
81
+ * @default false
82
+ */
83
+ closable?: boolean;
84
+ }
85
+
86
+ /**
87
+ * Measure the legend a set of entries asks for, and place its rows.
88
+ *
89
+ * Top right of the plot, because that is where a trace leaves room: a curve
90
+ * rises from the baseline and the tallest peak is rarely at the right-hand
91
+ * edge. Over the plot rather than in a gutter beside it, so that naming the
92
+ * traces never narrows the measurement they are drawn in.
93
+ *
94
+ * Past `limit` the remaining entries are counted rather than named — a legend
95
+ * taller than the plot hides the measurement it is explaining, which is the
96
+ * failure a scrollbar in a legend admits to. The count is a row of its own, so
97
+ * it is paid for in `height` while staying out of `rows`: nothing draws a
98
+ * swatch or a cross for it, and it names no entry to key on.
99
+ * @param entries - The traces to name, in the order they are drawn. Only the
100
+ * first `limit` of them get a row; the rest are counted.
101
+ * @param plot - The plot the legend is placed against.
102
+ * @param options - How many are named, and whether a control column is kept.
103
+ * @returns The box and its rows, in the plot's own pixels.
104
+ */
105
+ export function legendBox(
106
+ entries: readonly LegendBoxEntry[],
107
+ plot: PlotRect,
108
+ options: LegendBoxOptions = {},
109
+ ): LegendBox {
110
+ const { limit = 8, closable = false } = options;
111
+ // Never taller than the plot it is drawn over. A legend covers the
112
+ // measurement it explains, so one that overran its plot would hide the axis
113
+ // under it — and on a pane of a stack that axis is the only one the whole
114
+ // stack has. The surplus is counted on a last row exactly as `limit`'s is, so
115
+ // nothing goes missing; it is only no longer named.
116
+ const room = Math.max(
117
+ 1,
118
+ Math.floor((plot.height - MARGIN * 2 - PADDING * 2) / ROW_HEIGHT),
119
+ );
120
+ const asked = Math.min(Math.max(0, limit), entries.length);
121
+ // A row is spent on the count whenever anything is left out, so the test is
122
+ // against `asked + 1` in that case — otherwise a legend of exactly `room`
123
+ // names would grow a counted row and overflow by one after all.
124
+ const overflows = asked < entries.length ? asked + 1 > room : asked > room;
125
+ const named = overflows ? Math.max(0, room - 1) : asked;
126
+ const shown = entries.slice(0, named);
127
+ const hidden = entries.length - shown.length;
128
+
129
+ const width = boxWidth(shown, hidden, closable);
130
+ const rowCount = shown.length + (hidden > 0 ? 1 : 0);
131
+ const height = rowCount * ROW_HEIGHT + PADDING * 2;
132
+ const left = plot.left + plot.width - width - MARGIN;
133
+ const top = plot.top + MARGIN;
134
+
135
+ const rows: LegendRow[] = [];
136
+ for (const [index, entry] of shown.entries()) {
137
+ const rowTop = top + PADDING + index * ROW_HEIGHT;
138
+ rows.push({
139
+ id: entry.id,
140
+ top: rowTop,
141
+ height: ROW_HEIGHT,
142
+ middle: rowTop + ROW_HEIGHT / 2,
143
+ });
144
+ }
145
+
146
+ return { left, top, width, height, rows, hidden };
147
+ }
148
+
149
+ /**
150
+ * What a row of the legend actually reads, index and all.
151
+ *
152
+ * The number goes in front of the name rather than beside it because the
153
+ * palette hands out six hues and a seventh trace legitimately repeats one, so
154
+ * the number is what tells two blue traces apart — and it has to be the first
155
+ * thing on the row for that to work while the eye is running down the column.
156
+ * Written here rather than at each drawing site so that whatever measured the
157
+ * row and whatever draws it agree on the string, to the character.
158
+ * @param entry - The entry the row names.
159
+ * @returns The text of the row, without its note.
160
+ */
161
+ export function legendLabel(entry: LegendBoxEntry): string {
162
+ return entry.index === undefined
163
+ ? entry.name
164
+ : `${entry.index}${INDEX_SEPARATOR}${entry.name}`;
165
+ }
166
+
167
+ /**
168
+ * What the final row reads when entries were left out.
169
+ * @param hidden - How many were not named.
170
+ * @returns The text of that row.
171
+ */
172
+ export function hiddenLabel(hidden: number): string {
173
+ return `+ ${hidden} more`;
174
+ }
175
+
176
+ /**
177
+ * The entries a legend actually draws a row for.
178
+ *
179
+ * Two rules in one answer, and three drawings depend on both of them agreeing:
180
+ * the SVG legend, the HTML row layer placed over it, and whatever else is
181
+ * written along the top of the same plot and has to keep clear of the box. A
182
+ * trace with no name is not given a row — an unnamed curve in a legend is a
183
+ * swatch and nothing else, which is worse than being left out — and below
184
+ * `minimumEntries` names no legend is drawn at all, since the axis title
185
+ * already says what a single curve is.
186
+ * @param entries - The traces, in the order they are drawn.
187
+ * @param minimumEntries - How few named traces are still worth a legend.
188
+ * @returns The entries that get a row, empty where none is drawn.
189
+ */
190
+ export function legendNames<Entry extends LegendBoxEntry>(
191
+ entries: readonly Entry[],
192
+ minimumEntries = 2,
193
+ ): Entry[] {
194
+ const named = entries.filter((entry) => entry.name !== '');
195
+ return named.length < minimumEntries ? [] : named;
196
+ }
197
+
198
+ /**
199
+ * How wide the box has to be to hold the longest row it is drawing.
200
+ *
201
+ * The name column is sized on the longest label — the counted row included,
202
+ * since it is written in the same column — and clamped at
203
+ * `MAXIMUM_CHARACTERS`, past which a name simply overruns rather than dragging
204
+ * the box across the plot it is standing on. A note is a column of its own at
205
+ * the right, so a long note never pushes the names about, and the control
206
+ * column is a fixed strip because a cross is one glyph whatever the row says.
207
+ * @param entries - The rows being drawn.
208
+ * @param hidden - How many were left out, which the final row counts.
209
+ * @param closable - Whether a control column is kept at the right.
210
+ * @returns The width in pixels.
211
+ */
212
+ function boxWidth(
213
+ entries: readonly LegendBoxEntry[],
214
+ hidden: number,
215
+ closable: boolean,
216
+ ): number {
217
+ let longest = hidden > 0 ? hiddenLabel(hidden).length : 0;
218
+ let longestNote = 0;
219
+ for (const entry of entries) {
220
+ const label = legendLabel(entry).length;
221
+ if (label > longest) longest = label;
222
+ const note = entry.note === undefined ? 0 : entry.note.length;
223
+ if (note > longestNote) longestNote = note;
224
+ }
225
+ const text = Math.min(longest, MAXIMUM_CHARACTERS) * CHARACTER_WIDTH;
226
+ const note =
227
+ longestNote === 0
228
+ ? 0
229
+ : GAP + Math.min(longestNote, MAXIMUM_CHARACTERS) * CHARACTER_WIDTH;
230
+ return (
231
+ PADDING * 2 + SWATCH + GAP + text + note + (closable ? CLOSE_COLUMN : 0)
232
+ );
233
+ }
234
+
235
+ /** The line of colour that stands for the curve. */
236
+ export const SWATCH = 14;
237
+
238
+ /** Between the swatch and the name, and between the name and a note. */
239
+ export const GAP = 5;
240
+
241
+ /** Inside the box, on every side. */
242
+ export const PADDING = 6;
243
+
244
+ /** One row of the legend. */
245
+ export const ROW_HEIGHT = 14;
246
+
247
+ /** Between the box and the edge of the plot. */
248
+ export const MARGIN = 6;
249
+
250
+ /** The face the names are written at. */
251
+ export const FONT_SIZE = 11;
252
+
253
+ /** About how wide one character is at that size. */
254
+ export const CHARACTER_WIDTH = 6.1;
255
+
256
+ /** The longest name the box is widened for; past it a name simply overruns. */
257
+ export const MAXIMUM_CHARACTERS = 28;
258
+
259
+ /** The strip kept at the right of a row for a control, when one is asked for. */
260
+ export const CLOSE_COLUMN = 12;
261
+
262
+ /** Between the index and the name it numbers. */
263
+ const INDEX_SEPARATOR = ' · ';
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The rectangle a drag sweeps out, in the pixels it is drawn in.
3
+ *
4
+ * The preview and the release are two readings of one gesture, and they have to
5
+ * agree: a rectangle that promises a window the release then refuses teaches a
6
+ * user that the chart is unreliable, which is a far more expensive mistake than
7
+ * a preview that is a pixel out. So the same two tests decide both — the drag is
8
+ * pulled back inside the plot and measured against `MINIMUM_DRAG` here exactly
9
+ * as `zoomedDomain` does it, and the height comes from the answer
10
+ * `zoomSelection` already worked out rather than from a second one.
11
+ */
12
+
13
+ import { clamp } from '../../format/core/clamp.ts';
14
+
15
+ import type { PlotRect } from './chartGeometry.ts';
16
+ import type { ZoomSelection } from './zoomDomain.ts';
17
+ import { MINIMUM_DRAG } from './zoomDomain.ts';
18
+
19
+ /** A rectangle in the user units of the SVG. */
20
+ export interface SelectionRectangle {
21
+ /** Its left edge. */
22
+ x: number;
23
+ /** Its top edge. */
24
+ y: number;
25
+ /** How wide it is. */
26
+ width: number;
27
+ /** How tall it is. */
28
+ height: number;
29
+ }
30
+
31
+ /**
32
+ * The rectangle to draw for a drag being made.
33
+ *
34
+ * A drag that takes the y axis with it is drawn at the height of the drag
35
+ * itself, and one that asks for the x axis alone spans the whole plot.
36
+ * That is the gesture announcing itself before the button is let go: the
37
+ * rectangle changing shape as the pointer crosses the baseline is the only
38
+ * warning a user gets that the release is about to move both axes, and it is one
39
+ * they can still act on.
40
+ *
41
+ * A drag too short to zoom draws nothing at all. Below `MINIMUM_DRAG` the
42
+ * release does nothing — most clicks made on a trackpad wobble by a pixel or two
43
+ * — and a rectangle flashing up on every click would say that something
44
+ * happened.
45
+ * @param selection - The drag being made, `null` when none is.
46
+ * @param plot - Where the plot sits inside the SVG, which the drag is confined
47
+ * to.
48
+ * @returns The rectangle, `null` when there is nothing to draw.
49
+ */
50
+ export function selectionRectangle(
51
+ selection: ZoomSelection | null,
52
+ plot: PlotRect,
53
+ ): SelectionRectangle | null {
54
+ if (selection === null) return null;
55
+
56
+ const { fromX, toX, fromY, toY, zoomsYAxis } = selection;
57
+ const left = clamp(Math.min(fromX, toX), plot.left, plot.right);
58
+ const right = clamp(Math.max(fromX, toX), plot.left, plot.right);
59
+ const width = right - left;
60
+ if (!(width >= MINIMUM_DRAG)) return null;
61
+
62
+ if (!zoomsYAxis) {
63
+ return { x: left, y: plot.top, width, height: plot.height };
64
+ }
65
+ const top = clamp(Math.min(fromY, toY), plot.top, plot.bottom);
66
+ const bottom = clamp(Math.max(fromY, toY), plot.top, plot.bottom);
67
+ return { x: left, y: top, width, height: bottom - top };
68
+ }
@@ -0,0 +1,129 @@
1
+ import { CHART_SERIES_COLORS } from './chartPalette.ts';
2
+
3
+ /** The universal set's yellow, which a one-pixel stick cannot be drawn in. */
4
+ const CHART_YELLOW = '#f0e442';
5
+
6
+ /** Its neutral dark, which is already the ink the axes are drawn in. */
7
+ const CHART_NEUTRAL = '#4d4d4d';
8
+
9
+ /**
10
+ * The two of the eight a line has to do without.
11
+ *
12
+ * Above the palette it filters rather than below it with the other helpers:
13
+ * the list is built as the module is evaluated, so anything it reads has to
14
+ * exist by then.
15
+ */
16
+ const NOT_FOR_A_LINE = new Set([CHART_YELLOW, CHART_NEUTRAL]);
17
+
18
+ /**
19
+ * The colours spectra are told apart by, in two tiers.
20
+ *
21
+ * A viewer holds a handful of spectra at a time — a measurement, a reference,
22
+ * a predicted distribution — so the palette is short and every hue in it is
23
+ * distinguishable at the width of a one-pixel stick, which is all a centroid
24
+ * ever is. It is deliberately not a generated scale: named colours stay the same
25
+ * from one session to the next, and a chemist who calls the blue one "the blank"
26
+ * is still right tomorrow.
27
+ *
28
+ * A colour is the only thing telling one trace from another once they overlap,
29
+ * so a palette that fails for the one man in twelve with a colour vision
30
+ * deficiency fails at the only job it has. The matplotlib hues this used to hold
31
+ * put a red beside a green — the very pair a deuteranope reads as one colour,
32
+ * and the pair a blank and its sample are most often drawn in.
33
+ *
34
+ * That is why there are two tiers rather than one long list. Okabe and Ito's set
35
+ * is short because it holds only colours that survive **every** deficiency at
36
+ * once, including the rarer ones where two channels are affected; the Color
37
+ * Universal Design accent set that the same work grew into is longer because it
38
+ * asks only that a reader missing **one** channel can tell its members apart.
39
+ * Both are true, and which one is wanted depends on who is reading the chart, so
40
+ * the short set is what a chart hands out by itself and the longer one is what a
41
+ * reader may reach for. Nothing picks a colour out of the second tier on anyone's
42
+ * behalf.
43
+ *
44
+ * Every viewer offers both tiers and none of them keeps a set of its own: two
45
+ * charts on one page have to name a spectrum the same way, and a palette copied
46
+ * into a second package is a palette that drifts from the first.
47
+ */
48
+
49
+ /**
50
+ * The colours a spectrum is drawn in, in the order they are handed out.
51
+ *
52
+ * Okabe and Ito's universal set exactly as {@link CHART_SERIES_COLORS} holds
53
+ * it, less the two a line cannot use: their yellow, which is faint on a white
54
+ * plot at the width of a stick, and the neutral dark, which is already the ink
55
+ * of the axes and the labels. Both are still offered, one tier down.
56
+ *
57
+ * Derived rather than written out, because a palette copied into a second
58
+ * place is a palette that drifts from the first: a scatter plot and a spectrum
59
+ * on the same page have to call the same blue the same blue.
60
+ *
61
+ * Blue and vermillion come first because the commonest use is two spectra
62
+ * compared — the pair that reads most clearly, and the pair a mirror plot
63
+ * expects.
64
+ */
65
+ export const SPECTRUM_COLORS: readonly string[] = CHART_SERIES_COLORS.filter(
66
+ (color) => !NOT_FOR_A_LINE.has(color),
67
+ );
68
+
69
+ export const EXTRA_SPECTRUM_COLORS: readonly string[] = [
70
+ '#000000', // black
71
+ CHART_YELLOW,
72
+ '#ff8082', // pink
73
+ '#990099', // purple
74
+ '#804000', // brown
75
+ '#7f878f', // grey
76
+ ];
77
+
78
+ /**
79
+ * Both tiers in one list, the handed-out six first.
80
+ *
81
+ * What a picker shows. The order is the tiers in order and never sorted by hue:
82
+ * a reader who has learnt that the first chip is the blue their blank is drawn
83
+ * in must find it in the same place in every viewer, and the row a colour sits
84
+ * in is itself the answer to "will this survive whoever reads the figure".
85
+ */
86
+ export const ALL_SPECTRUM_COLORS: readonly string[] = [
87
+ ...SPECTRUM_COLORS,
88
+ ...EXTRA_SPECTRUM_COLORS,
89
+ ];
90
+
91
+ /**
92
+ * The colour to give the next spectrum, given the ones already in use.
93
+ *
94
+ * The lowest unused hue, never one derived from how many spectra there are:
95
+ * dropping the second of three and loading another would otherwise hand out a
96
+ * colour already on the chart, and two spectra of the same blue is the one
97
+ * mistake a colour is there to prevent.
98
+ *
99
+ * Once every hue is taken it falls to the least-used one, lowest first — the
100
+ * same rule, since an unused hue is a hue used no times. It never reaches into
101
+ * the second tier to avoid a repeat: a colour only that reader's eyes can place
102
+ * is a choice made for them, and a seventh blue they can read beats a brown they
103
+ * cannot.
104
+ *
105
+ * A spectrum a reader has drawn in a second-tier colour counts as holding none
106
+ * of the six, so it neither uses one up nor frees one: a chart of a black trace
107
+ * and a blue one is handed vermillion next, exactly as it would have been had
108
+ * the black one never been recoloured.
109
+ * @param taken - The colours the spectra already hold, in any order.
110
+ * @returns One of `SPECTRUM_COLORS`.
111
+ */
112
+ export function nextSpectrumColor(taken: readonly string[]): string {
113
+ const counts = new Array<number>(SPECTRUM_COLORS.length).fill(0);
114
+ for (const color of taken) {
115
+ const index = SPECTRUM_COLORS.indexOf(color);
116
+ if (index !== -1) counts[index] = (counts[index] as number) + 1;
117
+ }
118
+
119
+ let best = SPECTRUM_COLORS[0] as string;
120
+ let bestCount = counts[0] as number;
121
+ for (let index = 1; index < counts.length && bestCount > 0; index++) {
122
+ const count = counts[index] as number;
123
+ if (count < bestCount) {
124
+ best = SPECTRUM_COLORS[index] as string;
125
+ bestCount = count;
126
+ }
127
+ }
128
+ return best;
129
+ }
@@ -0,0 +1,162 @@
1
+ /**
2
+ * How many charts a column of a given height can stack, and how tall each stands.
3
+ *
4
+ * A viewer that draws one pane per selected spectrum has to answer a question
5
+ * the stack itself never asks. A reader who ticks a dozen spectra has not asked
6
+ * for twelve panes of fifty pixels, and a stack handed them draws twelve stubs
7
+ * with a full set of axes over each — the failure `ChartStack.tsx`'s header
8
+ * describes, arrived at from above instead of through a splitter. So the number
9
+ * of panes is settled from the height actually available, against the stack's
10
+ * own floors rather than a number somebody hoped for, and whatever a reader
11
+ * selects past that number is overlaid together into the last pane rather than
12
+ * dropped, which is the one outcome a reader cannot see happening.
13
+ *
14
+ * All of it is arithmetic over `chartStackLevel.tsx`'s floors and
15
+ * `chartGeometry.ts`'s margins; nothing here renders, measures or reads a
16
+ * spectrum.
17
+ */
18
+
19
+ import { MARGIN, SHARED_AXIS_MARGIN } from './chartGeometry.ts';
20
+
21
+ /**
22
+ * The shortest a pane that is *not* at the foot of the stack may stand, in
23
+ * pixels.
24
+ *
25
+ * Ninety, and ninety exactly, because it is not a judgement about how short a
26
+ * chart may be: `chartStackLevel.tsx` hands `SplitPane` a `closeThreshold` of 90
27
+ * at every non-foot split, and a split measuring under that closes its pane
28
+ * outright — before a splitter has ever been touched, so a stack built on a
29
+ * floor of 80 would come up with panes already shut and no gesture that made
30
+ * them so. The threshold is applied as `>=`, which is why standing exactly on it
31
+ * is allowed. That constant is module-private over there, so its value is
32
+ * restated here and the two have to move together.
33
+ *
34
+ * A caller must state this as each pane's own `minimumHeight`. Left unsaid,
35
+ * `paneHeight` clamps the pane up to the 120 pixels it defaults to, and five
36
+ * panes would then demand 688 pixels where 538 draws them.
37
+ */
38
+ export const STACKED_MINIMUM = 90;
39
+
40
+ /**
41
+ * What the pane at the foot pays for its axis beyond what every pane pays, in
42
+ * pixels.
43
+ *
44
+ * Only the foot of a stack writes the tick row and the axis title under its
45
+ * plot, and that is `MARGIN.bottom` less the `SHARED_AXIS_MARGIN` a pane keeps
46
+ * even when it writes no axis — 26 of them, not 34. The *difference* is what
47
+ * matters and the whole bottom margin is not it: a stacked pane still leaves a
48
+ * little room under its trace, and charging the foot for all 34 draws its plot
49
+ * eight pixels taller than the others, so a peak of one intensity comes out
50
+ * taller at the bottom of the stack than at the top. Every other side of the margin
51
+ * is paid alike by every pane, the room kept above the plot for the tallest
52
+ * peak's label as much as the gutter the value labels are written in, so it
53
+ * cancels out of the difference between two panes and does not appear here.
54
+ * This one asymmetry is the whole of why an equal split of the *boxes* is not an
55
+ * equal split of the *plots*.
56
+ */
57
+ export const FOOT_FURNITURE = MARGIN.bottom - SHARED_AXIS_MARGIN;
58
+
59
+ /**
60
+ * The shortest the pane at the foot may stand, in pixels.
61
+ *
62
+ * The ordinary floor plus the tick row and axis title only it writes, so that
63
+ * the plot left inside it is the same plot `STACKED_MINIMUM` leaves inside a
64
+ * pane above it. Deriving it rather than picking 116 is what makes the tightest
65
+ * stack land exactly on both floors at once: at a height of
66
+ * `FOOT_MINIMUM + (n - 1) * STACKED_MINIMUM`, `stackShares` gives every pane
67
+ * above the foot exactly `STACKED_MINIMUM` and the foot exactly this.
68
+ */
69
+ export const FOOT_MINIMUM = STACKED_MINIMUM + FOOT_FURNITURE;
70
+
71
+ /**
72
+ * How much room the splitter between two panes takes, in pixels.
73
+ *
74
+ * `react-science` draws a vertical splitter as a ten-pixel bar, and there is one
75
+ * between each *pair* of panes rather than one per pane — five of them under six
76
+ * panes. Small enough to be forgotten and large enough that forgetting it costs
77
+ * a pane: the fifty it comes to across a full stack is more than half a stacked
78
+ * minimum.
79
+ */
80
+ export const SPLITTER = 10;
81
+
82
+ /**
83
+ * The most panes worth stacking at all, however tall the column.
84
+ *
85
+ * Six, and the height is not what settles it. A 1080-pixel screen with the side
86
+ * panels open leaves the stack something near 900 pixels; six panes take 50 of
87
+ * those in splitters and share the rest, which is a box of 133 pixels each and a
88
+ * plot inside it of barely a hundred — about the height of the label stack a
89
+ * mass spectrum draws over its tallest sticks, so a seventh pane makes the
90
+ * labels taller than the trace they belong to. And the reader stacked the panes
91
+ * in order to compare them: past six the first and the last are most of a page
92
+ * apart, and an eye travelling that far is no longer comparing anything.
93
+ * Whatever is selected beyond this is overlaid into the last pane, where traces
94
+ * drawn over one another are compared the way they always were.
95
+ */
96
+ export const STACK_LIMIT = 6;
97
+
98
+ /**
99
+ * How many panes a column of a given height can hold and still draw spectra.
100
+ *
101
+ * The arithmetic is the stack as it will actually be built: one pane at the foot
102
+ * carrying the horizontal axis, every other pane at the stacked floor, and a
103
+ * splitter between each pair. Nothing here rounds in the caller's favour — a
104
+ * height one pixel short of the fourth pane holds three.
105
+ * @param height - The whole column the stack fills, in pixels, with the
106
+ * splitters counted in: it is the box `ChartStack` is handed, not the room its
107
+ * panes are left with.
108
+ * @returns At least one, because a lone pane squeezed short is still the
109
+ * measurement and the stack draws it rather than nothing — that is why the foot
110
+ * pane is given no close threshold — and never more than `STACK_LIMIT`.
111
+ */
112
+ export function stackCapacity(height: number): number {
113
+ const beyondTheFoot = height - FOOT_MINIMUM;
114
+ const fits = 1 + Math.floor(beyondTheFoot / (STACKED_MINIMUM + SPLITTER));
115
+ return Math.min(STACK_LIMIT, Math.max(1, fits));
116
+ }
117
+
118
+ /**
119
+ * How tall each pane of the stack stands, top to bottom.
120
+ *
121
+ * The split equalises the **plot** rather than the box. An equal share of the
122
+ * box hands the foot pane 34 pixels of tick row and axis title that the panes
123
+ * above it do not draw, so its trace comes out visibly shorter than theirs while
124
+ * every box measures the same — the one thing a reader comparing two spectra
125
+ * side by side must not be shown. So `FOOT_FURNITURE` is taken off the top, what
126
+ * is left is divided evenly, and the foot is given its share back with the
127
+ * furniture on it.
128
+ *
129
+ * The division is floored, so the panes above the foot are whole pixels and the
130
+ * remainder — never more than `count - 1` of them — lands on the foot, which is
131
+ * the tallest pane and the one where two pixels are least visible. That keeps
132
+ * the sum exact, and it is also why the foot's share is *at least*
133
+ * `FOOT_FURNITURE` above a stacked one rather than exactly it.
134
+ * @param height - The room the panes themselves share, in pixels. A caller
135
+ * holding the whole column subtracts the splitters first — `height -
136
+ * (count - 1) * SPLITTER` — because `SplitPane` takes those out of the panes,
137
+ * not out of the column.
138
+ * @param count - How many panes to stack, normally whatever `stackCapacity`
139
+ * answered.
140
+ * @returns One height per pane, summing exactly to `height`, each at or above
141
+ * its own floor. The two cannot both hold for a height short of what `count`
142
+ * panes need, and there the floors win and the sum overshoots: a pane under its
143
+ * floor is the stub with a full set of axes over it, which is the worse of the
144
+ * two pictures. A lone pane is the exception and takes the whole height floor
145
+ * and all, since there is nothing to redistribute to and nothing to compare it
146
+ * against.
147
+ */
148
+ export function stackShares(height: number, count: number): readonly number[] {
149
+ if (!Number.isInteger(count) || count < 1) return [];
150
+ if (count === 1) return [height];
151
+
152
+ const stacked = Math.max(
153
+ STACKED_MINIMUM,
154
+ Math.floor((height - FOOT_FURNITURE) / count),
155
+ );
156
+ const shares = new Array<number>(count);
157
+ for (let index = 0; index < count - 1; index++) {
158
+ shares[index] = stacked;
159
+ }
160
+ shares[count - 1] = Math.max(FOOT_MINIMUM, height - stacked * (count - 1));
161
+ return shares;
162
+ }