@chemistry/crystalview 1.0.9 → 3.0.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 (88) hide show
  1. package/README.md +24 -20
  2. package/dist/{src/camera → camera}/Camera.d.ts +69 -63
  3. package/dist/camera/Camera.d.ts.map +1 -0
  4. package/dist/camera/Camera.js +225 -0
  5. package/dist/camera/Camera.js.map +1 -0
  6. package/dist/camera/ICamera.d.ts +9 -0
  7. package/dist/camera/ICamera.d.ts.map +1 -0
  8. package/dist/camera/ICamera.js +2 -0
  9. package/dist/camera/ICamera.js.map +1 -0
  10. package/dist/{src/crystal-view.d.ts → crystal-view.d.ts} +25 -24
  11. package/dist/crystal-view.d.ts.map +1 -0
  12. package/dist/crystal-view.js +169 -0
  13. package/dist/crystal-view.js.map +1 -0
  14. package/dist/crystalview.css +47 -0
  15. package/dist/index.d.ts +2 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +2 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/{src/molecule3d → molecule3d}/Atom.d.ts +14 -13
  20. package/dist/molecule3d/Atom.d.ts.map +1 -0
  21. package/dist/molecule3d/Atom.js +15 -0
  22. package/dist/molecule3d/Atom.js.map +1 -0
  23. package/dist/{src/molecule3d → molecule3d}/Bond.d.ts +8 -7
  24. package/dist/molecule3d/Bond.d.ts.map +1 -0
  25. package/dist/molecule3d/Bond.js +8 -0
  26. package/dist/molecule3d/Bond.js.map +1 -0
  27. package/dist/{src/molecule3d → molecule3d}/CellAtom.d.ts +96 -96
  28. package/dist/molecule3d/CellAtom.d.ts.map +1 -0
  29. package/dist/molecule3d/CellAtom.js +83 -0
  30. package/dist/molecule3d/CellAtom.js.map +1 -0
  31. package/dist/{src/molecule3d → molecule3d}/Link.d.ts +15 -14
  32. package/dist/molecule3d/Link.d.ts.map +1 -0
  33. package/dist/molecule3d/Link.js +9 -0
  34. package/dist/molecule3d/Link.js.map +1 -0
  35. package/dist/{src/molecule3d → molecule3d}/Marker.d.ts +9 -8
  36. package/dist/molecule3d/Marker.d.ts.map +1 -0
  37. package/dist/molecule3d/Marker.js +8 -0
  38. package/dist/molecule3d/Marker.js.map +1 -0
  39. package/dist/{src/molecule3d → molecule3d}/MarkerContact.d.ts +7 -6
  40. package/dist/molecule3d/MarkerContact.d.ts.map +1 -0
  41. package/dist/molecule3d/MarkerContact.js +7 -0
  42. package/dist/molecule3d/MarkerContact.js.map +1 -0
  43. package/dist/{src/molecule3d → molecule3d}/Molecule3D.d.ts +45 -44
  44. package/dist/molecule3d/Molecule3D.d.ts.map +1 -0
  45. package/dist/molecule3d/Molecule3D.js +126 -0
  46. package/dist/molecule3d/Molecule3D.js.map +1 -0
  47. package/dist/{src/molecule3d → molecule3d}/MoleculeBuilder.d.ts +20 -19
  48. package/dist/molecule3d/MoleculeBuilder.d.ts.map +1 -0
  49. package/dist/molecule3d/MoleculeBuilder.js +130 -0
  50. package/dist/molecule3d/MoleculeBuilder.js.map +1 -0
  51. package/dist/molecule3d/MoleculeConnector.d.ts +10 -0
  52. package/dist/molecule3d/MoleculeConnector.d.ts.map +1 -0
  53. package/dist/molecule3d/MoleculeConnector.js +106 -0
  54. package/dist/molecule3d/MoleculeConnector.js.map +1 -0
  55. package/dist/{src/molecule3d → molecule3d}/UnitCell.d.ts +36 -35
  56. package/dist/molecule3d/UnitCell.d.ts.map +1 -0
  57. package/dist/molecule3d/UnitCell.js +227 -0
  58. package/dist/molecule3d/UnitCell.js.map +1 -0
  59. package/dist/molecule3d/io/IMoleculeReader.d.ts +8 -0
  60. package/dist/molecule3d/io/IMoleculeReader.d.ts.map +1 -0
  61. package/dist/molecule3d/io/IMoleculeReader.js +2 -0
  62. package/dist/molecule3d/io/IMoleculeReader.js.map +1 -0
  63. package/dist/{src/molecule3d → molecule3d}/io/MoleculeReaderJCIF.d.ts +12 -11
  64. package/dist/molecule3d/io/MoleculeReaderJCIF.d.ts.map +1 -0
  65. package/dist/molecule3d/io/MoleculeReaderJCIF.js +112 -0
  66. package/dist/molecule3d/io/MoleculeReaderJCIF.js.map +1 -0
  67. package/dist/{src/painter → painter}/CanvasContext.d.ts +15 -14
  68. package/dist/painter/CanvasContext.d.ts.map +1 -0
  69. package/dist/painter/CanvasContext.js +67 -0
  70. package/dist/painter/CanvasContext.js.map +1 -0
  71. package/dist/painter/Painter.d.ts +36 -0
  72. package/dist/painter/Painter.d.ts.map +1 -0
  73. package/dist/painter/Painter.js +235 -0
  74. package/dist/painter/Painter.js.map +1 -0
  75. package/dist/ui/ContextMenu.d.ts +24 -0
  76. package/dist/ui/ContextMenu.d.ts.map +1 -0
  77. package/dist/ui/ContextMenu.js +140 -0
  78. package/dist/ui/ContextMenu.js.map +1 -0
  79. package/dist/{src/ui → ui}/ContextMenuItem.d.ts +18 -17
  80. package/dist/ui/ContextMenuItem.d.ts.map +1 -0
  81. package/dist/ui/ContextMenuItem.js +66 -0
  82. package/dist/ui/ContextMenuItem.js.map +1 -0
  83. package/package.json +68 -87
  84. package/dist/crystal-view.min.js +0 -24
  85. package/dist/src/molecule3d/MoleculeConnector.d.ts +0 -9
  86. package/dist/src/painter/Painter.d.ts +0 -35
  87. package/dist/src/ui/ContextMenu.d.ts +0 -24
  88. package/package-lock.json +0 -9410
@@ -0,0 +1,169 @@
1
+ import { Camera } from './camera/Camera.js';
2
+ import { Molecule3D } from './molecule3d/Molecule3D.js';
3
+ import { Painter } from './painter/Painter.js';
4
+ import { ContextMenu } from './ui/ContextMenu.js';
5
+ import { ContextMenuItem } from './ui/ContextMenuItem.js';
6
+ export class Mol3DView {
7
+ constructor(options) {
8
+ this.options = {
9
+ bgcolor: options.bgcolor ?? '#2b303b',
10
+ showLabels: false,
11
+ showMarkers: true,
12
+ showUnitCell: false,
13
+ };
14
+ this.initDone = false;
15
+ this.subscriptions = [];
16
+ this.molecule = new Molecule3D();
17
+ }
18
+ append(element) {
19
+ if (this.viewElement || this.initDone) {
20
+ throw new Error('append or init were alredy done');
21
+ }
22
+ const viewEl = document.createElement('div');
23
+ viewEl.className = 'jcmolview';
24
+ const canvas = document.createElement('canvas');
25
+ viewEl.appendChild(canvas);
26
+ viewEl.style.backgroundColor = this.options.bgcolor;
27
+ viewEl.style.display = 'block';
28
+ viewEl.style.height = '100%';
29
+ viewEl.style.position = 'absolute';
30
+ viewEl.style.width = '100%';
31
+ canvas.style.display = 'block';
32
+ element.appendChild(viewEl);
33
+ this.viewElement = viewEl;
34
+ this.canvasElement = canvas;
35
+ this.context = this.canvasElement.getContext('2d');
36
+ this.painer = new Painter(this.context, this.options);
37
+ this.camera = new Camera({
38
+ element: this.canvasElement,
39
+ onClick: (x, y) => {
40
+ if (!this.options.showMarkers) {
41
+ return;
42
+ }
43
+ const marker = this.painer.uprojectToMarker({
44
+ camera: this.camera,
45
+ molecule: this.molecule,
46
+ x,
47
+ y,
48
+ });
49
+ if (marker) {
50
+ this.molecule.extendByMarker(marker);
51
+ this.redraw();
52
+ }
53
+ },
54
+ onRedraw: () => {
55
+ this.redraw();
56
+ },
57
+ });
58
+ this.contextMenu = new ContextMenu([
59
+ new ContextMenuItem({
60
+ command: () => {
61
+ this.center();
62
+ },
63
+ title: 'Center Molecule',
64
+ type: 'item',
65
+ }),
66
+ new ContextMenuItem({
67
+ title: '----',
68
+ type: 'delimer',
69
+ }),
70
+ new ContextMenuItem({
71
+ command: () => {
72
+ this.options.showMarkers = !this.options.showMarkers;
73
+ this.redraw();
74
+ },
75
+ isChecked: () => {
76
+ return this.options.showMarkers;
77
+ },
78
+ title: 'Show Markers',
79
+ type: 'checkbox',
80
+ }),
81
+ new ContextMenuItem({
82
+ command: () => {
83
+ this.options.showUnitCell = !this.options.showUnitCell;
84
+ this.redraw();
85
+ },
86
+ isChecked: () => {
87
+ return this.options.showUnitCell;
88
+ },
89
+ title: 'Show Unit Cell',
90
+ type: 'checkbox',
91
+ }),
92
+ new ContextMenuItem({
93
+ command: () => {
94
+ this.options.showLabels = !this.options.showLabels;
95
+ this.redraw();
96
+ },
97
+ isChecked: () => {
98
+ return this.options.showLabels;
99
+ },
100
+ title: 'Show Labels',
101
+ type: 'checkbox',
102
+ }),
103
+ ]);
104
+ }
105
+ load(jcif) {
106
+ this.molecule.clear();
107
+ this.molecule.load(jcif);
108
+ this.center();
109
+ }
110
+ center() {
111
+ // Center the molecule
112
+ if (this.molecule?.atoms?.length > 2) {
113
+ const center = this.molecule.getCenter();
114
+ const scale = Math.min(this.viewElement.clientWidth - 10, this.viewElement.clientHeight - 10) /
115
+ this.molecule.getRadius();
116
+ this.camera.setCameraView(scale / 2, center);
117
+ this.redraw();
118
+ }
119
+ this.redraw();
120
+ }
121
+ onInit() {
122
+ if (!this.viewElement) {
123
+ throw new Error('append has to be called first');
124
+ }
125
+ if (this.initDone) {
126
+ throw new Error('Init has to be called once');
127
+ }
128
+ this.camera.onInit();
129
+ const event = () => {
130
+ this.resizeCanvas();
131
+ };
132
+ window.addEventListener('resize', event);
133
+ // save subscription
134
+ this.subscriptions.push(() => {
135
+ window.removeEventListener('resize', event);
136
+ });
137
+ setTimeout(() => {
138
+ this.resizeCanvas();
139
+ }, 0);
140
+ this.contextMenu.onInit(this.viewElement);
141
+ this.initDone = true;
142
+ }
143
+ onDestroy() {
144
+ this.camera.onDestroy();
145
+ this.subscriptions.forEach((fn) => {
146
+ fn();
147
+ });
148
+ }
149
+ redraw() {
150
+ if (!this.height || !this.width) {
151
+ return;
152
+ }
153
+ this.painer.draw(this.molecule, this.camera);
154
+ }
155
+ resizeCanvas() {
156
+ const width = this.viewElement.clientWidth;
157
+ const height = this.viewElement.clientHeight;
158
+ // Same width alredy seted
159
+ if (width === this.width && height === this.height) {
160
+ return;
161
+ }
162
+ this.width = width;
163
+ this.height = height;
164
+ this.canvasElement.width = this.width;
165
+ this.canvasElement.height = this.height;
166
+ this.redraw();
167
+ }
168
+ }
169
+ //# sourceMappingURL=crystal-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crystal-view.js","sourceRoot":"","sources":["../src/cryst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AI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,47 @@
1
+ .jcmolview-dropdown-menu {
2
+ top: 100%;
3
+ left: 0;
4
+ z-index: 1000;
5
+ display: none;
6
+ float: left;
7
+ min-width: 10rem;
8
+ padding: 0.5rem 0;
9
+ margin: 0.125rem 0 0;
10
+ font-size: 1rem;
11
+ color: #292b2c;
12
+ text-align: left;
13
+ list-style: none;
14
+ background-color: #fff;
15
+ background-clip: padding-box;
16
+ border: 1px solid rgba(0, 0, 0, 0.15);
17
+ border-radius: 0.25rem;
18
+ }
19
+
20
+ .jcmolview-dropdown-item {
21
+ box-sizing: border-box;
22
+ display: block;
23
+ text-decoration: none;
24
+ width: 100%;
25
+ padding: 3px 1.5rem 3px 1rem;
26
+ clear: both;
27
+ font-weight: 400;
28
+ color: #292b2c;
29
+ text-align: inherit;
30
+ white-space: nowrap;
31
+ background: 0 0;
32
+ border: 0;
33
+ }
34
+
35
+ .jcmolview-dropdown-item:hover,
36
+ .jcmolview-dropdown-item:focus {
37
+ color: #1d1e1f;
38
+ text-decoration: none;
39
+ background-color: #f7f7f9;
40
+ }
41
+
42
+ .jcmolview-dropdown-divider {
43
+ height: 1px;
44
+ margin: 0.5rem 0;
45
+ overflow: hidden;
46
+ background-color: #eceeef;
47
+ }
@@ -0,0 +1,2 @@
1
+ export { Mol3DView } from './crystal-view.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { Mol3DView } from './crystal-view.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,13 +1,14 @@
1
- import { Matrix3x4, Vec3 } from "@chemistry/math";
2
- import { CellAtom } from "./CellAtom";
3
- export declare class Atom {
4
- fractional: Vec3;
5
- position: Vec3;
6
- parent: CellAtom;
7
- symetry: Matrix3x4;
8
- constructor(parent: CellAtom, symetry: Matrix3x4);
9
- /**
10
- * Return color of the element
11
- */
12
- getColor(): string;
13
- }
1
+ import { Matrix3x4, Vec3 } from '@chemistry/math';
2
+ import { CellAtom } from './CellAtom.js';
3
+ export declare class Atom {
4
+ fractional: Vec3;
5
+ position: Vec3;
6
+ parent: CellAtom;
7
+ symetry: Matrix3x4;
8
+ constructor(parent: CellAtom, symetry: Matrix3x4);
9
+ /**
10
+ * Return color of the element
11
+ */
12
+ getColor(): string;
13
+ }
14
+ //# sourceMappingURL=Atom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Atom.d.ts","sourceRoot":"","sources":["../../src/molecule3d/Atom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,IAAI;IACR,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,QAAQ,CAAC;IACjB,OAAO,EAAE,SAAS,CAAC;gBAEd,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS;IAOhD;;OAEG;IACI,QAAQ;CAGhB"}
@@ -0,0 +1,15 @@
1
+ export class Atom {
2
+ constructor(parent, symetry) {
3
+ this.parent = parent;
4
+ this.fractional = symetry.project(parent.fractional);
5
+ this.symetry = symetry;
6
+ this.position = parent.unitCell.fractToOrth(this.fractional);
7
+ }
8
+ /**
9
+ * Return color of the element
10
+ */
11
+ getColor() {
12
+ return this.parent.element.color;
13
+ }
14
+ }
15
+ //# sourceMappingURL=Atom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Atom.js","sourceRoot":"","sources":["../../src/molecule3d/Atom.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,IAAI;IAMf,YAAY,MAAgB,EAAE,OAAkB;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;IACnC,CAAC;CACF"}
@@ -1,7 +1,8 @@
1
- import { Atom } from "./Atom";
2
- export declare class Bond {
3
- atom1: Atom;
4
- atom2: Atom;
5
- order: number;
6
- constructor(atom1: Atom, atom2: Atom, order?: number);
7
- }
1
+ import { Atom } from './Atom.js';
2
+ export declare class Bond {
3
+ atom1: Atom;
4
+ atom2: Atom;
5
+ order: number;
6
+ constructor(atom1: Atom, atom2: Atom, order?: number);
7
+ }
8
+ //# sourceMappingURL=Bond.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bond.d.ts","sourceRoot":"","sources":["../../src/molecule3d/Bond.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,qBAAa,IAAI;IACR,KAAK,EAAE,IAAI,CAAC;IACZ,KAAK,EAAE,IAAI,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;gBAET,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM;CAKrD"}
@@ -0,0 +1,8 @@
1
+ export class Bond {
2
+ constructor(atom1, atom2, order) {
3
+ this.atom1 = atom1;
4
+ this.atom2 = atom2;
5
+ this.order = order ?? 1;
6
+ }
7
+ }
8
+ //# sourceMappingURL=Bond.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bond.js","sourceRoot":"","sources":["../../src/molecule3d/Bond.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,IAAI;IAKf,YAAY,KAAW,EAAE,KAAW,EAAE,KAAc;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF"}
@@ -1,96 +1,96 @@
1
- import { Element } from "@chemistry/elements";
2
- import { Matrix3x4, Vec3 } from "@chemistry/math";
3
- import { Atom } from "./Atom";
4
- import { Link } from "./Link";
5
- import { UnitCell } from "./UnitCell";
6
- export declare class CellAtom {
7
- /**
8
- * Atom ID within molecule
9
- */
10
- id: number;
11
- /**
12
- * label
13
- * @type {string}
14
- */
15
- label: string;
16
- /**
17
- * Element
18
- * @type {Element}
19
- */
20
- element: Element;
21
- /**
22
- * Cartezian position of Atom
23
- */
24
- position: Vec3;
25
- /**
26
- * Unit Cell
27
- */
28
- unitCell: UnitCell;
29
- /**
30
- * Fractional position of Atom
31
- */
32
- fractional: Vec3;
33
- /**
34
- * Occupancy
35
- */
36
- occupancy: number;
37
- /**
38
- * Isotropic U
39
- */
40
- uiso: number;
41
- /**
42
- * Disorder Assembly
43
- */
44
- assembly: string;
45
- /**
46
- * Disorder Group
47
- */
48
- group: string;
49
- /**
50
- * List of Atoms Created From this Cell Atom
51
- */
52
- children: Atom[];
53
- /**
54
- * List of connected atoms
55
- */
56
- links: Link[];
57
- constructor(data: {
58
- id: number;
59
- unitCell: UnitCell;
60
- type: string;
61
- label: string;
62
- x: number;
63
- y: number;
64
- z: number;
65
- occupancy: number;
66
- uiso: number;
67
- assembly: string;
68
- group: string;
69
- });
70
- /**
71
- * Add link to another element
72
- */
73
- addLink(otherAtom: CellAtom, symetry: Matrix3x4): void;
74
- getLinks(): Link[];
75
- /**
76
- * Returns true if Cell Atom has Chield with Specific position
77
- */
78
- hasChild(position: Vec3): boolean;
79
- /**
80
- * Return Chield Atom with Specifified Position or null if not found
81
- */
82
- getChild(position: Vec3): Atom;
83
- /**
84
- * Return true if has Atom with Specified symetry position
85
- */
86
- hasChieldWithSymetry(symetry: Matrix3x4): boolean;
87
- /**
88
- * Return Chield Atom with Specifified symetry or similar atom liing on the same spot
89
- */
90
- getChieldWithSymetry(symetry: Matrix3x4): Atom;
91
- /**
92
- * Create Atom & return it based on this Cell Atom
93
- * and set correct settings
94
- */
95
- createAtom(symetry: Matrix3x4, addToChields: boolean): Atom;
96
- }
1
+ import { ChemElementInfo } from '@chemistry/elements';
2
+ import { Matrix3x4, Vec3 } from '@chemistry/math';
3
+ import { Atom } from './Atom.js';
4
+ import { Link } from './Link.js';
5
+ import { UnitCell } from './UnitCell.js';
6
+ export declare class CellAtom {
7
+ /**
8
+ * Atom ID within molecule
9
+ */
10
+ id: number;
11
+ /**
12
+ * label
13
+ * @type {string}
14
+ */
15
+ label: string;
16
+ /**
17
+ * Element
18
+ */
19
+ element: ChemElementInfo;
20
+ /**
21
+ * Cartezian position of Atom
22
+ */
23
+ position: Vec3;
24
+ /**
25
+ * Unit Cell
26
+ */
27
+ unitCell: UnitCell;
28
+ /**
29
+ * Fractional position of Atom
30
+ */
31
+ fractional: Vec3;
32
+ /**
33
+ * Occupancy
34
+ */
35
+ occupancy: number;
36
+ /**
37
+ * Isotropic U
38
+ */
39
+ uiso: number;
40
+ /**
41
+ * Disorder Assembly
42
+ */
43
+ assembly: string;
44
+ /**
45
+ * Disorder Group
46
+ */
47
+ group: string;
48
+ /**
49
+ * List of Atoms Created From this Cell Atom
50
+ */
51
+ children: Atom[];
52
+ /**
53
+ * List of connected atoms
54
+ */
55
+ links: Link[];
56
+ constructor(data: {
57
+ id: number;
58
+ unitCell: UnitCell;
59
+ type: string;
60
+ label: string;
61
+ x: number;
62
+ y: number;
63
+ z: number;
64
+ occupancy: number;
65
+ uiso: number;
66
+ assembly: string;
67
+ group: string;
68
+ });
69
+ /**
70
+ * Add link to another element
71
+ */
72
+ addLink(otherAtom: CellAtom, symetry: Matrix3x4): void;
73
+ getLinks(): Link[];
74
+ /**
75
+ * Returns true if Cell Atom has Chield with Specific position
76
+ */
77
+ hasChild(position: Vec3): boolean;
78
+ /**
79
+ * Return Chield Atom with Specifified Position or null if not found
80
+ */
81
+ getChild(position: Vec3): Atom | null;
82
+ /**
83
+ * Return true if has Atom with Specified symetry position
84
+ */
85
+ hasChieldWithSymetry(symetry: Matrix3x4): boolean;
86
+ /**
87
+ * Return Chield Atom with Specifified symetry or similar atom liing on the same spot
88
+ */
89
+ getChieldWithSymetry(symetry: Matrix3x4): Atom | null;
90
+ /**
91
+ * Create Atom & return it based on this Cell Atom
92
+ * and set correct settings
93
+ */
94
+ createAtom(symetry: Matrix3x4, addToChields: boolean): Atom;
95
+ }
96
+ //# sourceMappingURL=CellAtom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CellAtom.d.ts","sourceRoot":"","sources":["../../src/molecule3d/CellAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,QAAQ;IACnB;;OAEG;IACI,EAAE,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACI,KAAK,EAAE,MAAM,CAAC;IAErB;;OAEG;IACI,OAAO,EAAE,eAAe,CAAC;IAEhC;;OAEG;IACI,QAAQ,EAAE,IAAI,CAAC;IAEtB;;OAEG;IACI,QAAQ,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4
+ import { Link } from './Link.js';
5
+ export class CellAtom {
6
+ constructor(data) {
7
+ const element = ChemElements.getBySymbol(data.type);
8
+ if (!element) {
9
+ throw new Error('Wrong Element Name or ID: ' + element);
10
+ }
11
+ this.element = element;
12
+ this.id = data.id;
13
+ this.unitCell = data.unitCell;
14
+ this.label = data.label || element.symbol || '';
15
+ this.fractional = new Vec3(data.x, data.y, data.z);
16
+ this.occupancy = data.occupancy;
17
+ this.uiso = data.uiso;
18
+ this.assembly = data.assembly || '';
19
+ this.group = data.group || '';
20
+ this.position = this.unitCell.fractToOrth(this.fractional);
21
+ this.children = [];
22
+ this.links = [];
23
+ }
24
+ /**
25
+ * Add link to another element
26
+ */
27
+ addLink(otherAtom, symetry) {
28
+ const link = new Link(otherAtom, symetry);
29
+ this.links.push(link);
30
+ }
31
+ getLinks() {
32
+ return this.links;
33
+ }
34
+ /**
35
+ * Returns true if Cell Atom has Chield with Specific position
36
+ */
37
+ hasChild(position) {
38
+ for (const ch of this.children) {
39
+ if (ch.fractional.equals(position)) {
40
+ return true;
41
+ }
42
+ }
43
+ return false;
44
+ }
45
+ /**
46
+ * Return Chield Atom with Specifified Position or null if not found
47
+ */
48
+ getChild(position) {
49
+ for (const ch of this.children) {
50
+ if (ch.fractional.equals(position)) {
51
+ return ch;
52
+ }
53
+ }
54
+ return null;
55
+ }
56
+ /**
57
+ * Return true if has Atom with Specified symetry position
58
+ */
59
+ hasChieldWithSymetry(symetry) {
60
+ // Predict inserted atom position
61
+ const predictedPostion = symetry.project(this.fractional);
62
+ return this.hasChild(predictedPostion);
63
+ }
64
+ /**
65
+ * Return Chield Atom with Specifified symetry or similar atom liing on the same spot
66
+ */
67
+ getChieldWithSymetry(symetry) {
68
+ const predictedPostion = symetry.project(this.fractional);
69
+ return this.getChild(predictedPostion);
70
+ }
71
+ /**
72
+ * Create Atom & return it based on this Cell Atom
73
+ * and set correct settings
74
+ */
75
+ createAtom(symetry, addToChields) {
76
+ const atom = new Atom(this, symetry);
77
+ if (addToChields) {
78
+ this.children.push(atom);
79
+ }
80
+ return atom;
81
+ }
82
+ }
83
+ //# sourceMappingURL=CellAtom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CellAtom.js","sourceRoot":"","sources":["../../src/molecule3d/CellAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAa,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,OAAO,QAAQ;IA8DnB,YAAY,IAYX;QACC,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,OAAO,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;QAEhD,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QACnD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAA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AAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IAEI,UAAU,CAAC,OAAkB,EAAE,YAAqB;QACzD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrC,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -1,14 +1,15 @@
1
- import { Vec3 } from "@chemistry/math";
2
- import { Matrix3x4 } from "@chemistry/math";
3
- import { CellAtom } from "./CellAtom";
4
- export declare class Link {
5
- atom: CellAtom;
6
- symetry: Matrix3x4;
7
- order: number;
8
- /**
9
- * Calc position of atom
10
- * @type {Vec3}
11
- */
12
- fractional: Vec3;
13
- constructor(atom: CellAtom, symetry: Matrix3x4, order?: number);
14
- }
1
+ import { Vec3 } from '@chemistry/math';
2
+ import { Matrix3x4 } from '@chemistry/math';
3
+ import { CellAtom } from './CellAtom.js';
4
+ export declare class Link {
5
+ atom: CellAtom;
6
+ symetry: Matrix3x4;
7
+ order: number;
8
+ /**
9
+ * Calc position of atom
10
+ * @type {Vec3}
11
+ */
12
+ fractional: Vec3;
13
+ constructor(atom: CellAtom, symetry: Matrix3x4, order?: number);
14
+ }
15
+ //# sourceMappingURL=Link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/molecule3d/Link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,IAAI;IACR,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACI,UAAU,EAAE,IAAI,CAAC;gBAEZ,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM;CAM/D"}