ml-time-graph 1.17.0 → 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 +81 -0
- package/GRAPH_JSON_STRUCTURE.md +6 -4
- package/README.de.md +6 -4
- package/README.md +5 -4
- package/SKILLS.md +9 -538
- package/USAGE.md +27 -2
- package/dist/index.d.ts +21 -16
- package/dist/index.js +41 -41
- package/dist/interaction/index.d.ts +1 -2
- package/dist/interaction/index.js +1 -1
- package/dist/internals.d.ts +16 -4
- package/dist/internals.js +19 -19
- package/dist/{marker_renderer-BsiVseet.d.ts → marker_renderer-BZMcTbHC.d.ts} +19 -3
- package/dist/{types-DdltSMkw.d.ts → types-CNIUKrmy.d.ts} +41 -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,87 @@ 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
|
+
|
|
74
|
+
## [1.17.1] - 2026-10-07
|
|
75
|
+
|
|
76
|
+
### Deprecated
|
|
77
|
+
- **`series.sensorType`** (TS and Go) — has no effect on the chart; use `enumMap` for state
|
|
78
|
+
series. Removed before 2.0.
|
|
79
|
+
- **Gap style `"label"`** in the flat form (`gaps: [{ style: "label" }]`) — use `"empty"` with
|
|
80
|
+
`label`. `warnings()` / `Warnings()` report it. Removed before 2.0.
|
|
81
|
+
|
|
82
|
+
### Fixed
|
|
83
|
+
- **Markings outside the visible range were drawn into the margin** (TS and Go) — zoomed in,
|
|
84
|
+
an arrow starting before the window ran through the axis labels, and a marker or label just
|
|
85
|
+
after it stood half cut off in the margin. Markers, labels and points with a time outside
|
|
86
|
+
the time axis (or a value outside its value axis) are no longer drawn; lines, arrows and
|
|
87
|
+
rectangles reaching beyond the axes are clipped to the plot. In `annotations_demo` a
|
|
88
|
+
rectangle no longer covers a time label.
|
|
89
|
+
- **`autoMargin` blew up on such a marking** — it counted as needing room, the plot shrank,
|
|
90
|
+
the element moved further out: margins of 10⁹ px and an empty chart. It now measures only
|
|
91
|
+
what is drawn, and no side gets more than 40 % of width or height. Also fixes
|
|
92
|
+
`ml-time-graph-svelte`, which uses `autoMargin`.
|
|
93
|
+
- **`ml-time-graph-svelte` with `applyZoom={false}` kept a stale zoom** — after the app reset
|
|
94
|
+
the window itself, double-click and Esc reported `null` again and `followEnd` shifted the old
|
|
95
|
+
window. The held zoom now follows the app's `axes.x.domain`.
|
|
96
|
+
- **`ml-time-graph-svelte`: `valuePadding` added a right axis the app never configured** — it
|
|
97
|
+
now pads only axes that exist (with `axes.y`, only that list).
|
|
98
|
+
- **`ml-time-graph-svelte`: the value table dropped the unit** — tooltip and announcement used
|
|
99
|
+
the axis `format` ("7.2 °C"), the table wrote a bare number. All three now share one rule,
|
|
100
|
+
for every value (min/max, both ends of a band). `formatValue` gets the axis-formatted text
|
|
101
|
+
as `label` and the `axisIndex`, so it can rewrite the number and keep the unit.
|
|
102
|
+
|
|
22
103
|
## [1.17.0] - 2026-10-07
|
|
23
104
|
|
|
24
105
|
### Added
|
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 |
|
|
@@ -145,8 +146,9 @@ A series is either a `TimeSeries` (individual samples) or an `AggregatedSeries`
|
|
|
145
146
|
| `id` | `string` | Stable identifier (used by selection/highlight logic) |
|
|
146
147
|
| `name` | `string` | Display name (legend, tooltips) |
|
|
147
148
|
| `data` | `DataPoint[]` | Samples, sorted by time |
|
|
148
|
-
| `sensorType` | `string` |
|
|
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) |
|
|
@@ -429,7 +431,7 @@ Two equivalent forms; prefer `GapsConfig`.
|
|
|
429
431
|
| `fillOpacity` | `number` | Background opacity |
|
|
430
432
|
| `labelBaseline` | `'above' \| 'middle' \| 'below'` | Vertical label alignment — **note the value set differs from `AnnotationBandItem.labelBaseline`** |
|
|
431
433
|
| `rotate` | `number` | Label rotation |
|
|
432
|
-
| `style` | `'dashed_border' \| 'empty' \| 'label'` | Rendering mode |
|
|
434
|
+
| `style` | `'dashed_border' \| 'empty' \| 'label'` | Rendering mode. `'label'` is **deprecated** and will be removed before 2.0 — use `'empty'` with `label`. |
|
|
433
435
|
|
|
434
436
|
### 10b. Preferred config form (`gaps: GapsConfig`)
|
|
435
437
|
|
|
@@ -541,7 +543,7 @@ Available only through `GraphBuilder.setTooltip()` — not part of `MLTimeGraphO
|
|
|
541
543
|
|
|
542
544
|
**GapStyle.display** (4): `empty`, `dashed_border`, `filled`, `bridge_line`
|
|
543
545
|
|
|
544
|
-
**DrawGapType_t** (3) — legacy `Gap.style`: `dashed_border`, `empty`, `label`
|
|
546
|
+
**DrawGapType_t** (3) — legacy `Gap.style`: `dashed_border`, `empty`, `label` (deprecated, removed before 2.0)
|
|
545
547
|
|
|
546
548
|
**FillSide:** `above`, `below`
|
|
547
549
|
|
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
|