ml-time-graph 1.17.1 → 1.18.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
@@ -19,6 +19,58 @@ release notes, and every change is in `git log` in full.
19
19
 
20
20
  ---
21
21
 
22
+ ## [1.18.0] - 2026-10-07
23
+
24
+ ### Added
25
+ - **`series.holdToEnd`** (TS and Go) — a sensor that reports only on change (a door contact)
26
+ holds its last value until the end of the time axis or `gaps.atEnd.now`; `{ maxAgeMs }` holds
27
+ at most that long. Before, its line ended at the last report and looked like an outage while
28
+ the tooltip still showed the state. Line and fill only; markers, tooltip and value axis keep
29
+ the real readings, and the series gets no `gaps.atEnd` region.
30
+ - **`axes.y[].labelOffset`** (TS and Go) — place an axis title at a fixed distance from its axis
31
+ line instead of the automatic lane search; other titles avoid it. Works in the `left`/`right`
32
+ form too.
33
+ - **`warnings()` checks references** (TS and Go, same texts) — unknown threshold names in
34
+ `colorByThresholds` and fill bounds, unknown series in fill bounds, and `side`/`outer` where
35
+ they are ignored. Before, all of these were silently skipped while drawing. It also reports
36
+ the deprecated `series.sensorType`.
37
+ - **Go: `models.LegendPositionAbove` / `LegendPositionBelow`** — constants for the legend
38
+ positions `"above"` and `"below"`, which existed without them.
39
+ - **`ml-time-graph-svelte`: `tooltip={false}`** — no tooltip box, while crosshair, points,
40
+ `onhover`, the announcement, zoom and keyboard stay.
41
+ - **`ml-time-graph-svelte`: `syncTime` outside the window** draws an arrow at the plot edge
42
+ where the time lies, instead of nothing.
43
+ - **`classPrefix`** (TS and Go) — prefix every CSS class the chart writes (`mltg-series`,
44
+ `mltg-time-axis`, …) so a host page stylesheet using the same words cannot reach into the
45
+ chart. `legend.itemClass` stays unprefixed. Renderer: `SVGRenderer({ classPrefix })` /
46
+ `SetClassPrefix`; CLI and HTTP server pass it on. The Svelte component handles it.
47
+ - **Go: `YAxisConfig.Format`** — a tick formatter for value axes, set in code (a function is not
48
+ JSON), like `axes.y[].format` in TypeScript.
49
+
50
+ ### Changed
51
+ - **The legend shows the line pattern** (TS and Go) — when a legend contains a dashed or dotted
52
+ series, every entry gets a short line in its series' colour, width and pattern instead of a
53
+ square, so the series stay apart in black-and-white print. Legends of solid lines only keep
54
+ their squares.
55
+ - **`SKILLS.md` became an agent skill** — `skills/ml-time-graph/SKILL.md` with `name`/`description`
56
+ frontmatter, a short core and reference files per task in `reference/`, shipped in the package
57
+ (copy the folder into `.claude/skills/`). It now also covers 1.17 and 1.18 (`gaps.atEnd`,
58
+ `holdToEnd`, `where`, `axisGroups`, `labelOffset`, `idPrefix`/`classPrefix`, `warnings()`, the
59
+ Svelte package). `SKILLS.md` remains as a pointer.
60
+ - Development tooling: Biome replaces ESLint and Prettier; type checking runs on TypeScript 7
61
+ (native), with TypeScript 6 kept for the build tools; vitest 5, esbuild 0.28 (security fix).
62
+
63
+ ### Deprecated
64
+ - **Go: `renderer.RenderLegend`** — use `RenderLegendWith(LegendOpts)`; eight positional
65
+ arguments made every new field a breaking change. Removed in a later 1.x release.
66
+ - **`series.style.gap.label`** (TS and Go) — a series has no gap text to style; set the label
67
+ style chart-wide on `gaps.style.label`. `warnings()` reports it. Removed before 2.0.
68
+
69
+ ### Fixed
70
+ - **`axes.*.labels` reached only the axis title** (TS and Go) — `labels.color` and
71
+ `labels.fontSize` now also apply to the tick labels, as documented; a red axis no longer
72
+ carries grey numbers. Go: `axis.AchsenFarbenMit` takes the labels; `AchsenFarben` is unchanged.
73
+
22
74
  ## [1.17.1] - 2026-10-07
23
75
 
24
76
  ### Deprecated
@@ -94,8 +94,9 @@ Use `left`/`right` for the classic two-axis setup. Use `y` as an array when more
94
94
  | `position` | `'left' \| 'right'` | Side of the plot area |
95
95
  | `offset` | `number` | Extra offset from the plot edge, px |
96
96
  | `label` | `string` | Axis title text |
97
+ | `labelOffset` | `number` | Distance in px from the axis line to the centre of the title; replaces the automatic placement. Since 1.18 |
97
98
  | `domain` | `[number, number] \| 'auto'` | Value range. `'auto'` derives from data |
98
- | `format` | **function — non-serializable** | Custom value formatter `(value: number) => string` |
99
+ | `format` | **function — non-serializable** | Custom value formatter `(value: number) => string`. Go: `YAxisConfig.Format`, set in code (since 1.18) |
99
100
  | `ticks` | `TickConfig` | Tick mark lengths |
100
101
  | `grid` | `GridStyle` | Grid line styling |
101
102
  | `axis` | `AxisStyle` | Axis line color/width |
@@ -147,6 +148,7 @@ A series is either a `TimeSeries` (individual samples) or an `AggregatedSeries`
147
148
  | `data` | `DataPoint[]` | Samples, sorted by time |
148
149
  | `sensorType` | `string` | **Deprecated** — has no effect on the chart; use `enumMap` for state series. Will be removed before 2.0. |
149
150
  | `enumMap` | `Record<string \| number, string>` | Maps raw codes to labels, e.g. `{ "1": "running", "2": "stopped" }` |
151
+ | `holdToEnd` | `boolean` \| `{ maxAgeMs }` | Hold the last value until the end of the time axis (or `gaps.atEnd.now`) — for a sensor that reports only on change. Line and fill only; markers, tooltip and value axis keep the real readings; no `gaps.atEnd` region for this series. Since 1.18. |
150
152
  | `style` | `SeriesStyle` | Visual appearance (section 5) |
151
153
  | `overlays` | `SeriesOverlay[]` | Derived curves such as moving averages (section 6) |
152
154
  | `yAxisIndex` | `number` | Which Y scale to draw on (`0` = left, `1` = right) |
package/README.de.md CHANGED
@@ -16,10 +16,12 @@ Browser und im Backend.
16
16
  > sechzehn Seiten, jede Karte mit Code- und Werte-Reiter, nichts zu installieren. Dieselben Seiten
17
17
  > stecken im [Handbuch](https://mlcgo.eu/books/mlctimegraph/).
18
18
 
19
- > 🤖 **Sie arbeiten mit einem KI-Assistenten?** Geben Sie ihm
20
- > **[SKILLS.md](https://gitlab.com/mlc0911/mlctimegraph/-/blob/main/packages/ml-time-graph/SKILLS.md)** — die Datei wird mitgeliefert und liegt nach
21
- > `npm install` unter `node_modules/ml-time-graph/SKILLS.md`. Eine Seite: der
22
- > kürzeste Weg zum Diagramm, die vier Einstiegspunkte, die üblichen Aufgaben und
19
+ > 🤖 **Sie arbeiten mit einem KI-Assistenten?** Das Paket bringt einen Agent-Skill mit,
20
+ > **[skills/ml-time-graph/SKILL.md](https://gitlab.com/mlc0911/mlctimegraph/-/blob/main/packages/ml-time-graph/skills/ml-time-graph/SKILL.md)** — nach `npm install` liegt er unter
21
+ > `node_modules/ml-time-graph/skills/ml-time-graph/`. Kopieren Sie den Ordner in das
22
+ > Skill-Verzeichnis Ihres Assistenten (`cp -r node_modules/ml-time-graph/skills/ml-time-graph
23
+ > .claude/skills/` für Claude Code). Der kürzeste Weg zum Diagramm, die Einstiegspunkte,
24
+ > Referenzdateien je Aufgabe und
23
25
  > ein Abschnitt **Traps** für die Stellen, an denen ein Modell danebengreift
24
26
  > (Zeitstempel sind Millisekunden, Ränder werden nicht aus den Beschriftungen
25
27
  > gemessen, `resolveDash` statt `getLineStyle`). Das ist der Unterschied zwischen
package/README.md CHANGED
@@ -16,10 +16,11 @@ backend.
16
16
  > pages, every card with a Code and a Values tab, nothing to install. The same pages are embedded
17
17
  > in the [handbook](https://mlcgo.eu/books/mlctimegraph/).
18
18
 
19
- > 🤖 **Working with an AI coding assistant?** Point it at
20
- > **[SKILLS.md](https://gitlab.com/mlc0911/mlctimegraph/-/blob/main/packages/ml-time-graph/SKILLS.md)** — it ships inside the package, so after
21
- > `npm install` it sits at `node_modules/ml-time-graph/SKILLS.md`. One page:
22
- > the shortest path to a chart, the four entry points, the recipes, and a
19
+ > 🤖 **Working with an AI coding assistant?** The package ships an agent skill,
20
+ > **[skills/ml-time-graph/SKILL.md](https://gitlab.com/mlc0911/mlctimegraph/-/blob/main/packages/ml-time-graph/skills/ml-time-graph/SKILL.md)** — after `npm install` it sits at
21
+ > `node_modules/ml-time-graph/skills/ml-time-graph/`. Copy that folder into your agent's skills
22
+ > directory (`cp -r node_modules/ml-time-graph/skills/ml-time-graph .claude/skills/` for Claude
23
+ > Code). The shortest path to a chart, the entry points, reference files per task, and a
23
24
  > **Traps** section for the places a model guesses wrong (timestamps are epoch
24
25
  > milliseconds, margins are not measured from the labels, `resolveDash` vs
25
26
  > `getLineStyle`). It is the difference between code that compiles and code