@wonderyard/vivarium 1.4.0 → 1.5.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/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # Vivarium
1
+ <p align="center">
2
+ <img width="128" height="128" src="docs/src/assets/glider.png" />
3
+ </p>
4
+
5
+ <h1 align="center">Vivarium</h1>
2
6
 
3
7
  <p align="center">
4
8
  <img src="docs/banner.png" />
@@ -81,7 +85,7 @@ const { evolve } = setup({ canvas, automaton: life });
81
85
  const loop = async () => {
82
86
  await evolve();
83
87
  requestAnimationFrame(loop);
84
- }
88
+ };
85
89
  requestAnimationFrame(loop);
86
90
  ```
87
91
 
@@ -92,4 +96,5 @@ requestAnimationFrame(loop);
92
96
  Vivarium runs its simulation entirely on the GPU thanks to the WebGPU API and its compute shaders. WebGPU is a relatively new technology. It is available since Chrome 113, Safari 26. See implementation status in other browsers [here](https://github.com/gpuweb/gpuweb/wiki/Implementation-Status). Vivarium has been tested on Chrome 139 for macOS and Safari 26.0 for macOS, showing better performances on Chrome overall.
93
97
 
94
98
  ## Contributing
99
+
95
100
  Although I've been researching and experimenting with cellular automata for years, this is my first WebGPU-based project, so it might be rough around the edges. With WebGPU I've been able to achieve something it wouldn't be possible in a browser otherwise: to build something simple, customizable, and accessible for the end user, without compromising on performance. The intent is to offer this library as a learning tool and something other people can build on top of. If you share the vision and you would like to improve this software, PRs are welcome.
@@ -19,9 +19,7 @@ class o {
19
19
  }
20
20
  assertNotEmpty() {
21
21
  if (!this.automaton.elements.length)
22
- throw new Error(
23
- "No elements found in automaton, at least one element is required"
24
- );
22
+ throw new Error("No elements found in automaton, at least one element is required");
25
23
  }
26
24
  }
27
25
  export {
@@ -1,7 +1,7 @@
1
1
  import { BaseBlueprint as n } from "./base-blueprint.js";
2
- import { R as p } from "../rule-blueprint-DGODv9IV.js";
2
+ import { R as p } from "../rule-blueprint-CIEvYOmb.js";
3
3
  import { toRefIdOrPoint as d } from "./utils.js";
4
- import { A as u } from "../constants-D4GX9YB2.js";
4
+ import { A as u } from "../constants-BMg7uvpO.js";
5
5
  class o extends n {
6
6
  constructor(e, t) {
7
7
  super(), this.automaton = e, this.id = t.id, this.name = t.name, this.type = t.type;
@@ -1,7 +1,7 @@
1
- import { R as o, a as l } from "../rule-blueprint-DGODv9IV.js";
1
+ import { R as o, a as l } from "../rule-blueprint-CIEvYOmb.js";
2
2
  import "./base-blueprint.js";
3
3
  import "./utils.js";
4
- import "../constants-D4GX9YB2.js";
4
+ import "../constants-BMg7uvpO.js";
5
5
  export {
6
6
  o as RuleBlueprint,
7
7
  l as RuleBlueprintWithAccept
@@ -1,4 +1,4 @@
1
- import { n as t } from "../constants-D4GX9YB2.js";
1
+ import { n as t } from "../constants-BMg7uvpO.js";
2
2
  const s = (o) => typeof o == "string" ? t[o] : o.id;
3
3
  export {
4
4
  s as toRefIdOrPoint
@@ -1,8 +1,8 @@
1
- import { n as o } from "../rule-blueprint-DGODv9IV.js";
1
+ import { n as o } from "../rule-blueprint-CIEvYOmb.js";
2
2
  import { BaseBlueprint as a } from "./base-blueprint.js";
3
3
  import { Helpers as h } from "./helpers.js";
4
4
  import { ElementBlueprint as m, KindBlueprint as u } from "./ref-blueprint.js";
5
- import { C as d, S as p } from "../constants-D4GX9YB2.js";
5
+ import { C as d, S as p } from "../constants-BMg7uvpO.js";
6
6
  class b extends a {
7
7
  constructor(t) {
8
8
  super(), this.neighborhoodName = t, this.helpers = new h(this.neighborhoodName), this.neighbor = this.neighborhoodName === "cross" ? d : p, this.automaton = {
@@ -1,4 +1,4 @@
1
- import { A as o, C as e, b as p, G as c, a as n, O as t, S as r, T as u, cj as G, c as i, n as O } from "../constants-D4GX9YB2.js";
1
+ import { A as o, C as e, b as p, G as c, a as n, O as t, S as r, T as u, c3 as G, c as i, n as O } from "../constants-BMg7uvpO.js";
2
2
  export {
3
3
  o as Accept,
4
4
  e as Cross,