@usetheo/ui 0.31.0 → 0.32.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.
@@ -31,7 +31,24 @@ export interface TrendSeries {
31
31
  export declare function linScale(domain: [number, number], range: [number, number]): (v: number) => number;
32
32
  /** A clean upper Y bound ≥ max(values). Returns 0 when there is no positive value. */
33
33
  export declare function niceMax(values: number[]): number;
34
- /** SVG path `d` for a polyline over the given scales. Non-finite points are skipped. */
34
+ /**
35
+ * SVG path `d` for a polyline over the given scales. A non-finite point is a GAP: the path BREAKS
36
+ * there and resumes with a new `M` subpath.
37
+ *
38
+ * M144 — this used to `filter(Number.isFinite)` and then join everything with `L`, which drew a
39
+ * continuous line straight over the hole. The filter is what made it wrong: it erased the
40
+ * information of WHERE the gap was, so the line could not break even in principle.
41
+ *
42
+ * Breaking is what every serious charting library does by default — `spanGaps` (Chart.js),
43
+ * `connectNulls` (Highcharts, ECharts, Recharts) and `connectgaps` (Plotly) all default to `false`,
44
+ * and Grafana ships "Connect null values: Never". It is also the only honest reading: connecting
45
+ * asserts continuity the data does not have, and the rest of THIS file already treats a non-finite
46
+ * `y` as absent (`niceMax` filters it, `hasData` filters it, and the accessible table renders `—`
47
+ * for a period a series has no point for).
48
+ *
49
+ * A run of one point emits a lone `M` and no `L` — a one-point line has no length, and the sparse
50
+ * marker is what makes it visible.
51
+ */
35
52
  export declare function seriesPath(points: TrendPoint[], xScale: (x: number) => number, yScale: (y: number) => number): string;
36
53
  export interface TrendChartProps extends HTMLAttributes<HTMLElement> {
37
54
  title: string;
package/dist/index.js CHANGED
@@ -5095,9 +5095,17 @@ function niceMax(values) {
5095
5095
  return Number((Math.ceil(m / pow) * pow).toPrecision(12));
5096
5096
  }
5097
5097
  function seriesPath(points, xScale, yScale) {
5098
- const finite = points.filter((p) => Number.isFinite(p.y));
5099
- if (finite.length === 0) return "";
5100
- return finite.map((p, i) => `${i === 0 ? "M" : "L"}${xScale(p.x).toFixed(2)},${yScale(p.y).toFixed(2)}`).join(" ");
5098
+ const out = [];
5099
+ let emTrecho = false;
5100
+ for (const p of points) {
5101
+ if (!Number.isFinite(p.y)) {
5102
+ emTrecho = false;
5103
+ continue;
5104
+ }
5105
+ out.push(`${emTrecho ? "L" : "M"}${xScale(p.x).toFixed(2)},${yScale(p.y).toFixed(2)}`);
5106
+ emTrecho = true;
5107
+ }
5108
+ return out.join(" ");
5101
5109
  }
5102
5110
  var VIEW_W = 600;
5103
5111
  var PAD = { top: 8, right: 8, bottom: 4, left: 40 };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@usetheo/ui",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
- "description": "Violet Forge design system — generic React components + primitives (the non-AI foundation of @theokit/ui).",
7
+ "description": "Violet Forge design system \u2014 generic React components + primitives (the non-AI foundation of @theokit/ui).",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "dist"