symcrys 0.4.0 → 0.6.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.
Files changed (75) hide show
  1. package/README.md +15 -132
  2. package/dist/crystalClasses.d.ts +211 -0
  3. package/dist/crystalClasses.d.ts.map +1 -0
  4. package/dist/crystalClasses.js +295 -0
  5. package/dist/crystalClasses.js.map +1 -0
  6. package/dist/index.d.ts +11 -9
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +6 -8
  9. package/dist/index.js.map +1 -1
  10. package/dist/magnetic.d.ts +35 -0
  11. package/dist/magnetic.d.ts.map +1 -0
  12. package/dist/magnetic.js +22 -0
  13. package/dist/magnetic.js.map +1 -0
  14. package/dist/operations.d.ts +8 -0
  15. package/dist/operations.d.ts.map +1 -1
  16. package/dist/operations.js +25 -0
  17. package/dist/operations.js.map +1 -1
  18. package/dist/pointGroups/data.d.ts +34 -0
  19. package/dist/pointGroups/data.d.ts.map +1 -1
  20. package/dist/pointGroups/data.js +29 -21
  21. package/dist/pointGroups/data.js.map +1 -1
  22. package/dist/pointGroups/elements.d.ts +12 -5
  23. package/dist/pointGroups/elements.d.ts.map +1 -1
  24. package/dist/pointGroups/elements.js +6 -1
  25. package/dist/pointGroups/elements.js.map +1 -1
  26. package/dist/pointGroups/magneticData.d.ts +61 -0
  27. package/dist/pointGroups/magneticData.d.ts.map +1 -0
  28. package/dist/pointGroups/magneticData.js +180 -0
  29. package/dist/pointGroups/magneticData.js.map +1 -0
  30. package/dist/pointGroups/magneticSymbols.d.ts +22 -0
  31. package/dist/pointGroups/magneticSymbols.d.ts.map +1 -0
  32. package/dist/pointGroups/magneticSymbols.js +103 -0
  33. package/dist/pointGroups/magneticSymbols.js.map +1 -0
  34. package/dist/pointGroups/pointGroups.d.ts +94 -24
  35. package/dist/pointGroups/pointGroups.d.ts.map +1 -1
  36. package/dist/pointGroups/pointGroups.js +293 -47
  37. package/dist/pointGroups/pointGroups.js.map +1 -1
  38. package/dist/pointGroups/properties.d.ts +25 -16
  39. package/dist/pointGroups/properties.d.ts.map +1 -1
  40. package/dist/pointGroups/properties.js +46 -56
  41. package/dist/pointGroups/properties.js.map +1 -1
  42. package/dist/pointGroups/wyckoff.d.ts +2 -1
  43. package/dist/pointGroups/wyckoff.d.ts.map +1 -1
  44. package/dist/pointGroups/wyckoff.js +6 -2
  45. package/dist/pointGroups/wyckoff.js.map +1 -1
  46. package/dist/tensors/propertyTable.d.ts +35 -0
  47. package/dist/tensors/propertyTable.d.ts.map +1 -0
  48. package/dist/tensors/propertyTable.js +32 -0
  49. package/dist/tensors/propertyTable.js.map +1 -0
  50. package/dist/tensors/tensorForm.d.ts +16 -10
  51. package/dist/tensors/tensorForm.d.ts.map +1 -1
  52. package/dist/tensors/tensorForm.js +23 -24
  53. package/dist/tensors/tensorForm.js.map +1 -1
  54. package/dist/tensors/tensorProperties.d.ts +30 -0
  55. package/dist/tensors/tensorProperties.d.ts.map +1 -0
  56. package/dist/tensors/tensorProperties.js +44 -0
  57. package/dist/tensors/tensorProperties.js.map +1 -0
  58. package/dist/version.d.ts +1 -1
  59. package/dist/version.js +1 -1
  60. package/package.json +9 -26
  61. package/src/crystalClasses.ts +436 -0
  62. package/src/index.ts +32 -38
  63. package/src/magnetic.ts +87 -0
  64. package/src/operations.ts +29 -0
  65. package/src/pointGroups/data.ts +29 -21
  66. package/src/pointGroups/elements.ts +23 -7
  67. package/src/pointGroups/magneticData.ts +322 -0
  68. package/src/pointGroups/magneticSymbols.ts +110 -0
  69. package/src/pointGroups/pointGroups.ts +380 -65
  70. package/src/pointGroups/properties.ts +47 -56
  71. package/src/pointGroups/wyckoff.ts +15 -2
  72. package/src/tensors/propertyTable.ts +79 -0
  73. package/src/tensors/tensorForm.ts +34 -28
  74. package/src/tensors/tensorProperties.ts +50 -0
  75. package/src/version.ts +1 -1
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Hermann–Mauguin symbols of the black-and-white point groups. The symbol of such a group in a
3
+ * given frame is the symbol of its crystal class in that frame, each position carrying a prime if
4
+ * the operation it names is combined with time reversal (ITC Vol. D, § 1.5.2.1, Table 1.5.2.3).
5
+ * So no symbols are stored for these groups: they follow from the symbols of the class
6
+ * (data.ts) and the operations (docs/conventions.md, "Symbols").
7
+ */
8
+ import { matricesEqual } from '../linalg.js';
9
+ import { crystalFamily, latticeBasis } from '../lattice.js';
10
+ import { LATTICE_SYMMETRY_DIRECTIONS } from '../symmetryDirections.js';
11
+ /** The Cartesian direction of the first symmetry direction of each position of the full symbol. */
12
+ function positionDirections(family, convention) {
13
+ const positions = LATTICE_SYMMETRY_DIRECTIONS[family];
14
+ // Birss reads position 2 of the hexagonal family along y and position 3 along x
15
+ // (docs/conventions.md, "Where ITC and Birss differ").
16
+ const ordered = convention === 'birss' && family === 'hexagonal' ? [positions[0], positions[2], positions[1]] : positions;
17
+ // Monoclinic: a, b, c along x, y, z, exact for the unique axis, the only one with an element.
18
+ const b = family === 'monoclinic' || family === 'triclinic'
19
+ ? [
20
+ [1, 0, 0],
21
+ [0, 1, 0],
22
+ [0, 0, 1],
23
+ ]
24
+ : latticeBasis(family);
25
+ return ordered.map(([uvw]) => [
26
+ b[0][0] * uvw[0] + b[0][1] * uvw[1] + b[0][2] * uvw[2],
27
+ b[1][0] * uvw[0] + b[1][1] * uvw[1] + b[1][2] * uvw[2],
28
+ b[2][0] * uvw[0] + b[2][1] * uvw[1] + b[2][2] * uvw[2],
29
+ ]);
30
+ }
31
+ /** Proper rotation by 360°/n about the direction u (Rodrigues' formula), times `sign`. */
32
+ function rotation(u, n, sign) {
33
+ const length = Math.hypot(u[0], u[1], u[2]);
34
+ const [x, y, z] = [u[0] / length, u[1] / length, u[2] / length];
35
+ const a = (2 * Math.PI) / n;
36
+ const c = Math.cos(a);
37
+ const s = Math.sin(a);
38
+ const t = 1 - c;
39
+ const r = [
40
+ [t * x * x + c, t * x * y - s * z, t * x * z + s * y],
41
+ [t * x * y + s * z, t * y * y + c, t * y * z - s * x],
42
+ [t * x * z - s * y, t * y * z + s * x, t * z * z + c],
43
+ ];
44
+ return r.map((row) => row.map((v) => sign * v));
45
+ }
46
+ /** `'` if the operation with this matrix is combined with time reversal in `ops`, otherwise ``. */
47
+ function prime(ops, matrix, what) {
48
+ const op = ops.find((x) => matricesEqual(x.matrix, matrix));
49
+ if (!op)
50
+ throw new Error(`${what}: the group does not contain the operation its symbol names`);
51
+ return op.timeReversal ? "'" : '';
52
+ }
53
+ /** One position (`N`, `-N`, `N/m`, `m`, `1`) with the primes of the operations along `u`. */
54
+ function primedToken(token, u, ops, what) {
55
+ if (token === '1')
56
+ return token;
57
+ const parts = /^(?:(-?)([1-6]))?(\/?m)?$/.exec(token);
58
+ if (!parts || token === '')
59
+ throw new Error(`${what}: unreadable position ${JSON.stringify(token)}`);
60
+ const [, bar, n, mirror] = parts;
61
+ let result = '';
62
+ if (n) {
63
+ // -1 is the inversion and needs no direction; every other axis lies along u.
64
+ if (n === '1')
65
+ result = `${bar}1${prime(ops, rotation([0, 0, 1], 1, -1), what)}`;
66
+ else {
67
+ if (!u)
68
+ throw new Error(`${what}: no symmetry direction for position ${token}`);
69
+ result = `${bar}${n}${prime(ops, rotation(u, Number(n), bar ? -1 : 1), what)}`;
70
+ }
71
+ }
72
+ if (mirror) {
73
+ if (!u)
74
+ throw new Error(`${what}: no symmetry direction for position ${token}`);
75
+ result += `${mirror}${prime(ops, rotation(u, 2, -1), what)}`;
76
+ }
77
+ return result;
78
+ }
79
+ /** The positions of a short symbol: `N`, `-N`, `N/m`, `m`. */
80
+ function shortTokens(symbol) {
81
+ const list = symbol.match(/-?[1-6](\/m)?|m/g) ?? [];
82
+ if (list.join('') !== symbol)
83
+ throw new Error(`Unreadable symbol: ${symbol}`);
84
+ return list;
85
+ }
86
+ /**
87
+ * The symbols of a black-and-white group in one frame: the short and the full symbol of its
88
+ * crystal class in that frame, in the given convention, with primes taken from `ops`, the
89
+ * operations of the group in that frame.
90
+ */
91
+ export function primedSymbols(classSymbols, system, convention, ops) {
92
+ const family = crystalFamily(system);
93
+ const directions = positionDirections(family, convention);
94
+ const what = `Symbol ${classSymbols.short}`;
95
+ const fullTokens = classSymbols.full.split(' ');
96
+ const full = fullTokens.map((t, i) => primedToken(t, directions[i], ops, what)).join(' ');
97
+ const tokens = shortTokens(classSymbols.short);
98
+ // A monoclinic short symbol has one position: the one of the unique axis in the full symbol.
99
+ const offset = family === 'monoclinic' && tokens.length === 1 ? fullTokens.findIndex((t) => t !== '1') : 0;
100
+ const short = tokens.map((t, i) => primedToken(t, directions[i + offset], ops, what)).join('');
101
+ return { short, full };
102
+ }
103
+ //# sourceMappingURL=magneticSymbols.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"magneticSymbols.js","sourceRoot":"","sources":["../../src/pointGroups/magneticSymbols.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAwB,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,YAAY,EAA0C,MAAM,eAAe,CAAC;AAEpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,mGAAmG;AACnG,SAAS,kBAAkB,CAAC,MAAqB,EAAE,UAA2B;IAC5E,MAAM,SAAS,GAAG,2BAA2B,CAAC,MAAM,CAAC,CAAC;IACtD,gFAAgF;IAChF,uDAAuD;IACvD,MAAM,OAAO,GACX,UAAU,KAAK,OAAO,IAAI,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5G,8FAA8F;IAC9F,MAAM,CAAC,GACL,MAAM,KAAK,YAAY,IAAI,MAAM,KAAK,WAAW;QAC/C,CAAC,CAAC;YACE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACT,CAAC,CAAC,EAAE,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AC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1F,MAAM,MAAM,GAAG,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC/C,6FAA6F;IAC7F,MAAM,MAAM,GAAG,MAAM,KAAK,YAAY,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3G,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/F,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
@@ -1,21 +1,49 @@
1
1
  /**
2
- * Public API for the crystallographic point groups: lookup, settings, operations, generators and
3
- * symbols, in the ITC convention (default) or the Birss convention.
2
+ * Public API for the point groups: the 32 crystallographic point groups (crystal classes) and the
3
+ * 90 magnetic point groups with time reversal (32 grey, 58 black-and-white). Lookup, settings,
4
+ * operations, generators and symbols, in the ITC convention (default) or the Birss convention.
4
5
  */
5
6
  import { type Operation } from '../operations.js';
6
7
  import type { CrystalSystem } from '../lattice.js';
7
8
  import { type PointGroupKey } from './data.js';
9
+ import { type MagneticPointGroupKey } from './magneticData.js';
8
10
  export { POINT_GROUP_KEYS, type PointGroupKey } from './data.js';
11
+ export { MAGNETIC_POINT_GROUP_KEYS, type MagneticPointGroupKey } from './magneticData.js';
9
12
  /** `'itc'`: International Tables for Crystallography (default). `'birss'`: Birss, Symmetry and Magnetism (1966). */
10
13
  export type Convention = 'itc' | 'birss';
11
- /** Type I: crystallographic point group without time reversal (the only type so far). */
12
- export type PointGroupType = 'I';
13
- export interface PointGroup {
14
- readonly key: PointGroupKey;
14
+ /**
15
+ * Type of a magnetic point group. `'I'`: a crystallographic point group, no operation with time
16
+ * reversal. `'II'`: a grey group, every operation of a crystal class with and without time
17
+ * reversal. `'III'`: a black-and-white group, half of the operations of a crystal class combined
18
+ * with time reversal. ITC Vol. D numbers these types differently (docs/conventions.md, "Types").
19
+ */
20
+ export type PointGroupType = 'I' | 'II' | 'III';
21
+ /**
22
+ * A point group with the properties that are fixed by its operations. None of them depends on the
23
+ * setting or the convention (docs/conventions.md, "Properties").
24
+ */
25
+ export interface PointGroup<K extends MagneticPointGroupKey = PointGroupKey> {
26
+ readonly key: K;
15
27
  readonly type: PointGroupType;
28
+ /**
29
+ * The crystal class of the group: the group itself for a class, otherwise the class it becomes
30
+ * when time reversal is dropped from every operation.
31
+ */
32
+ readonly crystalClass: PointGroupKey;
16
33
  readonly crystalSystem: CrystalSystem;
17
34
  /** Number of operations. */
18
35
  readonly order: number;
36
+ /** Contains the inversion, not combined with time reversal. */
37
+ readonly centrosymmetric: boolean;
38
+ /**
39
+ * Polar (pyroelectric class): some direction is left unchanged by every operation. Time reversal
40
+ * does not change a polar vector, so a magnetic group is polar if its crystal class is.
41
+ */
42
+ readonly polar: boolean;
43
+ /** Chiral (enantiomorphic class): proper rotations only, with or without time reversal. */
44
+ readonly chiral: boolean;
45
+ /** The Laue class: the centrosymmetric crystal class generated by the crystal class and the inversion. */
46
+ readonly laueClass: PointGroupKey;
19
47
  }
20
48
  export interface Setting {
21
49
  /** 1-based; the same physical frame in both conventions. */
@@ -24,7 +52,12 @@ export interface Setting {
24
52
  readonly symbol: string;
25
53
  /** Full symbol, symmetry directions separated by single spaces. */
26
54
  readonly fullSymbol: string;
27
- /** Monoclinic: the unique axis; orthorhombic mm2: the axis of the twofold rotation. */
55
+ /**
56
+ * Monoclinic: the unique axis. Orthorhombic `mm2`: the axis of the twofold rotation. In the
57
+ * magnetic API also: orthorhombic groups with three settings, the axis that is c in setting 1;
58
+ * `2'm'm`, with six settings, two for each axis, the normal of the mirror plane without time
59
+ * reversal (there the axis does not identify a setting).
60
+ */
28
61
  readonly uniqueAxis?: 'a' | 'b' | 'c';
29
62
  /** True for the default setting of the requested convention. */
30
63
  readonly isDefault: boolean;
@@ -45,40 +78,77 @@ export interface SymbolOptions extends SettingOptions {
45
78
  }
46
79
  /** True if `key` is the key of one of the 32 crystal classes. */
47
80
  export declare function isPointGroupKey(key: string): key is PointGroupKey;
48
- /** The point group with this key. Throws a RangeError for an unknown key. */
49
- export declare function pointGroup(key: PointGroupKey): PointGroup;
81
+ /** True if `key` is the key of one of the 122 magnetic point groups (the 32 crystal classes included). */
82
+ export declare function isMagneticPointGroupKey(key: string): key is MagneticPointGroupKey;
83
+ /**
84
+ * The point group with this key: a crystal class or a magnetic point group. Throws a RangeError
85
+ * for an unknown key.
86
+ */
87
+ export declare function pointGroup<K extends MagneticPointGroupKey>(key: K): PointGroup<K>;
50
88
  /** All 32 crystal classes, in the order of `POINT_GROUP_KEYS` (by crystal system, as in ITA). */
51
89
  export declare function pointGroups(): readonly PointGroup[];
90
+ /**
91
+ * All 122 magnetic point groups, in the order of `MAGNETIC_POINT_GROUP_KEYS`: the 32 crystal
92
+ * classes (type I), the 32 grey groups (type II) in the same order, and the 58 black-and-white
93
+ * groups (type III) in the order of ITC Vol. D Table 1.5.2.3.
94
+ */
95
+ export declare function magneticPointGroups(): readonly PointGroup<MagneticPointGroupKey>[];
96
+ /**
97
+ * The key of the crystal class of a point group: the group itself for a class, otherwise the class
98
+ * it becomes when time reversal is dropped from every operation. Internal (not exported from
99
+ * index.ts).
100
+ */
101
+ export declare function crystalClassOf(key: MagneticPointGroupKey): PointGroupKey;
52
102
  /** The settings of a point group, with symbols and the default of the given convention (default `'itc'`). */
53
- export declare function settings(key: PointGroupKey, conventionName?: Convention): readonly Setting[];
103
+ export declare function settings(key: MagneticPointGroupKey, conventionName?: Convention): readonly Setting[];
54
104
  /**
55
105
  * All operations of the point group in the requested setting (default: the convention's default
56
106
  * setting). ITC convention: in ITA's order, identity first, then as ITA numbers the general
57
- * position; Birss convention: in birss-app's order (docs/conventions.md, "Order of the
58
- * operations"). The matrices are Cartesian (docs/conventions.md, "Cartesian frame").
107
+ * position of the crystal class; an operation of a magnetic group has the number it has in the
108
+ * class, and a grey group lists the class first, then the same sequence with time reversal. Birss
109
+ * convention: in birss-app's order (docs/conventions.md, "Order of the operations"). The matrices
110
+ * are Cartesian (docs/conventions.md, "Cartesian frame").
59
111
  */
60
- export declare function operations(key: PointGroupKey, options?: SettingOptions): readonly Operation[];
112
+ export declare function operations(key: MagneticPointGroupKey, options?: SettingOptions): readonly Operation[];
61
113
  /**
62
114
  * Generators of the point group in the requested setting (docs/conventions.md, "Generators"). ITC
63
115
  * convention: ITA's selected generators in printed order, without the identity and ITA's lattice
64
116
  * translations, so the list is empty for `1`; for `mm2` settings 2 and 3, which ITA does not list,
65
- * those of setting 1 carried into their frame. Birss convention: birss-app's generators (for `1`
66
- * the identity, as in birss-app).
117
+ * those of setting 1 carried into their frame; for a magnetic group, those of its class with the
118
+ * time reversal they have in the group, for a grey group followed by 1'. Birss convention:
119
+ * birss-app's generators (for `1` the identity, as in birss-app).
67
120
  */
68
- export declare function generators(key: PointGroupKey, options?: SettingOptions): readonly Operation[];
121
+ export declare function generators(key: MagneticPointGroupKey, options?: SettingOptions): readonly Operation[];
69
122
  /** A symbol of the point group in the requested convention and setting. */
70
- export declare function symbol(key: PointGroupKey, options?: SymbolOptions): string;
123
+ export declare function symbol(key: MagneticPointGroupKey, options?: SymbolOptions): string;
71
124
  /** A point group in a given setting. */
72
- export interface PointGroupInSetting {
73
- readonly key: PointGroupKey;
125
+ export interface PointGroupInSetting<K extends MagneticPointGroupKey = PointGroupKey> {
126
+ readonly key: K;
74
127
  readonly setting: number;
75
128
  }
76
129
  /**
77
- * Finds a point group by a Hermann–Mauguin symbol in the given convention (default `'itc'`): the
78
- * key (giving the default setting), the short symbol of a setting, or a full symbol (spaces are
79
- * ignored). Returns undefined if nothing matches, also for a value that is not a string. Symbols
80
- * are written as in this library: `-` for the overbar, also in the Birss convention (`m-3m`, where
81
- * Birss prints `m3m`; docs/conventions.md, "Where ITC and Birss differ").
130
+ * Finds a crystal class by a Hermann–Mauguin symbol in the given convention (default `'itc'`): the
131
+ * short symbol of a setting, a full symbol, or the key (spaces are ignored). A symbol that names
132
+ * one setting gives that setting; the key, and a short symbol that several settings share (the
133
+ * monoclinic ones: `2` for unique axis b and c), give the default setting of the convention.
134
+ * Returns undefined if nothing matches, also for a value that is not a string and for the
135
+ * symbol of a magnetic group with time reversal (`findMagneticPointGroup`). Symbols are written as
136
+ * in this library: `-` for the overbar, also in the Birss convention (`m-3m`, where Birss prints
137
+ * `m3m`; docs/conventions.md, "Where ITC and Birss differ").
82
138
  */
83
139
  export declare function findPointGroup(hm: string, conventionName?: Convention): PointGroupInSetting | undefined;
140
+ /**
141
+ * Finds one of the 122 magnetic point groups (the 32 crystal classes included) by a symbol in the
142
+ * given convention (default `'itc'`): the short symbol of a setting, a full symbol, or the key
143
+ * (spaces are ignored). A prime `'` marks time reversal: `4'/mmm'`, `2221'`. A symbol that names
144
+ * one setting gives that setting; the key, and a short symbol that several settings share (the
145
+ * monoclinic ones: `2'` for unique axis b and c), give the default setting of the convention. In
146
+ * the Birss convention two keys are the Birss symbol of a setting that is not the default
147
+ * (`mm'm'` and `6'/mmm'`, setting 2; Birss prints `m'm'm` and `6'/mm'm` for these groups) and give
148
+ * that setting, like any symbol. Returns undefined if nothing matches, also for a value that is
149
+ * not a string. Symbols are written as in this library: `-` for the overbar, also in the Birss
150
+ * convention (`m'-3'm`, where Birss prints `m'3m`; docs/conventions.md, "Where ITC and Birss
151
+ * differ").
152
+ */
153
+ export declare function findMagneticPointGroup(hm: string, conventionName?: Convention): PointGroupInSetting<MagneticPointGroupKey> | undefined;
84
154
  //# sourceMappingURL=pointGroups.d.ts.map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