react-cheminfo 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -28
- package/lib/chrome/ui/HeaderToggle.d.ts +52 -0
- package/lib/chrome/ui/HeaderToggle.d.ts.map +1 -0
- package/lib/chrome/ui/HeaderToggle.js +31 -0
- package/lib/chrome/ui/HeaderToggle.js.map +1 -0
- package/lib/chrome/ui/index.d.ts +2 -0
- package/lib/chrome/ui/index.d.ts.map +1 -1
- package/lib/chrome/ui/index.js +1 -0
- package/lib/chrome/ui/index.js.map +1 -1
- package/lib/citation/core/gfn2Paper.d.ts +10 -0
- package/lib/citation/core/gfn2Paper.d.ts.map +1 -0
- package/lib/citation/core/gfn2Paper.js +28 -0
- package/lib/citation/core/gfn2Paper.js.map +1 -0
- package/lib/citation/core/index.d.ts +1 -0
- package/lib/citation/core/index.d.ts.map +1 -1
- package/lib/citation/core/index.js +1 -0
- package/lib/citation/core/index.js.map +1 -1
- package/lib/clipboard/ui/ClickToCopy.d.ts +8 -7
- package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
- package/lib/clipboard/ui/ClickToCopy.js +3 -3
- package/lib/clipboard/ui/ClickToCopy.js.map +1 -1
- package/lib/conformers.d.ts +27 -0
- package/lib/conformers.d.ts.map +1 -0
- package/lib/conformers.js +19 -0
- package/lib/conformers.js.map +1 -0
- package/lib/core.d.ts +1 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +1 -0
- package/lib/core.js.map +1 -1
- package/lib/credits/core/credits.d.ts +12 -0
- package/lib/credits/core/credits.d.ts.map +1 -1
- package/lib/credits/core/credits.js +14 -0
- package/lib/credits/core/credits.js.map +1 -1
- package/lib/ecosystem/core/index.d.ts +1 -1
- package/lib/ecosystem/core/index.d.ts.map +1 -1
- package/lib/ecosystem/core/index.js.map +1 -1
- package/lib/ecosystem/core/sites.d.ts +11 -1
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +7 -2
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemLinks.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemLinks.js +3 -1
- package/lib/ecosystem/ui/EcosystemLinks.js.map +1 -1
- package/lib/ecosystem/ui/SiteTile.d.ts.map +1 -1
- package/lib/ecosystem/ui/SiteTile.js +3 -1
- package/lib/ecosystem/ui/SiteTile.js.map +1 -1
- package/lib/format/core/index.d.ts +1 -1
- package/lib/format/core/index.d.ts.map +1 -1
- package/lib/format/core/index.js +1 -1
- package/lib/format/core/index.js.map +1 -1
- package/lib/format/core/words.d.ts +9 -0
- package/lib/format/core/words.d.ts.map +1 -1
- package/lib/format/core/words.js +16 -0
- package/lib/format/core/words.js.map +1 -1
- package/lib/language/core/index.d.ts +3 -0
- package/lib/language/core/index.d.ts.map +1 -0
- package/lib/language/core/index.js +3 -0
- package/lib/language/core/index.js.map +1 -0
- package/lib/language/core/languageName.d.ts +8 -0
- package/lib/language/core/languageName.d.ts.map +1 -0
- package/lib/language/core/languageName.js +16 -0
- package/lib/language/core/languageName.js.map +1 -0
- package/lib/language/core/languageParam.d.ts +35 -0
- package/lib/language/core/languageParam.d.ts.map +1 -0
- package/lib/language/core/languageParam.js +67 -0
- package/lib/language/core/languageParam.js.map +1 -0
- package/lib/language/ui/SiteLanguage.d.ts +20 -0
- package/lib/language/ui/SiteLanguage.d.ts.map +1 -0
- package/lib/language/ui/SiteLanguage.js +14 -0
- package/lib/language/ui/SiteLanguage.js.map +1 -0
- package/lib/language/ui/index.d.ts +4 -0
- package/lib/language/ui/index.d.ts.map +1 -0
- package/lib/language/ui/index.js +3 -0
- package/lib/language/ui/index.js.map +1 -0
- package/lib/language/ui/siteLanguageContext.d.ts +12 -0
- package/lib/language/ui/siteLanguageContext.d.ts.map +1 -0
- package/lib/language/ui/siteLanguageContext.js +19 -0
- package/lib/language/ui/siteLanguageContext.js.map +1 -0
- package/lib/orbital/core/atomicOrbitals.d.ts +9 -1
- package/lib/orbital/core/atomicOrbitals.d.ts.map +1 -1
- package/lib/orbital/core/atomicOrbitals.js +7 -0
- package/lib/orbital/core/atomicOrbitals.js.map +1 -1
- package/lib/orbital/core/hydrogenic.d.ts +2 -1
- package/lib/orbital/core/hydrogenic.d.ts.map +1 -1
- package/lib/orbital/core/hydrogenic.js +2 -1
- package/lib/orbital/core/hydrogenic.js.map +1 -1
- package/lib/orbital/core/index.d.ts +1 -0
- package/lib/orbital/core/index.d.ts.map +1 -1
- package/lib/orbital/core/index.js +1 -0
- package/lib/orbital/core/index.js.map +1 -1
- package/lib/orbital/core/slaterEnergy.d.ts +35 -0
- package/lib/orbital/core/slaterEnergy.d.ts.map +1 -0
- package/lib/orbital/core/slaterEnergy.js +66 -0
- package/lib/orbital/core/slaterEnergy.js.map +1 -0
- package/lib/overlay/core/index.d.ts +2 -2
- package/lib/overlay/core/index.d.ts.map +1 -1
- package/lib/overlay/core/index.js +1 -1
- package/lib/overlay/core/index.js.map +1 -1
- package/lib/overlay/core/overlayMarks.d.ts +20 -5
- package/lib/overlay/core/overlayMarks.d.ts.map +1 -1
- package/lib/overlay/core/overlayMarks.js +31 -5
- package/lib/overlay/core/overlayMarks.js.map +1 -1
- package/lib/overlay/ui/OverlayLegendMark.js +5 -0
- package/lib/overlay/ui/OverlayLegendMark.js.map +1 -1
- package/lib/projection/core/index.d.ts +4 -4
- package/lib/projection/core/index.d.ts.map +1 -1
- package/lib/projection/core/index.js +2 -2
- package/lib/projection/core/index.js.map +1 -1
- package/lib/projection/core/projectionCopy.d.ts +2 -0
- package/lib/projection/core/projectionCopy.d.ts.map +1 -1
- package/lib/projection/core/projectionCopy.js +1 -0
- package/lib/projection/core/projectionCopy.js.map +1 -1
- package/lib/projection/core/projectionGroupings.d.ts +44 -0
- package/lib/projection/core/projectionGroupings.d.ts.map +1 -0
- package/lib/projection/core/projectionGroupings.js +132 -0
- package/lib/projection/core/projectionGroupings.js.map +1 -0
- package/lib/projection/core/projectionOptions.d.ts +16 -6
- package/lib/projection/core/projectionOptions.d.ts.map +1 -1
- package/lib/projection/core/projectionOptions.js +7 -1
- package/lib/projection/core/projectionOptions.js.map +1 -1
- package/lib/projection/core/projectionPanelWords.d.ts +6 -0
- package/lib/projection/core/projectionPanelWords.d.ts.map +1 -1
- package/lib/projection/core/projectionPanelWords.js +4 -0
- package/lib/projection/core/projectionPanelWords.js.map +1 -1
- package/lib/projection/core/projectionSamples.d.ts +63 -32
- package/lib/projection/core/projectionSamples.d.ts.map +1 -1
- package/lib/projection/core/projectionSamples.js +1 -80
- package/lib/projection/core/projectionSamples.js.map +1 -1
- package/lib/projection/core/projectionStrings.d.ts +2 -0
- package/lib/projection/core/projectionStrings.d.ts.map +1 -1
- package/lib/projection/core/projectionStrings.js +10 -1
- package/lib/projection/core/projectionStrings.js.map +1 -1
- package/lib/projection/core/resolveProjectionOptions.d.ts +8 -3
- package/lib/projection/core/resolveProjectionOptions.d.ts.map +1 -1
- package/lib/projection/core/resolveProjectionOptions.js +58 -5
- package/lib/projection/core/resolveProjectionOptions.js.map +1 -1
- package/lib/projection/ui/ProjectionBar.d.ts +1 -1
- package/lib/projection/ui/ProjectionBar.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionBar.js +3 -1
- package/lib/projection/ui/ProjectionBar.js.map +1 -1
- package/lib/projection/ui/ProjectionGroupingPickers.d.ts +38 -0
- package/lib/projection/ui/ProjectionGroupingPickers.d.ts.map +1 -0
- package/lib/projection/ui/ProjectionGroupingPickers.js +33 -0
- package/lib/projection/ui/ProjectionGroupingPickers.js.map +1 -0
- package/lib/projection/ui/ProjectionMapControls.d.ts +6 -7
- package/lib/projection/ui/ProjectionMapControls.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionMapControls.js +11 -9
- package/lib/projection/ui/ProjectionMapControls.js.map +1 -1
- package/lib/projection/ui/ProjectionMapLegend.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionMapLegend.js +1 -1
- package/lib/projection/ui/ProjectionMapLegend.js.map +1 -1
- package/lib/projection/ui/ProjectionMapMore.d.ts +2 -2
- package/lib/projection/ui/ProjectionMapMore.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionMapMore.js +7 -5
- package/lib/projection/ui/ProjectionMapMore.js.map +1 -1
- package/lib/projection/ui/ProjectionMapTab.d.ts +15 -6
- package/lib/projection/ui/ProjectionMapTab.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionMapTab.js +11 -7
- package/lib/projection/ui/ProjectionMapTab.js.map +1 -1
- package/lib/projection/ui/ProjectionPairsMore.d.ts +3 -7
- package/lib/projection/ui/ProjectionPairsMore.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionPairsMore.js +4 -5
- package/lib/projection/ui/ProjectionPairsMore.js.map +1 -1
- package/lib/projection/ui/ProjectionPairsTab.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionPairsTab.js +2 -2
- package/lib/projection/ui/ProjectionPairsTab.js.map +1 -1
- package/lib/projection/ui/ProjectionPanel.d.ts +1 -1
- package/lib/projection/ui/ProjectionPanel.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionPanel.js +1 -1
- package/lib/projection/ui/ProjectionPanel.js.map +1 -1
- package/lib/projection/ui/ProjectionReadout.d.ts +7 -1
- package/lib/projection/ui/ProjectionReadout.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionReadout.js +19 -7
- package/lib/projection/ui/ProjectionReadout.js.map +1 -1
- package/lib/projection/ui/ProjectionSpaceControls.d.ts +3 -5
- package/lib/projection/ui/ProjectionSpaceControls.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionSpaceControls.js +9 -7
- package/lib/projection/ui/ProjectionSpaceControls.js.map +1 -1
- package/lib/projection/ui/ProjectionSpaceMore.d.ts +2 -2
- package/lib/projection/ui/ProjectionSpaceMore.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionSpaceMore.js +5 -4
- package/lib/projection/ui/ProjectionSpaceMore.js.map +1 -1
- package/lib/projection/ui/ProjectionSpaceTab.d.ts +11 -3
- package/lib/projection/ui/ProjectionSpaceTab.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionSpaceTab.js +7 -4
- package/lib/projection/ui/ProjectionSpaceTab.js.map +1 -1
- package/lib/projection/ui/ProjectionViewer.d.ts.map +1 -1
- package/lib/projection/ui/ProjectionViewer.js +1 -0
- package/lib/projection/ui/ProjectionViewer.js.map +1 -1
- package/lib/projection/ui/projectionBarReadings.d.ts +4 -1
- package/lib/projection/ui/projectionBarReadings.d.ts.map +1 -1
- package/lib/projection/ui/projectionBarReadings.js +14 -4
- package/lib/projection/ui/projectionBarReadings.js.map +1 -1
- package/lib/projection/ui/projectionBarSlots.d.ts +4 -2
- package/lib/projection/ui/projectionBarSlots.d.ts.map +1 -1
- package/lib/projection/ui/projectionBarSlots.js +3 -7
- package/lib/projection/ui/projectionBarSlots.js.map +1 -1
- package/lib/projection/ui/projectionMapChoices.d.ts +31 -6
- package/lib/projection/ui/projectionMapChoices.d.ts.map +1 -1
- package/lib/projection/ui/projectionMapChoices.js +58 -9
- package/lib/projection/ui/projectionMapChoices.js.map +1 -1
- package/lib/projection/ui/projectionMapChrome.d.ts +3 -9
- package/lib/projection/ui/projectionMapChrome.d.ts.map +1 -1
- package/lib/projection/ui/projectionMapChrome.js +41 -27
- package/lib/projection/ui/projectionMapChrome.js.map +1 -1
- package/lib/projection/ui/projectionMapCorner.d.ts +25 -0
- package/lib/projection/ui/projectionMapCorner.d.ts.map +1 -0
- package/lib/projection/ui/projectionMapCorner.js +46 -0
- package/lib/projection/ui/projectionMapCorner.js.map +1 -0
- package/lib/projection/ui/projectionMapModel.d.ts +9 -18
- package/lib/projection/ui/projectionMapModel.d.ts.map +1 -1
- package/lib/projection/ui/projectionMapModel.js +14 -39
- package/lib/projection/ui/projectionMapModel.js.map +1 -1
- package/lib/projection/ui/projectionMapView.d.ts +3 -1
- package/lib/projection/ui/projectionMapView.d.ts.map +1 -1
- package/lib/projection/ui/projectionMapView.js +9 -4
- package/lib/projection/ui/projectionMapView.js.map +1 -1
- package/lib/projection/ui/projectionSelectionSentence.d.ts +10 -0
- package/lib/projection/ui/projectionSelectionSentence.d.ts.map +1 -0
- package/lib/projection/ui/projectionSelectionSentence.js +18 -0
- package/lib/projection/ui/projectionSelectionSentence.js.map +1 -0
- package/lib/projection/ui/projectionStateApi.d.ts +47 -0
- package/lib/projection/ui/projectionStateApi.d.ts.map +1 -0
- package/lib/projection/ui/projectionStateApi.js +9 -0
- package/lib/projection/ui/projectionStateApi.js.map +1 -0
- package/lib/projection/ui/projectionTabModels.js +1 -1
- package/lib/projection/ui/projectionTabModels.js.map +1 -1
- package/lib/projection/ui/useProjectionState.d.ts +1 -29
- package/lib/projection/ui/useProjectionState.d.ts.map +1 -1
- package/lib/projection/ui/useProjectionState.js +13 -5
- package/lib/projection/ui/useProjectionState.js.map +1 -1
- package/lib/scatter/core/index.d.ts +1 -0
- package/lib/scatter/core/index.d.ts.map +1 -1
- package/lib/scatter/core/index.js +1 -0
- package/lib/scatter/core/index.js.map +1 -1
- package/lib/scatter/core/pointShape.d.ts +18 -0
- package/lib/scatter/core/pointShape.d.ts.map +1 -0
- package/lib/scatter/core/pointShape.js +70 -0
- package/lib/scatter/core/pointShape.js.map +1 -0
- package/lib/scatter/ui/ScatterPlot.d.ts.map +1 -1
- package/lib/scatter/ui/ScatterPlot.js +3 -2
- package/lib/scatter/ui/ScatterPlot.js.map +1 -1
- package/lib/scatter/ui/ScatterPointLayer.d.ts +14 -1
- package/lib/scatter/ui/ScatterPointLayer.d.ts.map +1 -1
- package/lib/scatter/ui/ScatterPointLayer.js +15 -3
- package/lib/scatter/ui/ScatterPointLayer.js.map +1 -1
- package/lib/scatter/ui/scatterFigureProps.d.ts +13 -0
- package/lib/scatter/ui/scatterFigureProps.d.ts.map +1 -1
- package/lib/scatter/ui/scatterMarkGlyph.d.ts +2 -1
- package/lib/scatter/ui/scatterMarkGlyph.d.ts.map +1 -1
- package/lib/scatter/ui/scatterMarkGlyph.js +7 -1
- package/lib/scatter/ui/scatterMarkGlyph.js.map +1 -1
- package/lib/scatter3d/ui/ScatterCloud.d.ts.map +1 -1
- package/lib/scatter3d/ui/ScatterCloud.js +2 -1
- package/lib/scatter3d/ui/ScatterCloud.js.map +1 -1
- package/lib/shared/ui/MenuButton.d.ts +3 -2
- package/lib/shared/ui/MenuButton.d.ts.map +1 -1
- package/lib/shared/ui/MenuButton.js +1 -1
- package/lib/shared/ui/MenuButton.js.map +1 -1
- package/lib/structure/core/conformerMinimise.d.ts +36 -0
- package/lib/structure/core/conformerMinimise.d.ts.map +1 -0
- package/lib/structure/core/conformerMinimise.js +81 -0
- package/lib/structure/core/conformerMinimise.js.map +1 -0
- package/lib/structure/core/conformerMinimum.d.ts +62 -0
- package/lib/structure/core/conformerMinimum.d.ts.map +1 -0
- package/lib/structure/core/conformerMinimum.js +90 -0
- package/lib/structure/core/conformerMinimum.js.map +1 -0
- package/lib/structure/core/conformerOptions.d.ts +62 -0
- package/lib/structure/core/conformerOptions.d.ts.map +1 -0
- package/lib/structure/core/conformerOptions.js +83 -0
- package/lib/structure/core/conformerOptions.js.map +1 -0
- package/lib/structure/core/conformerRefine.d.ts +104 -0
- package/lib/structure/core/conformerRefine.d.ts.map +1 -0
- package/lib/structure/core/conformerRefine.js +130 -0
- package/lib/structure/core/conformerRefine.js.map +1 -0
- package/lib/structure/core/conformerRefineRank.d.ts +36 -0
- package/lib/structure/core/conformerRefineRank.d.ts.map +1 -0
- package/lib/structure/core/conformerRefineRank.js +69 -0
- package/lib/structure/core/conformerRefineRank.js.map +1 -0
- package/lib/structure/core/conformerSession.d.ts +50 -0
- package/lib/structure/core/conformerSession.d.ts.map +1 -0
- package/lib/structure/core/conformerSession.js +88 -0
- package/lib/structure/core/conformerSession.js.map +1 -0
- package/lib/structure/core/conformerShape.d.ts +36 -0
- package/lib/structure/core/conformerShape.d.ts.map +1 -0
- package/lib/structure/core/conformerShape.js +150 -0
- package/lib/structure/core/conformerShape.js.map +1 -0
- package/lib/structure/core/conformers.d.ts +107 -0
- package/lib/structure/core/conformers.d.ts.map +1 -0
- package/lib/structure/core/conformers.js +149 -0
- package/lib/structure/core/conformers.js.map +1 -0
- package/lib/structure/core/geometryRelaxer.d.ts +66 -0
- package/lib/structure/core/geometryRelaxer.d.ts.map +1 -0
- package/lib/structure/core/geometryRelaxer.js +2 -0
- package/lib/structure/core/geometryRelaxer.js.map +1 -0
- package/lib/structure/core/index.d.ts +4 -0
- package/lib/structure/core/index.d.ts.map +1 -1
- package/lib/structure/core/index.js +2 -0
- package/lib/structure/core/index.js.map +1 -1
- package/lib/structure/core/moleculeCoordinates.d.ts +31 -0
- package/lib/structure/core/moleculeCoordinates.d.ts.map +1 -0
- package/lib/structure/core/moleculeCoordinates.js +80 -0
- package/lib/structure/core/moleculeCoordinates.js.map +1 -0
- package/lib/structure/core/molfileExport.d.ts +42 -0
- package/lib/structure/core/molfileExport.d.ts.map +1 -0
- package/lib/structure/core/molfileExport.js +47 -0
- package/lib/structure/core/molfileExport.js.map +1 -0
- package/lib/structure/core/oclResources.d.ts +12 -0
- package/lib/structure/core/oclResources.d.ts.map +1 -0
- package/lib/structure/core/oclResources.js +35 -0
- package/lib/structure/core/oclResources.js.map +1 -0
- package/lib/translate/core/catalog.d.ts +61 -0
- package/lib/translate/core/catalog.d.ts.map +1 -0
- package/lib/translate/core/catalog.js +49 -0
- package/lib/translate/core/catalog.js.map +1 -0
- package/lib/translate/core/checkTranslation.d.ts +32 -0
- package/lib/translate/core/checkTranslation.d.ts.map +1 -0
- package/lib/translate/core/checkTranslation.js +98 -0
- package/lib/translate/core/checkTranslation.js.map +1 -0
- package/lib/translate/core/contribution.d.ts +88 -0
- package/lib/translate/core/contribution.d.ts.map +1 -0
- package/lib/translate/core/contribution.js +14 -0
- package/lib/translate/core/contribution.js.map +1 -0
- package/lib/translate/core/index.d.ts +19 -0
- package/lib/translate/core/index.d.ts.map +1 -0
- package/lib/translate/core/index.js +15 -0
- package/lib/translate/core/index.js.map +1 -0
- package/lib/translate/core/marker.d.ts +45 -0
- package/lib/translate/core/marker.d.ts.map +1 -0
- package/lib/translate/core/marker.js +79 -0
- package/lib/translate/core/marker.js.map +1 -0
- package/lib/translate/core/mergeMessages.d.ts +35 -0
- package/lib/translate/core/mergeMessages.d.ts.map +1 -0
- package/lib/translate/core/mergeMessages.js +69 -0
- package/lib/translate/core/mergeMessages.js.map +1 -0
- package/lib/translate/core/session.d.ts +102 -0
- package/lib/translate/core/session.d.ts.map +1 -0
- package/lib/translate/core/session.js +162 -0
- package/lib/translate/core/session.js.map +1 -0
- package/lib/translate/core/start.d.ts +70 -0
- package/lib/translate/core/start.d.ts.map +1 -0
- package/lib/translate/core/start.js +73 -0
- package/lib/translate/core/start.js.map +1 -0
- package/lib/translate/core/suggestions.d.ts +77 -0
- package/lib/translate/core/suggestions.d.ts.map +1 -0
- package/lib/translate/core/suggestions.js +143 -0
- package/lib/translate/core/suggestions.js.map +1 -0
- package/lib/translate/core/tables.d.ts +100 -0
- package/lib/translate/core/tables.d.ts.map +1 -0
- package/lib/translate/core/tables.js +51 -0
- package/lib/translate/core/tables.js.map +1 -0
- package/lib/translate.d.ts +2 -0
- package/lib/translate.d.ts.map +1 -0
- package/lib/translate.js +6 -0
- package/lib/translate.js.map +1 -0
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/lib/xtb/core/xtbRelaxer.d.ts +61 -0
- package/lib/xtb/core/xtbRelaxer.d.ts.map +1 -0
- package/lib/xtb/core/xtbRelaxer.js +108 -0
- package/lib/xtb/core/xtbRelaxer.js.map +1 -0
- package/lib/xtb.d.ts +11 -0
- package/lib/xtb.d.ts.map +1 -0
- package/lib/xtb.js +10 -0
- package/lib/xtb.js.map +1 -0
- package/package.json +18 -11
- package/src/chrome/ui/HeaderToggle.tsx +100 -0
- package/src/chrome/ui/index.ts +2 -0
- package/src/citation/core/gfn2Paper.ts +32 -0
- package/src/citation/core/index.ts +1 -0
- package/src/clipboard/ui/ClickToCopy.tsx +8 -7
- package/src/conformers.ts +87 -0
- package/src/core.ts +1 -0
- package/src/credits/core/credits.ts +16 -0
- package/src/ecosystem/core/index.ts +1 -0
- package/src/ecosystem/core/sites.ts +20 -2
- package/src/ecosystem/ui/EcosystemLinks.tsx +3 -1
- package/src/ecosystem/ui/SiteTile.tsx +3 -1
- package/src/format/core/index.ts +1 -1
- package/src/format/core/words.ts +19 -0
- package/src/language/core/index.ts +7 -0
- package/src/language/core/languageName.ts +16 -0
- package/src/language/core/languageParam.ts +70 -0
- package/src/language/ui/SiteLanguage.tsx +26 -0
- package/src/language/ui/index.ts +3 -0
- package/src/language/ui/siteLanguageContext.ts +20 -0
- package/src/orbital/core/atomicOrbitals.ts +17 -1
- package/src/orbital/core/hydrogenic.ts +2 -1
- package/src/orbital/core/index.ts +1 -0
- package/src/orbital/core/slaterEnergy.ts +83 -0
- package/src/overlay/core/index.ts +6 -2
- package/src/overlay/core/overlayMarks.ts +51 -6
- package/src/overlay/ui/OverlayLegendMark.tsx +5 -0
- package/src/projection/core/index.ts +11 -3
- package/src/projection/core/projectionCopy.ts +3 -0
- package/src/projection/core/projectionGroupings.ts +174 -0
- package/src/projection/core/projectionOptions.ts +18 -7
- package/src/projection/core/projectionPanelWords.ts +10 -0
- package/src/projection/core/projectionSamples.ts +62 -120
- package/src/projection/core/projectionStrings.ts +12 -1
- package/src/projection/core/resolveProjectionOptions.ts +66 -4
- package/src/projection/ui/ProjectionBar.tsx +4 -2
- package/src/projection/ui/ProjectionGroupingPickers.tsx +91 -0
- package/src/projection/ui/ProjectionMapControls.tsx +29 -32
- package/src/projection/ui/ProjectionMapLegend.tsx +1 -1
- package/src/projection/ui/ProjectionMapMore.tsx +14 -4
- package/src/projection/ui/ProjectionMapTab.tsx +27 -9
- package/src/projection/ui/ProjectionPairsMore.tsx +12 -21
- package/src/projection/ui/ProjectionPairsTab.tsx +5 -2
- package/src/projection/ui/ProjectionPanel.tsx +7 -3
- package/src/projection/ui/ProjectionReadout.tsx +28 -8
- package/src/projection/ui/ProjectionSpaceControls.tsx +20 -27
- package/src/projection/ui/ProjectionSpaceMore.tsx +12 -3
- package/src/projection/ui/ProjectionSpaceTab.tsx +23 -6
- package/src/projection/ui/ProjectionViewer.tsx +1 -0
- package/src/projection/ui/projectionBarReadings.ts +24 -8
- package/src/projection/ui/projectionBarSlots.tsx +10 -9
- package/src/projection/ui/projectionMapChoices.ts +71 -14
- package/src/projection/ui/projectionMapChrome.ts +55 -30
- package/src/projection/ui/projectionMapCorner.ts +67 -0
- package/src/projection/ui/projectionMapModel.ts +20 -59
- package/src/projection/ui/projectionMapView.ts +15 -8
- package/src/projection/ui/projectionSelectionSentence.ts +22 -0
- package/src/projection/ui/projectionStateApi.ts +57 -0
- package/src/projection/ui/projectionTabModels.ts +1 -1
- package/src/projection/ui/useProjectionState.ts +33 -37
- package/src/scatter/core/index.ts +1 -0
- package/src/scatter/core/pointShape.ts +80 -0
- package/src/scatter/ui/ScatterPlot.tsx +4 -1
- package/src/scatter/ui/ScatterPointLayer.tsx +39 -11
- package/src/scatter/ui/scatterFigureProps.ts +13 -0
- package/src/scatter/ui/scatterMarkGlyph.tsx +9 -1
- package/src/scatter3d/ui/ScatterCloud.tsx +3 -0
- package/src/shared/ui/MenuButton.tsx +4 -3
- package/src/structure/core/conformerMinimise.ts +99 -0
- package/src/structure/core/conformerMinimum.ts +125 -0
- package/src/structure/core/conformerOptions.ts +125 -0
- package/src/structure/core/conformerRefine.ts +234 -0
- package/src/structure/core/conformerRefineRank.ts +89 -0
- package/src/structure/core/conformerSession.ts +123 -0
- package/src/structure/core/conformerShape.ts +181 -0
- package/src/structure/core/conformers.ts +282 -0
- package/src/structure/core/geometryRelaxer.ts +71 -0
- package/src/structure/core/index.ts +13 -0
- package/src/structure/core/moleculeCoordinates.ts +93 -0
- package/src/structure/core/molfileExport.ts +62 -0
- package/src/structure/core/oclResources.ts +41 -0
- package/src/translate/core/catalog.ts +83 -0
- package/src/translate/core/checkTranslation.ts +128 -0
- package/src/translate/core/contribution.ts +99 -0
- package/src/translate/core/index.ts +72 -0
- package/src/translate/core/marker.ts +85 -0
- package/src/translate/core/mergeMessages.ts +74 -0
- package/src/translate/core/session.ts +250 -0
- package/src/translate/core/start.ts +121 -0
- package/src/translate/core/suggestions.ts +211 -0
- package/src/translate/core/tables.ts +120 -0
- package/src/translate.ts +5 -0
- package/src/ui.ts +1 -0
- package/src/xtb/core/xtbRelaxer.ts +160 -0
- package/src/xtb.ts +16 -0
- package/styles/chrome.css +61 -30
|
@@ -8,13 +8,15 @@
|
|
|
8
8
|
* honest as the controls around it change.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { formatInteger } from '../../format/core/numbers.ts';
|
|
12
11
|
import type { OverlayLegendEntry } from '../../overlay/ui/OverlayLegend.tsx';
|
|
13
12
|
import type { EllipseSize } from '../../scatter/core/confidenceEllipse.ts';
|
|
14
13
|
import { fillCopy } from '../core/fillCopy.ts';
|
|
15
14
|
import type { ProjectionCopy } from '../core/projectionCopy.ts';
|
|
16
15
|
import type { ProjectionMarker } from '../core/projectionResult.ts';
|
|
17
|
-
import type {
|
|
16
|
+
import type {
|
|
17
|
+
ResolvedProjectionGroups,
|
|
18
|
+
ResolvedProjectionShapes,
|
|
19
|
+
} from '../core/projectionSamples.ts';
|
|
18
20
|
|
|
19
21
|
import { ellipseCoverageText } from './projectionEllipse.ts';
|
|
20
22
|
import { UNGROUPED_INK } from './projectionMapModel.ts';
|
|
@@ -27,6 +29,8 @@ interface ProjectionMapChromeInput {
|
|
|
27
29
|
groups: ResolvedProjectionGroups;
|
|
28
30
|
/** Whether colour stands for the group at all. */
|
|
29
31
|
colored: boolean;
|
|
32
|
+
/** The grouping the dots are shaped by, or `null` while they are all discs. */
|
|
33
|
+
shapes: ResolvedProjectionShapes | null;
|
|
30
34
|
/** How large the group outlines are, or `null` for none. */
|
|
31
35
|
ellipse: EllipseSize | null;
|
|
32
36
|
/** How many samples a group needs before it is outlined at all. */
|
|
@@ -82,6 +86,7 @@ export function projectionMapChrome(
|
|
|
82
86
|
input: ProjectionMapChromeInput,
|
|
83
87
|
): ProjectionMapChrome {
|
|
84
88
|
const { copy, groups, colored, ellipse, showGroupMeans, markers } = input;
|
|
89
|
+
const { shapes } = input;
|
|
85
90
|
const { minimumPoints, fittedCount, total, figure = 'map' } = input;
|
|
86
91
|
const entries: OverlayLegendEntry[] = [];
|
|
87
92
|
const skipped: string[] = [];
|
|
@@ -108,6 +113,7 @@ export function projectionMapChrome(
|
|
|
108
113
|
});
|
|
109
114
|
}
|
|
110
115
|
}
|
|
116
|
+
appendShapeEntries(entries, shapes);
|
|
111
117
|
appendMarkerEntries(entries, markers, groups);
|
|
112
118
|
|
|
113
119
|
const hollow = fittedCount < total;
|
|
@@ -121,7 +127,7 @@ export function projectionMapChrome(
|
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
return {
|
|
124
|
-
title: legendTitle(copy, groups, colored),
|
|
130
|
+
title: legendTitle(copy, groups, colored, shapes),
|
|
125
131
|
entries,
|
|
126
132
|
caption: captionFor(
|
|
127
133
|
copy,
|
|
@@ -136,44 +142,60 @@ export function projectionMapChrome(
|
|
|
136
142
|
}
|
|
137
143
|
|
|
138
144
|
/**
|
|
139
|
-
* The sentence
|
|
140
|
-
*
|
|
141
|
-
* @param count - How many samples are selected.
|
|
142
|
-
* @param total - How many there are in all.
|
|
143
|
-
* @returns The sentence.
|
|
144
|
-
*/
|
|
145
|
-
export function projectionSelectionSentence(
|
|
146
|
-
copy: ProjectionCopy,
|
|
147
|
-
count: number,
|
|
148
|
-
total: number,
|
|
149
|
-
): string {
|
|
150
|
-
if (count === 0) return copy.sentence.selectionNone;
|
|
151
|
-
return fillCopy(copy.sentence.selection, {
|
|
152
|
-
count: formatInteger(count),
|
|
153
|
-
total: formatInteger(total),
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* The sentence over the legend.
|
|
145
|
+
* The sentence over the legend, naming what the colour and the shape stand
|
|
146
|
+
* for.
|
|
159
147
|
*
|
|
160
|
-
* When
|
|
161
|
-
* names the shape channel: a legend naming no encoding at all is the one
|
|
162
|
-
* this title exists to prevent, and it is not fixed by leaving
|
|
148
|
+
* When neither stands for a grouping the entries left are all marks, so the
|
|
149
|
+
* title names the shape channel: a legend naming no encoding at all is the one
|
|
150
|
+
* fault this title exists to prevent, and it is not fixed by leaving it out.
|
|
163
151
|
* @param copy - The words the map writes.
|
|
164
152
|
* @param groups - The groups as the map colours them.
|
|
165
153
|
* @param colored - Whether colour stands for the group at all.
|
|
154
|
+
* @param shapes - The grouping the dots are shaped by, or `null`.
|
|
166
155
|
* @returns The title.
|
|
167
156
|
*/
|
|
168
157
|
function legendTitle(
|
|
169
158
|
copy: ProjectionCopy,
|
|
170
159
|
groups: ResolvedProjectionGroups,
|
|
171
160
|
colored: boolean,
|
|
161
|
+
shapes: ResolvedProjectionShapes | null,
|
|
172
162
|
): string {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
163
|
+
const parts: string[] = [];
|
|
164
|
+
if (colored && groups.entries.length > 0) {
|
|
165
|
+
parts.push(
|
|
166
|
+
fillCopy(copy.legend.mapNoEllipse, {
|
|
167
|
+
groups: groups.label.toLowerCase(),
|
|
168
|
+
}),
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
if (shapes !== null) {
|
|
172
|
+
parts.push(
|
|
173
|
+
fillCopy(copy.legend.shapedBy, { shapes: shapes.label.toLowerCase() }),
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
return parts.length === 0 ? copy.legend.shapes : parts.join(' ');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* One entry per shape, drawn in the muted ink: a colour on a shape's entry
|
|
181
|
+
* would claim a group of the colour grouping it does not stand for.
|
|
182
|
+
* @param entries - The legend, appended to in place.
|
|
183
|
+
* @param shapes - The grouping the dots are shaped by, or `null`.
|
|
184
|
+
*/
|
|
185
|
+
function appendShapeEntries(
|
|
186
|
+
entries: OverlayLegendEntry[],
|
|
187
|
+
shapes: ResolvedProjectionShapes | null,
|
|
188
|
+
): void {
|
|
189
|
+
if (shapes === null) return;
|
|
190
|
+
for (const entry of shapes.entries) {
|
|
191
|
+
entries.push({
|
|
192
|
+
id: `shape-${entry.id}`,
|
|
193
|
+
label: entry.label,
|
|
194
|
+
color: SHAPE_INK,
|
|
195
|
+
shape: entry.shape,
|
|
196
|
+
count: entry.count,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
177
199
|
}
|
|
178
200
|
|
|
179
201
|
function captionFor(
|
|
@@ -221,3 +243,6 @@ function appendMarkerEntries(
|
|
|
221
243
|
});
|
|
222
244
|
}
|
|
223
245
|
}
|
|
246
|
+
|
|
247
|
+
/** The ink a shape's entry is drawn in, the one the key uses for marks that name no colour. */
|
|
248
|
+
const SHAPE_INK = 'var(--text-muted)';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which corner of the map the floating key takes.
|
|
3
|
+
*
|
|
4
|
+
* It is a module of its own because it is the one piece of the map that has to
|
|
5
|
+
* know where the dots fall before anything is drawn over them, and it is all
|
|
6
|
+
* arithmetic that can be checked without rendering anything.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { emptiestCorner } from '../../overlay/core/emptiestCorner.ts';
|
|
10
|
+
import type { OverlayCorner } from '../../overlay/core/overlayPlacement.ts';
|
|
11
|
+
|
|
12
|
+
import type { ProjectionMapCloud } from './projectionMapModel.ts';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The corner of the map with the fewest dots under it.
|
|
16
|
+
*
|
|
17
|
+
* All four are offered. The chrome that asks is laid out inside the plot
|
|
18
|
+
* rectangle rather than over the figure's box, so no corner of it costs the
|
|
19
|
+
* reader an axis label, and the only thing left to weigh is how many samples
|
|
20
|
+
* each one would cover.
|
|
21
|
+
* @param cloud - Where every sample sits, in data units.
|
|
22
|
+
* @param xDomain - The range the horizontal axis covers.
|
|
23
|
+
* @param yDomain - The range the vertical axis covers.
|
|
24
|
+
* @param width - Width of the plot rectangle, in pixels.
|
|
25
|
+
* @param height - Its height.
|
|
26
|
+
* @returns The corner the card sits in.
|
|
27
|
+
*/
|
|
28
|
+
export function projectionMapCorner(
|
|
29
|
+
cloud: ProjectionMapCloud,
|
|
30
|
+
xDomain: readonly [number, number],
|
|
31
|
+
yDomain: readonly [number, number],
|
|
32
|
+
width: number,
|
|
33
|
+
height: number,
|
|
34
|
+
): OverlayCorner {
|
|
35
|
+
return emptiestCorner(
|
|
36
|
+
placeAlong(cloud.x, xDomain, width, false),
|
|
37
|
+
placeAlong(cloud.y, yDomain, height, true),
|
|
38
|
+
{ width, height, cardWidth: CARD_WIDTH, cardHeight: CARD_HEIGHT },
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function placeAlong(
|
|
43
|
+
values: Float64Array,
|
|
44
|
+
domain: readonly [number, number],
|
|
45
|
+
size: number,
|
|
46
|
+
flip: boolean,
|
|
47
|
+
): Float64Array {
|
|
48
|
+
const span = domain[1] - domain[0];
|
|
49
|
+
const factor = span === 0 ? 0 : size / span;
|
|
50
|
+
const pixels = new Float64Array(values.length);
|
|
51
|
+
for (let index = 0; index < values.length; index++) {
|
|
52
|
+
const along = ((values[index] ?? Number.NaN) - domain[0]) * factor;
|
|
53
|
+
pixels[index] = flip ? size - along : along;
|
|
54
|
+
}
|
|
55
|
+
return pixels;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* How much of the plot the floating key is expected to cover.
|
|
60
|
+
*
|
|
61
|
+
* It is an estimate on purpose — the card has not been laid out when the
|
|
62
|
+
* corner is chosen — and it is the compact key's size rather than the roomier
|
|
63
|
+
* card the overlay domain assumes: a corner counted as three species wide
|
|
64
|
+
* would call a corner busy that the key never reaches.
|
|
65
|
+
*/
|
|
66
|
+
const CARD_WIDTH = 170;
|
|
67
|
+
const CARD_HEIGHT = 84;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Where a map's samples land, and
|
|
2
|
+
* Where a map's samples land, and what a plot is handed to draw them.
|
|
3
3
|
*
|
|
4
4
|
* It sits beside the component rather than inside it because a plot has to
|
|
5
5
|
* know where its dots fall before it can decide where its controls may sit,
|
|
@@ -14,15 +14,17 @@ import {
|
|
|
14
14
|
import { chartAxisTitle } from '../../chart/core/chartLabels.ts';
|
|
15
15
|
import type { ChartViewport } from '../../chart/core/chartViewport.ts';
|
|
16
16
|
import type { MatrixLike } from '../../chart/core/matrix.ts';
|
|
17
|
-
import {
|
|
18
|
-
import type { OverlayCorner } from '../../overlay/core/overlayPlacement.ts';
|
|
17
|
+
import type { OverlaySampleShape } from '../../overlay/core/overlayMarks.ts';
|
|
19
18
|
import type { ScatterGroup } from '../../scatter/ui/scatterFigureProps.ts';
|
|
20
19
|
import type { ScatterMarker } from '../../scatter/ui/scatterPlotProps.ts';
|
|
21
20
|
import type {
|
|
22
21
|
ProjectionMarker,
|
|
23
22
|
ProjectionResult,
|
|
24
23
|
} from '../core/projectionResult.ts';
|
|
25
|
-
import type {
|
|
24
|
+
import type {
|
|
25
|
+
ResolvedProjectionGroups,
|
|
26
|
+
ResolvedProjectionShapes,
|
|
27
|
+
} from '../core/projectionSamples.ts';
|
|
26
28
|
|
|
27
29
|
/** Where every sample sits on the map, in the embedding's own units. */
|
|
28
30
|
export interface ProjectionMapCloud {
|
|
@@ -119,34 +121,6 @@ export function projectionMapViewport(
|
|
|
119
121
|
};
|
|
120
122
|
}
|
|
121
123
|
|
|
122
|
-
/**
|
|
123
|
-
* The corner of the map with the fewest dots under it.
|
|
124
|
-
*
|
|
125
|
-
* All four are offered. The chrome that asks is laid out inside the plot
|
|
126
|
-
* rectangle rather than over the figure's box, so no corner of it costs the
|
|
127
|
-
* reader an axis label, and the only thing left to weigh is how many samples
|
|
128
|
-
* each one would cover.
|
|
129
|
-
* @param cloud - Where every sample sits, in data units.
|
|
130
|
-
* @param xDomain - The range the horizontal axis covers.
|
|
131
|
-
* @param yDomain - The range the vertical axis covers.
|
|
132
|
-
* @param width - Width of the plot rectangle, in pixels.
|
|
133
|
-
* @param height - Its height.
|
|
134
|
-
* @returns The corner the card sits in.
|
|
135
|
-
*/
|
|
136
|
-
export function projectionMapCorner(
|
|
137
|
-
cloud: ProjectionMapCloud,
|
|
138
|
-
xDomain: readonly [number, number],
|
|
139
|
-
yDomain: readonly [number, number],
|
|
140
|
-
width: number,
|
|
141
|
-
height: number,
|
|
142
|
-
): OverlayCorner {
|
|
143
|
-
return emptiestCorner(
|
|
144
|
-
placeAlong(cloud.x, xDomain, width, false),
|
|
145
|
-
placeAlong(cloud.y, yDomain, height, true),
|
|
146
|
-
{ width, height, cardWidth: CARD_WIDTH, cardHeight: CARD_HEIGHT },
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
124
|
/**
|
|
151
125
|
* The reference points of a result, placed on the two axes the map draws.
|
|
152
126
|
* @param markers - The reference points, in the embedding's own units.
|
|
@@ -192,6 +166,20 @@ export function projectionScatterGroups(
|
|
|
192
166
|
return plotted;
|
|
193
167
|
}
|
|
194
168
|
|
|
169
|
+
/**
|
|
170
|
+
* The shapes in the order a plot names them by index.
|
|
171
|
+
* @param shapes - The grouping the dots are shaped by, or `null`.
|
|
172
|
+
* @returns One shape per group, or nothing while every dot is a disc.
|
|
173
|
+
*/
|
|
174
|
+
export function projectionScatterShapes(
|
|
175
|
+
shapes: ResolvedProjectionShapes | null,
|
|
176
|
+
): OverlaySampleShape[] | undefined {
|
|
177
|
+
if (shapes === null) return undefined;
|
|
178
|
+
const list: OverlaySampleShape[] = [];
|
|
179
|
+
for (const entry of shapes.entries) list.push(entry.shape);
|
|
180
|
+
return list;
|
|
181
|
+
}
|
|
182
|
+
|
|
195
183
|
/**
|
|
196
184
|
* What one axis of the map is called.
|
|
197
185
|
*
|
|
@@ -220,32 +208,5 @@ function withRoom(
|
|
|
220
208
|
return [extent.min, extent.max];
|
|
221
209
|
}
|
|
222
210
|
|
|
223
|
-
function placeAlong(
|
|
224
|
-
values: Float64Array,
|
|
225
|
-
domain: readonly [number, number],
|
|
226
|
-
size: number,
|
|
227
|
-
flip: boolean,
|
|
228
|
-
): Float64Array {
|
|
229
|
-
const span = domain[1] - domain[0];
|
|
230
|
-
const factor = span === 0 ? 0 : size / span;
|
|
231
|
-
const pixels = new Float64Array(values.length);
|
|
232
|
-
for (let index = 0; index < values.length; index++) {
|
|
233
|
-
const along = ((values[index] ?? Number.NaN) - domain[0]) * factor;
|
|
234
|
-
pixels[index] = flip ? size - along : along;
|
|
235
|
-
}
|
|
236
|
-
return pixels;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* How much of the plot the floating key is expected to cover.
|
|
241
|
-
*
|
|
242
|
-
* It is an estimate on purpose — the card has not been laid out when the
|
|
243
|
-
* corner is chosen — and it is the compact key's size rather than the roomier
|
|
244
|
-
* card the overlay domain assumes: a corner counted as three species wide
|
|
245
|
-
* would call a corner busy that the key never reaches.
|
|
246
|
-
*/
|
|
247
|
-
const CARD_WIDTH = 170;
|
|
248
|
-
const CARD_HEIGHT = 84;
|
|
249
|
-
|
|
250
211
|
/** Room left around a framed selection, as a share of its own span. */
|
|
251
212
|
const SELECTION_ROOM = 0.1;
|
|
@@ -18,23 +18,25 @@ import type { OrbitCamera } from '../../scatter3d/core/orbitCamera.ts';
|
|
|
18
18
|
import { DEFAULT_ORBIT_CAMERA } from '../../scatter3d/core/orbitCamera.ts';
|
|
19
19
|
import type { ProjectionCopy } from '../core/projectionCopy.ts';
|
|
20
20
|
import type { ProjectionOptions } from '../core/projectionOptions.ts';
|
|
21
|
+
import { NO_GROUPING } from '../core/projectionOptions.ts';
|
|
21
22
|
import type {
|
|
22
23
|
ProjectionMarker,
|
|
23
24
|
ProjectionResult,
|
|
24
25
|
} from '../core/projectionResult.ts';
|
|
25
|
-
import type {
|
|
26
|
+
import type {
|
|
27
|
+
ResolvedProjectionGroups,
|
|
28
|
+
ResolvedProjectionShapes,
|
|
29
|
+
} from '../core/projectionSamples.ts';
|
|
26
30
|
|
|
27
31
|
import type { SelectionReport } from './ProjectionMapCaption.tsx';
|
|
28
32
|
import type { ProjectionMapChrome } from './projectionMapChrome.ts';
|
|
29
|
-
import {
|
|
30
|
-
projectionMapChrome,
|
|
31
|
-
projectionSelectionSentence,
|
|
32
|
-
} from './projectionMapChrome.ts';
|
|
33
|
+
import { projectionMapChrome } from './projectionMapChrome.ts';
|
|
33
34
|
import {
|
|
34
35
|
MINIMUM_OUTLINE_POINTS,
|
|
35
36
|
projectionMapDomain,
|
|
36
37
|
projectionMapViewport,
|
|
37
38
|
} from './projectionMapModel.ts';
|
|
39
|
+
import { projectionSelectionSentence } from './projectionSelectionSentence.ts';
|
|
38
40
|
import { MINIMUM_SHELL_POINTS } from './projectionSpaceModel.ts';
|
|
39
41
|
|
|
40
42
|
/** What {@link useProjectionMapView} needs. */
|
|
@@ -45,6 +47,8 @@ interface ProjectionMapViewInput {
|
|
|
45
47
|
copy: ProjectionCopy;
|
|
46
48
|
/** The groups as every figure of this viewer draws them. */
|
|
47
49
|
groups: ResolvedProjectionGroups;
|
|
50
|
+
/** The grouping the dots are shaped by, or `null` while they are all discs. */
|
|
51
|
+
shapes: ResolvedProjectionShapes | null;
|
|
48
52
|
/** Every option, already made safe against the result. */
|
|
49
53
|
options: ProjectionOptions;
|
|
50
54
|
/** The selected rows, as indices into the score matrix. */
|
|
@@ -93,7 +97,7 @@ export interface ProjectionMapView {
|
|
|
93
97
|
export function useProjectionMapView(
|
|
94
98
|
input: ProjectionMapViewInput,
|
|
95
99
|
): ProjectionMapView {
|
|
96
|
-
const { result, copy, groups, options, selected, onSettle } = input;
|
|
100
|
+
const { result, copy, groups, shapes, options, selected, onSettle } = input;
|
|
97
101
|
const { scores, fittedCount, markers } = result;
|
|
98
102
|
const { colorBy, ellipse, showGroupMeans, xAxis, yAxis } = options;
|
|
99
103
|
|
|
@@ -139,13 +143,14 @@ export function useProjectionMapView(
|
|
|
139
143
|
setCloudZoom(1);
|
|
140
144
|
}, []);
|
|
141
145
|
|
|
142
|
-
const colored = colorBy
|
|
146
|
+
const colored = colorBy !== NO_GROUPING && groups.entries.length > 0;
|
|
143
147
|
const chrome = useMemo(
|
|
144
148
|
() =>
|
|
145
149
|
projectionMapChrome({
|
|
146
150
|
copy,
|
|
147
151
|
groups,
|
|
148
152
|
colored,
|
|
153
|
+
shapes,
|
|
149
154
|
ellipse: colored ? ellipse : null,
|
|
150
155
|
minimumPoints: MINIMUM_OUTLINE_POINTS,
|
|
151
156
|
showGroupMeans,
|
|
@@ -157,6 +162,7 @@ export function useProjectionMapView(
|
|
|
157
162
|
copy,
|
|
158
163
|
groups,
|
|
159
164
|
colored,
|
|
165
|
+
shapes,
|
|
160
166
|
ellipse,
|
|
161
167
|
showGroupMeans,
|
|
162
168
|
markers,
|
|
@@ -171,6 +177,7 @@ export function useProjectionMapView(
|
|
|
171
177
|
copy,
|
|
172
178
|
groups,
|
|
173
179
|
colored,
|
|
180
|
+
shapes,
|
|
174
181
|
ellipse: colored ? ellipse : null,
|
|
175
182
|
minimumPoints: MINIMUM_SHELL_POINTS,
|
|
176
183
|
showGroupMeans: false,
|
|
@@ -179,7 +186,7 @@ export function useProjectionMapView(
|
|
|
179
186
|
total: scores.rows,
|
|
180
187
|
figure: 'space',
|
|
181
188
|
}),
|
|
182
|
-
[copy, groups, colored, ellipse, fittedCount, scores],
|
|
189
|
+
[copy, groups, colored, shapes, ellipse, fittedCount, scores],
|
|
183
190
|
);
|
|
184
191
|
|
|
185
192
|
const settle = useCallback(
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { formatInteger } from '../../format/core/numbers.ts';
|
|
2
|
+
import { fillCopy } from '../core/fillCopy.ts';
|
|
3
|
+
import type { ProjectionCopy } from '../core/projectionCopy.ts';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The sentence reporting what a gesture picked out.
|
|
7
|
+
* @param copy - The words the map writes.
|
|
8
|
+
* @param count - How many samples are selected.
|
|
9
|
+
* @param total - How many there are in all.
|
|
10
|
+
* @returns The sentence.
|
|
11
|
+
*/
|
|
12
|
+
export function projectionSelectionSentence(
|
|
13
|
+
copy: ProjectionCopy,
|
|
14
|
+
count: number,
|
|
15
|
+
total: number,
|
|
16
|
+
): string {
|
|
17
|
+
if (count === 0) return copy.sentence.selectionNone;
|
|
18
|
+
return fillCopy(copy.sentence.selection, {
|
|
19
|
+
count: formatInteger(count),
|
|
20
|
+
total: formatInteger(total),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the one hook every tab shares hands out.
|
|
3
|
+
*
|
|
4
|
+
* The type lives beside the hook rather than inside it because the hook is
|
|
5
|
+
* short and its answer is not: a reader looking for how the state is kept
|
|
6
|
+
* should not have to scroll past a page of documented fields to find it.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { ScatterSelectionMode } from '../../scatter/core/scatterSelection.ts';
|
|
10
|
+
import type { SelectionChange } from '../../scatter/ui/useScatterSelection.ts';
|
|
11
|
+
import type { ProjectionOptions } from '../core/projectionOptions.ts';
|
|
12
|
+
import type {
|
|
13
|
+
ProjectionGrouping,
|
|
14
|
+
ResolvedProjectionGroups,
|
|
15
|
+
ResolvedProjectionShapes,
|
|
16
|
+
} from '../core/projectionSamples.ts';
|
|
17
|
+
import type { ProjectionTab } from '../core/projectionTabs.ts';
|
|
18
|
+
|
|
19
|
+
import type { ProjectionSelection } from './projectionSelection.ts';
|
|
20
|
+
|
|
21
|
+
/** What every tab reads, and the five ways any of them changes it. */
|
|
22
|
+
export interface ProjectionStateApi {
|
|
23
|
+
/** The tabs this result can fill, in reading order. */
|
|
24
|
+
tabs: readonly ProjectionTab[];
|
|
25
|
+
/** The one showing. */
|
|
26
|
+
tab: ProjectionTab;
|
|
27
|
+
/** Move to another tab. One the result cannot fill is ignored. */
|
|
28
|
+
setTab: (tab: ProjectionTab) => void;
|
|
29
|
+
/**
|
|
30
|
+
* The grouping the dots are coloured by, resolved once per change; empty
|
|
31
|
+
* while the colour stands for nothing.
|
|
32
|
+
*/
|
|
33
|
+
groups: ResolvedProjectionGroups;
|
|
34
|
+
/**
|
|
35
|
+
* The grouping the dots are shaped by, resolved once per change, or `null`
|
|
36
|
+
* while they are all discs.
|
|
37
|
+
*/
|
|
38
|
+
shapes: ResolvedProjectionShapes | null;
|
|
39
|
+
/** Every grouping the samples carry, for the pickers that choose between them. */
|
|
40
|
+
groupings: readonly ProjectionGrouping[];
|
|
41
|
+
/** Every option, already made safe against the result. */
|
|
42
|
+
options: ProjectionOptions;
|
|
43
|
+
/** Change some of them; the rest are carried over and checked again. */
|
|
44
|
+
setOptions: (patch: Partial<ProjectionOptions>) => void;
|
|
45
|
+
/** The selected rows, as indices, which is what a plot draws. */
|
|
46
|
+
selected: readonly number[];
|
|
47
|
+
/** Settle a selection a plot's own gesture produced. */
|
|
48
|
+
settleSelection: (change: SelectionChange) => void;
|
|
49
|
+
/** Settle one from elsewhere — a legend entry, a table beside the figure. */
|
|
50
|
+
selectRows: (
|
|
51
|
+
rows: readonly number[],
|
|
52
|
+
mode: ScatterSelectionMode,
|
|
53
|
+
source: ProjectionSelection['source'],
|
|
54
|
+
) => void;
|
|
55
|
+
/** Draw one pair of axes on the map, which is what a cell of the grid does. */
|
|
56
|
+
selectPair: (xAxis: number, yAxis: number) => void;
|
|
57
|
+
}
|
|
@@ -2,9 +2,13 @@ import { useCallback, useMemo, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import type { ScatterSelectionMode } from '../../scatter/core/scatterSelection.ts';
|
|
4
4
|
import type { SelectionChange } from '../../scatter/ui/useScatterSelection.ts';
|
|
5
|
+
import {
|
|
6
|
+
projectionGrouping,
|
|
7
|
+
resolveProjectionGroups,
|
|
8
|
+
resolveProjectionShapes,
|
|
9
|
+
} from '../core/projectionGroupings.ts';
|
|
5
10
|
import type { ProjectionOptions } from '../core/projectionOptions.ts';
|
|
6
|
-
import type {
|
|
7
|
-
import { resolveProjectionGroups } from '../core/projectionSamples.ts';
|
|
11
|
+
import type { ProjectionGrouping } from '../core/projectionSamples.ts';
|
|
8
12
|
import type { ProjectionTab } from '../core/projectionTabs.ts';
|
|
9
13
|
import { projectionTabs } from '../core/projectionTabs.ts';
|
|
10
14
|
import { resolveProjectionOptions } from '../core/resolveProjectionOptions.ts';
|
|
@@ -15,6 +19,7 @@ import {
|
|
|
15
19
|
projectionNamesOf,
|
|
16
20
|
projectionRowsOf,
|
|
17
21
|
} from './projectionSelection.ts';
|
|
22
|
+
import type { ProjectionStateApi } from './projectionStateApi.ts';
|
|
18
23
|
import type { ProjectionViewerProps } from './projectionViewerProps.ts';
|
|
19
24
|
|
|
20
25
|
/**
|
|
@@ -41,34 +46,6 @@ type ProjectionStateOptions = Pick<
|
|
|
41
46
|
| 'onOptionsChange'
|
|
42
47
|
>;
|
|
43
48
|
|
|
44
|
-
/** What every tab reads, and the five ways any of them changes it. */
|
|
45
|
-
export interface ProjectionStateApi {
|
|
46
|
-
/** The tabs this result can fill, in reading order. */
|
|
47
|
-
tabs: readonly ProjectionTab[];
|
|
48
|
-
/** The one showing. */
|
|
49
|
-
tab: ProjectionTab;
|
|
50
|
-
/** Move to another tab. One the result cannot fill is ignored. */
|
|
51
|
-
setTab: (tab: ProjectionTab) => void;
|
|
52
|
-
/** The groups as every figure draws them, resolved once per change. */
|
|
53
|
-
groups: ResolvedProjectionGroups;
|
|
54
|
-
/** Every option, already made safe against the result. */
|
|
55
|
-
options: ProjectionOptions;
|
|
56
|
-
/** Change some of them; the rest are carried over and checked again. */
|
|
57
|
-
setOptions: (patch: Partial<ProjectionOptions>) => void;
|
|
58
|
-
/** The selected rows, as indices, which is what a plot draws. */
|
|
59
|
-
selected: readonly number[];
|
|
60
|
-
/** Settle a selection a plot's own gesture produced. */
|
|
61
|
-
settleSelection: (change: SelectionChange) => void;
|
|
62
|
-
/** Settle one from elsewhere — a legend entry, a table beside the figure. */
|
|
63
|
-
selectRows: (
|
|
64
|
-
rows: readonly number[],
|
|
65
|
-
mode: ScatterSelectionMode,
|
|
66
|
-
source: ProjectionSelection['source'],
|
|
67
|
-
) => void;
|
|
68
|
-
/** Draw one pair of axes on the map, which is what a cell of the grid does. */
|
|
69
|
-
selectPair: (xAxis: number, yAxis: number) => void;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
49
|
/**
|
|
73
50
|
* The tab, the pair of axes, the selection and the options, controlled or not.
|
|
74
51
|
*
|
|
@@ -121,13 +98,23 @@ export function useProjectionState(
|
|
|
121
98
|
() => defaultOptions ?? {},
|
|
122
99
|
);
|
|
123
100
|
|
|
101
|
+
const groupings = samples.groupings ?? NO_GROUPINGS;
|
|
102
|
+
const settled = useMemo(
|
|
103
|
+
() =>
|
|
104
|
+
resolveProjectionOptions(heldOptions ?? ownOptions, result, groupings),
|
|
105
|
+
[groupings, heldOptions, ownOptions, result],
|
|
106
|
+
);
|
|
107
|
+
const { colorBy, shapeBy } = settled;
|
|
108
|
+
const rowCount = result.scores.rows;
|
|
124
109
|
const groups = useMemo(
|
|
125
|
-
() =>
|
|
126
|
-
|
|
110
|
+
() =>
|
|
111
|
+
resolveProjectionGroups(projectionGrouping(samples, colorBy), rowCount),
|
|
112
|
+
[colorBy, rowCount, samples],
|
|
127
113
|
);
|
|
128
|
-
const
|
|
129
|
-
() =>
|
|
130
|
-
|
|
114
|
+
const shapes = useMemo(
|
|
115
|
+
() =>
|
|
116
|
+
resolveProjectionShapes(projectionGrouping(samples, shapeBy), rowCount),
|
|
117
|
+
[rowCount, samples, shapeBy],
|
|
131
118
|
);
|
|
132
119
|
|
|
133
120
|
const setTab = useCallback(
|
|
@@ -142,11 +129,15 @@ export function useProjectionState(
|
|
|
142
129
|
|
|
143
130
|
const setOptions = useCallback(
|
|
144
131
|
(patch: Partial<ProjectionOptions>) => {
|
|
145
|
-
const next = resolveProjectionOptions(
|
|
132
|
+
const next = resolveProjectionOptions(
|
|
133
|
+
{ ...settled, ...patch },
|
|
134
|
+
result,
|
|
135
|
+
groupings,
|
|
136
|
+
);
|
|
146
137
|
if (heldOptions === undefined) setOwnOptions(next);
|
|
147
138
|
onOptionsChange?.(next);
|
|
148
139
|
},
|
|
149
|
-
[heldOptions, onOptionsChange, result, settled],
|
|
140
|
+
[groupings, heldOptions, onOptionsChange, result, settled],
|
|
150
141
|
);
|
|
151
142
|
|
|
152
143
|
const selectRows = useCallback(
|
|
@@ -189,6 +180,8 @@ export function useProjectionState(
|
|
|
189
180
|
tab: inReach(tab, tabs) ?? inReach(ownTab, tabs) ?? tabs[0] ?? 'map',
|
|
190
181
|
setTab,
|
|
191
182
|
groups,
|
|
183
|
+
shapes,
|
|
184
|
+
groupings,
|
|
192
185
|
options: settled,
|
|
193
186
|
setOptions,
|
|
194
187
|
selected:
|
|
@@ -222,3 +215,6 @@ function inReach(
|
|
|
222
215
|
}
|
|
223
216
|
return undefined;
|
|
224
217
|
}
|
|
218
|
+
|
|
219
|
+
/** No groupings at all, shared so an absent list keeps one identity. */
|
|
220
|
+
const NO_GROUPINGS: readonly ProjectionGrouping[] = [];
|
|
@@ -38,6 +38,7 @@ export {
|
|
|
38
38
|
resetLassoPath,
|
|
39
39
|
} from './lassoPath.ts';
|
|
40
40
|
export { pointInPolygon, pointsInPolygon, polygonBounds } from './polygon.ts';
|
|
41
|
+
export { pointShapePath } from './pointShape.ts';
|
|
41
42
|
export type { ScatterGroupMoments } from './scatterGroupMoments.ts';
|
|
42
43
|
export type {
|
|
43
44
|
ScatterGroupSpread,
|