react-cheminfo 0.76.0 → 0.78.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 (389) hide show
  1. package/README.md +141 -31
  2. package/lib/card/core/cardAddress.d.ts +19 -2
  3. package/lib/card/core/cardAddress.d.ts.map +1 -1
  4. package/lib/card/core/cardAddress.js +35 -2
  5. package/lib/card/core/cardAddress.js.map +1 -1
  6. package/lib/card/core/cardPageUrl.d.ts +7 -1
  7. package/lib/card/core/cardPageUrl.d.ts.map +1 -1
  8. package/lib/card/core/cardPageUrl.js +4 -2
  9. package/lib/card/core/cardPageUrl.js.map +1 -1
  10. package/lib/card/core/index.d.ts +1 -1
  11. package/lib/card/core/index.d.ts.map +1 -1
  12. package/lib/card/core/index.js +1 -1
  13. package/lib/card/core/index.js.map +1 -1
  14. package/lib/credits/core/credits.d.ts +30 -0
  15. package/lib/credits/core/credits.d.ts.map +1 -1
  16. package/lib/credits/core/credits.js +35 -0
  17. package/lib/credits/core/credits.js.map +1 -1
  18. package/lib/download/core/downloadFigure.d.ts +12 -1
  19. package/lib/download/core/downloadFigure.d.ts.map +1 -1
  20. package/lib/download/core/downloadFigure.js +21 -0
  21. package/lib/download/core/downloadFigure.js.map +1 -1
  22. package/lib/download/core/figureDpi.d.ts +59 -0
  23. package/lib/download/core/figureDpi.d.ts.map +1 -0
  24. package/lib/download/core/figureDpi.js +75 -0
  25. package/lib/download/core/figureDpi.js.map +1 -0
  26. package/lib/download/core/figurePng.d.ts +4 -1
  27. package/lib/download/core/figurePng.d.ts.map +1 -1
  28. package/lib/download/core/figurePng.js +11 -2
  29. package/lib/download/core/figurePng.js.map +1 -1
  30. package/lib/download/core/index.d.ts +4 -1
  31. package/lib/download/core/index.d.ts.map +1 -1
  32. package/lib/download/core/index.js +3 -1
  33. package/lib/download/core/index.js.map +1 -1
  34. package/lib/download/core/pngDpi.d.ts +22 -0
  35. package/lib/download/core/pngDpi.d.ts.map +1 -0
  36. package/lib/download/core/pngDpi.js +79 -0
  37. package/lib/download/core/pngDpi.js.map +1 -0
  38. package/lib/download/ui/FigureDownloadPanel.d.ts +13 -0
  39. package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
  40. package/lib/download/ui/FigureDownloadPanel.js +18 -34
  41. package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
  42. package/lib/download/ui/figureDownloadHint.d.ts +5 -0
  43. package/lib/download/ui/figureDownloadHint.d.ts.map +1 -1
  44. package/lib/download/ui/figureDownloadHint.js +8 -0
  45. package/lib/download/ui/figureDownloadHint.js.map +1 -1
  46. package/lib/download/ui/figureDownloadOptions.d.ts +84 -0
  47. package/lib/download/ui/figureDownloadOptions.d.ts.map +1 -0
  48. package/lib/download/ui/figureDownloadOptions.js +2 -0
  49. package/lib/download/ui/figureDownloadOptions.js.map +1 -0
  50. package/lib/download/ui/resolutionChoices.d.ts +27 -0
  51. package/lib/download/ui/resolutionChoices.d.ts.map +1 -0
  52. package/lib/download/ui/resolutionChoices.js +48 -0
  53. package/lib/download/ui/resolutionChoices.js.map +1 -0
  54. package/lib/download/ui/useFigureActions.d.ts +4 -1
  55. package/lib/download/ui/useFigureActions.d.ts.map +1 -1
  56. package/lib/download/ui/useFigureActions.js +17 -8
  57. package/lib/download/ui/useFigureActions.js.map +1 -1
  58. package/lib/download/ui/useFigureDownload.d.ts +2 -55
  59. package/lib/download/ui/useFigureDownload.d.ts.map +1 -1
  60. package/lib/download/ui/useFigureDownload.js +45 -13
  61. package/lib/download/ui/useFigureDownload.js.map +1 -1
  62. package/lib/ecosystem/core/sites.d.ts.map +1 -1
  63. package/lib/ecosystem/core/sites.js +14 -0
  64. package/lib/ecosystem/core/sites.js.map +1 -1
  65. package/lib/ecosystem/core/types.d.ts +1 -1
  66. package/lib/ecosystem/core/types.d.ts.map +1 -1
  67. package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
  68. package/lib/ecosystem/ui/glyphs.js +3 -0
  69. package/lib/ecosystem/ui/glyphs.js.map +1 -1
  70. package/lib/host/core/connectHost.js +1 -1
  71. package/lib/host/core/connectHost.js.map +1 -1
  72. package/lib/host/core/connectTool.d.ts +103 -0
  73. package/lib/host/core/connectTool.d.ts.map +1 -0
  74. package/lib/host/core/connectTool.js +169 -0
  75. package/lib/host/core/connectTool.js.map +1 -0
  76. package/lib/host/core/hostOutputs.d.ts +16 -3
  77. package/lib/host/core/hostOutputs.d.ts.map +1 -1
  78. package/lib/host/core/hostOutputs.js +38 -4
  79. package/lib/host/core/hostOutputs.js.map +1 -1
  80. package/lib/host/core/index.d.ts +8 -2
  81. package/lib/host/core/index.d.ts.map +1 -1
  82. package/lib/host/core/index.js +4 -1
  83. package/lib/host/core/index.js.map +1 -1
  84. package/lib/host/core/kinds.d.ts +31 -3
  85. package/lib/host/core/kinds.d.ts.map +1 -1
  86. package/lib/host/core/kinds.js +35 -4
  87. package/lib/host/core/kinds.js.map +1 -1
  88. package/lib/host/core/messageValues.d.ts +29 -0
  89. package/lib/host/core/messageValues.d.ts.map +1 -0
  90. package/lib/host/core/messageValues.js +57 -0
  91. package/lib/host/core/messageValues.js.map +1 -0
  92. package/lib/host/core/protocol.d.ts +2 -5
  93. package/lib/host/core/protocol.d.ts.map +1 -1
  94. package/lib/host/core/protocol.js +3 -37
  95. package/lib/host/core/protocol.js.map +1 -1
  96. package/lib/host/core/resultKinds.d.ts +74 -0
  97. package/lib/host/core/resultKinds.d.ts.map +1 -0
  98. package/lib/host/core/resultKinds.js +40 -0
  99. package/lib/host/core/resultKinds.js.map +1 -0
  100. package/lib/host/core/toolMessages.d.ts +24 -0
  101. package/lib/host/core/toolMessages.d.ts.map +1 -0
  102. package/lib/host/core/toolMessages.js +136 -0
  103. package/lib/host/core/toolMessages.js.map +1 -0
  104. package/lib/host/ui/index.d.ts +2 -0
  105. package/lib/host/ui/index.d.ts.map +1 -1
  106. package/lib/host/ui/index.js +1 -0
  107. package/lib/host/ui/index.js.map +1 -1
  108. package/lib/host/ui/useFramedTool.d.ts +74 -0
  109. package/lib/host/ui/useFramedTool.d.ts.map +1 -0
  110. package/lib/host/ui/useFramedTool.js +125 -0
  111. package/lib/host/ui/useFramedTool.js.map +1 -0
  112. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  113. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  114. package/lib/locales/de.json +30 -1
  115. package/lib/locales/en.json +30 -1
  116. package/lib/locales/es.json +30 -1
  117. package/lib/locales/fr.json +30 -1
  118. package/lib/locales/it.json +30 -1
  119. package/lib/molecule3d/ui/Molecule3DStage.d.ts +4 -33
  120. package/lib/molecule3d/ui/Molecule3DStage.d.ts.map +1 -1
  121. package/lib/molecule3d/ui/Molecule3DStage.js +3 -37
  122. package/lib/molecule3d/ui/Molecule3DStage.js.map +1 -1
  123. package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
  124. package/lib/molecule3d/ui/MoleculeCanvas3D.js +10 -2
  125. package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
  126. package/lib/molecule3d/ui/exportMoleculeImage.d.ts +10 -0
  127. package/lib/molecule3d/ui/exportMoleculeImage.d.ts.map +1 -1
  128. package/lib/molecule3d/ui/exportMoleculeImage.js +17 -0
  129. package/lib/molecule3d/ui/exportMoleculeImage.js.map +1 -1
  130. package/lib/molecule3d/ui/index.d.ts +1 -1
  131. package/lib/molecule3d/ui/index.d.ts.map +1 -1
  132. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +23 -0
  133. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
  134. package/lib/molecule3d/ui/useImageExport.d.ts +3 -0
  135. package/lib/molecule3d/ui/useImageExport.d.ts.map +1 -1
  136. package/lib/molecule3d/ui/useImageExport.js +21 -3
  137. package/lib/molecule3d/ui/useImageExport.js.map +1 -1
  138. package/lib/osiris/core/barGeometry.d.ts +42 -0
  139. package/lib/osiris/core/barGeometry.d.ts.map +1 -0
  140. package/lib/osiris/core/barGeometry.js +46 -0
  141. package/lib/osiris/core/barGeometry.js.map +1 -0
  142. package/lib/osiris/core/computeProperties.d.ts +42 -0
  143. package/lib/osiris/core/computeProperties.d.ts.map +1 -0
  144. package/lib/osiris/core/computeProperties.js +115 -0
  145. package/lib/osiris/core/computeProperties.js.map +1 -0
  146. package/lib/osiris/core/constants.d.ts +70 -0
  147. package/lib/osiris/core/constants.d.ts.map +1 -0
  148. package/lib/osiris/core/constants.js +99 -0
  149. package/lib/osiris/core/constants.js.map +1 -0
  150. package/lib/osiris/core/fitness.d.ts +32 -0
  151. package/lib/osiris/core/fitness.d.ts.map +1 -0
  152. package/lib/osiris/core/fitness.js +48 -0
  153. package/lib/osiris/core/fitness.js.map +1 -0
  154. package/lib/osiris/core/index.d.ts +29 -0
  155. package/lib/osiris/core/index.d.ts.map +1 -0
  156. package/lib/osiris/core/index.js +19 -0
  157. package/lib/osiris/core/index.js.map +1 -0
  158. package/lib/osiris/core/poolSize.d.ts +17 -0
  159. package/lib/osiris/core/poolSize.d.ts.map +1 -0
  160. package/lib/osiris/core/poolSize.js +22 -0
  161. package/lib/osiris/core/poolSize.js.map +1 -0
  162. package/lib/osiris/core/poolTypes.d.ts +140 -0
  163. package/lib/osiris/core/poolTypes.d.ts.map +1 -0
  164. package/lib/osiris/core/poolTypes.js +12 -0
  165. package/lib/osiris/core/poolTypes.js.map +1 -0
  166. package/lib/osiris/core/predictIdCode.d.ts +39 -0
  167. package/lib/osiris/core/predictIdCode.d.ts.map +1 -0
  168. package/lib/osiris/core/predictIdCode.js +54 -0
  169. package/lib/osiris/core/predictIdCode.js.map +1 -0
  170. package/lib/osiris/core/predictProtocol.d.ts +67 -0
  171. package/lib/osiris/core/predictProtocol.d.ts.map +1 -0
  172. package/lib/osiris/core/predictProtocol.js +29 -0
  173. package/lib/osiris/core/predictProtocol.js.map +1 -0
  174. package/lib/osiris/core/predictionPool.d.ts +23 -0
  175. package/lib/osiris/core/predictionPool.d.ts.map +1 -0
  176. package/lib/osiris/core/predictionPool.js +186 -0
  177. package/lib/osiris/core/predictionPool.js.map +1 -0
  178. package/lib/osiris/core/predictionQueue.d.ts +46 -0
  179. package/lib/osiris/core/predictionQueue.d.ts.map +1 -0
  180. package/lib/osiris/core/predictionQueue.js +57 -0
  181. package/lib/osiris/core/predictionQueue.js.map +1 -0
  182. package/lib/osiris/core/predictors.d.ts +62 -0
  183. package/lib/osiris/core/predictors.d.ts.map +1 -0
  184. package/lib/osiris/core/predictors.js +100 -0
  185. package/lib/osiris/core/predictors.js.map +1 -0
  186. package/lib/osiris/core/propertyKeys.d.ts +32 -0
  187. package/lib/osiris/core/propertyKeys.d.ts.map +1 -0
  188. package/lib/osiris/core/propertyKeys.js +44 -0
  189. package/lib/osiris/core/propertyKeys.js.map +1 -0
  190. package/lib/osiris/core/riskAppearance.d.ts +60 -0
  191. package/lib/osiris/core/riskAppearance.d.ts.map +1 -0
  192. package/lib/osiris/core/riskAppearance.js +59 -0
  193. package/lib/osiris/core/riskAppearance.js.map +1 -0
  194. package/lib/osiris/core/riskDetail.d.ts +22 -0
  195. package/lib/osiris/core/riskDetail.d.ts.map +1 -0
  196. package/lib/osiris/core/riskDetail.js +86 -0
  197. package/lib/osiris/core/riskDetail.js.map +1 -0
  198. package/lib/osiris/core/riskDetailRequest.d.ts +31 -0
  199. package/lib/osiris/core/riskDetailRequest.d.ts.map +1 -0
  200. package/lib/osiris/core/riskDetailRequest.js +49 -0
  201. package/lib/osiris/core/riskDetailRequest.js.map +1 -0
  202. package/lib/osiris/core/riskFindings.d.ts +26 -0
  203. package/lib/osiris/core/riskFindings.d.ts.map +1 -0
  204. package/lib/osiris/core/riskFindings.js +79 -0
  205. package/lib/osiris/core/riskFindings.js.map +1 -0
  206. package/lib/osiris/core/runPredictionJob.d.ts +20 -0
  207. package/lib/osiris/core/runPredictionJob.d.ts.map +1 -0
  208. package/lib/osiris/core/runPredictionJob.js +43 -0
  209. package/lib/osiris/core/runPredictionJob.js.map +1 -0
  210. package/lib/osiris/core/scales.d.ts +70 -0
  211. package/lib/osiris/core/scales.d.ts.map +1 -0
  212. package/lib/osiris/core/scales.js +185 -0
  213. package/lib/osiris/core/scales.js.map +1 -0
  214. package/lib/osiris/core/types.d.ts +91 -0
  215. package/lib/osiris/core/types.d.ts.map +1 -0
  216. package/lib/osiris/core/types.js +19 -0
  217. package/lib/osiris/core/types.js.map +1 -0
  218. package/lib/osiris/core/valuation.d.ts +28 -0
  219. package/lib/osiris/core/valuation.d.ts.map +1 -0
  220. package/lib/osiris/core/valuation.js +39 -0
  221. package/lib/osiris/core/valuation.js.map +1 -0
  222. package/lib/osiris/ui/PropertyBar.d.ts +27 -0
  223. package/lib/osiris/ui/PropertyBar.d.ts.map +1 -0
  224. package/lib/osiris/ui/PropertyBar.js +27 -0
  225. package/lib/osiris/ui/PropertyBar.js.map +1 -0
  226. package/lib/osiris/ui/PropertyPanel.d.ts +91 -0
  227. package/lib/osiris/ui/PropertyPanel.d.ts.map +1 -0
  228. package/lib/osiris/ui/PropertyPanel.js +77 -0
  229. package/lib/osiris/ui/PropertyPanel.js.map +1 -0
  230. package/lib/osiris/ui/PropertyRows.d.ts +40 -0
  231. package/lib/osiris/ui/PropertyRows.d.ts.map +1 -0
  232. package/lib/osiris/ui/PropertyRows.js +23 -0
  233. package/lib/osiris/ui/PropertyRows.js.map +1 -0
  234. package/lib/osiris/ui/RiskFindings.d.ts +43 -0
  235. package/lib/osiris/ui/RiskFindings.d.ts.map +1 -0
  236. package/lib/osiris/ui/RiskFindings.js +51 -0
  237. package/lib/osiris/ui/RiskFindings.js.map +1 -0
  238. package/lib/osiris/ui/RiskPanel.d.ts +46 -0
  239. package/lib/osiris/ui/RiskPanel.d.ts.map +1 -0
  240. package/lib/osiris/ui/RiskPanel.js +32 -0
  241. package/lib/osiris/ui/RiskPanel.js.map +1 -0
  242. package/lib/osiris/ui/RiskSquare.d.ts +51 -0
  243. package/lib/osiris/ui/RiskSquare.d.ts.map +1 -0
  244. package/lib/osiris/ui/RiskSquare.js +23 -0
  245. package/lib/osiris/ui/RiskSquare.js.map +1 -0
  246. package/lib/osiris/ui/index.d.ts +15 -0
  247. package/lib/osiris/ui/index.d.ts.map +1 -0
  248. package/lib/osiris/ui/index.js +8 -0
  249. package/lib/osiris/ui/index.js.map +1 -0
  250. package/lib/osiris/ui/usePredictions.d.ts +81 -0
  251. package/lib/osiris/ui/usePredictions.d.ts.map +1 -0
  252. package/lib/osiris/ui/usePredictions.js +102 -0
  253. package/lib/osiris/ui/usePredictions.js.map +1 -0
  254. package/lib/osiris-ui.d.ts +11 -0
  255. package/lib/osiris-ui.d.ts.map +1 -0
  256. package/lib/osiris-ui.js +11 -0
  257. package/lib/osiris-ui.js.map +1 -0
  258. package/lib/osiris.d.ts +17 -0
  259. package/lib/osiris.d.ts.map +1 -0
  260. package/lib/osiris.js +17 -0
  261. package/lib/osiris.js.map +1 -0
  262. package/lib/panel/ui/FilterInput.d.ts.map +1 -1
  263. package/lib/panel/ui/FilterInput.js +3 -1
  264. package/lib/panel/ui/FilterInput.js.map +1 -1
  265. package/lib/panel/ui/SidePanelItem.d.ts +39 -0
  266. package/lib/panel/ui/SidePanelItem.d.ts.map +1 -0
  267. package/lib/panel/ui/SidePanelItem.js +63 -0
  268. package/lib/panel/ui/SidePanelItem.js.map +1 -0
  269. package/lib/panel/ui/SidePanelStack.d.ts +11 -10
  270. package/lib/panel/ui/SidePanelStack.d.ts.map +1 -1
  271. package/lib/panel/ui/SidePanelStack.js +22 -15
  272. package/lib/panel/ui/SidePanelStack.js.map +1 -1
  273. package/lib/panel/ui/SpectrumColorSwatch.d.ts.map +1 -1
  274. package/lib/panel/ui/SpectrumColorSwatch.js +4 -2
  275. package/lib/panel/ui/SpectrumColorSwatch.js.map +1 -1
  276. package/lib/panel/ui/usePanelFolds.d.ts +35 -0
  277. package/lib/panel/ui/usePanelFolds.d.ts.map +1 -0
  278. package/lib/panel/ui/usePanelFolds.js +73 -0
  279. package/lib/panel/ui/usePanelFolds.js.map +1 -0
  280. package/lib/shared/ui/FullscreenStage.d.ts +43 -0
  281. package/lib/shared/ui/FullscreenStage.d.ts.map +1 -0
  282. package/lib/shared/ui/FullscreenStage.js +38 -0
  283. package/lib/shared/ui/FullscreenStage.js.map +1 -0
  284. package/lib/shared/ui/canFillScreen.d.ts +7 -0
  285. package/lib/shared/ui/canFillScreen.d.ts.map +1 -0
  286. package/lib/shared/ui/canFillScreen.js +9 -0
  287. package/lib/shared/ui/canFillScreen.js.map +1 -0
  288. package/lib/shared/ui/index.d.ts +3 -0
  289. package/lib/shared/ui/index.d.ts.map +1 -1
  290. package/lib/shared/ui/index.js +2 -0
  291. package/lib/shared/ui/index.js.map +1 -1
  292. package/lib/split/ui/splitPanes.d.ts +3 -3
  293. package/lib/split/ui/splitPanes.js +1 -1
  294. package/lib/structure/core/structureNotations.d.ts +8 -1
  295. package/lib/structure/core/structureNotations.d.ts.map +1 -1
  296. package/lib/structure/core/structureNotations.js +14 -8
  297. package/lib/structure/core/structureNotations.js.map +1 -1
  298. package/lib/structure/ui/StructureExportPanel.d.ts +8 -0
  299. package/lib/structure/ui/StructureExportPanel.d.ts.map +1 -1
  300. package/lib/structure/ui/StructureExportPanel.js +9 -4
  301. package/lib/structure/ui/StructureExportPanel.js.map +1 -1
  302. package/lib/structure/ui/index.d.ts +1 -0
  303. package/lib/structure/ui/index.d.ts.map +1 -1
  304. package/lib/structure/ui/index.js.map +1 -1
  305. package/package.json +4 -1
  306. package/src/card/core/cardAddress.ts +39 -3
  307. package/src/card/core/cardPageUrl.ts +10 -3
  308. package/src/card/core/index.ts +7 -1
  309. package/src/credits/core/credits.ts +40 -0
  310. package/src/download/core/downloadFigure.ts +26 -1
  311. package/src/download/core/figureDpi.ts +94 -0
  312. package/src/download/core/figurePng.ts +11 -2
  313. package/src/download/core/index.ts +13 -1
  314. package/src/download/core/pngDpi.ts +84 -0
  315. package/src/download/ui/FigureDownloadPanel.tsx +41 -51
  316. package/src/download/ui/figureDownloadHint.ts +13 -0
  317. package/src/download/ui/figureDownloadOptions.ts +85 -0
  318. package/src/download/ui/resolutionChoices.ts +67 -0
  319. package/src/download/ui/useFigureActions.ts +24 -9
  320. package/src/download/ui/useFigureDownload.tsx +57 -71
  321. package/src/ecosystem/core/sites.ts +14 -0
  322. package/src/ecosystem/core/types.ts +2 -1
  323. package/src/ecosystem/ui/glyphs.tsx +20 -0
  324. package/src/host/core/connectHost.ts +1 -1
  325. package/src/host/core/connectTool.ts +285 -0
  326. package/src/host/core/hostOutputs.ts +47 -5
  327. package/src/host/core/index.ts +20 -1
  328. package/src/host/core/kinds.ts +53 -8
  329. package/src/host/core/messageValues.ts +58 -0
  330. package/src/host/core/protocol.ts +5 -37
  331. package/src/host/core/resultKinds.ts +65 -0
  332. package/src/host/core/toolMessages.ts +160 -0
  333. package/src/host/ui/index.ts +6 -0
  334. package/src/host/ui/useFramedTool.ts +213 -0
  335. package/src/locales/de.json +30 -1
  336. package/src/locales/en.json +30 -1
  337. package/src/locales/es.json +30 -1
  338. package/src/locales/fr.json +30 -1
  339. package/src/locales/it.json +30 -1
  340. package/src/molecule3d/ui/Molecule3DStage.tsx +4 -88
  341. package/src/molecule3d/ui/MoleculeCanvas3D.tsx +10 -1
  342. package/src/molecule3d/ui/exportMoleculeImage.ts +22 -0
  343. package/src/molecule3d/ui/index.ts +4 -1
  344. package/src/molecule3d/ui/moleculeViewer3DProps.ts +24 -0
  345. package/src/molecule3d/ui/useImageExport.ts +28 -2
  346. package/src/osiris/core/barGeometry.ts +74 -0
  347. package/src/osiris/core/computeProperties.ts +175 -0
  348. package/src/osiris/core/constants.ts +110 -0
  349. package/src/osiris/core/fitness.ts +59 -0
  350. package/src/osiris/core/index.ts +78 -0
  351. package/src/osiris/core/poolSize.ts +24 -0
  352. package/src/osiris/core/poolTypes.ts +140 -0
  353. package/src/osiris/core/predictIdCode.ts +69 -0
  354. package/src/osiris/core/predictProtocol.ts +78 -0
  355. package/src/osiris/core/predictionPool.ts +237 -0
  356. package/src/osiris/core/predictionQueue.ts +89 -0
  357. package/src/osiris/core/predictors.ts +142 -0
  358. package/src/osiris/core/propertyKeys.ts +54 -0
  359. package/src/osiris/core/riskAppearance.ts +86 -0
  360. package/src/osiris/core/riskDetail.ts +120 -0
  361. package/src/osiris/core/riskDetailRequest.ts +64 -0
  362. package/src/osiris/core/riskFindings.ts +92 -0
  363. package/src/osiris/core/runPredictionJob.ts +49 -0
  364. package/src/osiris/core/scales.ts +236 -0
  365. package/src/osiris/core/types.ts +103 -0
  366. package/src/osiris/core/valuation.ts +44 -0
  367. package/src/osiris/ui/PropertyBar.tsx +77 -0
  368. package/src/osiris/ui/PropertyPanel.tsx +227 -0
  369. package/src/osiris/ui/PropertyRows.tsx +92 -0
  370. package/src/osiris/ui/RiskFindings.tsx +137 -0
  371. package/src/osiris/ui/RiskPanel.tsx +81 -0
  372. package/src/osiris/ui/RiskSquare.tsx +108 -0
  373. package/src/osiris/ui/index.ts +17 -0
  374. package/src/osiris/ui/usePredictions.ts +194 -0
  375. package/src/osiris-ui.ts +11 -0
  376. package/src/osiris.ts +17 -0
  377. package/src/panel/ui/FilterInput.tsx +4 -1
  378. package/src/panel/ui/SidePanelItem.tsx +162 -0
  379. package/src/panel/ui/SidePanelStack.tsx +29 -36
  380. package/src/panel/ui/SpectrumColorSwatch.tsx +5 -3
  381. package/src/panel/ui/usePanelFolds.ts +103 -0
  382. package/src/shared/ui/FullscreenStage.tsx +96 -0
  383. package/src/shared/ui/canFillScreen.ts +8 -0
  384. package/src/shared/ui/index.ts +6 -0
  385. package/src/split/ui/splitPanes.tsx +4 -4
  386. package/src/structure/core/structureNotations.ts +25 -8
  387. package/src/structure/ui/StructureExportPanel.tsx +23 -4
  388. package/src/structure/ui/index.ts +4 -0
  389. package/styles/osiris.css +339 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Where a property's bar starts, how far it runs, and where its labelled mark
3
+ * goes.
4
+ *
5
+ * Three numbers come out of the domain and are merely arranged here. The
6
+ * **position** is how far along the scale the value sits and gives the bar its
7
+ * length; the **fitness** is DataWarrior's own `getValuation`, a continuous
8
+ * 0-to-1 score that the stylesheet reads as the green-to-red ramp; the
9
+ * **threshold** is the published rule of thumb — cLogP ≤ 5, logS > −4,
10
+ * molweight < 450, drug-likeness > 0 — drawn as a mark on the track.
11
+ *
12
+ * Nothing here invents a cut-off. A bar whose colour disagreed with the panel's
13
+ * own scale record would be a second opinion nobody could trace.
14
+ */
15
+ import type { PropertyKey } from './propertyKeys.ts';
16
+ /** Where a bar's fill and its mark go, all as fractions of the track. */
17
+ export interface BarGeometry {
18
+ /** Where the fill starts, 0 at the left end of the track and 1 at the right. */
19
+ start: number;
20
+ /** How much of the track the fill covers, 0 to 1. */
21
+ length: number;
22
+ /** How good the value is: 0 as bad as the ramp goes, 1 inside the preferred band. */
23
+ fitness: number;
24
+ /**
25
+ * Where the fill grows from: the left end of the track, or its middle for a
26
+ * quantity that runs either side of zero. Drawn as a tick, because a fill
27
+ * that starts at a quarter of the way along says nothing without it.
28
+ */
29
+ origin: number;
30
+ /** Where the published threshold is marked, or `null` where the property has none. */
31
+ mark: number | null;
32
+ /** How that threshold reads, e.g. `≤ 5`, or `null`. */
33
+ markLabel: string | null;
34
+ }
35
+ /**
36
+ * Lay out one property's bar.
37
+ * @param key - Which of the ten properties.
38
+ * @param value - The predicted number, or `null` when the predictor could not answer.
39
+ * @returns The geometry, or `null` when there is no bar to draw.
40
+ */
41
+ export declare function barGeometry(key: PropertyKey, value: number | null): BarGeometry | null;
42
+ //# sourceMappingURL=barGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barGeometry.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/barGeometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,uDAAuD;IACvD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAQD;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,WAAW,GAAG,IAAI,CAmBpB"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Where a property's bar starts, how far it runs, and where its labelled mark
3
+ * goes.
4
+ *
5
+ * Three numbers come out of the domain and are merely arranged here. The
6
+ * **position** is how far along the scale the value sits and gives the bar its
7
+ * length; the **fitness** is DataWarrior's own `getValuation`, a continuous
8
+ * 0-to-1 score that the stylesheet reads as the green-to-red ramp; the
9
+ * **threshold** is the published rule of thumb — cLogP ≤ 5, logS > −4,
10
+ * molweight < 450, drug-likeness > 0 — drawn as a mark on the track.
11
+ *
12
+ * Nothing here invents a cut-off. A bar whose colour disagreed with the panel's
13
+ * own scale record would be a second opinion nobody could trace.
14
+ */
15
+ import { propertyFitness, propertyPosition } from "./fitness.js";
16
+ import { propertyScale } from "./scales.js";
17
+ /**
18
+ * Where a diverging bar grows from: the middle of its own range, which is
19
+ * drug-likeness 0 and drug score 0.
20
+ */
21
+ const DIVERGING_ORIGIN = 0.5;
22
+ /**
23
+ * Lay out one property's bar.
24
+ * @param key - Which of the ten properties.
25
+ * @param value - The predicted number, or `null` when the predictor could not answer.
26
+ * @returns The geometry, or `null` when there is no bar to draw.
27
+ */
28
+ export function barGeometry(key, value) {
29
+ const position = propertyPosition(key, value);
30
+ if (position === null)
31
+ return null;
32
+ const scale = propertyScale(key);
33
+ const origin = scale.diverging ? DIVERGING_ORIGIN : 0;
34
+ const mark = scale.threshold === null
35
+ ? null
36
+ : propertyPosition(key, scale.threshold.value);
37
+ return {
38
+ start: Math.min(origin, position),
39
+ length: Math.abs(position - origin),
40
+ fitness: propertyFitness(key, value) ?? 0,
41
+ origin,
42
+ mark,
43
+ markLabel: scale.threshold?.label ?? null,
44
+ };
45
+ }
46
+ //# sourceMappingURL=barGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barGeometry.js","sourceRoot":"","sources":["../../../src/osiris/core/barGeometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAsB5C;;;GAGG;AACH,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CACzB,GAAgB,EAChB,KAAoB;IAEpB,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9C,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEnC,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,IAAI,GACR,KAAK,CAAC,SAAS,KAAK,IAAI;QACtB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAEnD,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC;QACjC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC;QACnC,OAAO,EAAE,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC;QACzC,MAAM;QACN,IAAI;QACJ,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,IAAI,IAAI;KAC1C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Everything the tool predicts about one molecule, in one pass.
3
+ *
4
+ * The order of the reads is not arbitrary. `MoleculeProperties`' constructor
5
+ * normalises ambiguous bonds on the molecule it is handed, so the work is done
6
+ * on a copy and the caller's molecule — the one the editor is still drawing —
7
+ * is never touched. Its fields are prototype getters that rerun the whole
8
+ * predictor on every read, at 13 µs each, and the object cannot be spread or
9
+ * serialised at all, so each field is read exactly once into a plain object,
10
+ * and that plain object is what crosses the worker boundary.
11
+ *
12
+ * Nothing here trusts OpenChemLib to fail loudly. An empty molecule answers a
13
+ * full set of innocent numbers and a drug score of 0.63; a failed predictor
14
+ * answers -999, -1 or 0, never `NaN`; and `DrugScoreCalculator` consumes every
15
+ * one of those and returns something plausible. So the empty molecule is
16
+ * refused first, every sentinel becomes `null`, and a drug score is computed
17
+ * only when all of its inputs are real.
18
+ */
19
+ import type * as OCL from 'openchemlib';
20
+ import type { OsirisPredictors } from './predictors.ts';
21
+ import type { OsirisProperties } from './types.ts';
22
+ /** What a caller knows about the molecule that the molecule does not. */
23
+ export interface ComputePropertiesOptions {
24
+ /**
25
+ * The name the source carried. The canonical SMILES is used when there is
26
+ * none, so a row always has something to be called.
27
+ * @default the canonical SMILES
28
+ */
29
+ label?: string;
30
+ }
31
+ /** A structure with no atoms, which has nothing to predict. */
32
+ export declare const EMPTY_MOLECULE_MESSAGE = "This structure has no atoms, so there is nothing to predict.";
33
+ /**
34
+ * Predict everything the tool shows for one molecule.
35
+ * @param molecule - The molecule. It is copied before anything touches it, so the caller keeps it exactly as it was.
36
+ * @param predictors - OpenChemLib with its resources registered and checked.
37
+ * @param options - See {@link ComputePropertiesOptions}.
38
+ * @returns The ten numbers, the four risks, and what to call the molecule.
39
+ * @throws {Error} When the molecule has no atoms.
40
+ */
41
+ export declare function computeProperties(molecule: OCL.Molecule, predictors: OsirisPredictors, options?: ComputePropertiesOptions): OsirisProperties;
42
+ //# sourceMappingURL=computeProperties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeProperties.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/computeProperties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,KAAK,GAAG,MAAM,aAAa,CAAC;AAUxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,YAAY,CAAC;AAGxE,yEAAyE;AACzE,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,iEAC6B,CAAC;AAEjE;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,GAAG,CAAC,QAAQ,EACtB,UAAU,EAAE,gBAAgB,EAC5B,OAAO,GAAE,wBAA6B,GACrC,gBAAgB,CAmDlB"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Everything the tool predicts about one molecule, in one pass.
3
+ *
4
+ * The order of the reads is not arbitrary. `MoleculeProperties`' constructor
5
+ * normalises ambiguous bonds on the molecule it is handed, so the work is done
6
+ * on a copy and the caller's molecule — the one the editor is still drawing —
7
+ * is never touched. Its fields are prototype getters that rerun the whole
8
+ * predictor on every read, at 13 µs each, and the object cannot be spread or
9
+ * serialised at all, so each field is read exactly once into a plain object,
10
+ * and that plain object is what crosses the worker boundary.
11
+ *
12
+ * Nothing here trusts OpenChemLib to fail loudly. An empty molecule answers a
13
+ * full set of innocent numbers and a drug score of 0.63; a failed predictor
14
+ * answers -999, -1 or 0, never `NaN`; and `DrugScoreCalculator` consumes every
15
+ * one of those and returns something plausible. So the empty molecule is
16
+ * refused first, every sentinel becomes `null`, and a drug score is computed
17
+ * only when all of its inputs are real.
18
+ */
19
+ import { NO_FRAGMENT_MATCHED, RISK_TYPE_CODES, UNKNOWN_NUMBER, UNKNOWN_SURFACE_AREA, riskCodeOf, riskLevelOf, } from "./constants.js";
20
+ import { RISK_TYPES } from "./types.js";
21
+ /** A structure with no atoms, which has nothing to predict. */
22
+ export const EMPTY_MOLECULE_MESSAGE = 'This structure has no atoms, so there is nothing to predict.';
23
+ /**
24
+ * Predict everything the tool shows for one molecule.
25
+ * @param molecule - The molecule. It is copied before anything touches it, so the caller keeps it exactly as it was.
26
+ * @param predictors - OpenChemLib with its resources registered and checked.
27
+ * @param options - See {@link ComputePropertiesOptions}.
28
+ * @returns The ten numbers, the four risks, and what to call the molecule.
29
+ * @throws {Error} When the molecule has no atoms.
30
+ */
31
+ export function computeProperties(molecule, predictors, options = {}) {
32
+ if (molecule.getAllAtoms() === 0)
33
+ throw new Error(EMPTY_MOLECULE_MESSAGE);
34
+ const working = molecule.getCompactCopy();
35
+ const idCode = working.getIDCode();
36
+ const smiles = working.toIsomericSmiles();
37
+ const { formula, relativeWeight } = working.getMolecularFormula();
38
+ const properties = new predictors.MoleculeProperties(working);
39
+ const logP = real(properties.logP, UNKNOWN_NUMBER);
40
+ const logS = real(properties.logS, UNKNOWN_NUMBER);
41
+ const polarSurfaceArea = real(properties.polarSurfaceArea, UNKNOWN_SURFACE_AREA);
42
+ const acceptorCount = properties.acceptorCount;
43
+ const donorCount = properties.donorCount;
44
+ const stereoCenterCount = properties.stereoCenterCount;
45
+ const rotatableBondCount = properties.rotatableBondCount;
46
+ const assessed = predictors.druglikeness.assessDruglikeness(working);
47
+ const druglikeness = assessed === UNKNOWN_NUMBER || assessed === NO_FRAGMENT_MATCHED
48
+ ? null
49
+ : assessed;
50
+ const risks = assessRisks(working, predictors);
51
+ return {
52
+ idCode,
53
+ smiles,
54
+ label: options.label ?? smiles,
55
+ molecularFormula: formula,
56
+ molecularWeight: relativeWeight,
57
+ logP,
58
+ logS,
59
+ polarSurfaceArea,
60
+ druglikeness,
61
+ drugScore: drugScore(predictors, {
62
+ logP,
63
+ logS,
64
+ relativeWeight,
65
+ druglikeness,
66
+ risks,
67
+ }),
68
+ acceptorCount,
69
+ donorCount,
70
+ stereoCenterCount,
71
+ rotatableBondCount,
72
+ risks,
73
+ };
74
+ }
75
+ function assessRisks(molecule, predictors) {
76
+ const risks = {};
77
+ for (const risk of RISK_TYPES) {
78
+ risks[risk] = riskLevelOf(predictors.toxicity.assessRisk(molecule, RISK_TYPE_CODES[risk]));
79
+ }
80
+ return risks;
81
+ }
82
+ /**
83
+ * The drug score, or `null` when any of its five inputs was unknown.
84
+ *
85
+ * `calculate` never refuses: a drug-likeness of -999 simply makes that factor
86
+ * exactly 0.5 and the score comes back looking ordinary, and an unassessed risk
87
+ * applies no penalty where a high one would have applied 0.6. Both read as good
88
+ * news, which is why they are refused here instead.
89
+ *
90
+ * The second argument is the **solubility**. The legacy explorer passed the
91
+ * polar surface area, which is a different number in a different unit; see the
92
+ * test that pins both.
93
+ * @param predictors - OpenChemLib with its resources registered and checked.
94
+ * @param inputs - The four predicted numbers and the four risks.
95
+ * @returns The score, or `null` when it cannot be trusted.
96
+ */
97
+ function drugScore(predictors, inputs) {
98
+ const { logP, logS, relativeWeight, druglikeness, risks } = inputs;
99
+ if (logP === null || logS === null || druglikeness === null)
100
+ return null;
101
+ const codes = [];
102
+ for (const risk of RISK_TYPES) {
103
+ const level = risks[risk];
104
+ if (level === 'unknown')
105
+ return null;
106
+ codes.push(riskCodeOf(level));
107
+ }
108
+ return predictors.DrugScoreCalculator.calculate(logP, logS, relativeWeight, druglikeness, codes);
109
+ }
110
+ function real(value, sentinel) {
111
+ if (value === sentinel || !Number.isFinite(value))
112
+ return null;
113
+ return value;
114
+ }
115
+ //# sourceMappingURL=computeProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeProperties.js","sourceRoot":"","sources":["../../../src/osiris/core/computeProperties.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The numbers OpenChemLib speaks, and the words this site says instead.
3
+ *
4
+ * Two translations live here and nowhere else. The first is the library's risk
5
+ * numbering, which is easy to get backwards: `ToxicityPredictor.RISK_NAMES` is
6
+ * indexed by risk *type*, not by risk *level*, and the library exports no level
7
+ * names at all — so reading a level out of `RISK_NAMES` gives a confident,
8
+ * wrong answer. The second is the set of sentinels every predictor returns
9
+ * instead of failing: none of them is `NaN`, and `DrugScoreCalculator` consumes
10
+ * every one of them and hands back a plausible number.
11
+ */
12
+ import type { RiskLevel, RiskType } from './types.ts';
13
+ /**
14
+ * Where each risk sits in the library's numbering — `TYPE_MUTAGENIC` 0 through
15
+ * `TYPE_REPRODUCTIVE_EFFECTIVE` 3. It is also the order `DrugScoreCalculator`
16
+ * expects its `toxRisks` array in.
17
+ */
18
+ export declare const RISK_TYPE_CODES: Record<RiskType, number>;
19
+ /**
20
+ * What `assessRisk` returns, read as a word: `RISK_UNKNOWN` 0, `RISK_NO` 1,
21
+ * `RISK_LOW` 2, `RISK_HIGH` 3.
22
+ */
23
+ export declare const RISK_LEVELS: readonly RiskLevel[];
24
+ /**
25
+ * What the library calls each risk, matching `ToxicityPredictor.RISK_NAMES`.
26
+ * Written out here so reading a label costs no import of a megabyte of
27
+ * OpenChemLib on a page that only draws a table.
28
+ */
29
+ export declare const RISK_LABELS: Record<RiskType, string>;
30
+ /**
31
+ * How each level reads on screen. OSIRIS's own three words, plus one for the
32
+ * state where the tables did not load — which is not "no risk" and must never
33
+ * be shown as one.
34
+ */
35
+ export declare const RISK_LEVEL_LABELS: Record<RiskLevel, string>;
36
+ /**
37
+ * What each level multiplies the drug score by, decoded from
38
+ * `DrugScoreCalculator.calculate`. `unknown` applies no factor at all, which is
39
+ * why a score is refused rather than shown when a risk came back unassessed.
40
+ */
41
+ export declare const DRUG_SCORE_RISK_FACTORS: Record<RiskLevel, number>;
42
+ /**
43
+ * What cLogP, solubility and drug-likeness answer when the predictor failed
44
+ * outright. `CLogPPredictor` returns it on an internal exception, and both
45
+ * `SolubilityPredictor.cSolubilityUnknown` and
46
+ * `DruglikenessPredictor.DRUGLIKENESS_UNKNOWN` are this value.
47
+ */
48
+ export declare const UNKNOWN_NUMBER = -999;
49
+ /** What the polar surface area answers when it is unknown — not `-999`. */
50
+ export declare const UNKNOWN_SURFACE_AREA = -1;
51
+ /**
52
+ * What `assessDruglikeness` answers when the molecule matched none of the 5294
53
+ * fragments. It is a real return value, not a failure, and it is
54
+ * indistinguishable from a drug-likeness that happens to be exactly -1.
55
+ */
56
+ export declare const NO_FRAGMENT_MATCHED = -1;
57
+ /**
58
+ * The word for a risk the library answered with a number.
59
+ * @param code - What `assessRisk` returned, 0 to 3.
60
+ * @returns The level, `unknown` for anything outside the four the library defines.
61
+ */
62
+ export declare function riskLevelOf(code: number): RiskLevel;
63
+ /**
64
+ * The number the library uses for a level, for the `toxRisks` argument of
65
+ * `DrugScoreCalculator.calculate`.
66
+ * @param level - The level.
67
+ * @returns 0 to 3.
68
+ */
69
+ export declare function riskCodeOf(level: RiskLevel): number;
70
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAKpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAK3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAKhD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAKvD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAK7D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGnD"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The numbers OpenChemLib speaks, and the words this site says instead.
3
+ *
4
+ * Two translations live here and nowhere else. The first is the library's risk
5
+ * numbering, which is easy to get backwards: `ToxicityPredictor.RISK_NAMES` is
6
+ * indexed by risk *type*, not by risk *level*, and the library exports no level
7
+ * names at all — so reading a level out of `RISK_NAMES` gives a confident,
8
+ * wrong answer. The second is the set of sentinels every predictor returns
9
+ * instead of failing: none of them is `NaN`, and `DrugScoreCalculator` consumes
10
+ * every one of them and hands back a plausible number.
11
+ */
12
+ /**
13
+ * Where each risk sits in the library's numbering — `TYPE_MUTAGENIC` 0 through
14
+ * `TYPE_REPRODUCTIVE_EFFECTIVE` 3. It is also the order `DrugScoreCalculator`
15
+ * expects its `toxRisks` array in.
16
+ */
17
+ export const RISK_TYPE_CODES = {
18
+ mutagenic: 0,
19
+ tumorigenic: 1,
20
+ irritant: 2,
21
+ reproductive: 3,
22
+ };
23
+ /**
24
+ * What `assessRisk` returns, read as a word: `RISK_UNKNOWN` 0, `RISK_NO` 1,
25
+ * `RISK_LOW` 2, `RISK_HIGH` 3.
26
+ */
27
+ export const RISK_LEVELS = [
28
+ 'unknown',
29
+ 'none',
30
+ 'low',
31
+ 'high',
32
+ ];
33
+ /**
34
+ * What the library calls each risk, matching `ToxicityPredictor.RISK_NAMES`.
35
+ * Written out here so reading a label costs no import of a megabyte of
36
+ * OpenChemLib on a page that only draws a table.
37
+ */
38
+ export const RISK_LABELS = {
39
+ mutagenic: 'Mutagenicity',
40
+ tumorigenic: 'Tumorigenicity',
41
+ irritant: 'Irritating effects',
42
+ reproductive: 'Reproductive effects',
43
+ };
44
+ /**
45
+ * How each level reads on screen. OSIRIS's own three words, plus one for the
46
+ * state where the tables did not load — which is not "no risk" and must never
47
+ * be shown as one.
48
+ */
49
+ export const RISK_LEVEL_LABELS = {
50
+ unknown: 'Not assessed',
51
+ none: 'No risk',
52
+ low: 'Medium risk',
53
+ high: 'High risk',
54
+ };
55
+ /**
56
+ * What each level multiplies the drug score by, decoded from
57
+ * `DrugScoreCalculator.calculate`. `unknown` applies no factor at all, which is
58
+ * why a score is refused rather than shown when a risk came back unassessed.
59
+ */
60
+ export const DRUG_SCORE_RISK_FACTORS = {
61
+ unknown: 1,
62
+ none: 1,
63
+ low: 0.8,
64
+ high: 0.6,
65
+ };
66
+ /**
67
+ * What cLogP, solubility and drug-likeness answer when the predictor failed
68
+ * outright. `CLogPPredictor` returns it on an internal exception, and both
69
+ * `SolubilityPredictor.cSolubilityUnknown` and
70
+ * `DruglikenessPredictor.DRUGLIKENESS_UNKNOWN` are this value.
71
+ */
72
+ export const UNKNOWN_NUMBER = -999;
73
+ /** What the polar surface area answers when it is unknown — not `-999`. */
74
+ export const UNKNOWN_SURFACE_AREA = -1;
75
+ /**
76
+ * What `assessDruglikeness` answers when the molecule matched none of the 5294
77
+ * fragments. It is a real return value, not a failure, and it is
78
+ * indistinguishable from a drug-likeness that happens to be exactly -1.
79
+ */
80
+ export const NO_FRAGMENT_MATCHED = -1;
81
+ /**
82
+ * The word for a risk the library answered with a number.
83
+ * @param code - What `assessRisk` returned, 0 to 3.
84
+ * @returns The level, `unknown` for anything outside the four the library defines.
85
+ */
86
+ export function riskLevelOf(code) {
87
+ return RISK_LEVELS[code] ?? 'unknown';
88
+ }
89
+ /**
90
+ * The number the library uses for a level, for the `toxRisks` argument of
91
+ * `DrugScoreCalculator.calculate`.
92
+ * @param level - The level.
93
+ * @returns 0 to 3.
94
+ */
95
+ export function riskCodeOf(level) {
96
+ const code = RISK_LEVELS.indexOf(level);
97
+ return code === -1 ? 0 : code;
98
+ }
99
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/osiris/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C,SAAS;IACT,MAAM;IACN,KAAK;IACL,MAAM;CACP,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAA6B;IACnD,SAAS,EAAE,cAAc;IACzB,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,oBAAoB;IAC9B,YAAY,EAAE,sBAAsB;CACrC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA8B;IAC1D,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,aAAa;IAClB,IAAI,EAAE,WAAW;CAClB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA8B;IAChE,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,GAAG;CACV,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC;AAEnC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;AACxC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAChC,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * How good one predicted number is, from 0 to 1, and where it sits on its bar.
3
+ *
4
+ * The fitness is what the green-to-red ramp reads; the position is what the
5
+ * bar's length reads. They are deliberately two numbers: a molecular weight of
6
+ * 780 is nearly the full width of its bar and nearly the worst fitness, while
7
+ * a drug-likeness of 0 is halfway along its bar and exactly half fit.
8
+ */
9
+ import type { PropertyKey } from './propertyKeys.ts';
10
+ /**
11
+ * How well a value sits in its property's preferred band, from 0 (as bad as
12
+ * the ramp goes) to 1 (inside the band).
13
+ *
14
+ * The drug score is already that fitness — it is the product of the four
15
+ * valuations `DrugScoreCalculator` computes — so it is returned as it stands
16
+ * rather than valued a second time.
17
+ * @param key - Which of the ten properties.
18
+ * @param value - The predicted number, or `null` when the predictor could not answer.
19
+ * @returns The fitness, or `null` for an unknown value.
20
+ */
21
+ export declare function propertyFitness(key: PropertyKey, value: number | null): number | null;
22
+ /**
23
+ * Where a value sits along its bar, from 0 at the left end to 1 at the right.
24
+ *
25
+ * Clamped, because a range is a typical spread rather than a bound: cholesterol
26
+ * runs past the solubility axis and still has to draw.
27
+ * @param key - Which of the ten properties.
28
+ * @param value - The predicted number, or `null`.
29
+ * @returns The position, or `null` for an unknown value.
30
+ */
31
+ export declare function propertyPosition(key: PropertyKey, value: number | null): number | null;
32
+ //# sourceMappingURL=fitness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitness.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/fitness.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,MAAM,GAAG,IAAI,CAUf;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,MAAM,GAAG,IAAI,CAKf"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * How good one predicted number is, from 0 to 1, and where it sits on its bar.
3
+ *
4
+ * The fitness is what the green-to-red ramp reads; the position is what the
5
+ * bar's length reads. They are deliberately two numbers: a molecular weight of
6
+ * 780 is nearly the full width of its bar and nearly the worst fitness, while
7
+ * a drug-likeness of 0 is halfway along its bar and exactly half fit.
8
+ */
9
+ import { clamp } from "../../format/core/clamp.js";
10
+ import { propertyScale } from "./scales.js";
11
+ import { getValuation } from "./valuation.js";
12
+ /**
13
+ * How well a value sits in its property's preferred band, from 0 (as bad as
14
+ * the ramp goes) to 1 (inside the band).
15
+ *
16
+ * The drug score is already that fitness — it is the product of the four
17
+ * valuations `DrugScoreCalculator` computes — so it is returned as it stands
18
+ * rather than valued a second time.
19
+ * @param key - Which of the ten properties.
20
+ * @param value - The predicted number, or `null` when the predictor could not answer.
21
+ * @returns The fitness, or `null` for an unknown value.
22
+ */
23
+ export function propertyFitness(key, value) {
24
+ if (value === null || !Number.isFinite(value))
25
+ return null;
26
+ const scale = propertyScale(key);
27
+ if (scale.halfWidth === null)
28
+ return clamp(value, 0, 1);
29
+ return getValuation(value, scale.preferredMin, scale.preferredMax, scale.halfWidth);
30
+ }
31
+ /**
32
+ * Where a value sits along its bar, from 0 at the left end to 1 at the right.
33
+ *
34
+ * Clamped, because a range is a typical spread rather than a bound: cholesterol
35
+ * runs past the solubility axis and still has to draw.
36
+ * @param key - Which of the ten properties.
37
+ * @param value - The predicted number, or `null`.
38
+ * @returns The position, or `null` for an unknown value.
39
+ */
40
+ export function propertyPosition(key, value) {
41
+ if (value === null || !Number.isFinite(value))
42
+ return null;
43
+ const { rangeMin, rangeMax } = propertyScale(key);
44
+ if (rangeMax === rangeMin)
45
+ return 0;
46
+ return clamp((value - rangeMin) / (rangeMax - rangeMin), 0, 1);
47
+ }
48
+ //# sourceMappingURL=fitness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitness.js","sourceRoot":"","sources":["../../../src/osiris/core/fitness.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAgB,EAChB,KAAoB;IAEpB,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3D,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACxD,OAAO,YAAY,CACjB,KAAK,EACL,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CAChB,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,GAAgB,EAChB,KAAoB;IAEpB,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3D,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IAClD,IAAI,QAAQ,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,29 @@
1
+ export type { BarGeometry } from './barGeometry.ts';
2
+ export { barGeometry } from './barGeometry.ts';
3
+ export type { ComputePropertiesOptions } from './computeProperties.ts';
4
+ export { EMPTY_MOLECULE_MESSAGE, computeProperties, } from './computeProperties.ts';
5
+ export { DRUG_SCORE_RISK_FACTORS, NO_FRAGMENT_MATCHED, RISK_LABELS, RISK_LEVELS, RISK_LEVEL_LABELS, RISK_TYPE_CODES, UNKNOWN_NUMBER, UNKNOWN_SURFACE_AREA, riskCodeOf, riskLevelOf, } from './constants.ts';
6
+ export { propertyFitness, propertyPosition } from './fitness.ts';
7
+ export { MAX_POOL_SIZE, predictionPoolSize } from './poolSize.ts';
8
+ export type { PredictionInput, PredictionOutcome, PredictionPool, PredictionPoolOptions, PredictionProgress, } from './poolTypes.ts';
9
+ export { UNREADABLE_ID_CODE_MESSAGE, predictIdCode, riskDetailOfIdCode, } from './predictIdCode.ts';
10
+ export type { PredictRequest, PredictResponse, PropertiesRequest, RiskDetailRequest, } from './predictProtocol.ts';
11
+ export { isPredictRequest } from './predictProtocol.ts';
12
+ export { createPredictionPool } from './predictionPool.ts';
13
+ export type { PredictionQueue } from './predictionQueue.ts';
14
+ export { createPredictionQueue } from './predictionQueue.ts';
15
+ export type { OsirisPredictors, ResourceSource } from './predictors.ts';
16
+ export { PredictorsUnavailableError, loadPredictors, resetPredictors, } from './predictors.ts';
17
+ export type { PropertyKey } from './propertyKeys.ts';
18
+ export { PROPERTY_KEYS, isPropertyKey, propertyValue } from './propertyKeys.ts';
19
+ export type { RiskAppearance, RiskTone } from './riskAppearance.ts';
20
+ export { KNOWN_MOLECULE_NOTE, PENDING_RISK_LABEL, RISK_CAVEAT, riskAppearance, } from './riskAppearance.ts';
21
+ export { riskDetail } from './riskDetail.ts';
22
+ export { parseRiskFindings } from './riskFindings.ts';
23
+ export { runPredictionJob } from './runPredictionJob.ts';
24
+ export type { PropertyScale, PropertyThreshold, ScaleSource, } from './scales.ts';
25
+ export { PROPERTY_SCALES, propertyScale } from './scales.ts';
26
+ export type { DetailEntry, OsirisProperties, RiskDetail, RiskFinding, RiskFindingKind, RiskLevel, RiskType, } from './types.ts';
27
+ export { RISK_TYPES } from './types.ts';
28
+ export { getValuation } from './valuation.ts';
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAClE,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,0BAA0B,EAC1B,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAChF,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,19 @@
1
+ export { barGeometry } from "./barGeometry.js";
2
+ export { EMPTY_MOLECULE_MESSAGE, computeProperties, } from "./computeProperties.js";
3
+ export { DRUG_SCORE_RISK_FACTORS, NO_FRAGMENT_MATCHED, RISK_LABELS, RISK_LEVELS, RISK_LEVEL_LABELS, RISK_TYPE_CODES, UNKNOWN_NUMBER, UNKNOWN_SURFACE_AREA, riskCodeOf, riskLevelOf, } from "./constants.js";
4
+ export { propertyFitness, propertyPosition } from "./fitness.js";
5
+ export { MAX_POOL_SIZE, predictionPoolSize } from "./poolSize.js";
6
+ export { UNREADABLE_ID_CODE_MESSAGE, predictIdCode, riskDetailOfIdCode, } from "./predictIdCode.js";
7
+ export { isPredictRequest } from "./predictProtocol.js";
8
+ export { createPredictionPool } from "./predictionPool.js";
9
+ export { createPredictionQueue } from "./predictionQueue.js";
10
+ export { PredictorsUnavailableError, loadPredictors, resetPredictors, } from "./predictors.js";
11
+ export { PROPERTY_KEYS, isPropertyKey, propertyValue } from "./propertyKeys.js";
12
+ export { KNOWN_MOLECULE_NOTE, PENDING_RISK_LABEL, RISK_CAVEAT, riskAppearance, } from "./riskAppearance.js";
13
+ export { riskDetail } from "./riskDetail.js";
14
+ export { parseRiskFindings } from "./riskFindings.js";
15
+ export { runPredictionJob } from "./runPredictionJob.js";
16
+ export { PROPERTY_SCALES, propertyScale } from "./scales.js";
17
+ export { RISK_TYPES } from "./types.js";
18
+ export { getValuation } from "./valuation.js";
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/osiris/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAQlE,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EACL,0BAA0B,EAC1B,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMzD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAU7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * How many workers to run.
3
+ *
4
+ * One fewer than the machine's cores, so the thread that draws the table keeps
5
+ * one to itself, and never more than eight: measured scaling is 2.45x on two
6
+ * workers and 4.57x on four, and each worker costs its own copy of OpenChemLib
7
+ * and of the 398 kB resource tables.
8
+ */
9
+ /** The most workers the pool will ever run. */
10
+ export declare const MAX_POOL_SIZE = 8;
11
+ /**
12
+ * How many workers a pool should run here.
13
+ * @param requested - What the caller asked for, or `undefined` to read the machine.
14
+ * @returns A count between 1 and {@link MAX_POOL_SIZE}.
15
+ */
16
+ export declare function predictionPoolSize(requested?: number): number;
17
+ //# sourceMappingURL=poolSize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poolSize.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/poolSize.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,+CAA+C;AAC/C,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAI7D"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * How many workers to run.
3
+ *
4
+ * One fewer than the machine's cores, so the thread that draws the table keeps
5
+ * one to itself, and never more than eight: measured scaling is 2.45x on two
6
+ * workers and 4.57x on four, and each worker costs its own copy of OpenChemLib
7
+ * and of the 398 kB resource tables.
8
+ */
9
+ import { clamp } from "../../format/core/clamp.js";
10
+ /** The most workers the pool will ever run. */
11
+ export const MAX_POOL_SIZE = 8;
12
+ /**
13
+ * How many workers a pool should run here.
14
+ * @param requested - What the caller asked for, or `undefined` to read the machine.
15
+ * @returns A count between 1 and {@link MAX_POOL_SIZE}.
16
+ */
17
+ export function predictionPoolSize(requested) {
18
+ const cores = globalThis.navigator?.hardwareConcurrency;
19
+ const wanted = requested ?? (typeof cores === 'number' ? cores - 1 : 1);
20
+ return Math.trunc(clamp(wanted, 1, MAX_POOL_SIZE, 1));
21
+ }
22
+ //# sourceMappingURL=poolSize.js.map