ml-time-graph 1.24.0 → 1.26.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,43 @@ release notes, and every change is in `git log` in full.
19
19
 
20
20
  ---
21
21
 
22
+ ## [1.26.0] - 2026-11-28
23
+
24
+ ### Added
25
+
26
+ - **Logarithmic value axis** — `axes.left.scale: 'log'` with `min` as its lower edge
27
+ (I-TGRAF-20261128-01). Every power of ten gets the same height, so a light sensor's 2 lx at
28
+ dusk and 80,000 lx at noon are both readable. Readings below `min` — also 0 — are drawn on
29
+ the edge and `warnings()` counts them; without `min` the axis stays linear and `warnings()`
30
+ says why. Ticks sit on the decades, `ticks.minor` adds 2…9. Overlays and aggregates still
31
+ compute on the readings. TypeScript, Go, JSON; demo "Axes", manual chapter 4.
32
+
33
+ ### Changed
34
+
35
+ - **Groundwork for a logarithmic value axis, no visible change** (I-TGRAF-20261128-01). The
36
+ value scale now has a *drawing value* (`zeichenwert` / `wert`, Go `Zeichenwert` / `Wert`),
37
+ and everything that computes geometry between two readings — where a line crosses a
38
+ threshold, where a fill follows another series, where a marker sits — computes in it. On a
39
+ linear axis the drawing value is the value itself; every chart without `scale: 'log'`
40
+ renders as before.
41
+
42
+ ## [1.25.0] - 2026-11-22
43
+
44
+ ### Added
45
+ - **JSON Schema of the options** (draft 2020-12), generated from the Go types: shipped as
46
+ `ml-time-graph/options.schema.json` and served at `GET /api/v1/chart/schema`. `"$schema"` is now
47
+ allowed at the top level of the options JSON.
48
+ - **Fixed values are checked:** the schema lists the allowed values of fields such as
49
+ `legend.position`, hatch names and marker shapes. In Go, `graph-server`, `graph-cli` and
50
+ `chart.LoadOptions` reject an unknown value with a suggestion, as they do unknown fields. Line
51
+ styles stay lenient (unknown draws as `solid`).
52
+
53
+ ### Fixed
54
+ - **Two neighbouring value-axis ticks with the same label** now show it once (TS and Go): of a run of
55
+ identical labels only the last stays visible. A run of exactly two used to keep both.
56
+ - **Go doc comments** named marker shape `"rect"` (it is `"square"`) and `bridge_line` as a value
57
+ of `gaps[].style` (it belongs to `gaps.style.display`).
58
+
22
59
  ## [1.24.0] - 2026-11-06
23
60
 
24
61
  ### Added
@@ -4,6 +4,25 @@ A complete, field-by-field reference for the `MLTimeGraphOptions` object — the
4
4
 
5
5
  Every field listed here is serializable as plain JSON **except** the ones flagged with a function/object warning in section 2.
6
6
 
7
+ **Machine-readable:** the package ships a JSON Schema (draft 2020-12) of the JSON form,
8
+ `ml-time-graph/options.schema.json`. Point a JSON file at it and your editor completes and checks
9
+ the fields:
10
+
11
+ ```json
12
+ {
13
+ "$schema": "https://unpkg.com/ml-time-graph/options.schema.json",
14
+ "series": [{ "name": "Temp", "data": [{ "time": 1781474400000, "value": 21.5 }] }]
15
+ }
16
+ ```
17
+
18
+ It is generated from the Go types that go-time-graph validates against, so it accepts exactly what
19
+ both libraries read from JSON, unknown fields included as errors. Fields with a fixed set of values
20
+ (`legend.position`, `showAs`, hatch names, marker shapes …) list them, and an unknown value is an
21
+ error, with one exception: line styles. An unknown line style draws as `solid` on purpose, so the
22
+ schema only suggests those values. The Go server returns the same
23
+ schema at `GET /api/v1/chart/schema`. Function-valued options (formatters, a renderer instance)
24
+ have no JSON form and are not in it.
25
+
7
26
  ---
8
27
 
9
28
  ## 1. Top level: `MLTimeGraphOptions`
package/README.de.md CHANGED
@@ -145,6 +145,18 @@ sechzehn Seiten zum Anfassen, jede Karte mit Code- und Werte-Reiter, nichts zu i
145
145
  Lokal geht es mit `pnpm dev`; die Bilder oben entstehen mit
146
146
  `node scripts/make-examples.mjs`.
147
147
 
148
+ ### Im Einsatz
149
+
150
+ <p align="center">
151
+ <a href="https://gitlab.com/mlc0911/mlctunnel"><img src="https://gitlab.com/mlc0911/mlctimegraph/-/raw/main/book/images/in-use-autotunnel.png" alt="Verlaufsseite von mlc-autotunnel: je Tunnel ein kleines Diagramm mit dem Verkehr in beiden Richtungen und einem Statusband darunter" width="760"></a>
152
+ </p>
153
+
154
+ Die Verlaufsseite von [mlc-autotunnel](https://gitlab.com/mlc0911/mlctunnel), einem Wächter für SSH-Tunnel. Je Tunnel ein
155
+ kleines Diagramm: der Verkehr vom Dienst über der Nulllinie, der zum Dienst gespiegelt
156
+ darunter, jede Kachel mit eigener Skala. Die Achsenbeschriftung (`50 kB/s`, `1 kB/s`) schreibt
157
+ ein Formatierer der Anwendung selbst, und der Balken unter jeder Zeitachse ist ein Statusband —
158
+ grün, solange der Tunnel stand, rot, wo nicht. Gebaut mit `ml-time-graph-svelte`.
159
+
148
160
  ---
149
161
 
150
162
  ## 🔄 Go-Port & 1:1 Rendering-Parität
@@ -270,6 +282,11 @@ werden und die nachträgliche Auswertung entscheidend ist.
270
282
  - ❌ **High Performance** — für den Hauptanwendungsfall (Reporting, Analyse) nicht notwendig
271
283
  - ❌ **Volle Interaktivität** — Zoom/Pan ja, aber in Grenzen
272
284
  - ❌ GPU-Performance-Optimierungen o. Ä.
285
+ - ❌ **Balken- und Säulendiagramme** — eine Serie wird als `line`, `area` oder `step`
286
+ gezeichnet; einzelne Balken, Gruppieren und Stapeln gibt es nicht. Für Zählwerte je
287
+ Intervall (Nachrichten je 15 Minuten, Ereignisse je Stunde) nimm `seriesType: 'step'` mit
288
+ `style.fill`: das liest sich wie ein Histogramm und lässt sich bei mehreren Serien sauber
289
+ überlagern.
273
290
 
274
291
  „Keine Performance-Bibliothek" heißt: kein GPU-Pfad, kein virtualisiertes Canvas. Es heißt
275
292
  nicht, dass die Sache langsam wäre. Gemessen, damit niemand raten muss: Eine **Linie mit
package/README.md CHANGED
@@ -144,6 +144,18 @@ sixteen pages to play with, every card with a Code and a Values tab, nothing to
144
144
  Locally it is `pnpm dev`; the images above come from
145
145
  `node scripts/make-examples.mjs`.
146
146
 
147
+ ### In real use
148
+
149
+ <p align="center">
150
+ <a href="https://gitlab.com/mlc0911/mlctunnel"><img src="https://gitlab.com/mlc0911/mlctimegraph/-/raw/main/book/images/in-use-autotunnel.png" alt="History page of mlc-autotunnel: one small chart per tunnel with traffic in both directions and a status band below" width="760"></a>
151
+ </p>
152
+
153
+ The history page of [mlc-autotunnel](https://gitlab.com/mlc0911/mlctunnel), a supervisor for SSH tunnels. One small chart
154
+ per tunnel: traffic from the service above the zero line, to the service mirrored below it,
155
+ each tile on its own scale. The axis labels (`50 kB/s`, `1 kB/s`) come from a formatter of the
156
+ application's own, and the bar under each time axis is a status band — green while the tunnel
157
+ was up, red where it was not. Built with `ml-time-graph-svelte`.
158
+
147
159
  ---
148
160
 
149
161
  ## 🔄 Go Port & 1:1 Rendering Parity
@@ -265,6 +277,10 @@ after-the-fact evaluation is what matters.
265
277
  - ❌ **High performance** — not needed for the main use case (reporting, analysis)
266
278
  - ❌ **Full interactivity** — zoom/pan yes, but within limits
267
279
  - ❌ GPU performance optimizations and the like
280
+ - ❌ **Bar and column charts** — a series is drawn as `line`, `area` or `step`; there are no
281
+ separate bars, no grouping and no stacking. For counts per interval (messages per
282
+ 15 minutes, events per hour) use `seriesType: 'step'` with a `style.fill`: it reads like a
283
+ histogram and overlays cleanly when there are several series.
268
284
 
269
285
  "Not a performance library" means there is no GPU path and no virtualized canvas — it does not
270
286
  mean the thing is slow. Measured, so nobody has to guess: a **25,000-point line renders in
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { M as MLTimeGraphOptions, L as LegendItem, b as Margin, Y as YAxisConfig, A as AxesConfig, X as XAxisConfig, c as LegendOptions, d as LegendPosition, e as LegendOrientation, f as Marker, g as RenderOutput } from './marker_renderer-Dph9cKDY.js';
1
+ import { M as MLTimeGraphOptions, L as LegendItem, b as Margin, Y as YAxisConfig, A as AxesConfig, X as XAxisConfig, c as LegendOptions, d as LegendPosition, e as LegendOrientation, f as Marker, g as RenderOutput } from './marker_renderer-DYSAkVgI.js';
2
2
  import { Renderer, LayoutResult } from './internals.js';
3
- export { h as AxisLabelsStyle, i as AxisStyle, G as GridLineStyle, j as GridStyle, T as TextMetrics, k as Theme, l as TickConfig, m as TickFormat, n as drawMarker, o as estimateMetrics, p as getDefaultTheme, q as liberationMetrics, r as resetDefaultTheme, s as setDefaultTheme, t as slugify } from './marker_renderer-Dph9cKDY.js';
4
- import { e as AnySeries, i as Annotation, a as DrawCommand, g as Gap, h as GapsConfig, f as Threshold, H as Highlight, j as AnnotationBandConfig, l as SeriesStyle, c as LineVariant, S as SmoothingType, F as FillSpec, m as TimeSeries, b as LineDashStyle, n as ThresholdFill, k as HatchVariant, o as ThresholdLabelPosition, P as PointStyleType, M as MarkerLineStyle, R as RangeLabelPosition, p as AnnotationPointShape, q as LabelAnchor, r as AnnotationBandItem, s as TextBaseline, t as AggregatedPoint, u as AggregatedSeries, D as DataPoint } from './types-B9bbJxmn.js';
3
+ export { h as AxisLabelsStyle, i as AxisStyle, G as GridLineStyle, j as GridStyle, T as TextMetrics, k as Theme, l as TickConfig, m as TickFormat, n as drawMarker, o as estimateMetrics, p as getDefaultTheme, q as liberationMetrics, r as resetDefaultTheme, s as setDefaultTheme, t as slugify } from './marker_renderer-DYSAkVgI.js';
4
+ import { f as AnySeries, j as Annotation, a as DrawCommand, h as Gap, i as GapsConfig, g as Threshold, H as Highlight, k as AnnotationBandConfig, m as SeriesStyle, c as LineVariant, S as SmoothingType, F as FillSpec, n as TimeSeries, b as LineDashStyle, o as ThresholdFill, l as HatchVariant, p as ThresholdLabelPosition, P as PointStyleType, M as MarkerLineStyle, R as RangeLabelPosition, q as AnnotationPointShape, r as LabelAnchor, s as AnnotationBandItem, t as TextBaseline, u as AggregatedPoint, v as AggregatedSeries, D as DataPoint } from './types-RAg4hLZA.js';
5
5
  import { TimeScale, LinearScale } from './internals.js';
6
- export { v as AggregatedShowAs, w as AggregationConfig, x as AggregationMode, y as AnnotationBandLabels, z as AnnotationKind, B as AxisOrientation, A as AxisPosition, C as DataPointRef, E as EnumMap, I as FillBound, J as FillRegion, K as FillSide, N as FillStyle, O as FillWhere, Q as GapBand, U as GapConfig, V as GapLabel, W as GapRegion, X as GapStyle, Y as GapsAtEnd, G as GridLayer, Z as LineShape, _ as LineStyle, $ as MarkerStyle, a0 as MovingAverageType, a1 as SVGLineStyle, a2 as SensorType, a3 as SeriesGapStyle, a4 as SeriesGaps, a5 as SeriesLegend, a6 as SeriesOverlay, a7 as SeriesOverlayKind, a8 as SeriesType, a9 as ShadowStyle, aa as SolidDashStyle, ab as ThresholdLabelConfig, ac as getLineStyle, ad as resolveDash } from './types-B9bbJxmn.js';
6
+ export { w as AggregatedShowAs, x as AggregationConfig, y as AggregationMode, z as AnnotationBandLabels, B as AnnotationKind, C as AxisOrientation, A as AxisPosition, e as AxisScale, E as DataPointRef, I as EnumMap, J as FillBound, K as FillRegion, N as FillSide, O as FillStyle, Q as FillWhere, U as GapBand, V as GapConfig, W as GapLabel, X as GapRegion, Y as GapStyle, Z as GapsAtEnd, G as GridLayer, _ as LineShape, $ as LineStyle, a0 as MarkerStyle, a1 as MovingAverageType, a2 as SVGLineStyle, a3 as SensorType, a4 as SeriesGapStyle, a5 as SeriesGaps, a6 as SeriesLegend, a7 as SeriesOverlay, a8 as SeriesOverlayKind, a9 as SeriesType, aa as ShadowStyle, ab as SolidDashStyle, ac as ThresholdLabelConfig, ad as getLineStyle, ae as resolveDash } from './types-RAg4hLZA.js';
7
7
 
8
8
  /*!
9
9
  * MLTimeGraph — Copyright (c) 2026 Michael Lechner
@@ -1175,7 +1175,7 @@ declare function mergeOptions(...layers: (OptionsLayer | undefined)[]): MLTimeGr
1175
1175
  * Monate spaeter eine Datei aus einem Stapel von Berichten in der Hand haelt,
1176
1176
  * kann sonst nicht feststellen, welcher Stand sie gezeichnet hat.
1177
1177
  */
1178
- declare const VERSION = "1.24.0";
1178
+ declare const VERSION = "1.26.0";
1179
1179
 
1180
1180
  export { AggregatedPoint, AggregatedSeries, Annotation, AnnotationBandBuilder, AnnotationBandConfig, AnnotationBandItem, AnnotationBandItemBuilder, AnnotationBuilder, AnnotationPointShape, AnySeries, AxesConfig, DataPoint, DrawCommand, FillSpec, Gap, GapsConfig, GraphBuilder, HatchVariant, Highlight, HighlightBuilder, LabelAnchor, LegendItem, LegendOptions, LegendOrientation, LegendPosition, LineDashStyle, LineVariant, MLTimeGraph, MLTimeGraphOptions, Margin, Marker, MarkerBuilder, MarkerLineStyle, PointStyleType, RangeLabelPosition, RenderOutput, SVGRenderer, SeriesStyle, SmoothingType, TextBaseline, Threshold, ThresholdBuilder, ThresholdFill, ThresholdLabelPosition, TimeSeries, TimeSeriesBuilder, VERSION, XAxisConfig, YAxisConfig, attachTooltip, autoMargin, axisGroups, fillBetweenThresholds, mergeOptions, mount, parseAggregated, parseDataPoint, parseSeries, toDataPoints, toSeries, zeigerImSvg };
1181
1181
  export type { AutoMarginOptions, AxisGroupInput, AxisGroups, FieldAccessor, FillBetweenThresholdsInput, LimitStatsPoint, MktPoint, OptionsLayer, PointAt, PointsAtOptions, StatsAggregatedPoint, StdDevPoint, TimeInput, ToDataPointsSpec, TooltipOptions, TooltipSample };