bravais 0.1.4 → 0.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0 - 2026-10-20
4
+
5
+ - The first structure shows sooner, and the page no longer freezes while it
6
+ waits: the viewer and the thumbnail renderer compile all their shaders at
7
+ once when they are created, so the driver compiles them in parallel. On an
8
+ M2 Max with nothing cached, the first frame comes after 0.4 s instead of
9
+ 0.7 s, and the longest freeze is 0.1 s instead of 0.65 s.
10
+ - Right after a viewer is created, while its shaders compile, `setLayers` and
11
+ `render` draw once the shaders are ready instead of before they return.
12
+ - The README example runs as written: it gives the viewer's container a height
13
+ and loads `examples/CoO.cif`, a COD structure the package now ships.
14
+
3
15
  ## 0.1.4 - 2026-10-19
4
16
 
5
17
  - 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
 
@@ -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