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,28 @@
1
+ /**
2
+ * DataWarrior's own fuzzy fitness, ported from
3
+ * `com.actelion.research.chem.prediction.MolecularPropertyHelper`.
4
+ *
5
+ * It is what turns a predicted number into the green-to-red ramp behind it,
6
+ * and it is the library's arithmetic rather than a cut-off invented here: a
7
+ * property inside its preferred band scores 1, and the score falls away
8
+ * smoothly outside it over `halfWidth`. There is no cliff anywhere, so a cLogP
9
+ * of 4.01 does not look categorically worse than one of 3.99.
10
+ */
11
+ /**
12
+ * How well one value sits in a preferred band, from 0 to 1.
13
+ *
14
+ * A bound given as `null` is simply not applied, which is how a property
15
+ * bounded on one side only — a solubility that must be high enough, a weight
16
+ * that must be low enough — scores against the one bound it has. The original
17
+ * passes `Double.NaN` for an absent bound and `NaN` is accepted here too.
18
+ *
19
+ * The Java comment claims the fitness at `max + halfWidth` is `1/e`; the
20
+ * arithmetic gives `1/(1+e)`, and the arithmetic is what was ported.
21
+ * @param value - The predicted number.
22
+ * @param min - The bottom of the preferred band, or `null` when there is none.
23
+ * @param max - The top of the preferred band, or `null` when there is none.
24
+ * @param halfWidth - How far outside the band the score takes to fall away.
25
+ * @returns The fitness, or `NaN` when the value is `NaN`.
26
+ */
27
+ export declare function getValuation(value: number, min: number | null, max: number | null, halfWidth: number): number;
28
+ //# sourceMappingURL=valuation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valuation.d.ts","sourceRoot":"","sources":["../../../src/osiris/core/valuation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,SAAS,EAAE,MAAM,GAChB,MAAM,CAWR"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * DataWarrior's own fuzzy fitness, ported from
3
+ * `com.actelion.research.chem.prediction.MolecularPropertyHelper`.
4
+ *
5
+ * It is what turns a predicted number into the green-to-red ramp behind it,
6
+ * and it is the library's arithmetic rather than a cut-off invented here: a
7
+ * property inside its preferred band scores 1, and the score falls away
8
+ * smoothly outside it over `halfWidth`. There is no cliff anywhere, so a cLogP
9
+ * of 4.01 does not look categorically worse than one of 3.99.
10
+ */
11
+ /**
12
+ * How well one value sits in a preferred band, from 0 to 1.
13
+ *
14
+ * A bound given as `null` is simply not applied, which is how a property
15
+ * bounded on one side only — a solubility that must be high enough, a weight
16
+ * that must be low enough — scores against the one bound it has. The original
17
+ * passes `Double.NaN` for an absent bound and `NaN` is accepted here too.
18
+ *
19
+ * The Java comment claims the fitness at `max + halfWidth` is `1/e`; the
20
+ * arithmetic gives `1/(1+e)`, and the arithmetic is what was ported.
21
+ * @param value - The predicted number.
22
+ * @param min - The bottom of the preferred band, or `null` when there is none.
23
+ * @param max - The top of the preferred band, or `null` when there is none.
24
+ * @param halfWidth - How far outside the band the score takes to fall away.
25
+ * @returns The fitness, or `NaN` when the value is `NaN`.
26
+ */
27
+ export function getValuation(value, min, max, halfWidth) {
28
+ if (Number.isNaN(value))
29
+ return Number.NaN;
30
+ let v = 1;
31
+ if (min !== null && !Number.isNaN(min)) {
32
+ v *= 1 / (1 + Math.exp((min - value) / halfWidth));
33
+ }
34
+ if (max !== null && !Number.isNaN(max)) {
35
+ v *= 1 / (1 + Math.exp((value - max) / halfWidth));
36
+ }
37
+ return v;
38
+ }
39
+ //# sourceMappingURL=valuation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valuation.js","sourceRoot":"","sources":["../../../src/osiris/core/valuation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAa,EACb,GAAkB,EAClB,GAAkB,EAClB,SAAiB;IAEjB,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,GAAG,CAAC;IAE3C,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * One property's bar: a track, a fill whose colour is how good the value is,
3
+ * and the published rule of thumb marked on it.
4
+ *
5
+ * The colour is handed to the stylesheet as a number rather than mixed here.
6
+ * A ramp computed in JavaScript would be a hex code in a component, which is
7
+ * the one thing a site of this family may not write: the green, the amber and
8
+ * the red are the shared status tokens, and `properties.css` mixes them.
9
+ *
10
+ * The bar carries no accessible text of its own. It draws the same number the
11
+ * row already prints beside it, so announcing it twice would only make the
12
+ * panel longer to listen to.
13
+ */
14
+ import type { ReactElement } from 'react';
15
+ import type { BarGeometry } from '../core/barGeometry.ts';
16
+ /** What {@link PropertyBar} needs. */
17
+ export interface PropertyBarProps {
18
+ /** Where the fill and the mark go, from `barGeometry`. */
19
+ geometry: BarGeometry;
20
+ }
21
+ /**
22
+ * Draw one property's bar.
23
+ * @param props - See {@link PropertyBarProps}.
24
+ * @returns The track, its fill and its labelled mark.
25
+ */
26
+ export declare function PropertyBar(props: PropertyBarProps): ReactElement;
27
+ //# sourceMappingURL=PropertyBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyBar.d.ts","sourceRoot":"","sources":["../../../src/osiris/ui/PropertyBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,QAAQ,EAAE,WAAW,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAsCjE"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Draw one property's bar.
4
+ * @param props - See {@link PropertyBarProps}.
5
+ * @returns The track, its fill and its labelled mark.
6
+ */
7
+ export function PropertyBar(props) {
8
+ const { geometry } = props;
9
+ // `--fitness` is a custom property, which React sets verbatim and
10
+ // `CSSProperties` has no name for; the stylesheet reads it in the `calc()`
11
+ // that mixes the ramp.
12
+ const fill = {
13
+ left: percent(geometry.start),
14
+ width: percent(geometry.length),
15
+ '--fitness': geometry.fitness.toFixed(4),
16
+ };
17
+ return (_jsxs("div", { className: "property-bar", "aria-hidden": "true", children: [_jsxs("div", { className: "property-bar__track", children: [geometry.origin === 0 ? null : (_jsx("div", { className: "property-bar__origin", style: { left: percent(geometry.origin) } })), _jsx("div", { className: "property-bar__fill", style: fill }), geometry.mark === null ? null : (_jsx("div", { className: "property-bar__mark", style: { left: percent(geometry.mark) } }))] }), geometry.mark === null || geometry.markLabel === null ? null : (_jsx("span", { className: "property-bar__threshold", style: { left: percent(geometry.mark) }, children: geometry.markLabel }))] }));
18
+ }
19
+ /**
20
+ * A fraction of the track, as a CSS length.
21
+ * @param fraction - 0 at the left end, 1 at the right.
22
+ * @returns The percentage, to two decimals.
23
+ */
24
+ function percent(fraction) {
25
+ return `${(fraction * 100).toFixed(2)}%`;
26
+ }
27
+ //# sourceMappingURL=PropertyBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyBar.js","sourceRoot":"","sources":["../../../src/osiris/ui/PropertyBar.tsx"],"names":[],"mappings":";A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,SAAS,OAAO,CAAC,QAAgB;IAC/B,OAAO,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Everything OSIRIS predicts about one molecule: the four toxicity risks, then
3
+ * the ten numbers, in the order the original panel showed them.
4
+ *
5
+ * One panel wherever a molecule is predicted — beside an editor's canvas, for
6
+ * the row of a table the reader focused, beside a drawing — because a second
7
+ * panel would be a second place for the same ten rows to drift apart.
8
+ *
9
+ * The sections stand whether or not there is anything in them. A prediction
10
+ * costs a fifth of a second, and a panel that appeared only once it was ready
11
+ * would move the page under the reader's eye every time they drew a bond.
12
+ *
13
+ * Which explanation is open is the caller's state — it belongs to the page, and
14
+ * on the explorer it is what a click on a square changes — but *fetching* it is
15
+ * the panel's own business, so no page repeats the dance.
16
+ */
17
+ import type { ReactElement, ReactNode } from 'react';
18
+ import type { PropertyKey } from '../core/propertyKeys.ts';
19
+ import type { OsirisProperties, RiskDetail, RiskType } from '../core/types.ts';
20
+ /** What {@link PropertyPanel} needs. */
21
+ export interface PropertyPanelProps {
22
+ /**
23
+ * What was predicted, or `null` when there is nothing to show yet.
24
+ * @default null
25
+ */
26
+ properties?: OsirisProperties | null;
27
+ /**
28
+ * The atom layout to draw the molecule with, in an explanation. Empty leaves
29
+ * openchemlib to invent one.
30
+ * @default ''
31
+ */
32
+ coordinates?: string;
33
+ /**
34
+ * Whether a prediction is running for the molecule the panel is showing.
35
+ * @default false
36
+ */
37
+ pending?: boolean;
38
+ /**
39
+ * What went wrong with this structure, in one sentence, or `null`.
40
+ * @default null
41
+ */
42
+ problem?: string | null;
43
+ /**
44
+ * Whether to open on the molecule's formula and name. Off for a host that
45
+ * already shows the formula beside the panel, such as a structure editor's
46
+ * side panel.
47
+ * @default true
48
+ */
49
+ head?: boolean;
50
+ /**
51
+ * Whether to draw the four risks, and the explanation a square opens. Off
52
+ * for a page answering a question about the numbers alone.
53
+ * @default true
54
+ */
55
+ risks?: boolean;
56
+ /**
57
+ * The property rows to draw, in the panel's order whatever order they are
58
+ * given in. Empty leaves the section out, for a page answering a question
59
+ * about the risks alone.
60
+ * @default PROPERTY_KEYS
61
+ */
62
+ rows?: readonly PropertyKey[];
63
+ /**
64
+ * What is said when there is nothing predicted and nothing running.
65
+ * @default 'Nothing to predict yet.'
66
+ */
67
+ emptyMessage?: ReactNode;
68
+ /**
69
+ * Which risk has its explanation open.
70
+ * @default null
71
+ */
72
+ openRisk?: RiskType | null;
73
+ /**
74
+ * Called with the risk to open, or `null` to close it. Without it the squares
75
+ * are not clickable.
76
+ * @default undefined
77
+ */
78
+ onOpenRisk?: (risk: RiskType | null) => void;
79
+ /**
80
+ * Why a risk came back as it did. Without it no explanation is offered.
81
+ * @default undefined
82
+ */
83
+ loadDetail?: (structure: string, risk: RiskType) => Promise<RiskDetail>;
84
+ }
85
+ /**
86
+ * The risks and the properties of one molecule.
87
+ * @param props - See {@link PropertyPanelProps}.
88
+ * @returns The two panels, and the open explanation between them.
89
+ */
90
+ export declare function PropertyPanel(props: PropertyPanelProps): ReactElement;
91
+ //# sourceMappingURL=PropertyPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyPanel.d.ts","sourceRoot":"","sources":["../../../src/osiris/ui/PropertyPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAM/E,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACzE;AASD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CA2ErE"}
@@ -0,0 +1,77 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Everything OSIRIS predicts about one molecule: the four toxicity risks, then
4
+ * the ten numbers, in the order the original panel showed them.
5
+ *
6
+ * One panel wherever a molecule is predicted — beside an editor's canvas, for
7
+ * the row of a table the reader focused, beside a drawing — because a second
8
+ * panel would be a second place for the same ten rows to drift apart.
9
+ *
10
+ * The sections stand whether or not there is anything in them. A prediction
11
+ * costs a fifth of a second, and a panel that appeared only once it was ready
12
+ * would move the page under the reader's eye every time they drew a bond.
13
+ *
14
+ * Which explanation is open is the caller's state — it belongs to the page, and
15
+ * on the explorer it is what a click on a square changes — but *fetching* it is
16
+ * the panel's own business, so no page repeats the dance.
17
+ */
18
+ import { Callout, H5 } from '@blueprintjs/core';
19
+ import { useEffect, useState } from 'react';
20
+ import { MF } from 'react-mf';
21
+ import { errorMessage } from "../../error/core/toError.js";
22
+ import { PagePart } from "../../share/ui/PagePart.js";
23
+ import { PROPERTY_KEYS } from "../core/propertyKeys.js";
24
+ import { PropertyRows } from "./PropertyRows.js";
25
+ import { RiskFindings } from "./RiskFindings.js";
26
+ import { RiskPanel } from "./RiskPanel.js";
27
+ /**
28
+ * The risks and the properties of one molecule.
29
+ * @param props - See {@link PropertyPanelProps}.
30
+ * @returns The two panels, and the open explanation between them.
31
+ */
32
+ export function PropertyPanel(props) {
33
+ const { properties = null, coordinates = '', pending = false, problem = null, head = true, risks = true, rows = PROPERTY_KEYS, emptyMessage = 'Nothing to predict yet.', openRisk = null, onOpenRisk, loadDetail, } = props;
34
+ const structure = properties === null
35
+ ? ''
36
+ : coordinates === ''
37
+ ? properties.idCode
38
+ : `${properties.idCode} ${coordinates}`;
39
+ const answer = useRiskDetail(structure, openRisk, loadDetail);
40
+ return (_jsxs("div", { className: "property-panel", children: [problem === null ? null : (_jsx(Callout, { intent: "warning", compact: true, children: problem })), properties === null ? (_jsx("p", { className: "osiris-note", children: pending ? 'Predicting…' : emptyMessage })) : head ? (_jsxs("header", { className: "property-panel__head", children: [_jsx(MF, { mf: properties.molecularFormula }), _jsx("span", { className: "property-panel__label", children: properties.label })] })) : null, risks ? (_jsx(PagePart, { part: "risks", children: _jsx(RiskPanel, { risks: properties?.risks ?? null, pending: pending, openRisk: openRisk, onOpenRisk: onOpenRisk }) })) : null, !risks ||
41
+ openRisk === null ||
42
+ structure === '' ||
43
+ loadDetail === undefined ? null : (_jsx(PagePart, { part: "detail", children: _jsx(RiskFindings, { risk: openRisk, structure: structure, detail: answer?.detail ?? null, error: answer?.error ?? null }) })), rows.length === 0 ? null : (_jsx(PagePart, { part: "properties", children: _jsxs("section", { className: "property-section", children: [_jsx(H5, { children: "Predicted properties" }), _jsx(PropertyRows, { properties: properties, keys: rows })] }) }))] }));
44
+ }
45
+ /**
46
+ * Fetch the open risk's explanation, and answer only about the request that is
47
+ * open now.
48
+ *
49
+ * The answer carries the request it belongs to rather than being cleared when a
50
+ * new one starts: clearing would mean writing state from inside the effect, and
51
+ * comparing keys says the same thing without the extra render.
52
+ * @param structure - The molecule: an idCode, with its coordinates after a space.
53
+ * @param openRisk - Which risk is open, or `null`.
54
+ * @param loadDetail - What answers the question, or `undefined` when nothing does.
55
+ * @returns The answer to the open request, or `null` while it is being worked out.
56
+ */
57
+ function useRiskDetail(structure, openRisk, loadDetail) {
58
+ const key = openRisk === null || structure === '' ? '' : `${structure} ${openRisk}`;
59
+ const [answer, setAnswer] = useState(null);
60
+ useEffect(() => {
61
+ if (key === '' || openRisk === null || loadDetail === undefined)
62
+ return;
63
+ let live = true;
64
+ loadDetail(structure, openRisk).then((detail) => {
65
+ if (live)
66
+ setAnswer({ key, detail, error: null });
67
+ }, (error) => {
68
+ if (live)
69
+ setAnswer({ key, detail: null, error: errorMessage(error) });
70
+ });
71
+ return () => {
72
+ live = false;
73
+ };
74
+ }, [key, structure, openRisk, loadDetail]);
75
+ return answer !== null && answer.key === key ? answer : null;
76
+ }
77
+ //# sourceMappingURL=PropertyPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyPanel.js","sourceRoot":"","sources":["../../../src/osiris/ui/PropertyPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA6B,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBA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AAE,SAAS,CAAC,GAAG,QAAQ,CAAsB,IAAI,CAAC,CAAC;IAEhE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,GAAG,KAAK,EAAE,IAAI,QAAQ,KAAK,IAAI,IAAI,UAAU,KAAK,SAAS;YAAE,OAAO;QACxE,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,UAAU,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,IAAI,CAClC,CAAC,MAAM,EAAE,EAAE;YACT,IAAI,IAAI;gBAAE,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;YACjB,IAAI,IAAI;gBAAE,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC,CACF,CAAC;QACF,OAAO,GAAG,EAAE;YACV,IAAI,GAAG,KAAK,CAAC;QACf,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAE3C,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The ten predicted numbers, one row each: a name, a bar and a value.
3
+ *
4
+ * The order is the legacy panel's — cLogP, solubility, molweight, TPSA,
5
+ * drug-likeness, the two hydrogen-bond counts, stereocentres, rotatable bonds,
6
+ * drug score — and it is `PROPERTY_KEYS`, which the comparison table's columns
7
+ * and the plot's default axes also read. A reader who learned the panel reads
8
+ * the table without relearning it.
9
+ *
10
+ * A value the predictor could not answer prints the missing marker and draws no
11
+ * bar. It is never zero: `DrugScoreCalculator` consumes every sentinel and
12
+ * hands back a plausible number, so a bar drawn from one would be a wrong
13
+ * answer with nothing saying it is wrong.
14
+ */
15
+ import type { ReactElement } from 'react';
16
+ import type { PropertyKey } from '../core/propertyKeys.ts';
17
+ import type { OsirisProperties } from '../core/types.ts';
18
+ /** What {@link PropertyRows} needs. */
19
+ export interface PropertyRowsProps {
20
+ /**
21
+ * What was predicted, or `null` while the molecule is still being worked on —
22
+ * in which case every row stands with its name and no value, so nothing moves
23
+ * when the answer arrives.
24
+ * @default null
25
+ */
26
+ properties?: OsirisProperties | null;
27
+ /**
28
+ * The rows to draw. They are drawn in the panel's order whatever order they
29
+ * are given in, so a narrowed panel still reads as the whole one does.
30
+ * @default PROPERTY_KEYS
31
+ */
32
+ keys?: readonly PropertyKey[];
33
+ }
34
+ /**
35
+ * The property rows, all ten unless fewer are asked, in the panel's order.
36
+ * @param props - See {@link PropertyRowsProps}.
37
+ * @returns One row per property.
38
+ */
39
+ export declare function PropertyRows(props: PropertyRowsProps): ReactElement;
40
+ //# sourceMappingURL=PropertyRows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyRows.d.ts","sourceRoot":"","sources":["../../../src/osiris/ui/PropertyRows.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrC;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAcnE"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { MISSING_VALUE } from "../../format/core/missing.js";
3
+ import { formatDecimal } from "../../format/core/numbers.js";
4
+ import { barGeometry } from "../core/barGeometry.js";
5
+ import { PROPERTY_KEYS, propertyValue } from "../core/propertyKeys.js";
6
+ import { propertyScale } from "../core/scales.js";
7
+ import { PropertyBar } from "./PropertyBar.js";
8
+ /**
9
+ * The property rows, all ten unless fewer are asked, in the panel's order.
10
+ * @param props - See {@link PropertyRowsProps}.
11
+ * @returns One row per property.
12
+ */
13
+ export function PropertyRows(props) {
14
+ const { properties = null, keys = PROPERTY_KEYS } = props;
15
+ return (_jsx("div", { className: "property-rows", children: PROPERTY_KEYS.filter((key) => keys.includes(key)).map((key) => (_jsx(PropertyRow, { propertyKey: key, value: properties === null ? null : propertyValue(properties, key) }, key))) }));
16
+ }
17
+ function PropertyRow(props) {
18
+ const { propertyKey, value } = props;
19
+ const scale = propertyScale(propertyKey);
20
+ const geometry = barGeometry(propertyKey, value);
21
+ return (_jsxs("div", { className: "property-row", children: [_jsxs("span", { className: "property-row__label", children: [scale.label, scale.unit === '' ? null : (_jsx("span", { className: "property-row__unit", children: scale.unit }))] }), _jsx("span", { className: "property-row__bar", children: geometry === null ? null : _jsx(PropertyBar, { geometry: geometry }) }), _jsx("span", { className: "property-row__value", children: value === null ? MISSING_VALUE : formatDecimal(value, scale.decimals) })] }));
22
+ }
23
+ //# sourceMappingURL=PropertyRows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyRows.js","sourceRoot":"","sources":["../../../src/osiris/ui/PropertyRows.tsx"],"names":[],"mappings":";AAiBA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,yBAAyB,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AW,IAAC,QAAQ,EAAE,QAAQ,GAAI,GAC1D,EACP,eAAM,SAAS,EAAC,qBAAqB,YAClC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,GACjE,IACH,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Why one risk came back as it did.
3
+ *
4
+ * Two branches of the predictor reach the same red square and mean different
5
+ * things. *This molecule is known to be mutagenic* means the compound's own
6
+ * idCode is in a list derived from RTECS — data on this exact compound, and
7
+ * nothing on the drawing to point at. *High-risk fragments indicating
8
+ * Mutagenicity* means a substructure matched, and that substructure is drawn
9
+ * beside the molecule with its atoms painted on it.
10
+ *
11
+ * Telling them apart is the whole point of opening a square: aspirin, caffeine
12
+ * and paracetamol are all red through the first branch, and highlighting the
13
+ * whole molecule there would call the compound its own toxicophore.
14
+ *
15
+ * A fragment heading is repeated on each of the fragments under it, so it is
16
+ * printed once and the matches follow.
17
+ */
18
+ import type { ReactElement } from 'react';
19
+ import type { RiskDetail, RiskType } from '../core/types.ts';
20
+ /** What {@link RiskFindings} needs. */
21
+ export interface RiskFindingsProps {
22
+ /** Which risk is open. */
23
+ risk: RiskType;
24
+ /** The molecule it was assessed on: the idCode, with its coordinates after a space. */
25
+ structure: string;
26
+ /**
27
+ * What the predictor found, or `null` while it is being worked out.
28
+ * @default null
29
+ */
30
+ detail?: RiskDetail | null;
31
+ /**
32
+ * Why the explanation could not be fetched, or `null`.
33
+ * @default null
34
+ */
35
+ error?: string | null;
36
+ }
37
+ /**
38
+ * The explanation of one risk.
39
+ * @param props - See {@link RiskFindingsProps}.
40
+ * @returns The predictor's own sentences, with every matched fragment drawn.
41
+ */
42
+ export declare function RiskFindings(props: RiskFindingsProps): ReactElement;
43
+ //# sourceMappingURL=RiskFindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiskFindings.d.ts","sourceRoot":"","sources":["../../../src/osiris/ui/RiskFindings.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,UAAU,EAAe,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE1E,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,uFAAuF;IACvF,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAKD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAkCnE"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Why one risk came back as it did.
4
+ *
5
+ * Two branches of the predictor reach the same red square and mean different
6
+ * things. *This molecule is known to be mutagenic* means the compound's own
7
+ * idCode is in a list derived from RTECS — data on this exact compound, and
8
+ * nothing on the drawing to point at. *High-risk fragments indicating
9
+ * Mutagenicity* means a substructure matched, and that substructure is drawn
10
+ * beside the molecule with its atoms painted on it.
11
+ *
12
+ * Telling them apart is the whole point of opening a square: aspirin, caffeine
13
+ * and paracetamol are all red through the first branch, and highlighting the
14
+ * whole molecule there would call the compound its own toxicophore.
15
+ *
16
+ * A fragment heading is repeated on each of the fragments under it, so it is
17
+ * printed once and the matches follow.
18
+ */
19
+ import { Callout, Spinner } from '@blueprintjs/core';
20
+ import { Structure } from "../../structure/ui/Structure.js";
21
+ import { RISK_LABELS } from "../core/constants.js";
22
+ import { KNOWN_MOLECULE_NOTE } from "../core/riskAppearance.js";
23
+ /** How big a drawing in the explanation is, in pixels. */
24
+ const DRAWING = { width: 190, height: 130 };
25
+ /**
26
+ * The explanation of one risk.
27
+ * @param props - See {@link RiskFindingsProps}.
28
+ * @returns The predictor's own sentences, with every matched fragment drawn.
29
+ */
30
+ export function RiskFindings(props) {
31
+ const { risk, structure, detail = null, error = null } = props;
32
+ if (error !== null) {
33
+ return _jsx(Callout, { intent: "warning", children: error });
34
+ }
35
+ if (detail === null) {
36
+ return (_jsxs("div", { className: "osiris-note osiris-note--working", children: [_jsx(Spinner, { size: 14 }), " Working out why ", RISK_LABELS[risk], " came back as it did."] }));
37
+ }
38
+ return (_jsx("div", { className: "risk-findings", children: detail.findings.map((finding, index) => (_jsx(Finding
39
+ // The predictor prints each heading once and each matching fragment
40
+ // once under it, so the pair names the line without an index.
41
+ , { finding: finding, structure: structure, heading: detail.findings[index - 1]?.description === finding.description
42
+ ? null
43
+ : finding.description }, `${finding.kind}:${finding.description}:${finding.idCode ?? ''}`))) }));
44
+ }
45
+ function Finding(props) {
46
+ const { finding, structure, heading } = props;
47
+ return (_jsxs("div", { className: "risk-finding", children: [heading === null ? null : (_jsx("p", { className: "risk-finding__heading", children: heading })), finding.kind === 'known' ? (_jsx("p", { className: "osiris-note", children: KNOWN_MOLECULE_NOTE })) : null, finding.idCode === null ? null : (_jsxs("div", { className: "risk-finding__drawings", children: [_jsxs("figure", { className: "risk-finding__figure", children: [_jsx(Structure, { idCode: finding.idCode, width: DRAWING.width, height: DRAWING.height }), _jsxs("figcaption", { children: [finding.severity === 'medium' ? 'Medium-risk' : 'High-risk', ' ', "fragment"] })] }), _jsxs("figure", { className: "risk-finding__figure", children: [_jsx(Structure, { idCode: structure, width: DRAWING.width, height: DRAWING.height, atomHighlight: [...finding.atoms], bondHighlight: [...finding.bonds] }), _jsx("figcaption", { children: finding.atoms.length === 0
48
+ ? 'Not located on this drawing'
49
+ : 'Where it sits on the molecule' })] })] }))] }));
50
+ }
51
+ //# sourceMappingURL=RiskFindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiskFindings.js","s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KAAK,CAAC,GACjC,EACF,+BACG,OAAO,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;oCACzB,CAAC,CAAC,6BAA6B;oCAC/B,CAAC,CAAC,+BAA+B,GACxB,IACN,IACL,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The four toxicity risks, and the sentence that keeps them honest.
3
+ *
4
+ * OSIRIS assesses mutagenicity, tumorigenicity, irritating effects and
5
+ * reproductive effects, in that order, and answers each with one of three
6
+ * levels — the same three the drug score multiplies by. A red square is very
7
+ * often the known-molecule branch rather than a matched fragment, which is why
8
+ * every assessed square opens its explanation.
9
+ *
10
+ * The caveat under them is the author's own, quoted rather than paraphrased: it
11
+ * is the sentence that stops a red square being read as a verdict, and softening
12
+ * it would be our words over his.
13
+ */
14
+ import type { ReactElement } from 'react';
15
+ import type { RiskLevel, RiskType } from '../core/types.ts';
16
+ /** What {@link RiskPanel} needs. */
17
+ export interface RiskPanelProps {
18
+ /**
19
+ * How the four came back, or `null` when none of them has been assessed.
20
+ * @default null
21
+ */
22
+ risks?: Record<RiskType, RiskLevel> | null;
23
+ /**
24
+ * Whether a prediction is running for the molecule the panel is showing.
25
+ * @default false
26
+ */
27
+ pending?: boolean;
28
+ /**
29
+ * Which risk has its explanation open.
30
+ * @default null
31
+ */
32
+ openRisk?: RiskType | null;
33
+ /**
34
+ * Called with the risk to open, or `null` to close the one that is open.
35
+ * Without it the squares are not clickable.
36
+ * @default undefined
37
+ */
38
+ onOpenRisk?: (risk: RiskType | null) => void;
39
+ }
40
+ /**
41
+ * The four risk squares.
42
+ * @param props - See {@link RiskPanelProps}.
43
+ * @returns The panel, with the caveat under it.
44
+ */
45
+ export declare function RiskPanel(props: RiskPanelProps): ReactElement;
46
+ //# sourceMappingURL=RiskPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiskPanel.d.ts","sourceRoot":"","sources":["../../../src/osiris/ui/RiskPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK5D,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;IAC3C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CA2B7D"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The four toxicity risks, and the sentence that keeps them honest.
4
+ *
5
+ * OSIRIS assesses mutagenicity, tumorigenicity, irritating effects and
6
+ * reproductive effects, in that order, and answers each with one of three
7
+ * levels — the same three the drug score multiplies by. A red square is very
8
+ * often the known-molecule branch rather than a matched fragment, which is why
9
+ * every assessed square opens its explanation.
10
+ *
11
+ * The caveat under them is the author's own, quoted rather than paraphrased: it
12
+ * is the sentence that stops a red square being read as a verdict, and softening
13
+ * it would be our words over his.
14
+ */
15
+ import { H5 } from '@blueprintjs/core';
16
+ import { RISK_CAVEAT } from "../core/riskAppearance.js";
17
+ import { RISK_TYPES } from "../core/types.js";
18
+ import { RiskSquare } from "./RiskSquare.js";
19
+ /**
20
+ * The four risk squares.
21
+ * @param props - See {@link RiskPanelProps}.
22
+ * @returns The panel, with the caveat under it.
23
+ */
24
+ export function RiskPanel(props) {
25
+ const { risks = null, pending = false, openRisk = null, onOpenRisk } = props;
26
+ return (_jsxs("section", { className: "risk-panel", children: [_jsx(H5, { children: "Predicted toxicity risks" }), _jsx("div", { className: "risk-grid", children: RISK_TYPES.map((risk) => (_jsx(RiskSquare, { risk: risk, level: risks?.[risk], pending: pending, selected: openRisk === risk, onSelect: onOpenRisk === undefined
27
+ ? undefined
28
+ : (chosen) => {
29
+ onOpenRisk(chosen === openRisk ? null : chosen);
30
+ } }, risk))) }), _jsx("p", { className: "osiris-note", children: RISK_CAVEAT })] }));
31
+ }
32
+ //# sourceMappingURL=RiskPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiskPanel.js","sourceRoot":"","sources":["../../../src/osiris/ui/RiskPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AA2B9C;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7E,OAAO,CACL,mBAAS,SAAS,EAAC,YAAY,aAC7B,KAAC,EAAE,2CAA8B,EACjC,cAAK,SAAS,EAAC,WAAW,YACvB,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACxB,KAAC,UAAU,IAET,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EACpB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,KAAK,IAAI,EAC3B,QAAQ,EACN,UAAU,KAAK,SAAS;wBACtB,CAAC,CAAC,SAAS;wBACX,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE;4BACT,UAAU,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;wBAClD,CAAC,IAVF,IAAI,CAYT,CACH,CAAC,GACE,EACN,YAAG,SAAS,EAAC,aAAa,YAAE,WAAW,GAAK,IACpC,CACX,CAAC;AACJ,CAAC"}