@molcrafts/molrs 0.0.7 → 0.0.12
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 +40 -13
- package/molrs.d.ts +729 -285
- package/molrs.js +2 -2
- package/molrs_bg.js +1179 -408
- package/molrs_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,19 +29,19 @@ console.log(writeFrame(mol3d, "xyz"));
|
|
|
29
29
|
### Data model
|
|
30
30
|
|
|
31
31
|
- **`Frame`** — container mapping string keys (`"atoms"`, `"bonds"`) to `Block`s
|
|
32
|
-
- **`Block`** — column store with typed arrays
|
|
32
|
+
- **`Block`** — column store with typed arrays. Float columns are `Float64Array` (F = f64).
|
|
33
33
|
- **`Box`** — simulation box with periodic boundary conditions
|
|
34
34
|
|
|
35
35
|
### I/O
|
|
36
36
|
|
|
37
37
|
- `parseSMILES(smiles)` → `SmilesIR` → `.toFrame()`
|
|
38
38
|
- `XYZReader`, `PDBReader`, `LAMMPSReader` — file format parsers
|
|
39
|
-
- `writeFrame(frame, "xyz" | "pdb")` — serialize to string
|
|
40
|
-
- `
|
|
39
|
+
- `writeFrame(frame, "xyz" | "pdb" | "lammps-data" | "lammps-dump")` — serialize to string
|
|
40
|
+
- `MolRecReader` — MolRec Zarr V3 reader
|
|
41
41
|
|
|
42
42
|
### 3D generation
|
|
43
43
|
|
|
44
|
-
- `generate3D(frame, speed?)` — MMFF94 coordinate generation (`"fast"` | `"
|
|
44
|
+
- `generate3D(frame, speed?, seed?)` — MMFF94 coordinate generation (`"fast"` | `"medium"` | `"better"`)
|
|
45
45
|
|
|
46
46
|
### Analysis
|
|
47
47
|
|
|
@@ -69,21 +69,48 @@ Frames without a simulation box are supported — a non-periodic bounding box is
|
|
|
69
69
|
| Block | Column | Type | Description |
|
|
70
70
|
|-------|--------|------|-------------|
|
|
71
71
|
| `atoms` | `symbol` | `string` | Element symbol |
|
|
72
|
-
| `atoms` | `x`, `y`, `z` | `
|
|
73
|
-
| `atoms` | `mass` | `
|
|
74
|
-
| `atoms` | `charge` | `
|
|
72
|
+
| `atoms` | `x`, `y`, `z` | `F` | Cartesian coordinates |
|
|
73
|
+
| `atoms` | `mass` | `F` | Atomic mass |
|
|
74
|
+
| `atoms` | `charge` | `F` | Partial charge |
|
|
75
75
|
| `bonds` | `i`, `j` | `u32` | Atom indices |
|
|
76
|
-
| `bonds` | `order` | `
|
|
76
|
+
| `bonds` | `order` | `F` | Bond order (1.0, 1.5, 2.0, 3.0) |
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
`F` is the workspace float type from `molrs-core` — always `f64`.
|
|
79
|
+
|
|
80
|
+
## Build from source
|
|
79
81
|
|
|
80
82
|
```bash
|
|
81
|
-
wasm-pack build --target bundler --scope molcrafts
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
npm
|
|
83
|
+
wasm-pack build --release --target bundler --scope molcrafts
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This writes `pkg/` — the npm package. `pkg/package.json` is auto-generated by
|
|
87
|
+
wasm-pack with name `@molcrafts/molrs`. Consumers link it directly:
|
|
88
|
+
|
|
89
|
+
```jsonc
|
|
90
|
+
// consumer's package.json
|
|
91
|
+
"dependencies": {
|
|
92
|
+
"@molcrafts/molrs": "link:../path/to/molrs-wasm/pkg"
|
|
93
|
+
}
|
|
85
94
|
```
|
|
86
95
|
|
|
96
|
+
Then `npm install` creates a symlink — rebuilding `pkg/` (via `wasm-pack build`)
|
|
97
|
+
is picked up immediately by the consumer's dev server. No `npm link` dance
|
|
98
|
+
needed.
|
|
99
|
+
|
|
100
|
+
### Variants (optional)
|
|
101
|
+
|
|
102
|
+
Default build compiles all subsystems (`smiles`, `io`, `compute`, `embed`). To
|
|
103
|
+
build a smaller wasm containing only a subset, use Cargo features:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
wasm-pack build --release --target bundler --scope molcrafts \
|
|
107
|
+
--no-default-features --features io,smiles
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Note: **variants are mutually exclusive at runtime** — you can't mix a
|
|
111
|
+
`compute`-only build with an `io`-only build in the same app, because each
|
|
112
|
+
produces a separate wasm module with its own `Frame` class identity.
|
|
113
|
+
|
|
87
114
|
## License
|
|
88
115
|
|
|
89
116
|
BSD-3-Clause
|