react-cheminfo 0.134.1 → 0.136.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 +13 -0
- package/lib/crystal/core/bondGrid.d.ts +26 -0
- package/lib/crystal/core/bondGrid.d.ts.map +1 -0
- package/lib/crystal/core/bondGrid.js +76 -0
- package/lib/crystal/core/bondGrid.js.map +1 -0
- package/lib/crystal/core/cellAtoms.d.ts +43 -0
- package/lib/crystal/core/cellAtoms.d.ts.map +1 -0
- package/lib/crystal/core/cellAtoms.js +70 -0
- package/lib/crystal/core/cellAtoms.js.map +1 -0
- package/lib/crystal/core/cellBonds.d.ts +21 -0
- package/lib/crystal/core/cellBonds.d.ts.map +1 -0
- package/lib/crystal/core/cellBonds.js +100 -0
- package/lib/crystal/core/cellBonds.js.map +1 -0
- package/lib/crystal/core/cif/element.d.ts +9 -0
- package/lib/crystal/core/cif/element.d.ts.map +1 -0
- package/lib/crystal/core/cif/element.js +41 -0
- package/lib/crystal/core/cif/element.js.map +1 -0
- package/lib/crystal/core/cif/index.d.ts +4 -0
- package/lib/crystal/core/cif/index.d.ts.map +1 -0
- package/lib/crystal/core/cif/index.js +3 -0
- package/lib/crystal/core/cif/index.js.map +1 -0
- package/lib/crystal/core/cif/number.d.ts +27 -0
- package/lib/crystal/core/cif/number.d.ts.map +1 -0
- package/lib/crystal/core/cif/number.js +57 -0
- package/lib/crystal/core/cif/number.js.map +1 -0
- package/lib/crystal/core/cif/read.d.ts +12 -0
- package/lib/crystal/core/cif/read.d.ts.map +1 -0
- package/lib/crystal/core/cif/read.js +183 -0
- package/lib/crystal/core/cif/read.js.map +1 -0
- package/lib/crystal/core/cif/readGeometry.d.ts +17 -0
- package/lib/crystal/core/cif/readGeometry.d.ts.map +1 -0
- package/lib/crystal/core/cif/readGeometry.js +93 -0
- package/lib/crystal/core/cif/readGeometry.js.map +1 -0
- package/lib/crystal/core/cif/tags.d.ts +62 -0
- package/lib/crystal/core/cif/tags.d.ts.map +1 -0
- package/lib/crystal/core/cif/tags.js +115 -0
- package/lib/crystal/core/cif/tags.js.map +1 -0
- package/lib/crystal/core/cif/types.d.ts +158 -0
- package/lib/crystal/core/cif/types.d.ts.map +1 -0
- package/lib/crystal/core/cif/types.js +2 -0
- package/lib/crystal/core/cif/types.js.map +1 -0
- package/lib/crystal/core/components.d.ts +56 -0
- package/lib/crystal/core/components.d.ts.map +1 -0
- package/lib/crystal/core/components.js +132 -0
- package/lib/crystal/core/components.js.map +1 -0
- package/lib/crystal/core/covalentRadii.d.ts +24 -0
- package/lib/crystal/core/covalentRadii.d.ts.map +1 -0
- package/lib/crystal/core/covalentRadii.js +55 -0
- package/lib/crystal/core/covalentRadii.js.map +1 -0
- package/lib/crystal/core/disorder.d.ts +59 -0
- package/lib/crystal/core/disorder.d.ts.map +1 -0
- package/lib/crystal/core/disorder.js +168 -0
- package/lib/crystal/core/disorder.js.map +1 -0
- package/lib/crystal/core/expand.d.ts +62 -0
- package/lib/crystal/core/expand.d.ts.map +1 -0
- package/lib/crystal/core/expand.js +61 -0
- package/lib/crystal/core/expand.js.map +1 -0
- package/lib/crystal/core/index.d.ts +20 -0
- package/lib/crystal/core/index.d.ts.map +1 -0
- package/lib/crystal/core/index.js +13 -0
- package/lib/crystal/core/index.js.map +1 -0
- package/lib/crystal/core/moleculeOf.d.ts +31 -0
- package/lib/crystal/core/moleculeOf.d.ts.map +1 -0
- package/lib/crystal/core/moleculeOf.js +128 -0
- package/lib/crystal/core/moleculeOf.js.map +1 -0
- package/lib/crystal/core/moleculeTypes.d.ts +80 -0
- package/lib/crystal/core/moleculeTypes.d.ts.map +1 -0
- package/lib/crystal/core/moleculeTypes.js +2 -0
- package/lib/crystal/core/moleculeTypes.js.map +1 -0
- package/lib/crystal/core/molecules.d.ts +39 -0
- package/lib/crystal/core/molecules.d.ts.map +1 -0
- package/lib/crystal/core/molecules.js +106 -0
- package/lib/crystal/core/molecules.js.map +1 -0
- package/lib/crystal/core/operations.d.ts +19 -0
- package/lib/crystal/core/operations.d.ts.map +1 -0
- package/lib/crystal/core/operations.js +68 -0
- package/lib/crystal/core/operations.js.map +1 -0
- package/lib/crystal/core/packing.d.ts +43 -0
- package/lib/crystal/core/packing.d.ts.map +1 -0
- package/lib/crystal/core/packing.js +89 -0
- package/lib/crystal/core/packing.js.map +1 -0
- package/lib/crystal/core/periodicBonds.d.ts +57 -0
- package/lib/crystal/core/periodicBonds.d.ts.map +1 -0
- package/lib/crystal/core/periodicBonds.js +167 -0
- package/lib/crystal/core/periodicBonds.js.map +1 -0
- package/lib/crystal/core/resolve.d.ts +61 -0
- package/lib/crystal/core/resolve.d.ts.map +1 -0
- package/lib/crystal/core/resolve.js +149 -0
- package/lib/crystal/core/resolve.js.map +1 -0
- package/lib/crystal/core/spaceGroups/index.d.ts +5 -0
- package/lib/crystal/core/spaceGroups/index.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/index.js +4 -0
- package/lib/crystal/core/spaceGroups/index.js.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupOperations.d.ts +14 -0
- package/lib/crystal/core/spaceGroups/spaceGroupOperations.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupOperations.js +24 -0
- package/lib/crystal/core/spaceGroups/spaceGroupOperations.js.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupRows.d.ts +3 -0
- package/lib/crystal/core/spaceGroups/spaceGroupRows.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupRows.js +536 -0
- package/lib/crystal/core/spaceGroups/spaceGroupRows.js.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupSymbols.d.ts +43 -0
- package/lib/crystal/core/spaceGroups/spaceGroupSymbols.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupSymbols.js +169 -0
- package/lib/crystal/core/spaceGroups/spaceGroupSymbols.js.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroups.d.ts +78 -0
- package/lib/crystal/core/spaceGroups/spaceGroups.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroups.js +83 -0
- package/lib/crystal/core/spaceGroups/spaceGroups.js.map +1 -0
- package/lib/crystal/core/symmetry/group.d.ts +15 -0
- package/lib/crystal/core/symmetry/group.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/group.js +37 -0
- package/lib/crystal/core/symmetry/group.js.map +1 -0
- package/lib/crystal/core/symmetry/index.d.ts +8 -0
- package/lib/crystal/core/symmetry/index.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/index.js +6 -0
- package/lib/crystal/core/symmetry/index.js.map +1 -0
- package/lib/crystal/core/symmetry/integerMatrix.d.ts +45 -0
- package/lib/crystal/core/symmetry/integerMatrix.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/integerMatrix.js +139 -0
- package/lib/crystal/core/symmetry/integerMatrix.js.map +1 -0
- package/lib/crystal/core/symmetry/lattice.d.ts +64 -0
- package/lib/crystal/core/symmetry/lattice.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/lattice.js +113 -0
- package/lib/crystal/core/symmetry/lattice.js.map +1 -0
- package/lib/crystal/core/symmetry/operation.d.ts +91 -0
- package/lib/crystal/core/symmetry/operation.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/operation.js +184 -0
- package/lib/crystal/core/symmetry/operation.js.map +1 -0
- package/lib/crystal/core/symmetry/parseOperation.d.ts +18 -0
- package/lib/crystal/core/symmetry/parseOperation.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/parseOperation.js +145 -0
- package/lib/crystal/core/symmetry/parseOperation.js.map +1 -0
- package/lib/crystal/core/symmetry/types.d.ts +29 -0
- package/lib/crystal/core/symmetry/types.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/types.js +5 -0
- package/lib/crystal/core/symmetry/types.js.map +1 -0
- package/lib/crystal/core/symmetryClasses.d.ts +28 -0
- package/lib/crystal/core/symmetryClasses.d.ts.map +1 -0
- package/lib/crystal/core/symmetryClasses.js +93 -0
- package/lib/crystal/core/symmetryClasses.js.map +1 -0
- package/lib/crystal.d.ts +12 -0
- package/lib/crystal.d.ts.map +1 -0
- package/lib/crystal.js +12 -0
- package/lib/crystal.js.map +1 -0
- package/lib/crystal3d/core/cellClip.d.ts +46 -0
- package/lib/crystal3d/core/cellClip.d.ts.map +1 -0
- package/lib/crystal3d/core/cellClip.js +198 -0
- package/lib/crystal3d/core/cellClip.js.map +1 -0
- package/lib/crystal3d/core/cellGeometry.d.ts +63 -0
- package/lib/crystal3d/core/cellGeometry.d.ts.map +1 -0
- package/lib/crystal3d/core/cellGeometry.js +153 -0
- package/lib/crystal3d/core/cellGeometry.js.map +1 -0
- package/lib/crystal3d/core/cellStack.d.ts +51 -0
- package/lib/crystal3d/core/cellStack.d.ts.map +1 -0
- package/lib/crystal3d/core/cellStack.js +79 -0
- package/lib/crystal3d/core/cellStack.js.map +1 -0
- package/lib/crystal3d/core/crystalView.d.ts +71 -0
- package/lib/crystal3d/core/crystalView.d.ts.map +1 -0
- package/lib/crystal3d/core/crystalView.js +48 -0
- package/lib/crystal3d/core/crystalView.js.map +1 -0
- package/lib/crystal3d/core/drawingSet.d.ts +31 -0
- package/lib/crystal3d/core/drawingSet.d.ts.map +1 -0
- package/lib/crystal3d/core/drawingSet.js +63 -0
- package/lib/crystal3d/core/drawingSet.js.map +1 -0
- package/lib/crystal3d/core/elementDrawing.d.ts +50 -0
- package/lib/crystal3d/core/elementDrawing.d.ts.map +1 -0
- package/lib/crystal3d/core/elementDrawing.js +100 -0
- package/lib/crystal3d/core/elementDrawing.js.map +1 -0
- package/lib/crystal3d/core/elementExtent.d.ts +42 -0
- package/lib/crystal3d/core/elementExtent.d.ts.map +1 -0
- package/lib/crystal3d/core/elementExtent.js +56 -0
- package/lib/crystal3d/core/elementExtent.js.map +1 -0
- package/lib/crystal3d/core/elementLabels.d.ts +31 -0
- package/lib/crystal3d/core/elementLabels.d.ts.map +1 -0
- package/lib/crystal3d/core/elementLabels.js +99 -0
- package/lib/crystal3d/core/elementLabels.js.map +1 -0
- package/lib/crystal3d/core/elementShapes.d.ts +43 -0
- package/lib/crystal3d/core/elementShapes.d.ts.map +1 -0
- package/lib/crystal3d/core/elementShapes.js +115 -0
- package/lib/crystal3d/core/elementShapes.js.map +1 -0
- package/lib/crystal3d/core/frame.d.ts +36 -0
- package/lib/crystal3d/core/frame.d.ts.map +1 -0
- package/lib/crystal3d/core/frame.js +35 -0
- package/lib/crystal3d/core/frame.js.map +1 -0
- package/lib/crystal3d/core/framing.d.ts +41 -0
- package/lib/crystal3d/core/framing.d.ts.map +1 -0
- package/lib/crystal3d/core/framing.js +79 -0
- package/lib/crystal3d/core/framing.js.map +1 -0
- package/lib/crystal3d/core/index.d.ts +42 -0
- package/lib/crystal3d/core/index.d.ts.map +1 -0
- package/lib/crystal3d/core/index.js +29 -0
- package/lib/crystal3d/core/index.js.map +1 -0
- package/lib/crystal3d/core/labelText.d.ts +19 -0
- package/lib/crystal3d/core/labelText.d.ts.map +1 -0
- package/lib/crystal3d/core/labelText.js +42 -0
- package/lib/crystal3d/core/labelText.js.map +1 -0
- package/lib/crystal3d/core/latticeBasis.d.ts +49 -0
- package/lib/crystal3d/core/latticeBasis.d.ts.map +1 -0
- package/lib/crystal3d/core/latticeBasis.js +89 -0
- package/lib/crystal3d/core/latticeBasis.js.map +1 -0
- package/lib/crystal3d/core/mat3.d.ts +68 -0
- package/lib/crystal3d/core/mat3.d.ts.map +1 -0
- package/lib/crystal3d/core/mat3.js +146 -0
- package/lib/crystal3d/core/mat3.js.map +1 -0
- package/lib/crystal3d/core/operationMatrix.d.ts +44 -0
- package/lib/crystal3d/core/operationMatrix.d.ts.map +1 -0
- package/lib/crystal3d/core/operationMatrix.js +172 -0
- package/lib/crystal3d/core/operationMatrix.js.map +1 -0
- package/lib/crystal3d/core/orientation.d.ts +62 -0
- package/lib/crystal3d/core/orientation.d.ts.map +1 -0
- package/lib/crystal3d/core/orientation.js +166 -0
- package/lib/crystal3d/core/orientation.js.map +1 -0
- package/lib/crystal3d/core/palette.d.ts +24 -0
- package/lib/crystal3d/core/palette.d.ts.map +1 -0
- package/lib/crystal3d/core/palette.js +34 -0
- package/lib/crystal3d/core/palette.js.map +1 -0
- package/lib/crystal3d/core/primitives.d.ts +133 -0
- package/lib/crystal3d/core/primitives.d.ts.map +1 -0
- package/lib/crystal3d/core/primitives.js +80 -0
- package/lib/crystal3d/core/primitives.js.map +1 -0
- package/lib/crystal3d/core/structureText.d.ts +20 -0
- package/lib/crystal3d/core/structureText.d.ts.map +1 -0
- package/lib/crystal3d/core/structureText.js +37 -0
- package/lib/crystal3d/core/structureText.js.map +1 -0
- package/lib/crystal3d/core/supercell.d.ts +20 -0
- package/lib/crystal3d/core/supercell.d.ts.map +1 -0
- package/lib/crystal3d/core/supercell.js +35 -0
- package/lib/crystal3d/core/supercell.js.map +1 -0
- package/lib/crystal3d/core/types.d.ts +166 -0
- package/lib/crystal3d/core/types.d.ts.map +1 -0
- package/lib/crystal3d/core/types.js +10 -0
- package/lib/crystal3d/core/types.js.map +1 -0
- package/lib/crystal3d/core/vec3.d.ts +75 -0
- package/lib/crystal3d/core/vec3.d.ts.map +1 -0
- package/lib/crystal3d/core/vec3.js +119 -0
- package/lib/crystal3d/core/vec3.js.map +1 -0
- package/lib/crystal3d/ui/CrystalCanvas3D.d.ts +52 -0
- package/lib/crystal3d/ui/CrystalCanvas3D.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalCanvas3D.js +242 -0
- package/lib/crystal3d/ui/CrystalCanvas3D.js.map +1 -0
- package/lib/crystal3d/ui/CrystalStructureView.d.ts +17 -0
- package/lib/crystal3d/ui/CrystalStructureView.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalStructureView.js +76 -0
- package/lib/crystal3d/ui/CrystalStructureView.js.map +1 -0
- package/lib/crystal3d/ui/CrystalStructureViewer.d.ts +22 -0
- package/lib/crystal3d/ui/CrystalStructureViewer.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalStructureViewer.js +29 -0
- package/lib/crystal3d/ui/CrystalStructureViewer.js.map +1 -0
- package/lib/crystal3d/ui/CrystalViewControls.d.ts +25 -0
- package/lib/crystal3d/ui/CrystalViewControls.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalViewControls.js +22 -0
- package/lib/crystal3d/ui/CrystalViewControls.js.map +1 -0
- package/lib/crystal3d/ui/CrystalViewer3D.d.ts +72 -0
- package/lib/crystal3d/ui/CrystalViewer3D.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalViewer3D.js +70 -0
- package/lib/crystal3d/ui/CrystalViewer3D.js.map +1 -0
- package/lib/crystal3d/ui/crystalScene.d.ts +91 -0
- package/lib/crystal3d/ui/crystalScene.d.ts.map +1 -0
- package/lib/crystal3d/ui/crystalScene.js +10 -0
- package/lib/crystal3d/ui/crystalScene.js.map +1 -0
- package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts +52 -0
- package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts.map +1 -0
- package/lib/crystal3d/ui/crystalStructureViewerProps.js +2 -0
- package/lib/crystal3d/ui/crystalStructureViewerProps.js.map +1 -0
- package/lib/crystal3d/ui/index.d.ts +16 -0
- package/lib/crystal3d/ui/index.d.ts.map +1 -0
- package/lib/crystal3d/ui/index.js +12 -0
- package/lib/crystal3d/ui/index.js.map +1 -0
- package/lib/crystal3d/ui/useCrystalCaption.d.ts +14 -0
- package/lib/crystal3d/ui/useCrystalCaption.d.ts.map +1 -0
- package/lib/crystal3d/ui/useCrystalCaption.js +32 -0
- package/lib/crystal3d/ui/useCrystalCaption.js.map +1 -0
- package/lib/crystal3d/viewer/animate.d.ts +49 -0
- package/lib/crystal3d/viewer/animate.d.ts.map +1 -0
- package/lib/crystal3d/viewer/animate.js +83 -0
- package/lib/crystal3d/viewer/animate.js.map +1 -0
- package/lib/crystal3d/viewer/camera.d.ts +44 -0
- package/lib/crystal3d/viewer/camera.d.ts.map +1 -0
- package/lib/crystal3d/viewer/camera.js +103 -0
- package/lib/crystal3d/viewer/camera.js.map +1 -0
- package/lib/crystal3d/viewer/index.d.ts +13 -0
- package/lib/crystal3d/viewer/index.d.ts.map +1 -0
- package/lib/crystal3d/viewer/index.js +8 -0
- package/lib/crystal3d/viewer/index.js.map +1 -0
- package/lib/crystal3d/viewer/layerRegistry.d.ts +24 -0
- package/lib/crystal3d/viewer/layerRegistry.d.ts.map +1 -0
- package/lib/crystal3d/viewer/layerRegistry.js +39 -0
- package/lib/crystal3d/viewer/layerRegistry.js.map +1 -0
- package/lib/crystal3d/viewer/meshPrimitives.d.ts +13 -0
- package/lib/crystal3d/viewer/meshPrimitives.d.ts.map +1 -0
- package/lib/crystal3d/viewer/meshPrimitives.js +76 -0
- package/lib/crystal3d/viewer/meshPrimitives.js.map +1 -0
- package/lib/crystal3d/viewer/plugin.d.ts +133 -0
- package/lib/crystal3d/viewer/plugin.d.ts.map +1 -0
- package/lib/crystal3d/viewer/plugin.js +181 -0
- package/lib/crystal3d/viewer/plugin.js.map +1 -0
- package/lib/crystal3d/viewer/renderCell.d.ts +43 -0
- package/lib/crystal3d/viewer/renderCell.d.ts.map +1 -0
- package/lib/crystal3d/viewer/renderCell.js +53 -0
- package/lib/crystal3d/viewer/renderCell.js.map +1 -0
- package/lib/crystal3d/viewer/renderElements.d.ts +54 -0
- package/lib/crystal3d/viewer/renderElements.d.ts.map +1 -0
- package/lib/crystal3d/viewer/renderElements.js +77 -0
- package/lib/crystal3d/viewer/renderElements.js.map +1 -0
- package/lib/crystal3d/viewer/renderStructure.d.ts +55 -0
- package/lib/crystal3d/viewer/renderStructure.d.ts.map +1 -0
- package/lib/crystal3d/viewer/renderStructure.js +103 -0
- package/lib/crystal3d/viewer/renderStructure.js.map +1 -0
- package/lib/crystal3d/viewer/sceneParts.d.ts +32 -0
- package/lib/crystal3d/viewer/sceneParts.d.ts.map +1 -0
- package/lib/crystal3d/viewer/sceneParts.js +77 -0
- package/lib/crystal3d/viewer/sceneParts.js.map +1 -0
- package/lib/crystal3d/viewer/shapeLayer.d.ts +41 -0
- package/lib/crystal3d/viewer/shapeLayer.d.ts.map +1 -0
- package/lib/crystal3d/viewer/shapeLayer.js +57 -0
- package/lib/crystal3d/viewer/shapeLayer.js.map +1 -0
- package/lib/crystal3d/viewer/textLayer.d.ts +21 -0
- package/lib/crystal3d/viewer/textLayer.d.ts.map +1 -0
- package/lib/crystal3d/viewer/textLayer.js +59 -0
- package/lib/crystal3d/viewer/textLayer.js.map +1 -0
- package/lib/crystal3d/viewer/viewer.d.ts +110 -0
- package/lib/crystal3d/viewer/viewer.d.ts.map +1 -0
- package/lib/crystal3d/viewer/viewer.js +157 -0
- package/lib/crystal3d/viewer/viewer.js.map +1 -0
- package/lib/crystal3d.d.ts +12 -0
- package/lib/crystal3d.d.ts.map +1 -0
- package/lib/crystal3d.js +12 -0
- package/lib/crystal3d.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/locales/de.json +19 -1
- package/lib/locales/en.json +19 -1
- package/lib/locales/es.json +19 -1
- package/lib/locales/fr.json +19 -1
- package/lib/locales/it.json +19 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.js +16 -27
- package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
- package/lib/molstar/bonds/bondRule.d.ts +16 -0
- package/lib/molstar/bonds/bondRule.d.ts.map +1 -0
- package/lib/molstar/bonds/bondRule.js +23 -0
- package/lib/molstar/bonds/bondRule.js.map +1 -0
- package/lib/molstar/bonds/index.d.ts +9 -0
- package/lib/molstar/bonds/index.d.ts.map +1 -0
- package/lib/molstar/bonds/index.js +9 -0
- package/lib/molstar/bonds/index.js.map +1 -0
- package/lib/molstar/ui/MolstarToolbar.d.ts +47 -0
- package/lib/molstar/ui/MolstarToolbar.d.ts.map +1 -0
- package/lib/molstar/ui/MolstarToolbar.js +28 -0
- package/lib/molstar/ui/MolstarToolbar.js.map +1 -0
- package/lib/molstar/ui/index.d.ts +10 -0
- package/lib/molstar/ui/index.d.ts.map +1 -0
- package/lib/molstar/ui/index.js +8 -0
- package/lib/molstar/ui/index.js.map +1 -0
- package/lib/molstar/ui/useMolstarTools.d.ts +63 -0
- package/lib/molstar/ui/useMolstarTools.d.ts.map +1 -0
- package/lib/molstar/ui/useMolstarTools.js +36 -0
- package/lib/molstar/ui/useMolstarTools.js.map +1 -0
- package/package.json +4 -1
- package/src/crystal/core/bondGrid.ts +98 -0
- package/src/crystal/core/cellAtoms.ts +106 -0
- package/src/crystal/core/cellBonds.ts +121 -0
- package/src/crystal/core/cif/element.ts +40 -0
- package/src/crystal/core/cif/index.ts +12 -0
- package/src/crystal/core/cif/number.ts +62 -0
- package/src/crystal/core/cif/read.ts +218 -0
- package/src/crystal/core/cif/readGeometry.ts +104 -0
- package/src/crystal/core/cif/tags.ts +143 -0
- package/src/crystal/core/cif/types.ts +164 -0
- package/src/crystal/core/components.ts +183 -0
- package/src/crystal/core/covalentRadii.ts +56 -0
- package/src/crystal/core/disorder.ts +190 -0
- package/src/crystal/core/expand.ts +105 -0
- package/src/crystal/core/index.ts +46 -0
- package/src/crystal/core/moleculeOf.ts +169 -0
- package/src/crystal/core/moleculeTypes.ts +85 -0
- package/src/crystal/core/molecules.ts +128 -0
- package/src/crystal/core/operations.ts +79 -0
- package/src/crystal/core/packing.ts +116 -0
- package/src/crystal/core/periodicBonds.ts +234 -0
- package/src/crystal/core/resolve.ts +187 -0
- package/src/crystal/core/spaceGroups/index.ts +16 -0
- package/src/crystal/core/spaceGroups/spaceGroupOperations.ts +32 -0
- package/src/crystal/core/spaceGroups/spaceGroupRows.ts +536 -0
- package/src/crystal/core/spaceGroups/spaceGroupSymbols.ts +179 -0
- package/src/crystal/core/spaceGroups/spaceGroups.ts +154 -0
- package/src/crystal/core/symmetry/group.ts +42 -0
- package/src/crystal/core/symmetry/index.ts +23 -0
- package/src/crystal/core/symmetry/integerMatrix.ts +153 -0
- package/src/crystal/core/symmetry/lattice.ts +152 -0
- package/src/crystal/core/symmetry/operation.ts +223 -0
- package/src/crystal/core/symmetry/parseOperation.ts +180 -0
- package/src/crystal/core/symmetry/types.ts +32 -0
- package/src/crystal/core/symmetryClasses.ts +105 -0
- package/src/crystal.ts +12 -0
- package/src/crystal3d/core/cellClip.ts +229 -0
- package/src/crystal3d/core/cellGeometry.ts +193 -0
- package/src/crystal3d/core/cellStack.ts +87 -0
- package/src/crystal3d/core/crystalView.ts +114 -0
- package/src/crystal3d/core/drawingSet.ts +71 -0
- package/src/crystal3d/core/elementDrawing.ts +147 -0
- package/src/crystal3d/core/elementExtent.ts +81 -0
- package/src/crystal3d/core/elementLabels.ts +130 -0
- package/src/crystal3d/core/elementShapes.ts +141 -0
- package/src/crystal3d/core/frame.ts +56 -0
- package/src/crystal3d/core/framing.ts +101 -0
- package/src/crystal3d/core/index.ts +132 -0
- package/src/crystal3d/core/labelText.ts +44 -0
- package/src/crystal3d/core/latticeBasis.ts +110 -0
- package/src/crystal3d/core/mat3.ts +163 -0
- package/src/crystal3d/core/operationMatrix.ts +255 -0
- package/src/crystal3d/core/orientation.ts +229 -0
- package/src/crystal3d/core/palette.ts +43 -0
- package/src/crystal3d/core/primitives.ts +183 -0
- package/src/crystal3d/core/structureText.ts +43 -0
- package/src/crystal3d/core/supercell.ts +40 -0
- package/src/crystal3d/core/types.ts +186 -0
- package/src/crystal3d/core/vec3.ts +127 -0
- package/src/crystal3d/ui/CrystalCanvas3D.tsx +384 -0
- package/src/crystal3d/ui/CrystalStructureView.tsx +148 -0
- package/src/crystal3d/ui/CrystalStructureViewer.tsx +39 -0
- package/src/crystal3d/ui/CrystalViewControls.tsx +100 -0
- package/src/crystal3d/ui/CrystalViewer3D.tsx +183 -0
- package/src/crystal3d/ui/crystalScene.ts +100 -0
- package/src/crystal3d/ui/crystalStructureViewerProps.ts +54 -0
- package/src/crystal3d/ui/index.ts +20 -0
- package/src/crystal3d/ui/useCrystalCaption.ts +38 -0
- package/src/crystal3d/viewer/animate.ts +113 -0
- package/src/crystal3d/viewer/camera.ts +139 -0
- package/src/crystal3d/viewer/index.ts +13 -0
- package/src/crystal3d/viewer/layerRegistry.ts +47 -0
- package/src/crystal3d/viewer/meshPrimitives.ts +102 -0
- package/src/crystal3d/viewer/plugin.ts +258 -0
- package/src/crystal3d/viewer/renderCell.ts +98 -0
- package/src/crystal3d/viewer/renderElements.ts +121 -0
- package/src/crystal3d/viewer/renderStructure.ts +144 -0
- package/src/crystal3d/viewer/sceneParts.ts +119 -0
- package/src/crystal3d/viewer/shapeLayer.ts +108 -0
- package/src/crystal3d/viewer/textLayer.ts +85 -0
- package/src/crystal3d/viewer/viewer.ts +207 -0
- package/src/crystal3d.ts +12 -0
- package/src/locales/de.json +19 -1
- package/src/locales/en.json +19 -1
- package/src/locales/es.json +19 -1
- package/src/locales/fr.json +19 -1
- package/src/locales/it.json +19 -1
- package/src/molecule3d/ui/MoleculeCanvas3D.tsx +45 -71
- package/src/molstar/bonds/bondRule.ts +34 -0
- package/src/molstar/bonds/index.ts +9 -0
- package/src/molstar/ui/MolstarToolbar.tsx +103 -0
- package/src/molstar/ui/index.ts +14 -0
- package/src/molstar/ui/useMolstarTools.ts +98 -0
- package/styles/chrome.css +90 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The viewer a crystal page drives: a structure, a cell, a set of symmetry
|
|
3
|
+
* elements, and an operation applied to the first of them.
|
|
4
|
+
*
|
|
5
|
+
* Nothing here parses a space group or expands an orbit. The atoms arrive in
|
|
6
|
+
* their final places, because molstar's own expansion neither wraps into the
|
|
7
|
+
* cell nor deduplicates a special position, and falls back to `P 1` without a
|
|
8
|
+
* word on several common settings.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { clearMeasurements } from '../../molstar/core/index.ts';
|
|
12
|
+
import { mergeDrawings, withoutDrawings } from '../core/drawingSet.ts';
|
|
13
|
+
import type {
|
|
14
|
+
CellRepeat,
|
|
15
|
+
SymmetryDrawing,
|
|
16
|
+
UnitCell,
|
|
17
|
+
ViewerAtom,
|
|
18
|
+
ViewerOperation,
|
|
19
|
+
} from '../core/types.ts';
|
|
20
|
+
|
|
21
|
+
import type { PlayOptions } from './animate.ts';
|
|
22
|
+
import {
|
|
23
|
+
playOperation,
|
|
24
|
+
resetOperation,
|
|
25
|
+
setOperationFraction,
|
|
26
|
+
} from './animate.ts';
|
|
27
|
+
import type { CrystalViewerOptions } from './plugin.ts';
|
|
28
|
+
import { CrystalViewerPlugin } from './plugin.ts';
|
|
29
|
+
import type { CellStyle } from './renderCell.ts';
|
|
30
|
+
import type { ElementLayerStyle } from './renderElements.ts';
|
|
31
|
+
import type { StructureStyle } from './renderStructure.ts';
|
|
32
|
+
import { drawCell, drawElements, drawStructure } from './sceneParts.ts';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Create a crystal viewer inside `container` and start initialising it.
|
|
36
|
+
* @param container - An element with `position: relative`; molstar inserts its
|
|
37
|
+
* own canvas into it.
|
|
38
|
+
* @param options - See {@link CrystalViewerOptions}.
|
|
39
|
+
* @returns A handle that is safe to dispose immediately.
|
|
40
|
+
*/
|
|
41
|
+
export function createCrystalViewer(
|
|
42
|
+
container: HTMLElement,
|
|
43
|
+
options: CrystalViewerOptions = {},
|
|
44
|
+
): CrystalViewer {
|
|
45
|
+
return new CrystalViewer(container, options);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Everything a crystal page draws, on one canvas: the lifecycle, the camera,
|
|
50
|
+
* the measurements and the hover readout come from {@link CrystalViewerPlugin},
|
|
51
|
+
* the scene is here.
|
|
52
|
+
*/
|
|
53
|
+
export class CrystalViewer extends CrystalViewerPlugin {
|
|
54
|
+
#drawings: readonly SymmetryDrawing[] = [];
|
|
55
|
+
#elementStyle: ElementLayerStyle = {};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The symmetry elements drawn right now, in drawing order.
|
|
59
|
+
* @returns The drawings on screen.
|
|
60
|
+
*/
|
|
61
|
+
get elements(): readonly SymmetryDrawing[] {
|
|
62
|
+
return this.#drawings;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Replace the atoms on screen.
|
|
67
|
+
* @param atoms - The whole scene, expanded and repeated already, in Cartesian
|
|
68
|
+
* ångström. An empty list clears them.
|
|
69
|
+
* @param style - See {@link StructureStyle}.
|
|
70
|
+
* @returns Resolves once the atoms are drawn.
|
|
71
|
+
*/
|
|
72
|
+
showStructure(
|
|
73
|
+
atoms: readonly ViewerAtom[],
|
|
74
|
+
style?: StructureStyle,
|
|
75
|
+
): Promise<void> {
|
|
76
|
+
// A measurement names atoms of the structure it was taken on.
|
|
77
|
+
return this.run(async (plugin) => {
|
|
78
|
+
await clearMeasurements(plugin);
|
|
79
|
+
await drawStructure(plugin, atoms, style);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Remove the atoms, leaving the cell and the elements in place.
|
|
85
|
+
* @returns Resolves once the atoms are gone.
|
|
86
|
+
*/
|
|
87
|
+
hideStructure(): Promise<void> {
|
|
88
|
+
return this.run(async (plugin) => {
|
|
89
|
+
await clearMeasurements(plugin);
|
|
90
|
+
await drawStructure(plugin, []);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Replace the unit cell box, and the stack of cells around it.
|
|
96
|
+
* @param cell - The six cell parameters, or `null` to draw none.
|
|
97
|
+
* @param repeat - Cells along a, b and c.
|
|
98
|
+
* @param style - See {@link CellStyle}.
|
|
99
|
+
* @returns Resolves once the cell is drawn.
|
|
100
|
+
*/
|
|
101
|
+
showCell(
|
|
102
|
+
cell: UnitCell | null,
|
|
103
|
+
repeat: CellRepeat = [1, 1, 1],
|
|
104
|
+
style?: CellStyle,
|
|
105
|
+
): Promise<void> {
|
|
106
|
+
return this.run((plugin) => drawCell(plugin, cell, repeat, style));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Remove the cell.
|
|
111
|
+
* @returns Resolves once the cell is gone.
|
|
112
|
+
*/
|
|
113
|
+
hideCell(): Promise<void> {
|
|
114
|
+
return this.run((plugin) => drawCell(plugin, null));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Replace every drawn symmetry element.
|
|
119
|
+
* @param drawings - The elements; an empty list clears them.
|
|
120
|
+
* @param style - See {@link ElementLayerStyle}; kept for later edits.
|
|
121
|
+
* @returns Resolves once the elements are drawn.
|
|
122
|
+
*/
|
|
123
|
+
showElements(
|
|
124
|
+
drawings: readonly SymmetryDrawing[],
|
|
125
|
+
style?: ElementLayerStyle,
|
|
126
|
+
): Promise<void> {
|
|
127
|
+
if (style !== undefined) this.#elementStyle = style;
|
|
128
|
+
this.#drawings = [...drawings];
|
|
129
|
+
return this.#redrawElements();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Draw these elements as well, replacing any already drawn under the same id.
|
|
134
|
+
* @param drawings - What to add.
|
|
135
|
+
* @returns Resolves once the elements are drawn.
|
|
136
|
+
*/
|
|
137
|
+
addElements(drawings: readonly SymmetryDrawing[]): Promise<void> {
|
|
138
|
+
this.#drawings = mergeDrawings(this.#drawings, drawings);
|
|
139
|
+
return this.#redrawElements();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Stop drawing these elements, leaving the rest alone.
|
|
144
|
+
* @param ids - The ids to remove; an id that is not drawn is ignored.
|
|
145
|
+
* @returns Resolves once the rest are redrawn.
|
|
146
|
+
*/
|
|
147
|
+
removeElements(ids: readonly string[]): Promise<void> {
|
|
148
|
+
this.#drawings = withoutDrawings(this.#drawings, ids);
|
|
149
|
+
return this.#redrawElements();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Remove every symmetry element.
|
|
154
|
+
* @returns Resolves once they are gone.
|
|
155
|
+
*/
|
|
156
|
+
hideElements(): Promise<void> {
|
|
157
|
+
this.#drawings = [];
|
|
158
|
+
return this.#redrawElements();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Apply an operation to the structure, once, and leave it where it lands.
|
|
163
|
+
*
|
|
164
|
+
* The elements stay where they are: an axis that turned with the molecule
|
|
165
|
+
* would prove nothing.
|
|
166
|
+
* @param operation - What to apply.
|
|
167
|
+
* @param options - See {@link PlayOptions}.
|
|
168
|
+
* @returns Resolves once the operation has been applied in full.
|
|
169
|
+
*/
|
|
170
|
+
playOperation(
|
|
171
|
+
operation: ViewerOperation,
|
|
172
|
+
options?: PlayOptions,
|
|
173
|
+
): Promise<void> {
|
|
174
|
+
return this.run((plugin) => playOperation(plugin, operation, options));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Hold the structure part-way through an operation, for a slider.
|
|
179
|
+
* @param operation - What is being applied.
|
|
180
|
+
* @param fraction - How far through, 0 to 1.
|
|
181
|
+
* @returns Resolves once the structure is held there.
|
|
182
|
+
*/
|
|
183
|
+
setOperationFraction(
|
|
184
|
+
operation: ViewerOperation,
|
|
185
|
+
fraction: number,
|
|
186
|
+
): Promise<void> {
|
|
187
|
+
return this.run((plugin) => {
|
|
188
|
+
setOperationFraction(plugin, operation, fraction);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Put the structure back where it started.
|
|
194
|
+
* @returns Resolves once the structure is back.
|
|
195
|
+
*/
|
|
196
|
+
resetOperation(): Promise<void> {
|
|
197
|
+
return this.run((plugin) => {
|
|
198
|
+
resetOperation(plugin);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
#redrawElements(): Promise<void> {
|
|
203
|
+
const drawings = this.#drawings;
|
|
204
|
+
const style = this.#elementStyle;
|
|
205
|
+
return this.run((plugin) => drawElements(plugin, drawings, style));
|
|
206
|
+
}
|
|
207
|
+
}
|
package/src/crystal3d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Crystals in 3D: the atoms of a cell, the box around it, the symmetry
|
|
3
|
+
* elements over it and an operation applied to it, drawn by molstar.
|
|
4
|
+
*
|
|
5
|
+
* An entry point of its own because molstar is several megabytes: the canvas
|
|
6
|
+
* sits behind `React.lazy`, so importing this costs a page the drawing
|
|
7
|
+
* geometry and the components, never the viewer. The geometry needs neither
|
|
8
|
+
* React nor molstar and is exported beside the components.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export * from './crystal3d/core/index.ts';
|
|
12
|
+
export * from './crystal3d/ui/index.ts';
|
package/src/locales/de.json
CHANGED
|
@@ -1085,5 +1085,23 @@
|
|
|
1085
1085
|
"send.label": "Senden an",
|
|
1086
1086
|
"send.heading": "{what} senden an",
|
|
1087
1087
|
"send.none": "Von dieser Seite lässt sich noch nichts an ein anderes Werkzeug senden.",
|
|
1088
|
-
"send.blocked": "Der Browser hat den neuen Tab blockiert: Pop-ups für diese Seite erlauben, dann erneut senden."
|
|
1088
|
+
"send.blocked": "Der Browser hat den neuen Tab blockiert: Pop-ups für diese Seite erlauben, dann erneut senden.",
|
|
1089
|
+
"crystal3d.draw": "Zeichnen",
|
|
1090
|
+
"crystal3d.cells": "Zellen",
|
|
1091
|
+
"crystal3d.packing.molecules": "Ganze Moleküle",
|
|
1092
|
+
"crystal3d.packing.moleculesHelp": "Jedes Molekül ganz, in der Zelle, in die sein Zentrum fällt.",
|
|
1093
|
+
"crystal3d.packing.cell": "Atome der Zelle",
|
|
1094
|
+
"crystal3d.packing.cellHelp": "Jedes Atom innerhalb der Zelle, dort geschnitten, wo ihre Wände es schneiden.",
|
|
1095
|
+
"crystal3d.unitCell": "Elementarzelle",
|
|
1096
|
+
"crystal3d.unitCellHelp": "Der Rahmen der Elementarzelle.",
|
|
1097
|
+
"crystal3d.caption.molecules.one": "1 Molekül pro Zelle",
|
|
1098
|
+
"crystal3d.caption.molecules.other": "{count} Moleküle pro Zelle",
|
|
1099
|
+
"crystal3d.caption.atoms.one": "1 Atom pro Zelle",
|
|
1100
|
+
"crystal3d.caption.atoms.other": "{count} Atome pro Zelle",
|
|
1101
|
+
"crystal3d.caption.cells.one": "1×1×1 Zelle",
|
|
1102
|
+
"crystal3d.caption.cells.other": "{count}×{count}×{count} Zellen",
|
|
1103
|
+
"crystal3d.caption.cellsCapped": "{count}×{count}×{count} Zellen, da {asked}×{asked}×{asked} zu viele Atome enthielten",
|
|
1104
|
+
"crystal3d.unreadable": "Diese Datei konnte nicht gelesen werden",
|
|
1105
|
+
"crystal3d.tooLarge": "Diese Zelle enthält {count} Atome, mehr als der Betrachter zeichnet.",
|
|
1106
|
+
"crystal3d.unsupported": "Kein 3D auf diesem Rechner"
|
|
1089
1107
|
}
|
package/src/locales/en.json
CHANGED
|
@@ -1085,5 +1085,23 @@
|
|
|
1085
1085
|
"send.label": "Send to",
|
|
1086
1086
|
"send.heading": "Send {what} to",
|
|
1087
1087
|
"send.none": "Nothing on this page can be sent to another tool yet.",
|
|
1088
|
-
"send.blocked": "The browser blocked the new tab: allow pop-ups for this site, then send again."
|
|
1088
|
+
"send.blocked": "The browser blocked the new tab: allow pop-ups for this site, then send again.",
|
|
1089
|
+
"crystal3d.draw": "Draw",
|
|
1090
|
+
"crystal3d.cells": "Cells",
|
|
1091
|
+
"crystal3d.packing.molecules": "Whole molecules",
|
|
1092
|
+
"crystal3d.packing.moleculesHelp": "Each molecule whole, in the cell its centre falls in.",
|
|
1093
|
+
"crystal3d.packing.cell": "Atoms in the cell",
|
|
1094
|
+
"crystal3d.packing.cellHelp": "Every atom inside the cell, cut where its walls cut it.",
|
|
1095
|
+
"crystal3d.unitCell": "Unit cell",
|
|
1096
|
+
"crystal3d.unitCellHelp": "The box of the unit cell.",
|
|
1097
|
+
"crystal3d.caption.molecules.one": "1 molecule per cell",
|
|
1098
|
+
"crystal3d.caption.molecules.other": "{count} molecules per cell",
|
|
1099
|
+
"crystal3d.caption.atoms.one": "1 atom per cell",
|
|
1100
|
+
"crystal3d.caption.atoms.other": "{count} atoms per cell",
|
|
1101
|
+
"crystal3d.caption.cells.one": "1×1×1 cell",
|
|
1102
|
+
"crystal3d.caption.cells.other": "{count}×{count}×{count} cells",
|
|
1103
|
+
"crystal3d.caption.cellsCapped": "{count}×{count}×{count} cells, as {asked}×{asked}×{asked} would hold too many atoms",
|
|
1104
|
+
"crystal3d.unreadable": "That file could not be read",
|
|
1105
|
+
"crystal3d.tooLarge": "This cell holds {count} atoms, more than the viewer draws.",
|
|
1106
|
+
"crystal3d.unsupported": "No 3D on this machine"
|
|
1089
1107
|
}
|
package/src/locales/es.json
CHANGED
|
@@ -1085,5 +1085,23 @@
|
|
|
1085
1085
|
"send.label": "Enviar a",
|
|
1086
1086
|
"send.heading": "Enviar {what} a",
|
|
1087
1087
|
"send.none": "Nada de esta página puede enviarse todavía a otra herramienta.",
|
|
1088
|
-
"send.blocked": "El navegador bloqueó la nueva pestaña: permita las ventanas emergentes para este sitio y vuelva a enviar."
|
|
1088
|
+
"send.blocked": "El navegador bloqueó la nueva pestaña: permita las ventanas emergentes para este sitio y vuelva a enviar.",
|
|
1089
|
+
"crystal3d.draw": "Dibujar",
|
|
1090
|
+
"crystal3d.cells": "Celdas",
|
|
1091
|
+
"crystal3d.packing.molecules": "Moléculas enteras",
|
|
1092
|
+
"crystal3d.packing.moleculesHelp": "Cada molécula entera, en la celda donde cae su centro.",
|
|
1093
|
+
"crystal3d.packing.cell": "Átomos de la celda",
|
|
1094
|
+
"crystal3d.packing.cellHelp": "Cada átomo dentro de la celda, cortado donde lo cortan sus caras.",
|
|
1095
|
+
"crystal3d.unitCell": "Celda unidad",
|
|
1096
|
+
"crystal3d.unitCellHelp": "El contorno de la celda unidad.",
|
|
1097
|
+
"crystal3d.caption.molecules.one": "1 molécula por celda",
|
|
1098
|
+
"crystal3d.caption.molecules.other": "{count} moléculas por celda",
|
|
1099
|
+
"crystal3d.caption.atoms.one": "1 átomo por celda",
|
|
1100
|
+
"crystal3d.caption.atoms.other": "{count} átomos por celda",
|
|
1101
|
+
"crystal3d.caption.cells.one": "1×1×1 celda",
|
|
1102
|
+
"crystal3d.caption.cells.other": "{count}×{count}×{count} celdas",
|
|
1103
|
+
"crystal3d.caption.cellsCapped": "{count}×{count}×{count} celdas, ya que {asked}×{asked}×{asked} contendrían demasiados átomos",
|
|
1104
|
+
"crystal3d.unreadable": "Ese archivo no se ha podido leer",
|
|
1105
|
+
"crystal3d.tooLarge": "Esta celda contiene {count} átomos, más de los que dibuja el visor.",
|
|
1106
|
+
"crystal3d.unsupported": "Sin 3D en este equipo"
|
|
1089
1107
|
}
|
package/src/locales/fr.json
CHANGED
|
@@ -1085,5 +1085,23 @@
|
|
|
1085
1085
|
"send.label": "Envoyer vers",
|
|
1086
1086
|
"send.heading": "Envoyer {what} vers",
|
|
1087
1087
|
"send.none": "Rien sur cette page ne peut encore être envoyé à un autre outil.",
|
|
1088
|
-
"send.blocked": "Le navigateur a bloqué le nouvel onglet : autorisez les fenêtres pour ce site, puis envoyez à nouveau."
|
|
1088
|
+
"send.blocked": "Le navigateur a bloqué le nouvel onglet : autorisez les fenêtres pour ce site, puis envoyez à nouveau.",
|
|
1089
|
+
"crystal3d.draw": "Dessiner",
|
|
1090
|
+
"crystal3d.cells": "Mailles",
|
|
1091
|
+
"crystal3d.packing.molecules": "Molécules entières",
|
|
1092
|
+
"crystal3d.packing.moleculesHelp": "Chaque molécule entière, dans la maille où tombe son centre.",
|
|
1093
|
+
"crystal3d.packing.cell": "Atomes de la maille",
|
|
1094
|
+
"crystal3d.packing.cellHelp": "Chaque atome à l'intérieur de la maille, coupé là où ses faces le coupent.",
|
|
1095
|
+
"crystal3d.unitCell": "Maille",
|
|
1096
|
+
"crystal3d.unitCellHelp": "Le contour de la maille élémentaire.",
|
|
1097
|
+
"crystal3d.caption.molecules.one": "1 molécule par maille",
|
|
1098
|
+
"crystal3d.caption.molecules.other": "{count} molécules par maille",
|
|
1099
|
+
"crystal3d.caption.atoms.one": "1 atome par maille",
|
|
1100
|
+
"crystal3d.caption.atoms.other": "{count} atomes par maille",
|
|
1101
|
+
"crystal3d.caption.cells.one": "1×1×1 maille",
|
|
1102
|
+
"crystal3d.caption.cells.other": "{count}×{count}×{count} mailles",
|
|
1103
|
+
"crystal3d.caption.cellsCapped": "{count}×{count}×{count} mailles, car {asked}×{asked}×{asked} contiendraient trop d'atomes",
|
|
1104
|
+
"crystal3d.unreadable": "Ce fichier n'a pas pu être lu",
|
|
1105
|
+
"crystal3d.tooLarge": "Cette maille contient {count} atomes, plus que la visionneuse n'en dessine.",
|
|
1106
|
+
"crystal3d.unsupported": "Pas de 3D sur cette machine"
|
|
1089
1107
|
}
|
package/src/locales/it.json
CHANGED
|
@@ -1085,5 +1085,23 @@
|
|
|
1085
1085
|
"send.label": "Invia a",
|
|
1086
1086
|
"send.heading": "Invia {what} a",
|
|
1087
1087
|
"send.none": "Nulla di questa pagina può ancora essere inviato a un altro strumento.",
|
|
1088
|
-
"send.blocked": "Il browser ha bloccato la nuova scheda: consenti i pop-up per questo sito, poi invia di nuovo."
|
|
1088
|
+
"send.blocked": "Il browser ha bloccato la nuova scheda: consenti i pop-up per questo sito, poi invia di nuovo.",
|
|
1089
|
+
"crystal3d.draw": "Disegna",
|
|
1090
|
+
"crystal3d.cells": "Celle",
|
|
1091
|
+
"crystal3d.packing.molecules": "Molecole intere",
|
|
1092
|
+
"crystal3d.packing.moleculesHelp": "Ogni molecola intera, nella cella in cui cade il suo centro.",
|
|
1093
|
+
"crystal3d.packing.cell": "Atomi della cella",
|
|
1094
|
+
"crystal3d.packing.cellHelp": "Ogni atomo dentro la cella, tagliato dove lo tagliano le sue pareti.",
|
|
1095
|
+
"crystal3d.unitCell": "Cella elementare",
|
|
1096
|
+
"crystal3d.unitCellHelp": "Il contorno della cella elementare.",
|
|
1097
|
+
"crystal3d.caption.molecules.one": "1 molecola per cella",
|
|
1098
|
+
"crystal3d.caption.molecules.other": "{count} molecole per cella",
|
|
1099
|
+
"crystal3d.caption.atoms.one": "1 atomo per cella",
|
|
1100
|
+
"crystal3d.caption.atoms.other": "{count} atomi per cella",
|
|
1101
|
+
"crystal3d.caption.cells.one": "1×1×1 cella",
|
|
1102
|
+
"crystal3d.caption.cells.other": "{count}×{count}×{count} celle",
|
|
1103
|
+
"crystal3d.caption.cellsCapped": "{count}×{count}×{count} celle, perché {asked}×{asked}×{asked} conterrebbero troppi atomi",
|
|
1104
|
+
"crystal3d.unreadable": "Non è stato possibile leggere quel file",
|
|
1105
|
+
"crystal3d.tooLarge": "Questa cella contiene {count} atomi, più di quanti il visualizzatore ne disegni.",
|
|
1106
|
+
"crystal3d.unsupported": "Niente 3D su questo computer"
|
|
1089
1107
|
}
|
|
@@ -11,18 +11,17 @@ import { useEffect, useState } from 'react';
|
|
|
11
11
|
|
|
12
12
|
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
13
13
|
import { DEFAULT_SPIN_SPEED } from '../../molstar/core/index.ts';
|
|
14
|
+
import { MolstarToolbar } from '../../molstar/ui/MolstarToolbar.tsx';
|
|
15
|
+
import { useMolstarTools } from '../../molstar/ui/useMolstarTools.ts';
|
|
14
16
|
import { DEFAULT_FRAMES_PER_SECOND } from '../core/animatedPng.ts';
|
|
15
17
|
import type { Molecule3DHighlight } from '../core/highlight.ts';
|
|
16
|
-
import type { MeasurementKind } from '../core/measurement.ts';
|
|
17
18
|
import {
|
|
18
19
|
normalizeMolecule3DSettings,
|
|
19
20
|
resolveMolecule3DTools,
|
|
20
21
|
} from '../core/settings.ts';
|
|
21
22
|
|
|
22
|
-
import { Molecule3DExport } from './Molecule3DExport.tsx';
|
|
23
23
|
import { Molecule3DOptions } from './Molecule3DOptions.tsx';
|
|
24
24
|
import { Molecule3DStage } from './Molecule3DStage.tsx';
|
|
25
|
-
import { Molecule3DToolbar } from './Molecule3DToolbar.tsx';
|
|
26
25
|
import { highlightColorOf } from './highlightColor.ts';
|
|
27
26
|
import { moleculeFileAtoms } from './moleculeFileFormats.ts';
|
|
28
27
|
import type { MoleculeViewer3DProps } from './moleculeViewer3DProps.ts';
|
|
@@ -85,18 +84,12 @@ export function MoleculeCanvas3D(props: MoleculeCanvas3DProps): ReactElement {
|
|
|
85
84
|
initialSettings,
|
|
86
85
|
onSettingsChange,
|
|
87
86
|
);
|
|
88
|
-
const [spinning, setSpinning] = useControlledState(
|
|
89
|
-
spinningProp,
|
|
90
|
-
defaultSpinning,
|
|
91
|
-
onSpinningChange,
|
|
92
|
-
);
|
|
93
87
|
const {
|
|
94
88
|
measurements,
|
|
95
89
|
add: addMeasurement,
|
|
96
90
|
remove: removeMeasurement,
|
|
97
91
|
clear: clearMeasurements,
|
|
98
92
|
} = useMeasurementList(measurementsProp, onMeasurementsChange);
|
|
99
|
-
const [measureKind, setMeasureKind] = useState<MeasurementKind | null>(null);
|
|
100
93
|
const [frameCount, setFrameCount] = useState(0);
|
|
101
94
|
const polarSurfaceArea = usePolarSurfaceArea(
|
|
102
95
|
molfile,
|
|
@@ -117,18 +110,18 @@ export function MoleculeCanvas3D(props: MoleculeCanvas3DProps): ReactElement {
|
|
|
117
110
|
tools.measure && molfile !== null ? removeMeasurement : undefined,
|
|
118
111
|
);
|
|
119
112
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
113
|
+
const controls = useMolstarTools(viewerRef, container, {
|
|
114
|
+
spinning: spinningProp,
|
|
115
|
+
defaultSpinning,
|
|
116
|
+
onSpinningChange,
|
|
117
|
+
spinSpeed,
|
|
118
|
+
});
|
|
119
|
+
const { spinning } = controls;
|
|
123
120
|
|
|
124
121
|
useEffect(() => {
|
|
125
122
|
void viewerRef.current?.frames.play(playing, framesPerSecond);
|
|
126
123
|
}, [container, viewerRef, playing, framesPerSecond]);
|
|
127
124
|
|
|
128
|
-
useEffect(() => {
|
|
129
|
-
void viewerRef.current?.setMeasureKind(measureKind);
|
|
130
|
-
}, [container, viewerRef, measureKind]);
|
|
131
|
-
|
|
132
125
|
// Kept out of the scene: a new highlight repaints the model, never redraws it.
|
|
133
126
|
useEffect(() => {
|
|
134
127
|
void viewerRef.current?.setHighlights(
|
|
@@ -150,8 +143,13 @@ export function MoleculeCanvas3D(props: MoleculeCanvas3DProps): ReactElement {
|
|
|
150
143
|
camera: props,
|
|
151
144
|
});
|
|
152
145
|
|
|
153
|
-
const
|
|
154
|
-
|
|
146
|
+
const imageExport = useImageExport(
|
|
147
|
+
container,
|
|
148
|
+
viewerRef,
|
|
149
|
+
fileName,
|
|
150
|
+
framesPerSecond,
|
|
151
|
+
);
|
|
152
|
+
const { capture } = imageExport;
|
|
155
153
|
|
|
156
154
|
useEffect(() => {
|
|
157
155
|
if (onCapture === undefined || container === null) return;
|
|
@@ -171,47 +169,35 @@ export function MoleculeCanvas3D(props: MoleculeCanvas3DProps): ReactElement {
|
|
|
171
169
|
data-testid="molecule3d"
|
|
172
170
|
/>
|
|
173
171
|
{molfile !== null && (
|
|
174
|
-
<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
<Molecule3DExport
|
|
204
|
-
getSize={canvasSize}
|
|
205
|
-
onExport={exportImage}
|
|
206
|
-
onCopy={copyImage}
|
|
207
|
-
writeFile={imageFile}
|
|
208
|
-
frameCount={frameCount}
|
|
209
|
-
molfile={molfile}
|
|
210
|
-
fileName={fileName}
|
|
211
|
-
/>
|
|
212
|
-
}
|
|
213
|
-
/>
|
|
214
|
-
</div>
|
|
172
|
+
<MolstarToolbar
|
|
173
|
+
controls={controls}
|
|
174
|
+
tools={tools}
|
|
175
|
+
fullscreen={fullscreen}
|
|
176
|
+
measurementCount={measurements.length}
|
|
177
|
+
onClearMeasurements={clearMeasurements}
|
|
178
|
+
showSurface={settings.showSurface}
|
|
179
|
+
onShowSurfaceChange={(showSurface) => {
|
|
180
|
+
setSettings({ ...settings, showSurface });
|
|
181
|
+
}}
|
|
182
|
+
onResetView={resetView}
|
|
183
|
+
options={
|
|
184
|
+
<Molecule3DOptions
|
|
185
|
+
settings={settings}
|
|
186
|
+
onChange={setSettings}
|
|
187
|
+
polarSurfaceArea={polarSurfaceArea}
|
|
188
|
+
defaults={initialSettings}
|
|
189
|
+
/>
|
|
190
|
+
}
|
|
191
|
+
exportLabel={
|
|
192
|
+
moleculeFileAtoms(molfile, frameCount) > 0
|
|
193
|
+
? t('molecule3d.exportImageOrMolfile')
|
|
194
|
+
: undefined
|
|
195
|
+
}
|
|
196
|
+
imageExport={imageExport}
|
|
197
|
+
frameCount={frameCount}
|
|
198
|
+
molfile={molfile}
|
|
199
|
+
fileName={fileName}
|
|
200
|
+
/>
|
|
215
201
|
)}
|
|
216
202
|
</>
|
|
217
203
|
)}
|
|
@@ -231,15 +217,3 @@ const STAGE_STYLE: CSSProperties = {
|
|
|
231
217
|
|
|
232
218
|
/** molstar inserts its canvas here, which therefore has a size of its own. */
|
|
233
219
|
const CANVAS_STYLE: CSSProperties = { position: 'absolute', inset: 0 };
|
|
234
|
-
|
|
235
|
-
const OVERLAY_STYLE: CSSProperties = {
|
|
236
|
-
position: 'absolute',
|
|
237
|
-
top: 8,
|
|
238
|
-
bottom: 8,
|
|
239
|
-
left: 8,
|
|
240
|
-
zIndex: 2,
|
|
241
|
-
display: 'flex',
|
|
242
|
-
alignItems: 'flex-start',
|
|
243
|
-
gap: 8,
|
|
244
|
-
pointerEvents: 'none',
|
|
245
|
-
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The longest bond molstar draws between two elements.
|
|
3
|
+
*
|
|
4
|
+
* Molecules are completed across the cell walls by this rule, so what the
|
|
5
|
+
* viewer draws as one molecule is exactly what the packing kept together. It
|
|
6
|
+
* is one molstar module with no imports of its own, so a page reading it pays
|
|
7
|
+
* for a table of thresholds, not for the 2.8 MB viewer.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { ElementSymbol } from 'molstar/lib/mol-model/structure/model/types.js';
|
|
11
|
+
import {
|
|
12
|
+
getElementIdx,
|
|
13
|
+
getElementThreshold,
|
|
14
|
+
getPairingThreshold,
|
|
15
|
+
isHydrogen,
|
|
16
|
+
} from 'molstar/lib/mol-model/structure/structure/unit/bonds/common.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The longest distance at which molstar bonds two atoms.
|
|
20
|
+
* @param a - One element symbol, e.g. `C`.
|
|
21
|
+
* @param b - The other.
|
|
22
|
+
* @returns The distance in ångström, or 0 for a pair it never bonds (H–H).
|
|
23
|
+
*/
|
|
24
|
+
export function bondLimit(a: string, b: string): number {
|
|
25
|
+
const first = getElementIdx(a as ElementSymbol);
|
|
26
|
+
const second = getElementIdx(b as ElementSymbol);
|
|
27
|
+
if (isHydrogen(first) && isHydrogen(second)) return 0;
|
|
28
|
+
return getPairingThreshold(
|
|
29
|
+
first,
|
|
30
|
+
second,
|
|
31
|
+
getElementThreshold(first),
|
|
32
|
+
getElementThreshold(second),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The longest bond molstar draws between two elements.
|
|
3
|
+
*
|
|
4
|
+
* Its own path because it is one small molstar module: a page that fills a
|
|
5
|
+
* crystal's cell before the viewer has loaded completes its molecules by the
|
|
6
|
+
* rule the viewer will join them by, without downloading the viewer.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export { bondLimit } from './bondRule.ts';
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The toolbars every 3D view of the family floats over its canvas: reset,
|
|
3
|
+
* spin, export, full screen and help, then the measuring tools.
|
|
4
|
+
*
|
|
5
|
+
* It is `Molecule3DToolbar` placed in the top-left corner of the stage and fed
|
|
6
|
+
* from `useMolstarTools` and `useImageExport`, so a site drawing its own
|
|
7
|
+
* scene — orbitals, a crystal — gets the controls `<MoleculeViewer3D>` has
|
|
8
|
+
* without wiring them a second time.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { CSSProperties, ReactElement } from 'react';
|
|
12
|
+
|
|
13
|
+
import type { Molecule3DFile } from '../../molecule3d/core/file.ts';
|
|
14
|
+
import { Molecule3DExport } from '../../molecule3d/ui/Molecule3DExport.tsx';
|
|
15
|
+
import type { Molecule3DToolbarProps } from '../../molecule3d/ui/Molecule3DToolbar.tsx';
|
|
16
|
+
import { Molecule3DToolbar } from '../../molecule3d/ui/Molecule3DToolbar.tsx';
|
|
17
|
+
import type { ImageExport } from '../../molecule3d/ui/useImageExport.ts';
|
|
18
|
+
|
|
19
|
+
import type { MolstarTools } from './useMolstarTools.ts';
|
|
20
|
+
|
|
21
|
+
/** Props of {@link MolstarToolbar}. */
|
|
22
|
+
export interface MolstarToolbarProps extends Omit<
|
|
23
|
+
Molecule3DToolbarProps,
|
|
24
|
+
| 'measureKind'
|
|
25
|
+
| 'onMeasureKindChange'
|
|
26
|
+
| 'spinning'
|
|
27
|
+
| 'onSpinningChange'
|
|
28
|
+
| 'exportPanel'
|
|
29
|
+
> {
|
|
30
|
+
/** The state `useMolstarTools` keeps. */
|
|
31
|
+
controls: MolstarTools;
|
|
32
|
+
/**
|
|
33
|
+
* The pictures the export tool saves and copies; the tool is left out
|
|
34
|
+
* without them.
|
|
35
|
+
* @default undefined
|
|
36
|
+
*/
|
|
37
|
+
imageExport?: ImageExport;
|
|
38
|
+
/**
|
|
39
|
+
* Base name of what the export tool saves, extension excluded.
|
|
40
|
+
* @default 'molecule'
|
|
41
|
+
*/
|
|
42
|
+
fileName?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The file on screen, offered beside the pictures; say so in `exportLabel`.
|
|
45
|
+
* @default undefined — only pictures are offered
|
|
46
|
+
*/
|
|
47
|
+
molfile?: Molecule3DFile | null;
|
|
48
|
+
/**
|
|
49
|
+
* How many frames the scene holds. Above one, a PNG may hold them all.
|
|
50
|
+
* @default 1
|
|
51
|
+
*/
|
|
52
|
+
frameCount?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The toolbars, in the top-left corner of a positioned stage.
|
|
57
|
+
* @param props - See {@link MolstarToolbarProps}.
|
|
58
|
+
* @returns The toolbars.
|
|
59
|
+
*/
|
|
60
|
+
export function MolstarToolbar(props: MolstarToolbarProps): ReactElement {
|
|
61
|
+
const { controls, imageExport, fileName, molfile, frameCount, ...toolbar } =
|
|
62
|
+
props;
|
|
63
|
+
return (
|
|
64
|
+
<div style={OVERLAY_STYLE}>
|
|
65
|
+
<Molecule3DToolbar
|
|
66
|
+
{...toolbar}
|
|
67
|
+
measureKind={controls.measureKind}
|
|
68
|
+
onMeasureKindChange={controls.setMeasureKind}
|
|
69
|
+
spinning={controls.spinning}
|
|
70
|
+
onSpinningChange={controls.setSpinning}
|
|
71
|
+
exportPanel={
|
|
72
|
+
imageExport === undefined ? undefined : (
|
|
73
|
+
<Molecule3DExport
|
|
74
|
+
getSize={imageExport.canvasSize}
|
|
75
|
+
onExport={imageExport.exportImage}
|
|
76
|
+
onCopy={imageExport.copyImage}
|
|
77
|
+
writeFile={imageExport.imageFile}
|
|
78
|
+
frameCount={frameCount}
|
|
79
|
+
molfile={molfile}
|
|
80
|
+
fileName={fileName}
|
|
81
|
+
/>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* `pointerEvents` is off here and back on inside the toolbars, so the empty
|
|
91
|
+
* column beside them does not swallow a drag of the scene.
|
|
92
|
+
*/
|
|
93
|
+
const OVERLAY_STYLE: CSSProperties = {
|
|
94
|
+
position: 'absolute',
|
|
95
|
+
top: 8,
|
|
96
|
+
bottom: 8,
|
|
97
|
+
left: 8,
|
|
98
|
+
zIndex: 2,
|
|
99
|
+
display: 'flex',
|
|
100
|
+
alignItems: 'flex-start',
|
|
101
|
+
gap: 8,
|
|
102
|
+
pointerEvents: 'none',
|
|
103
|
+
};
|