ml-time-graph 1.17.1 → 1.19.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 +78 -0
- package/GRAPH_JSON_STRUCTURE.md +3 -1
- package/README.de.md +6 -4
- package/README.md +5 -4
- package/SKILLS.md +9 -538
- package/USAGE.md +27 -2
- package/dist/analyze/index.d.ts +2 -1
- package/dist/analyze/index.js +2 -2
- package/dist/index.d.ts +25 -17
- package/dist/index.js +26 -26
- package/dist/interaction/index.d.ts +4 -3
- package/dist/interaction/index.js +1 -1
- package/dist/internals.d.ts +8 -5
- package/dist/internals.js +4 -4
- package/dist/{marker_renderer-VcAK5as0.d.ts → marker_renderer-BKOhqPkn.d.ts} +21 -4
- package/dist/{types-D7tmWwH9.d.ts → types-pKdGBqvc.d.ts} +32 -2
- package/package.json +3 -2
- package/skills/ml-time-graph/SKILL.md +113 -0
- package/skills/ml-time-graph/reference/annotations-and-markers.md +63 -0
- package/skills/ml-time-graph/reference/axes.md +112 -0
- package/skills/ml-time-graph/reference/gaps.md +75 -0
- package/skills/ml-time-graph/reference/legend.md +57 -0
- package/skills/ml-time-graph/reference/rendering.md +84 -0
- package/skills/ml-time-graph/reference/series-styles.md +58 -0
- package/skills/ml-time-graph/reference/svelte.md +37 -0
- package/skills/ml-time-graph/reference/thresholds-and-fills.md +64 -0
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,84 @@ release notes, and every change is in `git log` in full.
|
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
+
## [1.19.0] - 2026-10-19
|
|
23
|
+
|
|
24
|
+
### Security
|
|
25
|
+
- **go-time-graph now requires Go 1.26** (was 1.25) and builds with Go 1.26.9. This closes 10
|
|
26
|
+
standard-library vulnerabilities reachable from `graph-server` (govulncheck) and updates
|
|
27
|
+
`golang.org/x/{crypto,net,text,sys,mod}`, whose fixes need Go 1.26. Go 1.25 is no longer
|
|
28
|
+
maintained since Go 1.27. No change to the output.
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- **Type exports** (TS) — `RenderOutput` and `GapBand` from `ml-time-graph`; `Point`,
|
|
32
|
+
`FlatSeriesStyle` and `RenderingContext` from `ml-time-graph/internals`. They already appeared
|
|
33
|
+
in public signatures (`render()`, `gaps.band`, the series renderers) but could not be named, so
|
|
34
|
+
a project emitting declarations could hit TS2742.
|
|
35
|
+
- **Gallery card "Line styles"** — every `style.line.style` variant, drawn from the same fixture
|
|
36
|
+
(`line_variants.json`) that the Go golden and the TS/Go parity test check.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
- **Unknown `dash` variant** (TS) — a line style name the table does not know (e.g. `"dots"`
|
|
40
|
+
from JSON) now draws a plain solid line with no dash attributes, as `"solid"` does and as
|
|
41
|
+
the Go port always did. Before, TS wrote `stroke-dasharray="none" stroke-linecap="butt"`;
|
|
42
|
+
`resolveDash()` returned that pair instead of `null`. Looks the same; the SVG differs.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
- Internal clean-up in both ports (Go `zeichne` split into steps, shared SVG attribute and
|
|
46
|
+
rolling-window helpers). No change to the output: every fixture renders byte-identical.
|
|
47
|
+
|
|
48
|
+
## [1.18.0] - 2026-10-07
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
- **`series.holdToEnd`** (TS and Go) — a sensor that reports only on change (a door contact)
|
|
52
|
+
holds its last value until the end of the time axis or `gaps.atEnd.now`; `{ maxAgeMs }` holds
|
|
53
|
+
at most that long. Before, its line ended at the last report and looked like an outage while
|
|
54
|
+
the tooltip still showed the state. Line and fill only; markers, tooltip and value axis keep
|
|
55
|
+
the real readings, and the series gets no `gaps.atEnd` region.
|
|
56
|
+
- **`axes.y[].labelOffset`** (TS and Go) — place an axis title at a fixed distance from its axis
|
|
57
|
+
line instead of the automatic lane search; other titles avoid it. Works in the `left`/`right`
|
|
58
|
+
form too.
|
|
59
|
+
- **`warnings()` checks references** (TS and Go, same texts) — unknown threshold names in
|
|
60
|
+
`colorByThresholds` and fill bounds, unknown series in fill bounds, and `side`/`outer` where
|
|
61
|
+
they are ignored. Before, all of these were silently skipped while drawing. It also reports
|
|
62
|
+
the deprecated `series.sensorType`.
|
|
63
|
+
- **Go: `models.LegendPositionAbove` / `LegendPositionBelow`** — constants for the legend
|
|
64
|
+
positions `"above"` and `"below"`, which existed without them.
|
|
65
|
+
- **`ml-time-graph-svelte`: `tooltip={false}`** — no tooltip box, while crosshair, points,
|
|
66
|
+
`onhover`, the announcement, zoom and keyboard stay.
|
|
67
|
+
- **`ml-time-graph-svelte`: `syncTime` outside the window** draws an arrow at the plot edge
|
|
68
|
+
where the time lies, instead of nothing.
|
|
69
|
+
- **`classPrefix`** (TS and Go) — prefix every CSS class the chart writes (`mltg-series`,
|
|
70
|
+
`mltg-time-axis`, …) so a host page stylesheet using the same words cannot reach into the
|
|
71
|
+
chart. `legend.itemClass` stays unprefixed. Renderer: `SVGRenderer({ classPrefix })` /
|
|
72
|
+
`SetClassPrefix`; CLI and HTTP server pass it on. The Svelte component handles it.
|
|
73
|
+
- **Go: `YAxisConfig.Format`** — a tick formatter for value axes, set in code (a function is not
|
|
74
|
+
JSON), like `axes.y[].format` in TypeScript.
|
|
75
|
+
|
|
76
|
+
### Changed
|
|
77
|
+
- **The legend shows the line pattern** (TS and Go) — when a legend contains a dashed or dotted
|
|
78
|
+
series, every entry gets a short line in its series' colour, width and pattern instead of a
|
|
79
|
+
square, so the series stay apart in black-and-white print. Legends of solid lines only keep
|
|
80
|
+
their squares.
|
|
81
|
+
- **`SKILLS.md` became an agent skill** — `skills/ml-time-graph/SKILL.md` with `name`/`description`
|
|
82
|
+
frontmatter, a short core and reference files per task in `reference/`, shipped in the package
|
|
83
|
+
(copy the folder into `.claude/skills/`). It now also covers 1.17 and 1.18 (`gaps.atEnd`,
|
|
84
|
+
`holdToEnd`, `where`, `axisGroups`, `labelOffset`, `idPrefix`/`classPrefix`, `warnings()`, the
|
|
85
|
+
Svelte package). `SKILLS.md` remains as a pointer.
|
|
86
|
+
- Development tooling: Biome replaces ESLint and Prettier; type checking runs on TypeScript 7
|
|
87
|
+
(native), with TypeScript 6 kept for the build tools; vitest 5, esbuild 0.28 (security fix).
|
|
88
|
+
|
|
89
|
+
### Deprecated
|
|
90
|
+
- **Go: `renderer.RenderLegend`** — use `RenderLegendWith(LegendOpts)`; eight positional
|
|
91
|
+
arguments made every new field a breaking change. Removed in a later 1.x release.
|
|
92
|
+
- **`series.style.gap.label`** (TS and Go) — a series has no gap text to style; set the label
|
|
93
|
+
style chart-wide on `gaps.style.label`. `warnings()` reports it. Removed before 2.0.
|
|
94
|
+
|
|
95
|
+
### Fixed
|
|
96
|
+
- **`axes.*.labels` reached only the axis title** (TS and Go) — `labels.color` and
|
|
97
|
+
`labels.fontSize` now also apply to the tick labels, as documented; a red axis no longer
|
|
98
|
+
carries grey numbers. Go: `axis.AchsenFarbenMit` takes the labels; `AchsenFarben` is unchanged.
|
|
99
|
+
|
|
22
100
|
## [1.17.1] - 2026-10-07
|
|
23
101
|
|
|
24
102
|
### Deprecated
|
package/GRAPH_JSON_STRUCTURE.md
CHANGED
|
@@ -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?**
|
|
20
|
-
> **[
|
|
21
|
-
> `
|
|
22
|
-
>
|
|
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?**
|
|
20
|
-
> **[
|
|
21
|
-
> `
|
|
22
|
-
>
|
|
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
|