@glissade/scene 0.32.0 → 0.33.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,6 +1,6 @@
1
1
  # @glissade/scene
2
2
 
3
- The scene graph and the **DisplayList IR**: nodes (Group, Rect, Circle, Text, Image, Video) whose every animatable property is a signal, `createScene`, and the canonical `evaluate(scene, timeline, t) → DisplayList`. Text layout (explicit fonts, Intl.Segmenter line breaking) is deterministic across browser and headless render. Yoga flexbox lives behind the LayoutEngine seam at the separate `@glissade/scene/layout` entry — the base path never pays for wasm — including `width/height: 'auto'` content sizing and `computedSize()`.
3
+ The scene graph and the **DisplayList IR**: nodes (Group, Rect, Circle, Path, Text, Image, Video) whose every animatable property is a signal, `createScene`, and the canonical `evaluate(scene, timeline, t) → DisplayList`. Text layout (explicit fonts, Intl.Segmenter line breaking) is deterministic across browser and headless render. Yoga flexbox lives behind the LayoutEngine seam at the separate `@glissade/scene/layout` entry — the base path never pays for wasm — including `width/height: 'auto'` content sizing and `computedSize()`. Other tree-shaken subpaths carry `splitText` (`./type`), `Grid` (`./grid`), motion-path drivers (`./motion`), the SVG `d` parser (`./path`), and `Chart()` + serializable scales (`./chart`).
4
4
 
5
5
  ```sh
6
6
  npm i @glissade/scene @glissade/core
package/dist/chart.d.ts CHANGED
@@ -80,7 +80,10 @@ interface ChartSpec extends NodeProps {
80
80
  bandPadding?: number;
81
81
  /**
82
82
  * Bar fill: a solid colour string, or a `ColorScale` evaluated at each bar's
83
- * VALUE (a colour ramp over the data). Default `'#4f8cff'`.
83
+ * VALUE (a colour ramp over the data). A ramp still on colorRamp's DEFAULT
84
+ * `[0, 1]` domain is automatically re-domained over `[0, max(y)]` when the
85
+ * data ranges past 1 (so `colorRamp(['#39e0ff', '#ffcf3f'])` "just works");
86
+ * pass an explicit domain to opt out. Default `'#4f8cff'`.
84
87
  */
85
88
  fill?: string | ColorScale;
86
89
  }
package/dist/chart.js CHANGED
@@ -119,14 +119,18 @@ function Chart(spec) {
119
119
  data.forEach((row, i) => {
120
120
  if (row[xKey] === void 0) throw new ChartError(`Chart row ${i}: missing xKey '${xKey}'`);
121
121
  });
122
+ values.forEach((v, i) => {
123
+ if (v < 0) throw new ChartError(`Chart row ${i}: ${yKey}=${v} is negative — the bar MVP draws from a zero baseline; offset your data or pass an explicit yScale that maps your domain to positive heights`);
124
+ });
122
125
  const yMax = Math.max(...values, 0);
123
126
  const yScale = spec.yScale ?? linearScale([0, yMax === 0 ? 1 : yMax], [0, height]);
124
127
  const bands = bandScale(data.length, [0, width], bandPadding);
128
+ const fillScale = typeof fill === "string" ? void 0 : fill.domain[0] === 0 && fill.domain[1] === 1 && yMax > 1 ? colorRamp(fill.stops, [0, yMax]) : fill;
125
129
  const ox = -width / 2;
126
130
  const baseline = height / 2;
127
131
  const bars = data.map((row, i) => {
128
132
  const h = yScale.map(values[i]);
129
- const barFill = typeof fill === "string" ? fill : fill.map(values[i]);
133
+ const barFill = fillScale === void 0 ? fill : fillScale.map(values[i]);
130
134
  return new Rect({
131
135
  id: `${id}/bars/${i}`,
132
136
  anchor: "bottom",
package/dist/describe.js CHANGED
@@ -22,7 +22,7 @@ import { easings, listValueTypes } from "@glissade/core";
22
22
  * never pulled onto the base embed path — a scene that never calls `describe()`
23
23
  * pays zero bytes for it.
24
24
  */
25
- const RAW_VERSION = "0.32.0";
25
+ const RAW_VERSION = "0.33.0";
26
26
  const PACKAGE_VERSION = RAW_VERSION.includes("GLISSADE_".concat("VERSION")) ? "0.0.0-dev" : RAW_VERSION;
27
27
  /** Arity of a value type's numeric repr: vec2/vec2-arc → 2, number → 1; others (color/paint/path/string/boolean) carry no scalar arity. */
28
28
  function arityOf(type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissade/scene",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "description": "glissade scene graph: nodes, transforms, DisplayList emission. Renderer-agnostic; zero DOM/Node dependencies.",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "dependencies": {
71
71
  "yoga-layout": "^3.2.1",
72
- "@glissade/core": "0.32.0"
72
+ "@glissade/core": "0.33.0"
73
73
  },
74
74
  "repository": {
75
75
  "type": "git",