react-cheminfo 0.139.0 → 0.140.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/lib/credits/core/credits.d.ts +12 -0
- package/lib/credits/core/credits.d.ts.map +1 -1
- package/lib/credits/core/credits.js +16 -0
- package/lib/credits/core/credits.js.map +1 -1
- package/lib/crystal3d/ui/CrystalCanvas3D.d.ts +1 -1
- package/lib/crystal3d/ui/CrystalCanvas3D.d.ts.map +1 -1
- package/lib/crystal3d/ui/CrystalViewer3D.d.ts +1 -1
- package/lib/crystal3d/ui/CrystalViewer3D.d.ts.map +1 -1
- package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts +1 -1
- package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.d.ts +17 -3
- package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.js +1 -1
- package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
- package/lib/download/ui/FigureQuickActions.d.ts +10 -4
- package/lib/download/ui/FigureQuickActions.d.ts.map +1 -1
- package/lib/download/ui/FigureQuickActions.js +12 -6
- package/lib/download/ui/FigureQuickActions.js.map +1 -1
- package/lib/ecosystem/core/home.d.ts +19 -0
- package/lib/ecosystem/core/home.d.ts.map +1 -0
- package/lib/ecosystem/core/home.js +23 -0
- package/lib/ecosystem/core/home.js.map +1 -0
- package/lib/ecosystem/core/index.d.ts +3 -0
- package/lib/ecosystem/core/index.d.ts.map +1 -1
- package/lib/ecosystem/core/index.js +2 -0
- package/lib/ecosystem/core/index.js.map +1 -1
- package/lib/ecosystem/core/searchSites.d.ts +39 -0
- package/lib/ecosystem/core/searchSites.d.ts.map +1 -0
- package/lib/ecosystem/core/searchSites.js +77 -0
- package/lib/ecosystem/core/searchSites.js.map +1 -0
- package/lib/ecosystem/core/types.d.ts +1 -1
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/ecosystem/core/unlistedSites.d.ts.map +1 -1
- package/lib/ecosystem/core/unlistedSites.js +14 -0
- package/lib/ecosystem/core/unlistedSites.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemButton.d.ts +6 -0
- package/lib/ecosystem/ui/EcosystemButton.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemButton.js +2 -2
- package/lib/ecosystem/ui/EcosystemButton.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.d.ts +13 -4
- package/lib/ecosystem/ui/EcosystemMenu.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.js +56 -6
- package/lib/ecosystem/ui/EcosystemMenu.js.map +1 -1
- package/lib/ecosystem/ui/SiteGroupGrid.d.ts +12 -0
- package/lib/ecosystem/ui/SiteGroupGrid.d.ts.map +1 -1
- package/lib/ecosystem/ui/SiteGroupGrid.js +15 -2
- package/lib/ecosystem/ui/SiteGroupGrid.js.map +1 -1
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +4 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/locales/de.json +10 -0
- package/lib/locales/en.json +10 -0
- package/lib/locales/es.json +10 -0
- package/lib/locales/fr.json +10 -0
- package/lib/locales/it.json +10 -0
- package/lib/molecule3d/core/bondNeighbours.d.ts +30 -0
- package/lib/molecule3d/core/bondNeighbours.d.ts.map +1 -0
- package/lib/molecule3d/core/bondNeighbours.js +108 -0
- package/lib/molecule3d/core/bondNeighbours.js.map +1 -0
- package/lib/molecule3d/core/file.d.ts +15 -4
- package/lib/molecule3d/core/file.d.ts.map +1 -1
- package/lib/molecule3d/core/file.js +10 -1
- package/lib/molecule3d/core/file.js.map +1 -1
- package/lib/molecule3d/core/index.d.ts +11 -2
- package/lib/molecule3d/core/index.d.ts.map +1 -1
- package/lib/molecule3d/core/index.js +6 -1
- package/lib/molecule3d/core/index.js.map +1 -1
- package/lib/molecule3d/core/partialBondMode.d.ts +34 -0
- package/lib/molecule3d/core/partialBondMode.d.ts.map +1 -0
- package/lib/molecule3d/core/partialBondMode.js +39 -0
- package/lib/molecule3d/core/partialBondMode.js.map +1 -0
- package/lib/molecule3d/core/partialBondRanges.d.ts +61 -0
- package/lib/molecule3d/core/partialBondRanges.d.ts.map +1 -0
- package/lib/molecule3d/core/partialBondRanges.js +89 -0
- package/lib/molecule3d/core/partialBondRanges.js.map +1 -0
- package/lib/molecule3d/core/partialBonds.d.ts +61 -0
- package/lib/molecule3d/core/partialBonds.d.ts.map +1 -0
- package/lib/molecule3d/core/partialBonds.js +115 -0
- package/lib/molecule3d/core/partialBonds.js.map +1 -0
- package/lib/molecule3d/core/settings.d.ts +13 -35
- package/lib/molecule3d/core/settings.d.ts.map +1 -1
- package/lib/molecule3d/core/settings.js +17 -25
- package/lib/molecule3d/core/settings.js.map +1 -1
- package/lib/molecule3d/core/tools.d.ts +36 -0
- package/lib/molecule3d/core/tools.d.ts.map +1 -0
- package/lib/molecule3d/core/tools.js +24 -0
- package/lib/molecule3d/core/tools.js.map +1 -0
- package/lib/molecule3d/ui/Molecule3DExport.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DExport.js +19 -2
- package/lib/molecule3d/ui/Molecule3DExport.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DOptions.d.ts +5 -2
- package/lib/molecule3d/ui/Molecule3DOptions.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DOptions.js +6 -4
- package/lib/molecule3d/ui/Molecule3DOptions.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DPartialBonds.d.ts +22 -0
- package/lib/molecule3d/ui/Molecule3DPartialBonds.d.ts.map +1 -0
- package/lib/molecule3d/ui/Molecule3DPartialBonds.js +53 -0
- package/lib/molecule3d/ui/Molecule3DPartialBonds.js.map +1 -0
- package/lib/molecule3d/ui/Molecule3DToolbar.d.ts +1 -1
- package/lib/molecule3d/ui/Molecule3DToolbar.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DToolbar.js +1 -1
- package/lib/molecule3d/ui/Molecule3DToolbar.js.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.js +3 -2
- package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
- package/lib/molecule3d/ui/drawScene.d.ts +4 -3
- package/lib/molecule3d/ui/drawScene.d.ts.map +1 -1
- package/lib/molecule3d/ui/drawScene.js +12 -2
- package/lib/molecule3d/ui/drawScene.js.map +1 -1
- package/lib/molecule3d/ui/moleculeFileFormats.d.ts +3 -2
- package/lib/molecule3d/ui/moleculeFileFormats.d.ts.map +1 -1
- package/lib/molecule3d/ui/moleculeFileFormats.js +5 -3
- package/lib/molecule3d/ui/moleculeFileFormats.js.map +1 -1
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +2 -1
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
- package/lib/molecule3d/ui/partialBondShapes.d.ts +117 -0
- package/lib/molecule3d/ui/partialBondShapes.d.ts.map +1 -0
- package/lib/molecule3d/ui/partialBondShapes.js +164 -0
- package/lib/molecule3d/ui/partialBondShapes.js.map +1 -0
- package/lib/molecule3d/ui/renderMolecule.d.ts +9 -0
- package/lib/molecule3d/ui/renderMolecule.d.ts.map +1 -1
- package/lib/molecule3d/ui/renderMolecule.js +17 -0
- package/lib/molecule3d/ui/renderMolecule.js.map +1 -1
- package/lib/molecule3d/ui/renderPartialBonds.d.ts +19 -0
- package/lib/molecule3d/ui/renderPartialBonds.d.ts.map +1 -0
- package/lib/molecule3d/ui/renderPartialBonds.js +90 -0
- package/lib/molecule3d/ui/renderPartialBonds.js.map +1 -0
- package/lib/molecule3d/ui/structureGeometry.d.ts +22 -0
- package/lib/molecule3d/ui/structureGeometry.d.ts.map +1 -0
- package/lib/molecule3d/ui/structureGeometry.js +63 -0
- package/lib/molecule3d/ui/structureGeometry.js.map +1 -0
- package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts +2 -2
- package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts.map +1 -1
- package/lib/molecule3d/ui/usePolarSurfaceArea.js +5 -4
- package/lib/molecule3d/ui/usePolarSurfaceArea.js.map +1 -1
- package/lib/molecule3d/ui/viewer.d.ts +8 -1
- package/lib/molecule3d/ui/viewer.d.ts.map +1 -1
- package/lib/molecule3d/ui/viewer.js +10 -0
- package/lib/molecule3d/ui/viewer.js.map +1 -1
- package/lib/molecule3d/ui/viewerTypes.d.ts +18 -0
- package/lib/molecule3d/ui/viewerTypes.d.ts.map +1 -1
- package/lib/panel/ui/FilterInput.d.ts +11 -0
- package/lib/panel/ui/FilterInput.d.ts.map +1 -1
- package/lib/panel/ui/FilterInput.js +10 -1
- package/lib/panel/ui/FilterInput.js.map +1 -1
- package/lib/shell/ui/ShellFrame.d.ts.map +1 -1
- package/lib/shell/ui/ShellFrame.js +3 -2
- package/lib/shell/ui/ShellFrame.js.map +1 -1
- package/package.json +1 -1
- package/src/credits/core/credits.ts +16 -0
- package/src/crystal3d/ui/CrystalCanvas3D.tsx +1 -1
- package/src/crystal3d/ui/CrystalViewer3D.tsx +1 -1
- package/src/crystal3d/ui/crystalStructureViewerProps.ts +1 -1
- package/src/download/ui/FigureDownloadPanel.tsx +20 -4
- package/src/download/ui/FigureQuickActions.tsx +18 -6
- package/src/ecosystem/core/home.ts +27 -0
- package/src/ecosystem/core/index.ts +7 -0
- package/src/ecosystem/core/searchSites.ts +102 -0
- package/src/ecosystem/core/types.ts +1 -0
- package/src/ecosystem/core/unlistedSites.ts +15 -0
- package/src/ecosystem/ui/EcosystemButton.tsx +8 -2
- package/src/ecosystem/ui/EcosystemMenu.tsx +103 -7
- package/src/ecosystem/ui/SiteGroupGrid.tsx +28 -3
- package/src/ecosystem/ui/glyphs.tsx +14 -0
- package/src/locales/de.json +10 -0
- package/src/locales/en.json +10 -0
- package/src/locales/es.json +10 -0
- package/src/locales/fr.json +10 -0
- package/src/locales/it.json +10 -0
- package/src/molecule3d/core/bondNeighbours.ts +108 -0
- package/src/molecule3d/core/file.ts +18 -4
- package/src/molecule3d/core/index.ts +17 -3
- package/src/molecule3d/core/partialBondMode.ts +48 -0
- package/src/molecule3d/core/partialBondRanges.ts +120 -0
- package/src/molecule3d/core/partialBonds.ts +180 -0
- package/src/molecule3d/core/settings.ts +29 -52
- package/src/molecule3d/core/tools.ts +51 -0
- package/src/molecule3d/ui/Molecule3DExport.tsx +17 -2
- package/src/molecule3d/ui/Molecule3DOptions.tsx +16 -3
- package/src/molecule3d/ui/Molecule3DPartialBonds.tsx +100 -0
- package/src/molecule3d/ui/Molecule3DToolbar.tsx +2 -2
- package/src/molecule3d/ui/MoleculeCanvas3D.tsx +3 -4
- package/src/molecule3d/ui/drawScene.ts +15 -2
- package/src/molecule3d/ui/moleculeFileFormats.ts +5 -3
- package/src/molecule3d/ui/moleculeViewer3DProps.ts +2 -1
- package/src/molecule3d/ui/partialBondShapes.ts +246 -0
- package/src/molecule3d/ui/renderMolecule.ts +20 -0
- package/src/molecule3d/ui/renderPartialBonds.ts +122 -0
- package/src/molecule3d/ui/structureGeometry.ts +73 -0
- package/src/molecule3d/ui/usePolarSurfaceArea.ts +5 -4
- package/src/molecule3d/ui/viewer.ts +12 -0
- package/src/molecule3d/ui/viewerTypes.ts +19 -0
- package/src/panel/ui/FilterInput.tsx +24 -0
- package/src/shell/ui/ShellFrame.tsx +7 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The distances a partial bond may span, per pair of elements.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The reach of a pair three bonds apart, or holding a hydrogen: 1.4 times the
|
|
6
|
+
* limit, and at most 0.7 Å past it — 2.45 Å for C–C.
|
|
7
|
+
*
|
|
8
|
+
* Three bonds apart, the ends of a ring are already close: 2.59 Å across
|
|
9
|
+
* bicyclo[2.2.2]octane, 2.63 Å across a boat cyclohexane. With a hydrogen, the
|
|
10
|
+
* stretch stops short of a hydrogen bond: O–H is bonded up to 1.1 Å, and
|
|
11
|
+
* O–H···O starts near 1.6 Å. The 0.7 Å holds back the elements whose limit is
|
|
12
|
+
* long already: 1.4 times the 2.48 Å of C–I would reach the carbon three bonds
|
|
13
|
+
* away in a gauche iodoalkane, at 3.4 Å.
|
|
14
|
+
*/
|
|
15
|
+
export const NEAR_PARTIAL_BOND = { stretch: 1.4, reach: 0.7 };
|
|
16
|
+
/**
|
|
17
|
+
* The reach of two heavy atoms further apart, or in separate molecules: 1.5
|
|
18
|
+
* times the limit, and at most 0.85 Å past it — 2.6 Å for C–C, which takes in
|
|
19
|
+
* the forming bonds of the usual transition states, 2.0–2.6 Å, while two
|
|
20
|
+
* molecules merely in contact are 3.2 Å apart or more.
|
|
21
|
+
*/
|
|
22
|
+
export const FAR_PARTIAL_BOND = { stretch: 1.5, reach: 0.85 };
|
|
23
|
+
/**
|
|
24
|
+
* The bonding limit and the two partial bond limits of every pair of the
|
|
25
|
+
* elements present, row-major; all 0 for a pair never partially bonded.
|
|
26
|
+
* @param symbols - The elements present.
|
|
27
|
+
* @param bondLimit - The longest bond between two elements, 0 for never.
|
|
28
|
+
* @param nearReach - The reach of a pair three bonds apart, or with a hydrogen.
|
|
29
|
+
* @param farReach - The reach of any other pair.
|
|
30
|
+
* @returns The limits, and the longest partial bond of all.
|
|
31
|
+
*/
|
|
32
|
+
export function pairRanges(symbols, bondLimit, nearReach, farReach) {
|
|
33
|
+
const size = symbols.length;
|
|
34
|
+
const limit = new Float64Array(size * size);
|
|
35
|
+
const near = new Float64Array(size * size);
|
|
36
|
+
const far = new Float64Array(size * size);
|
|
37
|
+
let longest = 0;
|
|
38
|
+
for (let a = 0; a < size; a++) {
|
|
39
|
+
for (let b = 0; b < size; b++) {
|
|
40
|
+
const first = symbols[a] ?? '';
|
|
41
|
+
const second = symbols[b] ?? '';
|
|
42
|
+
const bonded = bondLimit(first, second);
|
|
43
|
+
const hydrogens = Number(isHydrogen(first)) + Number(isHydrogen(second));
|
|
44
|
+
if (!(bonded > 0) || hydrogens === 2)
|
|
45
|
+
continue;
|
|
46
|
+
const cell = a * size + b;
|
|
47
|
+
const nearest = reachOf(bonded, nearReach);
|
|
48
|
+
const farthest = hydrogens === 1
|
|
49
|
+
? nearest
|
|
50
|
+
: Math.max(nearest, reachOf(bonded, farReach));
|
|
51
|
+
limit[cell] = bonded;
|
|
52
|
+
near[cell] = nearest;
|
|
53
|
+
far[cell] = farthest;
|
|
54
|
+
longest = Math.max(longest, farthest);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return { limit, near, far, longest };
|
|
58
|
+
}
|
|
59
|
+
function reachOf(limit, { stretch, reach }) {
|
|
60
|
+
return Math.max(limit, Math.min(limit * stretch, limit + reach));
|
|
61
|
+
}
|
|
62
|
+
// Hydrogen and its isotopes, written as molstar reads them.
|
|
63
|
+
function isHydrogen(symbol) {
|
|
64
|
+
return HYDROGENS.has(symbol.toUpperCase());
|
|
65
|
+
}
|
|
66
|
+
const HYDROGENS = new Set(['H', 'D', 'T']);
|
|
67
|
+
/**
|
|
68
|
+
* The elements present, and which of them each atom is.
|
|
69
|
+
* @param elements - The element of each atom.
|
|
70
|
+
* @param count - How many atoms are read.
|
|
71
|
+
* @returns The index of each atom's element, and the elements.
|
|
72
|
+
*/
|
|
73
|
+
export function elementKinds(elements, count) {
|
|
74
|
+
const indices = new Int32Array(count);
|
|
75
|
+
const symbols = [];
|
|
76
|
+
const known = new Map();
|
|
77
|
+
for (let atom = 0; atom < count; atom++) {
|
|
78
|
+
const element = elements[atom] ?? '';
|
|
79
|
+
let kind = known.get(element);
|
|
80
|
+
if (kind === undefined) {
|
|
81
|
+
kind = symbols.length;
|
|
82
|
+
known.set(element, kind);
|
|
83
|
+
symbols.push(element);
|
|
84
|
+
}
|
|
85
|
+
indices[atom] = kind;
|
|
86
|
+
}
|
|
87
|
+
return { indices, symbols };
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=partialBondRanges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partialBondRanges.js","sourceRoot":"","sources":["../../../src/molecule3d/core/partialBondRanges.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqB,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqB,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAchF;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CACxB,OAA0B,EAC1B,SAA2C,EAC3C,SAA2B,EAC3B,QAA0B;IAE1B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAC5B,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAI,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC1C,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAChC,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,EAAE,M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AAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,QAA2B,EAAE,KAAa;IACrE,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;QACxC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACrC,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;YACtB,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The partial bonds of a geometry: pairs of atoms a little too far apart to be
|
|
3
|
+
* bonded, as the bonds being formed and broken in a transition state are.
|
|
4
|
+
*
|
|
5
|
+
* A viewer that infers bonds from distances drops exactly those, so a
|
|
6
|
+
* transition state loses the feature it is about. A pair is a partial bond
|
|
7
|
+
* when it is longer than the longest bond between its elements, but not by
|
|
8
|
+
* more than its {@link PartialBondReach} allows, and when its two atoms are
|
|
9
|
+
* neither both hydrogens nor within two bonds of each other: a 1,3 pair is the
|
|
10
|
+
* two ends of a bond angle, never a bond. Nor does one pass through a third
|
|
11
|
+
* atom: the oxygens either side of a proton in flight are joined through it.
|
|
12
|
+
*
|
|
13
|
+
* Free of molstar: the bonding rule is handed in, so the viewer passes the one
|
|
14
|
+
* it bonds by and a page listing the partial bonds beside it can do the same.
|
|
15
|
+
*/
|
|
16
|
+
import type { PartialBondReach } from './partialBondRanges.ts';
|
|
17
|
+
/** The atoms a partial bond is looked for between. */
|
|
18
|
+
export interface PartialBondGeometry {
|
|
19
|
+
/** The element of each atom, e.g. `C`. */
|
|
20
|
+
readonly elements: readonly string[];
|
|
21
|
+
/** Cartesian coordinates, ångström: x, y and z of each atom in turn. */
|
|
22
|
+
readonly coordinates: ArrayLike<number>;
|
|
23
|
+
/** The bonds already drawn, in atom-index pairs: `[a0, b0, a1, b1, …]`. */
|
|
24
|
+
readonly bonds: ArrayLike<number>;
|
|
25
|
+
}
|
|
26
|
+
/** Options of {@link findPartialBonds}. */
|
|
27
|
+
export interface PartialBondOptions {
|
|
28
|
+
/**
|
|
29
|
+
* The longest bond between two elements, ångström, and 0 for a pair never
|
|
30
|
+
* bonded: the viewer passes molstar's own, `bondLimit` from
|
|
31
|
+
* `react-cheminfo/molstar/bonds`.
|
|
32
|
+
*/
|
|
33
|
+
readonly bondLimit: (a: string, b: string) => number;
|
|
34
|
+
/**
|
|
35
|
+
* The reach of a pair three bonds apart, or holding a hydrogen.
|
|
36
|
+
* @default NEAR_PARTIAL_BOND
|
|
37
|
+
*/
|
|
38
|
+
readonly near?: PartialBondReach;
|
|
39
|
+
/**
|
|
40
|
+
* The reach of any other pair.
|
|
41
|
+
* @default FAR_PARTIAL_BOND
|
|
42
|
+
*/
|
|
43
|
+
readonly far?: PartialBondReach;
|
|
44
|
+
}
|
|
45
|
+
/** One partial bond. */
|
|
46
|
+
export interface PartialBond {
|
|
47
|
+
/** One atom, from 0 in the order of the geometry. */
|
|
48
|
+
readonly first: number;
|
|
49
|
+
/** The other, always after `first`. */
|
|
50
|
+
readonly second: number;
|
|
51
|
+
/** Their distance, Å. */
|
|
52
|
+
readonly distance: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Every partial bond of a geometry.
|
|
56
|
+
* @param geometry - The atoms and the bonds already drawn between them.
|
|
57
|
+
* @param options - The bonding rule, and how far past it to look.
|
|
58
|
+
* @returns The partial bonds, ordered by `first` then `second`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function findPartialBonds(geometry: PartialBondGeometry, options: PartialBondOptions): PartialBond[];
|
|
61
|
+
//# sourceMappingURL=partialBonds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partialBonds.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/core/partialBonds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAQ/D,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,wEAAwE;IACxE,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACnC;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC;CACjC;AAED,wBAAwB;AACxB,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yBAAyB;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,WAAW,EAAE,CA+Cf"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The partial bonds of a geometry: pairs of atoms a little too far apart to be
|
|
3
|
+
* bonded, as the bonds being formed and broken in a transition state are.
|
|
4
|
+
*
|
|
5
|
+
* A viewer that infers bonds from distances drops exactly those, so a
|
|
6
|
+
* transition state loses the feature it is about. A pair is a partial bond
|
|
7
|
+
* when it is longer than the longest bond between its elements, but not by
|
|
8
|
+
* more than its {@link PartialBondReach} allows, and when its two atoms are
|
|
9
|
+
* neither both hydrogens nor within two bonds of each other: a 1,3 pair is the
|
|
10
|
+
* two ends of a bond angle, never a bond. Nor does one pass through a third
|
|
11
|
+
* atom: the oxygens either side of a proton in flight are joined through it.
|
|
12
|
+
*
|
|
13
|
+
* Free of molstar: the bonding rule is handed in, so the viewer passes the one
|
|
14
|
+
* it bonds by and a page listing the partial bonds beside it can do the same.
|
|
15
|
+
*/
|
|
16
|
+
import { BondNeighbours } from "./bondNeighbours.js";
|
|
17
|
+
import { FAR_PARTIAL_BOND, NEAR_PARTIAL_BOND, elementKinds, pairRanges, } from "./partialBondRanges.js";
|
|
18
|
+
/**
|
|
19
|
+
* Every partial bond of a geometry.
|
|
20
|
+
* @param geometry - The atoms and the bonds already drawn between them.
|
|
21
|
+
* @param options - The bonding rule, and how far past it to look.
|
|
22
|
+
* @returns The partial bonds, ordered by `first` then `second`.
|
|
23
|
+
*/
|
|
24
|
+
export function findPartialBonds(geometry, options) {
|
|
25
|
+
const { elements, coordinates, bonds } = geometry;
|
|
26
|
+
const count = Math.min(elements.length, Math.floor(coordinates.length / 3));
|
|
27
|
+
const kinds = elementKinds(elements, count);
|
|
28
|
+
const ranges = pairRanges(kinds.symbols, options.bondLimit, options.near ?? NEAR_PARTIAL_BOND, options.far ?? FAR_PARTIAL_BOND);
|
|
29
|
+
const kindCount = kinds.symbols.length;
|
|
30
|
+
const neighbours = new BondNeighbours(count, bonds);
|
|
31
|
+
const order = alongX(coordinates, count);
|
|
32
|
+
const found = [];
|
|
33
|
+
for (let p = 0; p < count; p++) {
|
|
34
|
+
const i = order[p] ?? 0;
|
|
35
|
+
const xi = coordinates[i * 3] ?? 0;
|
|
36
|
+
const yi = coordinates[i * 3 + 1] ?? 0;
|
|
37
|
+
const zi = coordinates[i * 3 + 2] ?? 0;
|
|
38
|
+
const row = (kinds.indices[i] ?? 0) * kindCount;
|
|
39
|
+
for (let q = p + 1; q < count; q++) {
|
|
40
|
+
const j = order[q] ?? 0;
|
|
41
|
+
const dx = (coordinates[j * 3] ?? 0) - xi;
|
|
42
|
+
if (dx > ranges.longest)
|
|
43
|
+
break;
|
|
44
|
+
const dy = (coordinates[j * 3 + 1] ?? 0) - yi;
|
|
45
|
+
const dz = (coordinates[j * 3 + 2] ?? 0) - zi;
|
|
46
|
+
const squared = dx * dx + dy * dy + dz * dz;
|
|
47
|
+
const pair = row + (kinds.indices[j] ?? 0);
|
|
48
|
+
const lower = ranges.limit[pair] ?? 0;
|
|
49
|
+
const far = ranges.far[pair] ?? 0;
|
|
50
|
+
if (squared <= lower * lower || squared > far * far)
|
|
51
|
+
continue;
|
|
52
|
+
const separation = neighbours.separation(i, j);
|
|
53
|
+
if (separation < 3)
|
|
54
|
+
continue;
|
|
55
|
+
const near = ranges.near[pair] ?? 0;
|
|
56
|
+
if (separation === 3 && squared > near * near)
|
|
57
|
+
continue;
|
|
58
|
+
if (passesThroughAtom(coordinates, count, i, j, squared))
|
|
59
|
+
continue;
|
|
60
|
+
found.push({
|
|
61
|
+
first: Math.min(i, j),
|
|
62
|
+
second: Math.max(i, j),
|
|
63
|
+
distance: Math.sqrt(squared),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return found.toSorted((one, other) => one.first - other.first || one.second - other.second);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The atoms in increasing x, so that a pair further apart along x than the
|
|
71
|
+
* longest partial bond ends the search from its first atom.
|
|
72
|
+
* @param coordinates - x, y, z of each atom.
|
|
73
|
+
* @param count - How many atoms.
|
|
74
|
+
* @returns Atom indices.
|
|
75
|
+
*/
|
|
76
|
+
function alongX(coordinates, count) {
|
|
77
|
+
const order = new Int32Array(count);
|
|
78
|
+
for (let atom = 0; atom < count; atom++)
|
|
79
|
+
order[atom] = atom;
|
|
80
|
+
return order.toSorted((a, b) => (coordinates[a * 3] ?? 0) - (coordinates[b * 3] ?? 0));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Whether a third atom stands between two, nearly on the line joining them:
|
|
84
|
+
* seen from it, the two make an angle of 150° or more.
|
|
85
|
+
* @param coordinates - x, y, z of each atom.
|
|
86
|
+
* @param count - How many atoms.
|
|
87
|
+
* @param i - One end.
|
|
88
|
+
* @param j - The other.
|
|
89
|
+
* @param squared - Their squared distance.
|
|
90
|
+
* @returns True when the line from `i` to `j` passes through an atom.
|
|
91
|
+
*/
|
|
92
|
+
function passesThroughAtom(coordinates, count, i, j, squared) {
|
|
93
|
+
for (let k = 0; k < count; k++) {
|
|
94
|
+
if (k === i || k === j)
|
|
95
|
+
continue;
|
|
96
|
+
const toI = squaredDistance(coordinates, k, i);
|
|
97
|
+
const toJ = squaredDistance(coordinates, k, j);
|
|
98
|
+
if (toI >= squared || toJ >= squared)
|
|
99
|
+
continue;
|
|
100
|
+
// The law of cosines, at k.
|
|
101
|
+
const cosine = (toI + toJ - squared) / (2 * Math.sqrt(toI * toJ));
|
|
102
|
+
if (cosine <= THROUGH_COSINE)
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
/** cos 150°. */
|
|
108
|
+
const THROUGH_COSINE = -Math.sqrt(3) / 2;
|
|
109
|
+
function squaredDistance(coordinates, a, b) {
|
|
110
|
+
const dx = (coordinates[a * 3] ?? 0) - (coordinates[b * 3] ?? 0);
|
|
111
|
+
const dy = (coordinates[a * 3 + 1] ?? 0) - (coordinates[b * 3 + 1] ?? 0);
|
|
112
|
+
const dz = (coordinates[a * 3 + 2] ?? 0) - (coordinates[b * 3 + 2] ?? 0);
|
|
113
|
+
return dx * dx + dy * dy + dz * dz;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=partialBonds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partialBonds.js","sourceRoot":"","sources":["../../../src/molecule3d/core/partialBonds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,UAAU,GACX,MAAM,wBAAwB,CAAC;AA0ChC;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAA6B,EAC7B,OAA2B;IAE3B,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAClD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5E,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,UAAU,CACvB,KAAK,CAAC,OAAO,EACb,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,IAAI,IAAI,iBAAiB,EACjC,OAAO,CAAC,GAAG,IAAI,gBAAgB,CAChC,CAAC;IACF,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,MAAM,UAAU,GAAG,IAAI,cAA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C;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,gBAAgB;AAChB,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAEzC,SAAS,eAAe,CACtB,WAA8B,EAC9B,CAAS,EACT,CAAS;IAET,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACzE,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACzE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The display settings of the 3D molecule viewer
|
|
3
|
-
*
|
|
2
|
+
* The display settings of the 3D molecule viewer, free of React and molstar so
|
|
3
|
+
* a site can persist and validate them.
|
|
4
4
|
*/
|
|
5
|
+
import type { PartialBondMode } from './partialBondMode.ts';
|
|
5
6
|
/** Ways the model can be drawn, in the order the picker offers them. */
|
|
6
7
|
export declare const REPRESENTATIONS: readonly ["ball-and-stick", "spacefill", "stick"];
|
|
7
8
|
/** One of {@link REPRESENTATIONS}. */
|
|
@@ -32,6 +33,14 @@ export interface Molecule3DSettings {
|
|
|
32
33
|
surfaceColoring: SurfaceColoringId;
|
|
33
34
|
/** Surface colour in `uniform` mode, `#rrggbb`. */
|
|
34
35
|
surfaceColor: string;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the partial bonds are drawn dashed: pairs a little too far apart
|
|
38
|
+
* to be bonded, as the forming and breaking bonds of a transition state.
|
|
39
|
+
* `auto` draws them for an XYZ file, whose bonds are guessed from distances.
|
|
40
|
+
*/
|
|
41
|
+
partialBonds: PartialBondMode;
|
|
42
|
+
/** Whether each partial bond is labelled with its length. */
|
|
43
|
+
partialBondLengths: boolean;
|
|
35
44
|
}
|
|
36
45
|
/**
|
|
37
46
|
* The colours of `polarity` mode. Positive: cations, and hydrogens bonded to
|
|
@@ -63,31 +72,6 @@ export declare const MOLECULE_3D_RANGES: {
|
|
|
63
72
|
readonly step: 0.1;
|
|
64
73
|
};
|
|
65
74
|
};
|
|
66
|
-
/** Which buttons the toolbar over the canvas shows. */
|
|
67
|
-
export interface Molecule3DTools {
|
|
68
|
-
/** Distance, angle and dihedral tools, and a button removing them all. */
|
|
69
|
-
measure: boolean;
|
|
70
|
-
/** A popover with the representation, the size and the surface sliders. */
|
|
71
|
-
options: boolean;
|
|
72
|
-
/** A toggle turning the model on its own. */
|
|
73
|
-
spin: boolean;
|
|
74
|
-
/** A toggle drawing the molecular surface. */
|
|
75
|
-
surface: boolean;
|
|
76
|
-
/** A button framing the model again. */
|
|
77
|
-
reset: boolean;
|
|
78
|
-
/** A popover saving the picture as a PNG or an SVG. */
|
|
79
|
-
export: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* A toggle filling the screen with the canvas and its toolbars. It is left
|
|
82
|
-
* out where the browser cannot fill the screen, as on an iPhone or in a
|
|
83
|
-
* frame not allowed to.
|
|
84
|
-
*/
|
|
85
|
-
fullscreen: boolean;
|
|
86
|
-
/** A popover listing what the mouse and the keyboard do on the canvas. */
|
|
87
|
-
help: boolean;
|
|
88
|
-
}
|
|
89
|
-
/** Every tool on. */
|
|
90
|
-
export declare const DEFAULT_MOLECULE_3D_TOOLS: Molecule3DTools;
|
|
91
75
|
/**
|
|
92
76
|
* Narrow an arbitrary string — a stored preference, a picker's value — to a
|
|
93
77
|
* representation.
|
|
@@ -104,8 +88,8 @@ export declare function isSurfaceColoringId(value: string): value is SurfaceColo
|
|
|
104
88
|
/**
|
|
105
89
|
* Complete and repair settings from any source: missing fields take their
|
|
106
90
|
* default, numbers are clamped into {@link MOLECULE_3D_RANGES}, an unknown
|
|
107
|
-
* representation or
|
|
108
|
-
* is not `#rrggbb` to its default.
|
|
91
|
+
* representation, colouring or partial bond mode falls back to the default
|
|
92
|
+
* one, and a colour that is not `#rrggbb` to its default.
|
|
109
93
|
* @param settings - Whatever a site has, possibly read back from storage.
|
|
110
94
|
* @returns Settings the viewer can draw.
|
|
111
95
|
*/
|
|
@@ -125,10 +109,4 @@ export declare function resetMolecule3DSettings(settings: Molecule3DSettings, de
|
|
|
125
109
|
* @returns True when every field is equal.
|
|
126
110
|
*/
|
|
127
111
|
export declare function sameMolecule3DSettings(first: Molecule3DSettings, second: Molecule3DSettings): boolean;
|
|
128
|
-
/**
|
|
129
|
-
* Complete a partial tool selection.
|
|
130
|
-
* @param tools - The tools a site switched on or off.
|
|
131
|
-
* @returns Every tool, those not named left on.
|
|
132
|
-
*/
|
|
133
|
-
export declare function resolveMolecule3DTools(tools?: Partial<Molecule3DTools>): Molecule3DTools;
|
|
134
112
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/core/settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wEAAwE;AACxE,eAAO,MAAM,eAAe,mDAIlB,CAAC;AAEX,sCAAsC;AACtC,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,iDAAiD;AACjD,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAA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
|
|
2
|
-
* The display settings of the 3D molecule viewer
|
|
3
|
-
*
|
|
2
|
+
* The display settings of the 3D molecule viewer, free of React and molstar so
|
|
3
|
+
* a site can persist and validate them.
|
|
4
4
|
*/
|
|
5
|
+
import { isPartialBondMode } from "./partialBondMode.js";
|
|
5
6
|
/** Ways the model can be drawn, in the order the picker offers them. */
|
|
6
7
|
export const REPRESENTATIONS = [
|
|
7
8
|
'ball-and-stick',
|
|
@@ -42,6 +43,8 @@ export const DEFAULT_MOLECULE_3D_SETTINGS = {
|
|
|
42
43
|
surfaceColoring: 'uniform',
|
|
43
44
|
// A scene colour: WebGL cannot read a CSS custom property.
|
|
44
45
|
surfaceColor: '#94a3b8', // tokens-ok
|
|
46
|
+
partialBonds: 'auto',
|
|
47
|
+
partialBondLengths: true,
|
|
45
48
|
};
|
|
46
49
|
/** The span, and the slider step, of every numeric setting. */
|
|
47
50
|
export const MOLECULE_3D_RANGES = {
|
|
@@ -49,17 +52,6 @@ export const MOLECULE_3D_RANGES = {
|
|
|
49
52
|
surfaceAlpha: { minimum: 0.1, maximum: 1, step: 0.05 },
|
|
50
53
|
probeRadius: { minimum: 1, maximum: 3, step: 0.1 },
|
|
51
54
|
};
|
|
52
|
-
/** Every tool on. */
|
|
53
|
-
export const DEFAULT_MOLECULE_3D_TOOLS = {
|
|
54
|
-
measure: true,
|
|
55
|
-
options: true,
|
|
56
|
-
spin: true,
|
|
57
|
-
surface: true,
|
|
58
|
-
reset: true,
|
|
59
|
-
export: true,
|
|
60
|
-
fullscreen: true,
|
|
61
|
-
help: true,
|
|
62
|
-
};
|
|
63
55
|
/**
|
|
64
56
|
* Narrow an arbitrary string — a stored preference, a picker's value — to a
|
|
65
57
|
* representation.
|
|
@@ -88,14 +80,14 @@ export function isSurfaceColoringId(value) {
|
|
|
88
80
|
/**
|
|
89
81
|
* Complete and repair settings from any source: missing fields take their
|
|
90
82
|
* default, numbers are clamped into {@link MOLECULE_3D_RANGES}, an unknown
|
|
91
|
-
* representation or
|
|
92
|
-
* is not `#rrggbb` to its default.
|
|
83
|
+
* representation, colouring or partial bond mode falls back to the default
|
|
84
|
+
* one, and a colour that is not `#rrggbb` to its default.
|
|
93
85
|
* @param settings - Whatever a site has, possibly read back from storage.
|
|
94
86
|
* @returns Settings the viewer can draw.
|
|
95
87
|
*/
|
|
96
88
|
export function normalizeMolecule3DSettings(settings = {}) {
|
|
97
89
|
const defaults = DEFAULT_MOLECULE_3D_SETTINGS;
|
|
98
|
-
const { representation, sizeFactor, showSurface, surfaceAlpha, probeRadius, surfaceColoring, surfaceColor, } = settings;
|
|
90
|
+
const { representation, sizeFactor, showSurface, surfaceAlpha, probeRadius, surfaceColoring, surfaceColor, partialBonds, partialBondLengths, } = settings;
|
|
99
91
|
return {
|
|
100
92
|
representation: typeof representation === 'string' && isRepresentationId(representation)
|
|
101
93
|
? representation
|
|
@@ -109,6 +101,12 @@ export function normalizeMolecule3DSettings(settings = {}) {
|
|
|
109
101
|
? surfaceColoring
|
|
110
102
|
: defaults.surfaceColoring,
|
|
111
103
|
surfaceColor: hexColor(surfaceColor, defaults.surfaceColor),
|
|
104
|
+
partialBonds: isPartialBondMode(partialBonds)
|
|
105
|
+
? partialBonds
|
|
106
|
+
: defaults.partialBonds,
|
|
107
|
+
partialBondLengths: typeof partialBondLengths === 'boolean'
|
|
108
|
+
? partialBondLengths
|
|
109
|
+
: defaults.partialBondLengths,
|
|
112
110
|
};
|
|
113
111
|
}
|
|
114
112
|
/**
|
|
@@ -134,15 +132,9 @@ export function sameMolecule3DSettings(first, second) {
|
|
|
134
132
|
first.surfaceAlpha === second.surfaceAlpha &&
|
|
135
133
|
first.probeRadius === second.probeRadius &&
|
|
136
134
|
first.surfaceColoring === second.surfaceColoring &&
|
|
137
|
-
first.surfaceColor === second.surfaceColor
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
* Complete a partial tool selection.
|
|
141
|
-
* @param tools - The tools a site switched on or off.
|
|
142
|
-
* @returns Every tool, those not named left on.
|
|
143
|
-
*/
|
|
144
|
-
export function resolveMolecule3DTools(tools = {}) {
|
|
145
|
-
return { ...DEFAULT_MOLECULE_3D_TOOLS, ...tools };
|
|
135
|
+
first.surfaceColor === second.surfaceColor &&
|
|
136
|
+
first.partialBonds === second.partialBonds &&
|
|
137
|
+
first.partialBondLengths === second.partialBondLengths);
|
|
146
138
|
}
|
|
147
139
|
function hexColor(value, fallback) {
|
|
148
140
|
return typeof value === 'string' && /^#[\da-f]{6}$/i.test(value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/molecule3d/core/settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/molecule3d/core/settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,wEAAwE;AACxE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,gBAAgB;IAChB,WAAW;IACX,OAAO;CACC,CAAC;AAKX,iDAAiD;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAqC;IACrE,gBAAgB,EAAE,gBAAgB;IAClC,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,QAAQ;CAChB,CAAC;AAEF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAK7E,oDAAoD;AACpD,MAAM,CAAC,MAAM,uBAAuB,GAAsC;IACxE,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACrB,CAAC;AA8BF;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,QAAQ,EAAE,SAAS,EAAE,YAAY;IACjC,QAAQ,EAAE,SAAS,EAAE,YAAY;IACjC,OAAO,EAAE,SAAS,EAAE,YAAY;CACxB,C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,CAAC,cAAc,KAAK,MAAM,CAAC,cAAc;QAC9C,KAAK,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU;QACtC,KAAK,CAAC,WAAW,KAAK,MAAM,CAAC,WAAW;QACxC,KAAK,CAAC,YAAY,KAAK,MAAM,CAAC,YAAY;QAC1C,KAAK,CAAC,WAAW,KAAK,MAAM,CAAC,WAAW;QACxC,KAAK,CAAC,eAAe,KAAK,MAAM,CAAC,eAAe;QAChD,KAAK,CAAC,YAAY,KAAK,MAAM,CAAC,YAAY;QAC1C,KAAK,CAAC,YAAY,KAAK,MAAM,CAAC,YAAY;QAC1C,KAAK,CAAC,kBAAkB,KAAK,MAAM,CAAC,kBAAkB,CACvD,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAyB,EAAE,QAAgB;IAC3D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;QAC9D,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE;QACrB,CAAC,CAAC,QAAQ,CAAC;AACf,CAAC;AAED,SAAS,KAAK,CACZ,KAAyB,EACzB,GAAoC;IAEpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,OAAO,4BAA4B,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACrD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which buttons the toolbar over the 3D molecule canvas shows, free of React
|
|
3
|
+
* and molstar so a site can persist them.
|
|
4
|
+
*/
|
|
5
|
+
/** Which buttons the toolbar over the canvas shows. */
|
|
6
|
+
export interface Molecule3DTools {
|
|
7
|
+
/** Distance, angle and dihedral tools, and a button removing them all. */
|
|
8
|
+
measure: boolean;
|
|
9
|
+
/** A popover with the representation, the size and the surface sliders. */
|
|
10
|
+
options: boolean;
|
|
11
|
+
/** A toggle turning the model on its own. */
|
|
12
|
+
spin: boolean;
|
|
13
|
+
/** A toggle drawing the molecular surface. */
|
|
14
|
+
surface: boolean;
|
|
15
|
+
/** A button framing the model again. */
|
|
16
|
+
reset: boolean;
|
|
17
|
+
/** A popover saving the picture as a PNG or an SVG. */
|
|
18
|
+
export: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* A toggle filling the screen with the canvas and its toolbars. It is left
|
|
21
|
+
* out where the browser cannot fill the screen, as on an iPhone or in a
|
|
22
|
+
* frame not allowed to.
|
|
23
|
+
*/
|
|
24
|
+
fullscreen: boolean;
|
|
25
|
+
/** A popover listing what the mouse and the keyboard do on the canvas. */
|
|
26
|
+
help: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Every tool on. */
|
|
29
|
+
export declare const DEFAULT_MOLECULE_3D_TOOLS: Molecule3DTools;
|
|
30
|
+
/**
|
|
31
|
+
* Complete a partial tool selection.
|
|
32
|
+
* @param tools - The tools a site switched on or off.
|
|
33
|
+
* @returns Every tool, those not named left on.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveMolecule3DTools(tools?: Partial<Molecule3DTools>): Molecule3DTools;
|
|
36
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/core/tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,OAAO,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,OAAO,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,IAAI,EAAE,OAAO,CAAC;IACd,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,KAAK,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,IAAI,EAAE,OAAO,CAAC;CACf;AAED,qBAAqB;AACrB,eAAO,MAAM,yBAAyB,EAAE,eASvC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,GAAE,OAAO,CAAC,eAAe,CAAM,GACnC,eAAe,CAEjB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which buttons the toolbar over the 3D molecule canvas shows, free of React
|
|
3
|
+
* and molstar so a site can persist them.
|
|
4
|
+
*/
|
|
5
|
+
/** Every tool on. */
|
|
6
|
+
export const DEFAULT_MOLECULE_3D_TOOLS = {
|
|
7
|
+
measure: true,
|
|
8
|
+
options: true,
|
|
9
|
+
spin: true,
|
|
10
|
+
surface: true,
|
|
11
|
+
reset: true,
|
|
12
|
+
export: true,
|
|
13
|
+
fullscreen: true,
|
|
14
|
+
help: true,
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Complete a partial tool selection.
|
|
18
|
+
* @param tools - The tools a site switched on or off.
|
|
19
|
+
* @returns Every tool, those not named left on.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveMolecule3DTools(tools = {}) {
|
|
22
|
+
return { ...DEFAULT_MOLECULE_3D_TOOLS, ...tools };
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/molecule3d/core/tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH,qBAAqB;AACrB,MAAM,CAAC,MAAM,yBAAyB,GAAoB;IACxD,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,IAAI,EAAE,IAAI;CACX,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAkC,EAAE;IAEpC,OAAO,EAAE,GAAG,yBAAyB,EAAE,GAAG,KAAK,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Molecule3DExport.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/ui/Molecule3DExport.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Molecule3DExport.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/ui/Molecule3DExport.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAM1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAQvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAUtD,yCAAyC;AACzC,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,OAAO,EAAE,MAAM,YAAY,GAAG,IAAI,CAAC;IACnC;;OAEG;IACH,QAAQ,EAAE,CACR,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,OAAO,KACd,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,2EAA2E;IAC3E,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACjD;;;;OAIG;IACH,SAAS,CAAC,EAAE,CACV,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,OAAO,KACd,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,CA8H3E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useState } from 'react';
|
|
3
|
+
import { writeToClipboard } from "../../clipboard/core/writeToClipboard.js";
|
|
3
4
|
import { DEFAULT_FIGURE_DPI, FIGURE_DPIS, dpiScale, } from "../../download/core/figureDpi.js";
|
|
4
5
|
import { FigureDownloadPanel } from "../../download/ui/FigureDownloadPanel.js";
|
|
5
6
|
import { useFigureSend } from "../../download/ui/useFigureSend.js";
|
|
@@ -30,11 +31,18 @@ export function Molecule3DExport(props) {
|
|
|
30
31
|
const atoms = moleculeFileAtoms(molfile, frameCount);
|
|
31
32
|
const versions = moleculeFileChoices(atoms, t);
|
|
32
33
|
const writtenVersion = versions[0]?.disabled ? 'molfileV3000' : version;
|
|
33
|
-
// Written once picked
|
|
34
|
+
// Written once picked rather than on the press: Safari only allows a
|
|
35
|
+
// clipboard write the click itself started, and Save has it at hand too.
|
|
34
36
|
const written = useAsync(useCallback(() => file !== null && molfile
|
|
35
37
|
? moleculeFileText(molfile, writtenVersion)
|
|
36
38
|
: Promise.resolve(null), [file, molfile, writtenVersion]));
|
|
37
39
|
const text = written.pending ? null : written.data;
|
|
40
|
+
const versionLabel = writtenVersion === 'molfileV3000' ? 'V3000' : 'V2000';
|
|
41
|
+
async function copyMolfile(molfileText) {
|
|
42
|
+
if (await writeToClipboard(molfileText))
|
|
43
|
+
return 'copied';
|
|
44
|
+
throw new Error(t('clipboard.failed'));
|
|
45
|
+
}
|
|
38
46
|
// What the last copy came to only describes the choices it was made with.
|
|
39
47
|
function changed(apply) {
|
|
40
48
|
return (value) => {
|
|
@@ -50,6 +58,12 @@ export function Molecule3DExport(props) {
|
|
|
50
58
|
value: file,
|
|
51
59
|
onChange: changed(setFile),
|
|
52
60
|
hint: t('molecule3d.molfileHint', { count: atoms }),
|
|
61
|
+
copy: {
|
|
62
|
+
ready: t('molecule3d.copyMolfile', { version: versionLabel }),
|
|
63
|
+
copied: t('molecule3d.copiedMolfile', {
|
|
64
|
+
version: versionLabel,
|
|
65
|
+
}),
|
|
66
|
+
},
|
|
53
67
|
}
|
|
54
68
|
: undefined, scale: scale, scales: DPI_SCALES, unit: "dpi", size: size, failure: failure ?? written.failure?.message ?? null, notice: notice, saving: busy || (file !== null && text === null), rasterSvg: true, onFormatChange: changed(setFormat), onScaleChange: changed(setScale), onSave: () => {
|
|
55
69
|
if (file === null) {
|
|
@@ -59,7 +73,10 @@ export function Molecule3DExport(props) {
|
|
|
59
73
|
saveMoleculeFile(text, writtenVersion, fileName);
|
|
60
74
|
}
|
|
61
75
|
}, onCopy: () => {
|
|
62
|
-
|
|
76
|
+
if (file === null)
|
|
77
|
+
run(onCopy(scale));
|
|
78
|
+
else if (text)
|
|
79
|
+
run(copyMolfile(text));
|
|
63
80
|
}, onSend: writeFile === undefined
|
|
64
81
|
? undefined
|
|
65
82
|
: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Molecule3DExport.js","sourceRoot":"","sources":["../../../src/molecule3d/ui/Molecule3DExport.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Molecule3DExport.js","sourceRoot":"","sources":["../../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