bravais 0.1.4 → 0.2.1

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1 - 2026-10-23
4
+
5
+ - `parseSymmetryOperator` is renamed `parseSymmetryOperation`, after the
6
+ `SymmetryOperation` it returns, and its errors say "symmetry operation".
7
+ - Dead code is removed and internal names are made consistent; nothing else
8
+ changes for users.
9
+
10
+ ## 0.2.0 - 2026-10-20
11
+
12
+ - The first structure shows sooner, and the page no longer freezes while it
13
+ waits: the viewer and the thumbnail renderer compile all their shaders at
14
+ once when they are created, so the driver compiles them in parallel. On an
15
+ M2 Max with nothing cached, the first frame comes after 0.4 s instead of
16
+ 0.7 s, and the longest freeze is 0.1 s instead of 0.65 s.
17
+ - Right after a viewer is created, while its shaders compile, `setLayers` and
18
+ `render` draw once the shaders are ready instead of before they return.
19
+ - The README example runs as written: it gives the viewer's container a height
20
+ and loads `examples/CoO.cif`, a COD structure the package now ships.
21
+
3
22
  ## 0.1.4 - 2026-10-19
4
23
 
5
24
  - Switching structures is faster: the viewer keeps its compiled shaders
package/README.md CHANGED
@@ -14,10 +14,19 @@ npm install bravais three
14
14
 
15
15
  ## Use
16
16
 
17
+ Add a container with a height:
18
+
19
+ ```html
20
+ <div id="viewer" style="height: 480px"></div>
21
+ ```
22
+
23
+ Then read a CIF and visualize it:
24
+
17
25
  ```js
18
26
  import { buildScene, createViewer, expandStructure, readCif } from "bravais";
19
27
 
20
- const scene = buildScene(expandStructure(await readCif(cifText)));
28
+ const response = await fetch("https://unpkg.com/bravais/examples/CoO.cif");
29
+ const scene = buildScene(expandStructure(await readCif(await response.text())));
21
30
  createViewer(document.getElementById("viewer")).setLayers([{ scene }]);
22
31
  ```
23
32
 
@@ -28,7 +37,8 @@ createViewer(document.getElementById("viewer")).setLayers([{ scene }]);
28
37
  - [VESTA](https://jp-minerals.org/vesta/en/)'s bond cutoffs and occupancy
29
38
  pies, with the cutoff table from
30
39
  [pymatgen](https://github.com/materialsproject/pymatgen).
31
- - Björn Ottosson's OKLab colour space, to keep element colours apart.
40
+ - Björn Ottosson's [OKLab](https://bottosson.github.io/posts/oklab/) colour
41
+ space, to keep element colours apart.
32
42
 
33
43
  Thanks to Feitong Song's
34
44
  [Pretty Lattice](https://github.com/songfeitong/pretty-lattice), whose look,
@@ -1,9 +1,9 @@
1
1
  # Third-party notices
2
2
 
3
3
  bravais is MIT licensed (see [LICENSE](LICENSE)). It ships material from the
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.
4
+ four MIT-licensed projects below, bundled into `dist/`, and one example
5
+ structure file. Each project is reproduced with its copyright notice, and the
6
+ MIT permission notice at the end applies to all four.
7
7
 
8
8
  ## three.js
9
9
 
@@ -38,6 +38,14 @@ version of VESTA's element colours.
38
38
 
39
39
  Copyright (c) 2026 Feitong Song
40
40
 
41
+ ## Example structure
42
+
43
+ `examples/CoO.cif`, the structure the README example loads, is entry 9008618
44
+ of the [Crystallography Open Database](https://www.crystallography.net/cod/),
45
+ shipped unchanged. Its header asks that the source of the data be credited:
46
+ R. W. G. Wyckoff, _Crystal Structures_, vol. 1, 2nd ed., Interscience
47
+ Publishers, New York, 1963.
48
+
41
49
  ## MIT permission notice
42
50
 
43
51
  Permission is hereby granted, free of charge, to any person obtaining a copy