react-cheminfo 0.127.0 → 0.129.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 +79 -43
- package/lib/drawing/core/camera.d.ts +22 -0
- package/lib/drawing/core/camera.d.ts.map +1 -1
- package/lib/drawing/core/camera.js +37 -0
- package/lib/drawing/core/camera.js.map +1 -1
- package/lib/drawing/core/graphics.d.ts.map +1 -1
- package/lib/drawing/core/graphics.js +2 -10
- package/lib/drawing/core/graphics.js.map +1 -1
- package/lib/drawing/core/groupFiles.d.ts +22 -0
- package/lib/drawing/core/groupFiles.d.ts.map +1 -0
- package/lib/drawing/core/groupFiles.js +51 -0
- package/lib/drawing/core/groupFiles.js.map +1 -0
- package/lib/drawing/core/groups.d.ts +76 -0
- package/lib/drawing/core/groups.d.ts.map +1 -0
- package/lib/drawing/core/groups.js +190 -0
- package/lib/drawing/core/groups.js.map +1 -0
- package/lib/drawing/core/index.d.ts +7 -2
- package/lib/drawing/core/index.d.ts.map +1 -1
- package/lib/drawing/core/index.js +5 -2
- package/lib/drawing/core/index.js.map +1 -1
- package/lib/drawing/core/selectionFrame.d.ts +70 -0
- package/lib/drawing/core/selectionFrame.d.ts.map +1 -0
- package/lib/drawing/core/selectionFrame.js +156 -0
- package/lib/drawing/core/selectionFrame.js.map +1 -0
- package/lib/drawing/core/transform.d.ts +30 -0
- package/lib/drawing/core/transform.d.ts.map +1 -1
- package/lib/drawing/core/transform.js +59 -0
- package/lib/drawing/core/transform.js.map +1 -1
- package/lib/drawing/ui/FrameMarks.d.ts +30 -0
- package/lib/drawing/ui/FrameMarks.d.ts.map +1 -0
- package/lib/drawing/ui/FrameMarks.js +19 -0
- package/lib/drawing/ui/FrameMarks.js.map +1 -0
- package/lib/drawing/ui/curveHandleMarks.d.ts +10 -0
- package/lib/drawing/ui/curveHandleMarks.d.ts.map +1 -1
- package/lib/drawing/ui/curveHandleMarks.js +20 -2
- package/lib/drawing/ui/curveHandleMarks.js.map +1 -1
- package/lib/drawing/ui/index.d.ts +5 -1
- package/lib/drawing/ui/index.d.ts.map +1 -1
- package/lib/drawing/ui/index.js +3 -1
- package/lib/drawing/ui/index.js.map +1 -1
- package/lib/drawing/ui/useCanvasNavigation.d.ts +35 -0
- package/lib/drawing/ui/useCanvasNavigation.d.ts.map +1 -0
- package/lib/drawing/ui/useCanvasNavigation.js +95 -0
- package/lib/drawing/ui/useCanvasNavigation.js.map +1 -0
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/ir/ui/BandsPanel.d.ts +3 -3
- package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
- package/lib/ir/ui/BandsPanel.js +7 -7
- package/lib/ir/ui/BandsPanel.js.map +1 -1
- package/lib/ir/ui/BandsToolbar.d.ts.map +1 -1
- package/lib/ir/ui/BandsToolbar.js +2 -4
- package/lib/ir/ui/BandsToolbar.js.map +1 -1
- package/lib/ir/ui/IrEditor.d.ts +7 -0
- package/lib/ir/ui/IrEditor.d.ts.map +1 -1
- package/lib/ir/ui/IrEditor.js.map +1 -1
- package/lib/ir/ui/IrShell.d.ts.map +1 -1
- package/lib/ir/ui/IrShell.js +3 -2
- package/lib/ir/ui/IrShell.js.map +1 -1
- package/lib/ir/ui/IrStatusBar.js +2 -2
- package/lib/ir/ui/IrStatusBar.js.map +1 -1
- package/lib/ir/ui/IrToolbar.js +2 -2
- package/lib/ir/ui/IrToolbar.js.map +1 -1
- package/lib/ir/ui/VibrationalEditor.d.ts +7 -0
- package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -1
- package/lib/ir/ui/VibrationalEditor.js +2 -1
- package/lib/ir/ui/VibrationalEditor.js.map +1 -1
- package/lib/ir/ui/useIrEditor.d.ts +12 -0
- package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
- package/lib/ir/ui/useIrEditor.js +10 -3
- package/lib/ir/ui/useIrEditor.js.map +1 -1
- package/lib/locales/de.json +9 -0
- package/lib/locales/en.json +9 -0
- package/lib/locales/es.json +9 -0
- package/lib/locales/fr.json +9 -0
- package/lib/locales/it.json +9 -0
- package/lib/pedagogy/ui/ExerciseActions.d.ts +10 -2
- package/lib/pedagogy/ui/ExerciseActions.d.ts.map +1 -1
- package/lib/pedagogy/ui/ExerciseActions.js +7 -5
- package/lib/pedagogy/ui/ExerciseActions.js.map +1 -1
- package/lib/share/core/exampleMark.d.ts +31 -0
- package/lib/share/core/exampleMark.d.ts.map +1 -0
- package/lib/share/core/exampleMark.js +31 -0
- package/lib/share/core/exampleMark.js.map +1 -0
- package/lib/share/core/index.d.ts +5 -0
- package/lib/share/core/index.d.ts.map +1 -1
- package/lib/share/core/index.js +3 -0
- package/lib/share/core/index.js.map +1 -1
- package/lib/share/core/linkBytes.d.ts +29 -0
- package/lib/share/core/linkBytes.d.ts.map +1 -0
- package/lib/share/core/linkBytes.js +70 -0
- package/lib/share/core/linkBytes.js.map +1 -0
- package/lib/share/core/linkValue.d.ts +34 -0
- package/lib/share/core/linkValue.d.ts.map +1 -0
- package/lib/share/core/linkValue.js +58 -0
- package/lib/share/core/linkValue.js.map +1 -0
- package/lib/share/core/opensOn.d.ts +133 -0
- package/lib/share/core/opensOn.d.ts.map +1 -0
- package/lib/share/core/opensOn.js +82 -0
- package/lib/share/core/opensOn.js.map +1 -0
- package/lib/share/core/seal.d.ts.map +1 -1
- package/lib/share/core/seal.js +3 -32
- package/lib/share/core/seal.js.map +1 -1
- package/lib/share/ui/ShareOpensOn.d.ts +32 -0
- package/lib/share/ui/ShareOpensOn.d.ts.map +1 -0
- package/lib/share/ui/ShareOpensOn.js +49 -0
- package/lib/share/ui/ShareOpensOn.js.map +1 -0
- package/lib/share/ui/index.d.ts +4 -0
- package/lib/share/ui/index.d.ts.map +1 -1
- package/lib/share/ui/index.js +2 -0
- package/lib/share/ui/index.js.map +1 -1
- package/lib/share/ui/useOpensOnShare.d.ts +65 -0
- package/lib/share/ui/useOpensOnShare.d.ts.map +1 -0
- package/lib/share/ui/useOpensOnShare.js +60 -0
- package/lib/share/ui/useOpensOnShare.js.map +1 -0
- package/package.json +1 -1
- package/src/drawing/core/camera.ts +45 -0
- package/src/drawing/core/graphics.ts +2 -12
- package/src/drawing/core/groupFiles.ts +55 -0
- package/src/drawing/core/groups.ts +221 -0
- package/src/drawing/core/index.ts +29 -1
- package/src/drawing/core/selectionFrame.ts +192 -0
- package/src/drawing/core/transform.ts +80 -0
- package/src/drawing/ui/FrameMarks.tsx +57 -0
- package/src/drawing/ui/curveHandleMarks.tsx +43 -10
- package/src/drawing/ui/index.ts +8 -1
- package/src/drawing/ui/useCanvasNavigation.ts +120 -0
- package/src/ir/ui/BandsPanel.tsx +15 -10
- package/src/ir/ui/BandsToolbar.tsx +2 -4
- package/src/ir/ui/IrEditor.tsx +7 -0
- package/src/ir/ui/IrShell.tsx +4 -2
- package/src/ir/ui/IrStatusBar.tsx +2 -2
- package/src/ir/ui/IrToolbar.tsx +2 -2
- package/src/ir/ui/VibrationalEditor.tsx +9 -0
- package/src/ir/ui/useIrEditor.ts +23 -4
- package/src/locales/de.json +9 -0
- package/src/locales/en.json +9 -0
- package/src/locales/es.json +9 -0
- package/src/locales/fr.json +9 -0
- package/src/locales/it.json +9 -0
- package/src/pedagogy/ui/ExerciseActions.tsx +22 -7
- package/src/share/core/exampleMark.ts +52 -0
- package/src/share/core/index.ts +25 -0
- package/src/share/core/linkBytes.ts +75 -0
- package/src/share/core/linkValue.ts +66 -0
- package/src/share/core/opensOn.ts +203 -0
- package/src/share/core/seal.ts +3 -36
- package/src/share/ui/ShareOpensOn.tsx +169 -0
- package/src/share/ui/index.ts +7 -0
- package/src/share/ui/useOpensOnShare.tsx +152 -0
- package/styles/chrome.css +18 -0
package/README.md
CHANGED
|
@@ -160,49 +160,49 @@ through a wildcard subpath exactly as `react-science` serves its own.
|
|
|
160
160
|
|
|
161
161
|
## What is in it
|
|
162
162
|
|
|
163
|
-
| Area | `…/core`
|
|
164
|
-
| -------------------------- |
|
|
165
|
-
| **Site identity** | `siteById`, `findSiteByHost`, `siteTokensCss`
|
|
166
|
-
| **Chrome** | —
|
|
167
|
-
| **An empty tool** | —
|
|
168
|
-
| **Waiting for data** | —
|
|
169
|
-
| **Languages** | `LANGUAGES`, `DEFAULT_LANGUAGE`, `LANGUAGE_LABELS`, `isLanguage`, `MessageCatalog`, `CHROME_CATALOG`, `setMessageSession`, `loadCatalogs`, `startTranslateMode`, `LANGUAGE_PARAM`, `withLanguageParam`
|
|
170
|
-
| **Citation** | `formatCitation`, `formatCitations`, `citationSegments`, `downloadCitation`, `citedReferences`, `doiUrl`, `referenceVenue`
|
|
171
|
-
| **Contact** | `CONTACT_FORM_URLS`, `contactFormUrl`, `contactUrl`
|
|
172
|
-
| **Share & embed** | `parseShareConfig`, `applyShareConfig`, `buildShareUrl`, `buildEmbedCode`, `isHidden`, `visibleShareParts`, `applySharePreset`, `findSharePreset`, the param codecs, `syncPreferencesWithUrl`, `preferenceEffect`, `pinnedPreferenceSearch`, `applyPreferencesFromSearch`, `writePreferencesToSearch`, sealed links: `openSealedAddress`, `sealShareUrl`, `sealQuery`, `unsealQuery`
|
|
173
|
-
| **Routing & head** | `createTabRouter`, `readRoute`, `writeRoute`, `subscribeToRoute`, `adoptLegacyHashAddress`, `writeDocumentMeta`, `pageLocation`, `pageHistory`
|
|
174
|
-
| **Indexing** | `injectPageMeta`, `pageHeadTags`, `pageDocumentMeta`, `fill`, `PAGE_HEAD_MARKER`, `PAGE_BODY_MARKER`, `robotsTxt`, `sitemapXml`, `noscriptIndex`, `structuredDataScript`, `assertRoutes`, `routeFor`, `homeRoute`
|
|
175
|
-
| **Pedagogy** | `parseGlossaryMarkers`, `localStorageProgressStore`, `progressSummary`, `finishValidation`
|
|
176
|
-
| **Graded series** | `pickSeeded`, `freshSeed`, `parseSeed`, `seedParam`, `createAttemptStore`, `createProgressController`, `readAnswerNumber`, `emptyCase`, `unreadableCase`
|
|
177
|
-
| **Formulas** | `readFormula`, `normalizeFormula`, `canonicalFormula`, `atomCounts`, `formulaHtml`, `formulaText` (all `/formula`)
|
|
178
|
-
| **Site shell** | `pageContentOf`; the `pages` option of `cheminfoPrerender` (`/vite`)
|
|
179
|
-
| **Properties** | `copyableText`
|
|
180
|
-
| **Clipboard & files** | `writeToClipboard`, `downloadBlob`, `downloadText`, `sanitizeFileName`, `toDelimited`, `readDelimited`, `readXYTable`, `downloadFigure`, `figureSvg`, `figurePng`, `cropFigure`, `figureSize`, `dpiScale`, `withPngDpi`
|
|
181
|
-
| **Formatting & colour** | `formatInteger`, `formatDecimal`, `formatBytes`, `pluralize`, `readableInk`, `contrastRatio`, `COLOR_SCALES`, `resolveColorScale`, `formatColorScale`, `colorAt`, `swatchAt`, `sampleScale`, `colorScaleGradient`, `rgbToHsv`
|
|
182
|
-
| **Number entry** | `readNumber`, `numberText`, `isPartialNumber`, `stepNumber`, `snapToStep`
|
|
183
|
-
| **Linked highlight** | `hoverHighlight`, `selectHighlight`, `highlightStateOf`, `highlightMatches`, `sameHighlightKey`
|
|
184
|
-
| **Range filter** | `isRangeBounded`, `isRangeDomain`, `rangeHandles`, `movedRange`, `settleHandles`, `sameRange`, `rangeHistogramPath`, `OPEN_RANGE`
|
|
185
|
-
| **Widgets** | `CREDITS`, `credits`
|
|
186
|
-
| **Hooks & state** | `createWorkerChannel`, `persistBucket`, `persistSignalBucket`
|
|
187
|
-
| **Requests** | `fetchJson`, `ApiError`, `readApiError`, `keySetParam`, `readHiddenParts`, `formatHiddenParts`, `fitDescription`, `DESCRIPTION_MIN`, `DESCRIPTION_MAX`, `openingRoute`, `anchorHref`
|
|
188
|
-
| **Chemistry** | `atomicOrbitalsOf`, `configurationOf`, `classifyMolfile`, `readStructure`, `toMolfileExport`
|
|
189
|
-
| **Conformers** | `generateConformers`, `continueConformers`, `refineConformers`, `conformerShape`, `isSameMinimum`, `rankByEnergy`, `minimiseConformer`, `DEFAULT_CONFORMER_OPTIONS`, `CONFORMER_STRATEGIES` (all `/conformers`); `GeometryRelaxer`, `readRelaxableGeometry`, `centredRmsd`
|
|
190
|
-
| **Spectrum charts** | `chartScale`, `chartAxisScale`, `plotRect`, `zoomDomain`, `zoomSelection`, `labelStackBaselines`, `layoutAnnotationBoxes`, `profilePath`, `stickPath`, `guidePlacement`, `readoutPlacement`, `stackCapacity`, `nextSpectrumColor`, `panelStyles`, `statusBar`
|
|
191
|
-
| **Infrared and Raman** | `loadIrSpectra`, `toIrSpectrum`, `pickBands`, `pickBandAt`, `editBandsAt`, `bandsFromIrPeaks`, `irPeaksFromBands`, `bandsFromRamanPeaks`, `ramanPeaksFromBands`, `bandsFromUvPeaks`, `uvPeaksFromBands`, `loadUvVisSpectra`, `assignBands`, `BAND_ASSIGNMENTS`, `irSpectrumToJcamp`, `IR_MODE_RULES`, `IR_TECHNIQUE_RULES`, `nearestBandAt`, `planBandLabels`, `irReducer` (all `/ir`)
|
|
192
|
-
| **Mass spectra** | `loadMassSpectra`, `toMassSpectra`, `analyseSpectrum`, `decideResolution`, `resolutionOf`, `mzDecimalsOf`, `planPeakLabels`, `peakTableRows`, `massSpectrumToJcamp`, `massReducer` (all `/mass`)
|
|
193
|
-
| **X-ray photoelectron** | `loadSpectra`, `detectFormat`, `readAnalysisBlocks`, `pickPeaks`, `assignElements`, `referenceLevels`, `applyBackground`, `shirleyBackground`, `tougaardBackground`, `integrateWindow`, `quantifyComponents`, `toBindingEnergy`, `toKineticEnergy`, `xpsReducer` (all `/xps`)
|
|
194
|
-
| **Spectra** | `FILTER_CATALOG`, `filterMenu`, `settingsProblems`, `normalizationFilters`, `addFilter`, `moveFilter`, `setFilterOption`, `principalComponentChoices`, `clampPrincipalComponents`, `EMPTY_SETTINGS` (all `/spectra`)
|
|
195
|
-
| **About** | `resolveAbout`, `aboutProblems`
|
|
196
|
-
| **Which build is running** | `formatBuiltAt`, `shortCommit`, `BuildInfo`
|
|
197
|
-
| **Slideshows** | `parseTalk`, `splitDemoLinks`, `slideActionForKey`, `parseTalkOrigin`, `buildTalkManifest` (all `/slides`)
|
|
198
|
-
| **Token guard** | `findTokenViolations`
|
|
199
|
-
| **Figures** | `chartScale`, `chartAxisScale`, `chartAxisTitle`, `chartShare`, `chartColumnExtent`, `chartBinCounts`, `chartSeriesColor`, `rowMatrix`, `stackedMatrix`, `emptiestCorner`, `placeOverlayCard`, `overlayMetrics`
|
|
200
|
-
| **Projections** | `pcaResult`, `embeddingResult`, `projectionTabs`, `loadingProfiles`, `explainedShares`, `confidenceEllipse`, `projectEllipse`, `pointsInPolygon`, `resolveProjectionGroups`, `resolveProjectionShapes`, `PROJECTION_COPY`
|
|
201
|
-
| **Parallel coordinates** | `parallelAxisOf`, `parallelAxisLayouts`, `parallelIncludedMask`, `parallelKeptCount`, `parallelNearestRow`, `parallelSegmentAt`, `parallelBandAt`, `parallelRangeOf`, `parallelPalette`, `parallelColorSteps`, `paintParallelLines`
|
|
202
|
-
| **Periodic table** | `PERIODIC_ELEMENTS`, `elementBySymbol`, `elementByAtomicNumber`, `cellOf`, `placedElements`, `elementByArrowKey`, `tableGeometry`, `EMPTY_BLOCK`, `categorySwatch`, `CATEGORY_LABELS`
|
|
203
|
-
| **Taxonomy** | `TAXON_RANKS`, `PRINCIPAL_RANKS`, `rankOrder`, `isPrincipalRank`, `isGenusOrBelow`, `isAboveGenus`, `principalLineage`, `lineageFromNodes`, `lineageFromRanks`, `genusOrBelow`, `ncbiTaxonomyUrl`, `splitOrganismName`
|
|
204
|
-
| **Framed by a host** | `hostStructureLoader`, `readHostMolecule` (`/structure`, which carries OpenChemLib, so `/host` does not); `STRUCTURE_KINDS`, `IR_JDX_SCHEMA`, `IR_PEAKS_SCHEMA`, `RAMAN_JDX_SCHEMA`, `RAMAN_PEAKS_SCHEMA`, `BAND_STRENGTHS`, `connectHost`, `selectInputs`, `checkValue`, `kindAccepts`, `parseRequest`, `OUTPUT_DELAY` (all `/host`); `startStandInHost`, `sendStandInHostRequest`, `SCIPEAKS_ETHYLBENZENE_LOAD`, `sciPeaksEthylbenzeneIrLoad`, `sciPeaksEthylbenzeneRamanLoad` (`/host-testing`)
|
|
205
|
-
| **Answer cards** | `CARD_PARAM`, `ONLY_PARAM`, `isCardAddress`, `parseOnlyParam`, `sitePageUrl`, `cardPageUrl`, `framedPageUrl`, `roomForPanels`; `answerAddresses`, `joinAddress`, `viewOrigins`, `cardMeta`, `pageAnswer`, `siteView` (all `/server`)
|
|
163
|
+
| Area | `…/core` | `…/ui` |
|
|
164
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
165
|
+
| **Site identity** | `siteById`, `findSiteByHost`, `siteTokensCss` | `SiteMark`, `Wordmark`, `SiteTheme`, `SiteTile`, `EcosystemButton`, `EcosystemLinks` |
|
|
166
|
+
| **Chrome** | — | `SiteHeader`, `SiteFooter`, `NavLink`, `NavMenuButton`, `MenuButton`, `AccountButton`, `useCompactHeader` |
|
|
167
|
+
| **An empty tool** | — | `EmptyGuide`, `EmptyGuideSection`, `ShortcutList`, `ShortcutKeys` |
|
|
168
|
+
| **Waiting for data** | — | `DataDropZone` |
|
|
169
|
+
| **Languages** | `LANGUAGES`, `DEFAULT_LANGUAGE`, `LANGUAGE_LABELS`, `isLanguage`, `MessageCatalog`, `CHROME_CATALOG`, `setMessageSession`, `loadCatalogs`, `startTranslateMode`, `LANGUAGE_PARAM`, `withLanguageParam` | `useT`, `useChromeT`, `useLanguage`, `LanguageSelect`, `SiteLanguage` |
|
|
170
|
+
| **Citation** | `formatCitation`, `formatCitations`, `citationSegments`, `downloadCitation`, `citedReferences`, `doiUrl`, `referenceVenue` | `CiteButton`, `CitationMenu`, `CitationPreview` |
|
|
171
|
+
| **Contact** | `CONTACT_FORM_URLS`, `contactFormUrl`, `contactUrl` | `ContactButton` |
|
|
172
|
+
| **Share & embed** | `parseShareConfig`, `applyShareConfig`, `buildShareUrl`, `buildEmbedCode`, `isHidden`, `visibleShareParts`, `applySharePreset`, `findSharePreset`, the param codecs, `syncPreferencesWithUrl`, `preferenceEffect`, `pinnedPreferenceSearch`, `applyPreferencesFromSearch`, `writePreferencesToSearch`, sealed links: `openSealedAddress`, `sealShareUrl`, `sealQuery`, `unsealQuery`, links to an example: `opensOnLinks`, `defaultOpensOn`, `opensOnSearch`, `createExampleMark`, `packLinkValue`, `unpackLinkValue` | `ShareDialog`, `ShareButton`, `HiddenPartsProvider`, `PagePart`, `useIsHidden`, `SealedLinkRefused`, `ShareOpensOn`, `useOpensOnShare` |
|
|
173
|
+
| **Routing & head** | `createTabRouter`, `readRoute`, `writeRoute`, `subscribeToRoute`, `adoptLegacyHashAddress`, `writeDocumentMeta`, `pageLocation`, `pageHistory` | `useTabRoute` |
|
|
174
|
+
| **Indexing** | `injectPageMeta`, `pageHeadTags`, `pageDocumentMeta`, `fill`, `PAGE_HEAD_MARKER`, `PAGE_BODY_MARKER`, `robotsTxt`, `sitemapXml`, `noscriptIndex`, `structuredDataScript`, `assertRoutes`, `routeFor`, `homeRoute` | `cheminfoPrerender`, `ogCardHtml`, `OG_WIDTH`, `OG_HEIGHT` (all `/vite`) |
|
|
175
|
+
| **Pedagogy** | `parseGlossaryMarkers`, `localStorageProgressStore`, `progressSummary`, `finishValidation` | `GlossaryText`, `SyntaxTooltip`, `HintLadder`, `ExerciseActions`, `ExerciseProgressHeader`, `TutorialStepStrip`, `ReferenceGrid`, `TestCaseList` |
|
|
176
|
+
| **Graded series** | `pickSeeded`, `freshSeed`, `parseSeed`, `seedParam`, `createAttemptStore`, `createProgressController`, `readAnswerNumber`, `emptyCase`, `unreadableCase` | `ExerciseSeries`, `QuestionCard`, `AnswerFields`, `ExerciseList`, `useAttemptRecords`, `PracticePage`, `CalculatorTable` (with `styles/practice.css`) |
|
|
177
|
+
| **Formulas** | `readFormula`, `normalizeFormula`, `canonicalFormula`, `atomCounts`, `formulaHtml`, `formulaText` (all `/formula`) | `CopyableFormula`, `QuestionFormula`, `QuestionCompound`, `FormulaInput` (all `/formula`) |
|
|
178
|
+
| **Site shell** | `pageContentOf`; the `pages` option of `cheminfoPrerender` (`/vite`) | `SiteShell`, `ShareControl` |
|
|
179
|
+
| **Properties** | `copyableText` | `PropertyTable` |
|
|
180
|
+
| **Clipboard & files** | `writeToClipboard`, `downloadBlob`, `downloadText`, `sanitizeFileName`, `toDelimited`, `readDelimited`, `readXYTable`, `downloadFigure`, `figureSvg`, `figurePng`, `cropFigure`, `figureSize`, `dpiScale`, `withPngDpi` | `ClickToCopy`, `CopyButton`, `CopyableValue`, `CodeBlock`, `DelimitedTextDialog`, `FigureDownload` |
|
|
181
|
+
| **Formatting & colour** | `formatInteger`, `formatDecimal`, `formatBytes`, `pluralize`, `readableInk`, `contrastRatio`, `COLOR_SCALES`, `resolveColorScale`, `formatColorScale`, `colorAt`, `swatchAt`, `sampleScale`, `colorScaleGradient`, `rgbToHsv` | `ColorScaleLegend`, `ColorScaleSelect`, `ColorScaleEditor`, `ColorScaleBar` |
|
|
182
|
+
| **Number entry** | `readNumber`, `numberText`, `isPartialNumber`, `stepNumber`, `snapToStep` | `NumberInput` |
|
|
183
|
+
| **Linked highlight** | `hoverHighlight`, `selectHighlight`, `highlightStateOf`, `highlightMatches`, `sameHighlightKey` | `highlightTarget`; the `dimmed` flag of a `TrackedLineChart` series |
|
|
184
|
+
| **Range filter** | `isRangeBounded`, `isRangeDomain`, `rangeHandles`, `movedRange`, `settleHandles`, `sameRange`, `rangeHistogramPath`, `OPEN_RANGE` | `RangeSlider` |
|
|
185
|
+
| **Widgets** | `CREDITS`, `credits` | `ErrorBoundary`, `CollapsibleSection`, `CapsuleFilter`, `HelpTooltip`, `CreditsList` |
|
|
186
|
+
| **Hooks & state** | `createWorkerChannel`, `persistBucket`, `persistSignalBucket` | `useDebouncedValue`, `useContainerSize`, `useListKeyboardNavigation`, `useDisclosure` |
|
|
187
|
+
| **Requests** | `fetchJson`, `ApiError`, `readApiError`, `keySetParam`, `readHiddenParts`, `formatHiddenParts`, `fitDescription`, `DESCRIPTION_MIN`, `DESCRIPTION_MAX`, `openingRoute`, `anchorHref` | `useAsync` (signal, `pending`) |
|
|
188
|
+
| **Chemistry** | `atomicOrbitalsOf`, `configurationOf`, `classifyMolfile`, `readStructure`, `toMolfileExport` | `AtomicOrbitalViewer` (`/orbital`), `StructureEditor`, `Structure`, `MoleculeExport` (`/structure`) |
|
|
189
|
+
| **Conformers** | `generateConformers`, `continueConformers`, `refineConformers`, `conformerShape`, `isSameMinimum`, `rankByEnergy`, `minimiseConformer`, `DEFAULT_CONFORMER_OPTIONS`, `CONFORMER_STRATEGIES` (all `/conformers`); `GeometryRelaxer`, `readRelaxableGeometry`, `centredRmsd` | — |
|
|
190
|
+
| **Spectrum charts** | `chartScale`, `chartAxisScale`, `plotRect`, `zoomDomain`, `zoomSelection`, `labelStackBaselines`, `layoutAnnotationBoxes`, `profilePath`, `stickPath`, `guidePlacement`, `readoutPlacement`, `stackCapacity`, `nextSpectrumColor`, `panelStyles`, `statusBar` | `Axes`, `AxisGuide`, `ChartTracker`, `ChartStack`, `SelectionRect`, `TraceLegend`, `PlotCaption`, `useChartZoom`, `useChartPointer`, `useChartSize`, `SidePanelStack`, `PanelRail`, `PanelRow`, `Section`, `FilterInput`, `AboutDialogFrame`, `DocumentationDialogFrame`, `FigureDownload`, `useFigureDownload` |
|
|
191
|
+
| **Infrared and Raman** | `loadIrSpectra`, `toIrSpectrum`, `pickBands`, `pickBandAt`, `editBandsAt`, `bandsFromIrPeaks`, `irPeaksFromBands`, `bandsFromRamanPeaks`, `ramanPeaksFromBands`, `bandsFromUvPeaks`, `uvPeaksFromBands`, `loadUvVisSpectra`, `assignBands`, `BAND_ASSIGNMENTS`, `irSpectrumToJcamp`, `IR_MODE_RULES`, `IR_TECHNIQUE_RULES`, `nearestBandAt`, `planBandLabels`, `irReducer` (all `/ir`) | `IrEditor`, `IrChart`, `BandsPanel`, `SpectraPanel`, `MetadataPanel`, `useIrEditor` (all `/ir`); `RamanEditor` (`/raman`); `UvVisEditor`, `FluorescenceEditor` (`/uvvis`) |
|
|
192
|
+
| **Mass spectra** | `loadMassSpectra`, `toMassSpectra`, `analyseSpectrum`, `decideResolution`, `resolutionOf`, `mzDecimalsOf`, `planPeakLabels`, `peakTableRows`, `massSpectrumToJcamp`, `massReducer` (all `/mass`) | `MassEditor`, `MassChart`, `SpectraPanel`, `PeaksPanel`, `MetadataPanel`, `useMassEditor` (all `/mass`) |
|
|
193
|
+
| **X-ray photoelectron** | `loadSpectra`, `detectFormat`, `readAnalysisBlocks`, `pickPeaks`, `assignElements`, `referenceLevels`, `applyBackground`, `shirleyBackground`, `tougaardBackground`, `integrateWindow`, `quantifyComponents`, `toBindingEnergy`, `toKineticEnergy`, `xpsReducer` (all `/xps`) | `XpsEditor`, `XpsChart`, `SpectraPanel`, `PeaksPanel`, `ElementsPanel`, `ComponentsPanel`, `CompositionPanel`, `useXpsEditor` (all `/xps`) |
|
|
194
|
+
| **Spectra** | `FILTER_CATALOG`, `filterMenu`, `settingsProblems`, `normalizationFilters`, `addFilter`, `moveFilter`, `setFilterOption`, `principalComponentChoices`, `clampPrincipalComponents`, `EMPTY_SETTINGS` (all `/spectra`) | `SpectraSettingsEditor`, `FilterChainEditor`, `PrincipalComponentSelect` (all `/spectra`) |
|
|
195
|
+
| **About** | `resolveAbout`, `aboutProblems` | `AboutPage` |
|
|
196
|
+
| **Which build is running** | `formatBuiltAt`, `shortCommit`, `BuildInfo` | `AboutVersion`, `cheminfoBuildInfo` (`/vite`) |
|
|
197
|
+
| **Slideshows** | `parseTalk`, `splitDemoLinks`, `slideActionForKey`, `parseTalkOrigin`, `buildTalkManifest` (all `/slides`) | `Slideshow`, `SlideView`, `TalkList`, `BackToSlides` (all `/slides`), `cheminfoTalks` (`/vite`) |
|
|
198
|
+
| **Token guard** | `findTokenViolations` | `cheminfo-check-tokens`, `cheminfo-check-messages`, `cheminfo-check-deploy` (the bins) |
|
|
199
|
+
| **Figures** | `chartScale`, `chartAxisScale`, `chartAxisTitle`, `chartShare`, `chartColumnExtent`, `chartBinCounts`, `chartSeriesColor`, `rowMatrix`, `stackedMatrix`, `emptiestCorner`, `placeOverlayCard`, `overlayMetrics` | `ChartFrame`, `ChartAxis`, `TrackedLineChart`, `OverlayBar`, `OverlaySelect`, `OverlaySegmented`, `OverlayToggle`, `OverlayNumber`, `OverlayLegend`, `OverlayCaption`, `OverlayReadout` |
|
|
200
|
+
| **Projections** | `pcaResult`, `embeddingResult`, `projectionTabs`, `loadingProfiles`, `explainedShares`, `confidenceEllipse`, `projectEllipse`, `pointsInPolygon`, `resolveProjectionGroups`, `resolveProjectionShapes`, `PROJECTION_COPY` | `PcaViewer`, `ProjectionViewer`, `ScatterPlot`, `ScatterMatrix` |
|
|
201
|
+
| **Parallel coordinates** | `parallelAxisOf`, `parallelAxisLayouts`, `parallelIncludedMask`, `parallelKeptCount`, `parallelNearestRow`, `parallelSegmentAt`, `parallelBandAt`, `parallelRangeOf`, `parallelPalette`, `parallelColorSteps`, `paintParallelLines` | `ParallelCoordinates` |
|
|
202
|
+
| **Periodic table** | `PERIODIC_ELEMENTS`, `elementBySymbol`, `elementByAtomicNumber`, `cellOf`, `placedElements`, `elementByArrowKey`, `tableGeometry`, `EMPTY_BLOCK`, `categorySwatch`, `CATEGORY_LABELS` | `PeriodicTable`, `ElementCell`, `CategoryLegend`, `periodicTableMinWidth` |
|
|
203
|
+
| **Taxonomy** | `TAXON_RANKS`, `PRINCIPAL_RANKS`, `rankOrder`, `isPrincipalRank`, `isGenusOrBelow`, `isAboveGenus`, `principalLineage`, `lineageFromNodes`, `lineageFromRanks`, `genusOrBelow`, `ncbiTaxonomyUrl`, `splitOrganismName` | `TaxonLineage`, `OrganismName`, `useRankLabel` |
|
|
204
|
+
| **Framed by a host** | `hostStructureLoader`, `readHostMolecule` (`/structure`, which carries OpenChemLib, so `/host` does not); `STRUCTURE_KINDS`, `IR_JDX_SCHEMA`, `IR_PEAKS_SCHEMA`, `RAMAN_JDX_SCHEMA`, `RAMAN_PEAKS_SCHEMA`, `BAND_STRENGTHS`, `connectHost`, `selectInputs`, `checkValue`, `kindAccepts`, `parseRequest`, `OUTPUT_DELAY` (all `/host`); `startStandInHost`, `sendStandInHostRequest`, `SCIPEAKS_ETHYLBENZENE_LOAD`, `sciPeaksEthylbenzeneIrLoad`, `sciPeaksEthylbenzeneRamanLoad` (`/host-testing`) | `useHostConnection` (`/host`) |
|
|
205
|
+
| **Answer cards** | `CARD_PARAM`, `ONLY_PARAM`, `isCardAddress`, `parseOnlyParam`, `sitePageUrl`, `cardPageUrl`, `framedPageUrl`, `roomForPanels`; `answerAddresses`, `joinAddress`, `viewOrigins`, `cardMeta`, `pageAnswer`, `siteView` (all `/server`) | `CardFrame`, `CardDetailsButton`, `CardStatus`, `CardMissing`, `CardFigure`, `CopyTableButton`, `fitCardToFrame`, `useFitCardToFrame`, `useOverlayRoom`, `holdRoomForPanels` (all `/card`); `StructureExportButton`, `useStructureDraft` (`/structure`) |
|
|
206
206
|
|
|
207
207
|
Everything in that table is exported from `./core`, `./ui`, `./slides`,
|
|
208
208
|
`./vite` or `./structure` and nothing else is: the sub-components a component is built
|
|
@@ -1442,6 +1442,42 @@ edited one is refused. **The key ships in every bundle**: this stops a class,
|
|
|
1442
1442
|
not someone who digs the key out of the code. A token, once handed out, must
|
|
1443
1443
|
open for ever: a new key or format ships under a new version prefix (`e2`).
|
|
1444
1444
|
|
|
1445
|
+
## A link to an example
|
|
1446
|
+
|
|
1447
|
+
**A site whose folder panel lists examples lets its Share dialog hand out any
|
|
1448
|
+
of them, whatever is on screen.** `useOpensOnShare` adds an _Opens on_ section
|
|
1449
|
+
to the dialog: what is on screen, when a link can carry it; an example, picked
|
|
1450
|
+
from the list; or the page alone. An example still as it opened is offered
|
|
1451
|
+
first, and named rather than carried whole.
|
|
1452
|
+
|
|
1453
|
+
```tsx
|
|
1454
|
+
const EXAMPLE = createExampleMark<SiteBench>(); // mark() where an example opens
|
|
1455
|
+
|
|
1456
|
+
const opensOn = useOpensOnShare({
|
|
1457
|
+
active: tab === HOME_TAB,
|
|
1458
|
+
examples: LISTED, // the folder panel's own list
|
|
1459
|
+
openedOn: [BENCH_PARAM],
|
|
1460
|
+
onScreen: async () => ({
|
|
1461
|
+
...EXAMPLE.read(bench.peek()),
|
|
1462
|
+
screen: isEmptyBench(bench.peek())
|
|
1463
|
+
? undefined
|
|
1464
|
+
: await benchLink(bench.peek()), // { entries: [[BENCH_PARAM, token]] }
|
|
1465
|
+
}),
|
|
1466
|
+
});
|
|
1467
|
+
|
|
1468
|
+
<SiteShell share={{ vocabulary, title, ...opensOn }} />;
|
|
1469
|
+
```
|
|
1470
|
+
|
|
1471
|
+
A site whose examples are not `?example=<id>` says how a link reaches one:
|
|
1472
|
+
`exampleAddress` returns the parameters and the page (tex writes the example's
|
|
1473
|
+
source as `?tex=`, nmr opens `/sequences/<id>`), and `aloneAddress` the page
|
|
1474
|
+
alone.
|
|
1475
|
+
|
|
1476
|
+
`packLinkValue` and `unpackLinkValue` write a document into a link: JSON,
|
|
1477
|
+
deflated, in URL-safe base64. `packLinkValueIfFits` refuses a token past
|
|
1478
|
+
`MAX_LINK_TOKEN`, which keeps the address under the 8 KB request line nginx and
|
|
1479
|
+
Apache accept. What a link carries is checked as a file would be, never trusted.
|
|
1480
|
+
|
|
1445
1481
|
## Speaking four languages
|
|
1446
1482
|
|
|
1447
1483
|
Every word this library puts on a page — the header, the Tools menu, the Cite
|
|
@@ -69,4 +69,26 @@ export declare function visibleBox(camera: Camera, width: number, height: number
|
|
|
69
69
|
* @returns The camera, zoomed.
|
|
70
70
|
*/
|
|
71
71
|
export declare function zoomAround(camera: Camera, factor: number, offset: Point): Camera;
|
|
72
|
+
/**
|
|
73
|
+
* How much a turn of the wheel zooms: a smooth exponential of the distance it
|
|
74
|
+
* scrolls, so a trackpad's many small steps and a mouse's few large ones zoom
|
|
75
|
+
* alike. A wheel that counts in lines or in pages is turned into pixels first.
|
|
76
|
+
* @param wheel - The wheel's `deltaY` and `deltaMode`.
|
|
77
|
+
* @param wheel.deltaY - How far it scrolls down, in its unit.
|
|
78
|
+
* @param wheel.deltaMode - Its unit: 0 pixels, 1 lines, 2 pages.
|
|
79
|
+
* @param pageHeight - The height of the view, in pixels: a page's worth.
|
|
80
|
+
* @returns The factor: above 1 zooms in.
|
|
81
|
+
*/
|
|
82
|
+
export declare function wheelZoomFactor(wheel: {
|
|
83
|
+
deltaY: number;
|
|
84
|
+
deltaMode: number;
|
|
85
|
+
}, pageHeight: number): number;
|
|
86
|
+
/**
|
|
87
|
+
* The camera dragged by the pointer: the drawing follows the pointer.
|
|
88
|
+
* @param camera - The camera.
|
|
89
|
+
* @param dx - How far the pointer went right, in screen pixels.
|
|
90
|
+
* @param dy - How far it went down, in screen pixels.
|
|
91
|
+
* @returns The camera, moved.
|
|
92
|
+
*/
|
|
93
|
+
export declare function pannedCamera(camera: Camera, dx: number, dy: number): Camera;
|
|
72
94
|
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/drawing/core/camera.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAE7C,2CAA2C;AAC3C,MAAM,WAAW,MAAM;IACrB,qEAAqE;IACrE,CAAC,EAAE,MAAM,CAAC;IACV,qEAAqE;IACrE,CAAC,EAAE,MAAM,CAAC;IACV,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wCAAwC;AACxC,eAAO,MAAM,gBAAgB,QAAU,CAAC;AAExC,8EAA8E;AAC9E,eAAO,MAAM,UAAU;;;CAAkC,CAAC;AAE1D,uCAAuC;AACvC,eAAO,MAAM,YAAY,EAAE,SAAS,MA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,SAAS,MAAM,EAEzC,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,YAAY,EAAE,MAAkC,CAAC;AAQ9D;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,MAAM,CAcR;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAO7E;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,GACZ,MAAM,CASR;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAC5C,UAAU,EAAE,MAAM,GACjB,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAM3E"}
|
|
@@ -98,6 +98,43 @@ export function zoomAround(camera, factor, offset) {
|
|
|
98
98
|
y: pointY - offset.y / zoom,
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* How much a turn of the wheel zooms: a smooth exponential of the distance it
|
|
103
|
+
* scrolls, so a trackpad's many small steps and a mouse's few large ones zoom
|
|
104
|
+
* alike. A wheel that counts in lines or in pages is turned into pixels first.
|
|
105
|
+
* @param wheel - The wheel's `deltaY` and `deltaMode`.
|
|
106
|
+
* @param wheel.deltaY - How far it scrolls down, in its unit.
|
|
107
|
+
* @param wheel.deltaMode - Its unit: 0 pixels, 1 lines, 2 pages.
|
|
108
|
+
* @param pageHeight - The height of the view, in pixels: a page's worth.
|
|
109
|
+
* @returns The factor: above 1 zooms in.
|
|
110
|
+
*/
|
|
111
|
+
export function wheelZoomFactor(wheel, pageHeight) {
|
|
112
|
+
const { deltaY, deltaMode } = wheel;
|
|
113
|
+
const pixels = deltaMode === 1
|
|
114
|
+
? deltaY * WHEEL_LINE
|
|
115
|
+
: deltaMode === 2
|
|
116
|
+
? deltaY * pageHeight
|
|
117
|
+
: deltaY;
|
|
118
|
+
return Math.exp(-pixels * WHEEL_ZOOM_RATE);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The camera dragged by the pointer: the drawing follows the pointer.
|
|
122
|
+
* @param camera - The camera.
|
|
123
|
+
* @param dx - How far the pointer went right, in screen pixels.
|
|
124
|
+
* @param dy - How far it went down, in screen pixels.
|
|
125
|
+
* @returns The camera, moved.
|
|
126
|
+
*/
|
|
127
|
+
export function pannedCamera(camera, dx, dy) {
|
|
128
|
+
return {
|
|
129
|
+
...camera,
|
|
130
|
+
x: camera.x - dx / camera.zoom,
|
|
131
|
+
y: camera.y - dy / camera.zoom,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/** Pixels per line of a wheel that counts in lines, as Firefox's does. */
|
|
135
|
+
const WHEEL_LINE = 16;
|
|
136
|
+
/** How much closer each pixel the wheel scrolls up brings the view. */
|
|
137
|
+
const WHEEL_ZOOM_RATE = 0.002;
|
|
101
138
|
function clampZoom(zoom) {
|
|
102
139
|
return Math.min(ZOOM_RANGE.max * PIXELS_PER_POINT, Math.max(ZOOM_RANGE.min * PIXELS_PER_POINT, zoom));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,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,GAC3B,eAAe,CAEjB"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { curveOutline } from "./curves.js";
|
|
9
9
|
import { boxCorners } from "./geometry.js";
|
|
10
|
+
import { mapCurve } from "./transform.js";
|
|
10
11
|
import { turnAbout } from "./vectors.js";
|
|
11
12
|
/**
|
|
12
13
|
* Whether a graphic is drawn in a box: a rectangle or an ellipse.
|
|
@@ -83,15 +84,6 @@ export function boxTurn(graphic) {
|
|
|
83
84
|
* @returns The moved path.
|
|
84
85
|
*/
|
|
85
86
|
export function mapPath(graphic, map) {
|
|
86
|
-
|
|
87
|
-
...graphic,
|
|
88
|
-
points: graphic.points.map(map),
|
|
89
|
-
};
|
|
90
|
-
if (graphic.controls) {
|
|
91
|
-
moved.controls = graphic.controls.map((control) => control
|
|
92
|
-
? { before: map(control.before), after: map(control.after) }
|
|
93
|
-
: null);
|
|
94
|
-
}
|
|
95
|
-
return moved;
|
|
87
|
+
return mapCurve(graphic, map);
|
|
96
88
|
}
|
|
97
89
|
//# sourceMappingURL=graphics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphics.js","sourceRoot":"","sources":["../../../src/drawing/core/graphics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"graphics.js","sourceRoot":"","sources":["../../../src/drawing/core/graphics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;A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MAAM,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AACtE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CACrB,OAAwB,EACxB,GAA4B;IAE5B,OAAO,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Groups going in and out of a figure: read from a file, and renamed for a
|
|
3
|
+
* paste. See `groups.ts` for what a group is.
|
|
4
|
+
*/
|
|
5
|
+
import type { DrawGroup } from './groups.ts';
|
|
6
|
+
/**
|
|
7
|
+
* The groups of a figure read from a file; `reconcileGroups` then drops
|
|
8
|
+
* what they name that is not there.
|
|
9
|
+
* @param value - The parsed `groups` of the file.
|
|
10
|
+
* @returns The groups, or undefined when there are none.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseGroups(value: unknown): DrawGroup[] | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The groups of pasted items, under the identifiers the items took in the
|
|
15
|
+
* figure pasted into; a member that was not pasted is left out.
|
|
16
|
+
* @param groups - The groups of what was copied.
|
|
17
|
+
* @param renamed - The new identifier of each pasted item.
|
|
18
|
+
* @param nextGroupId - Gives a free identifier for each group.
|
|
19
|
+
* @returns The groups.
|
|
20
|
+
*/
|
|
21
|
+
export declare function renumberGroups(groups: readonly DrawGroup[] | undefined, renamed: ReadonlyMap<string, string>, nextGroupId: () => string): DrawGroup[];
|
|
22
|
+
//# sourceMappingURL=groupFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupFiles.d.ts","sourceRoot":"","sources":["../../../src/drawing/core/groupFiles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,SAAS,CAenE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EACxC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,WAAW,EAAE,MAAM,MAAM,GACxB,SAAS,EAAE,CAWb"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Groups going in and out of a figure: read from a file, and renamed for a
|
|
3
|
+
* paste. See `groups.ts` for what a group is.
|
|
4
|
+
*/
|
|
5
|
+
import { isRecord } from "./values.js";
|
|
6
|
+
/**
|
|
7
|
+
* The groups of a figure read from a file; `reconcileGroups` then drops
|
|
8
|
+
* what they name that is not there.
|
|
9
|
+
* @param value - The parsed `groups` of the file.
|
|
10
|
+
* @returns The groups, or undefined when there are none.
|
|
11
|
+
*/
|
|
12
|
+
export function parseGroups(value) {
|
|
13
|
+
if (!Array.isArray(value))
|
|
14
|
+
return undefined;
|
|
15
|
+
const seen = new Set();
|
|
16
|
+
const groups = [];
|
|
17
|
+
for (const item of value) {
|
|
18
|
+
if (!isRecord(item) || !Array.isArray(item.members))
|
|
19
|
+
continue;
|
|
20
|
+
const { id } = item;
|
|
21
|
+
if (typeof id !== 'string' || id === '' || seen.has(id))
|
|
22
|
+
continue;
|
|
23
|
+
seen.add(id);
|
|
24
|
+
const members = item.members.filter((member) => typeof member === 'string' && member !== '');
|
|
25
|
+
groups.push({ id, members });
|
|
26
|
+
}
|
|
27
|
+
return groups.length > 0 ? groups : undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The groups of pasted items, under the identifiers the items took in the
|
|
31
|
+
* figure pasted into; a member that was not pasted is left out.
|
|
32
|
+
* @param groups - The groups of what was copied.
|
|
33
|
+
* @param renamed - The new identifier of each pasted item.
|
|
34
|
+
* @param nextGroupId - Gives a free identifier for each group.
|
|
35
|
+
* @returns The groups.
|
|
36
|
+
*/
|
|
37
|
+
export function renumberGroups(groups, renamed, nextGroupId) {
|
|
38
|
+
if (!groups?.length)
|
|
39
|
+
return [];
|
|
40
|
+
const groupIds = new Map(groups.map((group) => [group.id, nextGroupId()]));
|
|
41
|
+
return groups.map((group) => {
|
|
42
|
+
const members = [];
|
|
43
|
+
for (const id of group.members) {
|
|
44
|
+
const next = groupIds.get(id) ?? renamed.get(id);
|
|
45
|
+
if (next !== undefined)
|
|
46
|
+
members.push(next);
|
|
47
|
+
}
|
|
48
|
+
return { id: groupIds.get(group.id), members };
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=groupFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupFiles.js","sourceRoot":"","sources":["../../../src/drawing/core/groupFiles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,SAAS;QAC9D,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;QACpB,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,SAAS;QAClE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CACjC,CAAC,MAAM,EAAoB,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,EAAE,CAC1E,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAChD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAwC,EACxC,OAAoC,EACpC,WAAyB;IAEzB,IAAI,CAAC,MAAM,EAAE,MAAM;QAAE,OAAO,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACjD,IAAI,IAAI,KAAK,SAAS;gBAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAW,EAAE,OAAO,EAAE,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Groups: items of a figure selected, moved, scaled and turned as one, the
|
|
3
|
+
* same on every canvas of the family. A group names its members by their
|
|
4
|
+
* identifiers — the site's items, or other groups, so that grouping two groups
|
|
5
|
+
* and ungrouping the result gives the two back. What a member stands for (a
|
|
6
|
+
* molecule's atoms on draw, a membrane on cell) is the site's to say; this
|
|
7
|
+
* module knows only identifiers.
|
|
8
|
+
*/
|
|
9
|
+
/** A group of items. */
|
|
10
|
+
export interface DrawGroup {
|
|
11
|
+
/** Identifier, unique in the figure. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** What it holds, two members at least: items and groups, by identifier. */
|
|
14
|
+
members: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The group each member is held in.
|
|
18
|
+
* @param groups - The groups of a figure.
|
|
19
|
+
* @returns The identifier of the group holding each member, by the member's.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parentsOf(groups: readonly DrawGroup[] | undefined): Map<string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* The outermost things some members belong to: the outermost group of a
|
|
24
|
+
* grouped member, or the member itself.
|
|
25
|
+
* @param groups - The groups of a figure.
|
|
26
|
+
* @param members - The members, by identifier.
|
|
27
|
+
* @returns The outermost units, each once.
|
|
28
|
+
*/
|
|
29
|
+
export declare function outermostUnits(groups: readonly DrawGroup[] | undefined, members: Iterable<string>): Set<string>;
|
|
30
|
+
/**
|
|
31
|
+
* The items some units stand for: a group's members in turn, at any depth,
|
|
32
|
+
* and an item itself.
|
|
33
|
+
* @param groups - The groups of a figure.
|
|
34
|
+
* @param units - Items and groups, by identifier.
|
|
35
|
+
* @returns The items, each once, groups left out.
|
|
36
|
+
*/
|
|
37
|
+
export declare function leafMembers(groups: readonly DrawGroup[] | undefined, units: Iterable<string>): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Some items grown to the whole of every group they belong to, which is what
|
|
40
|
+
* a click or a box with the selection tool picks.
|
|
41
|
+
* @param groups - The groups of a figure.
|
|
42
|
+
* @param items - The items, by identifier.
|
|
43
|
+
* @returns The items and every item grouped with them.
|
|
44
|
+
*/
|
|
45
|
+
export declare function expandToGroups(groups: readonly DrawGroup[] | undefined, items: Iterable<string>): string[];
|
|
46
|
+
/**
|
|
47
|
+
* Group the outermost things some items belong to.
|
|
48
|
+
* @param groups - The groups of a figure.
|
|
49
|
+
* @param items - What to group, by identifier.
|
|
50
|
+
* @param id - The new group's identifier.
|
|
51
|
+
* @returns The groups with the new one, or undefined when the items belong
|
|
52
|
+
* to fewer than two things to group.
|
|
53
|
+
*/
|
|
54
|
+
export declare function withGroup(groups: readonly DrawGroup[] | undefined, items: Iterable<string>, id: string): DrawGroup[] | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Take apart, one level, the outermost groups some items belong to: a group
|
|
57
|
+
* of groups gives its groups back.
|
|
58
|
+
* @param groups - The groups of a figure.
|
|
59
|
+
* @param items - The items, by identifier.
|
|
60
|
+
* @returns The groups left, or undefined when the items belong to none.
|
|
61
|
+
*/
|
|
62
|
+
export declare function withoutGroups(groups: readonly DrawGroup[] | undefined, items: Iterable<string>): DrawGroup[] | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Groups brought in step with what a figure holds: a member gone leaves its
|
|
65
|
+
* group, a member named twice stays in the first group naming it, a group
|
|
66
|
+
* never holds itself, and a group left with one member gives it back to the
|
|
67
|
+
* group above.
|
|
68
|
+
* @param groups - The groups.
|
|
69
|
+
* @param existing - The items the figure holds, by identifier; groups need not
|
|
70
|
+
* be listed.
|
|
71
|
+
* @param rejoining - A group to put an item back in, when the site knows the
|
|
72
|
+
* item replaced one that was grouped (a molecule split in two on draw).
|
|
73
|
+
* @returns The groups, the same array when nothing changed.
|
|
74
|
+
*/
|
|
75
|
+
export declare function reconcileGroups(groups: readonly DrawGroup[], existing: ReadonlySet<string>, rejoining?: ReadonlyMap<string, string>): readonly DrawGroup[];
|
|
76
|
+
//# sourceMappingURL=groups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../src/drawing/core/groups.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAwB;AACx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