react-cheminfo 0.134.0 → 0.135.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/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 +18 -0
- package/lib/crystal/core/index.d.ts.map +1 -0
- package/lib/crystal/core/index.js +12 -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 +140 -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/server/spaSite.d.ts.map +1 -1
- package/lib/server/spaSite.js +9 -0
- package/lib/server/spaSite.js.map +1 -1
- package/package.json +3 -1
- package/src/crystal/core/bondGrid.ts +98 -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 +44 -0
- package/src/crystal/core/moleculeOf.ts +169 -0
- package/src/crystal/core/moleculeTypes.ts +85 -0
- package/src/crystal/core/molecules.ts +165 -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/server/spaSite.ts +9 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which setting a file is written in.
|
|
3
|
+
*
|
|
4
|
+
* A CIF names its group up to four ways and they do not always agree, so the
|
|
5
|
+
* order matters: the Hall symbol pins a setting on its own, a Hermann–Mauguin
|
|
6
|
+
* symbol usually does, a number alone never does. The operations in the file
|
|
7
|
+
* are then checked against whatever won, because a file whose symbol and
|
|
8
|
+
* operations disagree is common and the operations are what the structure
|
|
9
|
+
* actually has.
|
|
10
|
+
*/
|
|
11
|
+
import { spaceGroupOperations } from "./spaceGroups/spaceGroupOperations.js";
|
|
12
|
+
import { resolveSpaceGroups } from "./spaceGroups/spaceGroupSymbols.js";
|
|
13
|
+
import { SPACE_GROUP_SETTINGS } from "./spaceGroups/spaceGroups.js";
|
|
14
|
+
import { operationKey } from "./symmetry/operation.js";
|
|
15
|
+
import { parseOperation } from "./symmetry/parseOperation.js";
|
|
16
|
+
/**
|
|
17
|
+
* Read a structure's space group off the file.
|
|
18
|
+
* @param structure - What `readCif` returned.
|
|
19
|
+
* @returns The setting and how it was decided; `setting` is `null` only when
|
|
20
|
+
* the file names no group the catalogue recognises.
|
|
21
|
+
*/
|
|
22
|
+
export function resolveStructureSetting(structure) {
|
|
23
|
+
const { hall, hm, number } = structure.spaceGroup;
|
|
24
|
+
const byHall = hall === null ? [] : resolveSpaceGroups(hall);
|
|
25
|
+
const bySymbol = hm === null ? [] : withinNumber(resolveSpaceGroups(hm), number);
|
|
26
|
+
const named = byHall.length > 0 ? byHall : bySymbol;
|
|
27
|
+
const from = byHall.length > 0 ? 'hall' : 'symbol';
|
|
28
|
+
if (named.length > 0) {
|
|
29
|
+
const setting = named[0] ?? null;
|
|
30
|
+
const agrees = setting === null ? null : operationsBelong(structure.symopsXyz, setting);
|
|
31
|
+
return {
|
|
32
|
+
setting,
|
|
33
|
+
from,
|
|
34
|
+
candidates: named,
|
|
35
|
+
// Only worth the scan when the file contradicts its own symbol.
|
|
36
|
+
fromOperations: agrees === false ? settingOfOperations(structure.symopsXyz) : null,
|
|
37
|
+
agrees,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const fromOperations = settingOfOperations(structure.symopsXyz);
|
|
41
|
+
if (fromOperations !== null) {
|
|
42
|
+
return {
|
|
43
|
+
setting: fromOperations,
|
|
44
|
+
from: 'operations',
|
|
45
|
+
candidates: [fromOperations],
|
|
46
|
+
fromOperations,
|
|
47
|
+
agrees: true,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const byNumber = number === null ? [] : resolveSpaceGroups(number);
|
|
51
|
+
const setting = byNumber[0] ?? null;
|
|
52
|
+
return {
|
|
53
|
+
setting,
|
|
54
|
+
from: setting === null ? null : 'number',
|
|
55
|
+
candidates: byNumber,
|
|
56
|
+
fromOperations: null,
|
|
57
|
+
agrees: setting === null ? null : operationsBelong(structure.symopsXyz, setting),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Whether every operation the file lists is an operation of the setting.
|
|
62
|
+
*
|
|
63
|
+
* A file often lists one coset of a centred group and leaves the centring to
|
|
64
|
+
* the symbol, so the test is containment rather than equality: a shorter list
|
|
65
|
+
* is not a disagreement, an operation outside the group is.
|
|
66
|
+
* @param symopsXyz - The operation triplets the file carries, verbatim.
|
|
67
|
+
* @param setting - The setting they are checked against.
|
|
68
|
+
* @returns `null` when the file lists no operation; `false` when one of them is
|
|
69
|
+
* not the setting's, a triplet nothing can parse included.
|
|
70
|
+
*/
|
|
71
|
+
export function operationsBelong(symopsXyz, setting) {
|
|
72
|
+
if (symopsXyz.length === 0)
|
|
73
|
+
return null;
|
|
74
|
+
const keys = operationKeys(setting);
|
|
75
|
+
for (const triplet of symopsXyz) {
|
|
76
|
+
const key = keyOf(triplet);
|
|
77
|
+
if (key === null || !keys.has(key))
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The one setting whose coset list is exactly the file's, or `null`.
|
|
84
|
+
*
|
|
85
|
+
* The last resort — a file with operations and no readable symbol — and what
|
|
86
|
+
* names the group when a file contradicts its own symbol.
|
|
87
|
+
* @param symopsXyz - The operation triplets the file carries.
|
|
88
|
+
* @returns The setting, or `null` when none matches exactly.
|
|
89
|
+
*/
|
|
90
|
+
export function settingOfOperations(symopsXyz) {
|
|
91
|
+
if (symopsXyz.length === 0)
|
|
92
|
+
return null;
|
|
93
|
+
const wanted = new Set();
|
|
94
|
+
for (const triplet of symopsXyz) {
|
|
95
|
+
const key = keyOf(triplet);
|
|
96
|
+
if (key === null)
|
|
97
|
+
return null;
|
|
98
|
+
wanted.add(key);
|
|
99
|
+
}
|
|
100
|
+
for (const setting of SPACE_GROUP_SETTINGS) {
|
|
101
|
+
if (setting.multiplicity !== wanted.size)
|
|
102
|
+
continue;
|
|
103
|
+
let same = true;
|
|
104
|
+
for (const key of operationKeys(setting)) {
|
|
105
|
+
if (!wanted.has(key)) {
|
|
106
|
+
same = false;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (same)
|
|
111
|
+
return setting;
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A symbol that matches several numbers is cut down by the number the file also
|
|
117
|
+
* gives, so `Fd-3m` plus `227` never drifts onto another group's spelling. A
|
|
118
|
+
* number that agrees with nothing is ignored rather than obeyed.
|
|
119
|
+
* @param settings - The settings the symbol matches.
|
|
120
|
+
* @param number - The number the file gives, or `null`.
|
|
121
|
+
* @returns The settings of that number, or all of them when none is.
|
|
122
|
+
*/
|
|
123
|
+
function withinNumber(settings, number) {
|
|
124
|
+
if (number === null)
|
|
125
|
+
return settings;
|
|
126
|
+
const inside = settings.filter((setting) => setting.number === number);
|
|
127
|
+
return inside.length > 0 ? inside : settings;
|
|
128
|
+
}
|
|
129
|
+
const KEYS = new WeakMap();
|
|
130
|
+
function operationKeys(setting) {
|
|
131
|
+
const known = KEYS.get(setting);
|
|
132
|
+
if (known !== undefined)
|
|
133
|
+
return known;
|
|
134
|
+
const keys = new Set();
|
|
135
|
+
for (const operation of spaceGroupOperations(setting)) {
|
|
136
|
+
keys.add(operationKey(operation));
|
|
137
|
+
}
|
|
138
|
+
KEYS.set(setting, keys);
|
|
139
|
+
return keys;
|
|
140
|
+
}
|
|
141
|
+
function keyOf(triplet) {
|
|
142
|
+
try {
|
|
143
|
+
return operationKey(parseOperation(triplet, 3));
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/crystal/core/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAuB9D;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,SAA2B;IAE3B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC;IAClD,MAAM,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,QAAQ,GACZ,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAClE,MAAM,KAAK,GAAG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,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { Centring, CrystalSystem, SpaceGroupSetting, } from './spaceGroups.ts';
|
|
2
|
+
export { SPACE_GROUP_SETTINGS, SPACE_GROUP_SETTINGS_BY_NUMBER, spaceGroup, } from './spaceGroups.ts';
|
|
3
|
+
export { spaceGroupOperations } from './spaceGroupOperations.ts';
|
|
4
|
+
export { normalizeSpaceGroupSymbol, resolveSpaceGroup, resolveSpaceGroups, } from './spaceGroupSymbols.ts';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/crystal/core/spaceGroups/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,QAAQ,EACR,aAAa,EACb,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SPACE_GROUP_SETTINGS, SPACE_GROUP_SETTINGS_BY_NUMBER, spaceGroup, } from "./spaceGroups.js";
|
|
2
|
+
export { spaceGroupOperations } from "./spaceGroupOperations.js";
|
|
3
|
+
export { normalizeSpaceGroupSymbol, resolveSpaceGroup, resolveSpaceGroups, } from "./spaceGroupSymbols.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/crystal/core/spaceGroups/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CrystalOperation } from '../symmetry/types.ts';
|
|
2
|
+
import type { SpaceGroupSetting } from './spaceGroups.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The exact operations of one setting: its coset list with the centring
|
|
5
|
+
* expanded, parsed from the canonical triplets the data module carries.
|
|
6
|
+
*
|
|
7
|
+
* Parsing all 7244 operations of the 521 settings takes long enough to be worth
|
|
8
|
+
* not doing on a page that shows one group, so a setting is parsed the first
|
|
9
|
+
* time it is asked for and the result is kept for as long as the setting is.
|
|
10
|
+
* @param setting - One setting of the catalogue.
|
|
11
|
+
* @returns The operations, parsed once per setting.
|
|
12
|
+
*/
|
|
13
|
+
export declare function spaceGroupOperations(setting: SpaceGroupSetting): ReadonlyArray<CrystalOperation<3>>;
|
|
14
|
+
//# sourceMappingURL=spaceGroupOperations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceGroupOperations.d.ts","sourceRoot":"","sources":["../../../../src/crystal/core/spaceGroups/spaceGroupOperations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAO1D;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,GACzB,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CASpC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { parseOperation } from "../symmetry/parseOperation.js";
|
|
2
|
+
const cache = new WeakMap();
|
|
3
|
+
/**
|
|
4
|
+
* The exact operations of one setting: its coset list with the centring
|
|
5
|
+
* expanded, parsed from the canonical triplets the data module carries.
|
|
6
|
+
*
|
|
7
|
+
* Parsing all 7244 operations of the 521 settings takes long enough to be worth
|
|
8
|
+
* not doing on a page that shows one group, so a setting is parsed the first
|
|
9
|
+
* time it is asked for and the result is kept for as long as the setting is.
|
|
10
|
+
* @param setting - One setting of the catalogue.
|
|
11
|
+
* @returns The operations, parsed once per setting.
|
|
12
|
+
*/
|
|
13
|
+
export function spaceGroupOperations(setting) {
|
|
14
|
+
const known = cache.get(setting);
|
|
15
|
+
if (known !== undefined)
|
|
16
|
+
return known;
|
|
17
|
+
const operations = [];
|
|
18
|
+
for (const triplet of setting.operations) {
|
|
19
|
+
operations.push(parseOperation(triplet, 3));
|
|
20
|
+
}
|
|
21
|
+
cache.set(setting, operations);
|
|
22
|
+
return operations;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=spaceGroupOperations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceGroupOperations.js","sourceRoot":"","sources":["../../../../src/crystal/core/spaceGroups/spaceGroupOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAK/D,MAAM,KAAK,GAAG,IAAI,OAAO,EAGtB,CAAC;AAEJ;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA0B;IAE1B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC,MAAM,UAAU,GAA+B,EAAE,CAAC;IAClD,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC/B,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceGroupRows.d.ts","sourceRoot":"","sources":["../../../../src/crystal/core/spaceGroups/spaceGroupRows.ts"],"names":[],"mappings":"AAYA,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EA0gB7C,CAAC"}
|