bravais 0.1.2 → 0.1.4
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/CHANGELOG.md +30 -0
- package/README.md +11 -17
- package/THIRD_PARTY_NOTICES.md +11 -3
- package/dist/bravais.js +663 -976
- package/dist/bravais.js.map +1 -1
- package/dist/moyo-wasm.js +367 -0
- package/dist/moyo-wasm.js.map +1 -0
- package/dist/types/cif/symmetry-operators.d.ts +2 -2
- package/dist/types/index.d.ts +8 -7
- package/dist/types/render/gizmo.d.ts +4 -1
- package/dist/types/render/materials.d.ts +1 -2
- package/dist/types/render/model.d.ts +7 -2
- package/dist/types/render/palette.d.ts +5 -6
- package/dist/types/render/thumbnails.d.ts +4 -3
- package/dist/types/render/view-state.d.ts +3 -3
- package/dist/types/render/viewer.d.ts +10 -12
- package/dist/types/scene/build.d.ts +9 -6
- package/dist/types/structure/bonds.d.ts +2 -1
- package/dist/types/structure/expand.d.ts +3 -2
- package/dist/types/structure/fractional.d.ts +16 -0
- package/dist/types/structure/lattice.d.ts +3 -3
- package/dist/types/symmetry/dataset.d.ts +2 -4
- package/dist/types/symmetry/moyo-loader.d.ts +8 -0
- package/dist/types/symmetry/moyo-wasm.d.ts +3 -0
- package/dist/types/symmetry/moyo.d.ts +7 -8
- package/dist/types/symmetry/symbol.d.ts +5 -7
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.4 - 2026-10-19
|
|
4
|
+
|
|
5
|
+
- Switching structures is faster: the viewer keeps its compiled shaders
|
|
6
|
+
instead of compiling them again, builds the axes once instead of leaking a
|
|
7
|
+
new set on every switch, and resizes the canvas only when its size changes.
|
|
8
|
+
- The README, the package description and the doc comments are shorter and
|
|
9
|
+
plainer.
|
|
10
|
+
|
|
11
|
+
## 0.1.3 - 2026-10-19
|
|
12
|
+
|
|
13
|
+
- A layer at opacity 0 is no longer drawn but still frames the view, so a
|
|
14
|
+
viewer switching between two states of a structure keeps one centre and
|
|
15
|
+
scale.
|
|
16
|
+
- moyo is a separate file, `dist/moyo-wasm.js`, loaded the first time a
|
|
17
|
+
structure needs it, so `dist/bravais.js` shrinks from 1.1 MB to 87 kB. A
|
|
18
|
+
CIF with an operator loop never loads it.
|
|
19
|
+
- Large structures read, expand and bond in about linear time: a P1 cell of
|
|
20
|
+
27,000 atoms reads in 0.1 s instead of 5.6 s and expands in 0.03 s
|
|
21
|
+
instead of 12 s.
|
|
22
|
+
- Bonds are listed by `start`, then `end`.
|
|
23
|
+
- `latticeFromParameters` and `latticeFromVectors` are exported, to build a
|
|
24
|
+
structure from cell parameters or vectors.
|
|
25
|
+
- A thumbnail centres on its view's target when the target is not the
|
|
26
|
+
origin.
|
|
27
|
+
- If three.js drops or renames a shader include that bravais patches, drawing
|
|
28
|
+
fails with an error naming the include, instead of showing flat squares.
|
|
29
|
+
- `package.json` marks the package free of side effects and exports itself.
|
|
30
|
+
- The third-party notices credit three.js for the bundled TrackballControls
|
|
31
|
+
addon.
|
|
32
|
+
|
|
3
33
|
## 0.1.2 - 2026-10-16
|
|
4
34
|
|
|
5
35
|
- README revised.
|
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/bravais)
|
|
4
4
|
[](https://github.com/jcwang587/bravais/actions/workflows/ci.yml)
|
|
5
5
|
|
|
6
|
-
A minimal crystal structure viewer for the web.
|
|
6
|
+
A minimal crystal structure viewer for the web. Try the
|
|
7
|
+
[demo](https://jcwang.dev/bravais/).
|
|
7
8
|
|
|
8
9
|
## Install
|
|
9
10
|
|
|
@@ -22,26 +23,19 @@ createViewer(document.getElementById("viewer")).setLayers([{ scene }]);
|
|
|
22
23
|
|
|
23
24
|
## Built with
|
|
24
25
|
|
|
25
|
-
- [three.js](https://threejs.org/)
|
|
26
|
-
- [moyo](https://github.com/spglib/moyo)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- [pymatgen](https://github.com/materialsproject/pymatgen): the copy of
|
|
32
|
-
VESTA's cutoff table this package ships.
|
|
33
|
-
- OKLab: Björn Ottosson's public-domain colour formulas. They supply no
|
|
34
|
-
colours: they measure how alike two colours look, and move an element's
|
|
35
|
-
colour only when it would clash with one already on screen.
|
|
26
|
+
- [three.js](https://threejs.org/) for rendering.
|
|
27
|
+
- [moyo](https://github.com/spglib/moyo) for space-group symmetry.
|
|
28
|
+
- [VESTA](https://jp-minerals.org/vesta/en/)'s bond cutoffs and occupancy
|
|
29
|
+
pies, with the cutoff table from
|
|
30
|
+
[pymatgen](https://github.com/materialsproject/pymatgen).
|
|
31
|
+
- Björn Ottosson's OKLab colour space, to keep element colours apart.
|
|
36
32
|
|
|
37
33
|
Thanks to Feitong Song's
|
|
38
|
-
[Pretty Lattice](https://github.com/songfeitong/pretty-lattice),
|
|
39
|
-
|
|
40
|
-
axes gizmo, legend swatch, standard view and softened element colours.
|
|
34
|
+
[Pretty Lattice](https://github.com/songfeitong/pretty-lattice), whose look,
|
|
35
|
+
controls and softened element colours this viewer follows.
|
|
41
36
|
|
|
42
37
|
The code was written by Claude Code, under the author's direction and review.
|
|
43
38
|
|
|
44
39
|
## License
|
|
45
40
|
|
|
46
|
-
[MIT](LICENSE)
|
|
47
|
-
[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
41
|
+
[MIT](LICENSE)
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
3
|
bravais is MIT licensed (see [LICENSE](LICENSE)). It ships material from the
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
four MIT-licensed projects below, bundled into `dist/`. Each is reproduced
|
|
5
|
+
with its copyright notice, and the MIT permission notice at the end applies
|
|
6
|
+
to all four.
|
|
7
|
+
|
|
8
|
+
## three.js
|
|
9
|
+
|
|
10
|
+
The TrackballControls addon of [three.js](https://github.com/mrdoob/three.js)
|
|
11
|
+
is bundled, used under its MIT licence. three.js itself is a peer dependency
|
|
12
|
+
and is not bundled.
|
|
13
|
+
|
|
14
|
+
Copyright © 2010-2026 three.js authors
|
|
7
15
|
|
|
8
16
|
## moyo
|
|
9
17
|
|