ml-time-graph 1.16.0 → 1.17.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 +52 -0
- package/README.de.md +5 -29
- package/README.md +5 -28
- package/USAGE.md +113 -0
- package/dist/index.d.ts +59 -6
- package/dist/index.js +34 -34
- package/dist/interaction/index.d.ts +1 -1
- package/dist/internals.d.ts +10 -10
- package/dist/internals.js +4 -4
- package/dist/{marker_renderer-CN1N04nS.d.ts → marker_renderer-BsiVseet.d.ts} +21 -5
- package/dist/{scale-kRRbXFik.d.ts → types-DdltSMkw.d.ts} +186 -105
- package/package.json +1 -1
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.17.0] - 2026-10-07
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **`ml-time-graph-svelte`** — new package, same version: `<TimeGraph>` (container width,
|
|
26
|
+
`autoMargin`, tooltip over `pointsAt` and by keyboard, hiding, zoom, `syncTime` for
|
|
27
|
+
dashboards, dark mode and `--mtg-*` CSS variables, light print, SVG/PNG export, loading and
|
|
28
|
+
empty states, value table for screen readers, SSR) and `<Legend>` (buttons, swatches in the
|
|
29
|
+
line's dash, width and marker). App-wide defaults (`setTimeGraphDefaults`: locale, time zone,
|
|
30
|
+
formats, texts, scheme), translatable `labels`, `formatValue`, `followEnd` for live data,
|
|
31
|
+
`printHidden`. Manual: the package README and handbook chapter 7.
|
|
32
|
+
- **`gaps.atEnd`** (TS and Go) — a device that went quiet gets a hatched region from its last
|
|
33
|
+
reading to now (`now` or the end of the time axis), when that is longer than `afterMs`.
|
|
34
|
+
Label with `{since}` / `{duration}` placeholders (TS also a function); per series
|
|
35
|
+
`gaps: { atEnd: false | { afterMs } }`.
|
|
36
|
+
- **`where` on a fill region** (TS and Go) — fill only where the two edges are more than
|
|
37
|
+
`exceeds` apart (`side`, `maxAgeMs`). Decided on the readings (straight / held), drawn
|
|
38
|
+
between the drawn curves; `warnings()` flags catmull-rom and akima, which can overshoot.
|
|
39
|
+
- **`axisGroups(items)`** (TS) — suggests which series share a value axis: same unit and
|
|
40
|
+
nearby ranges together, distant ranges apart. Returns `yAxisIndex` per series and `axes.y`.
|
|
41
|
+
- **`analyze.ComputeLimitExcursions` (Go)** — the Go counterpart of `computeLimitExcursions`:
|
|
42
|
+
episodes outside `[low, high]` and the time above/below, so screen and PDF report the same
|
|
43
|
+
duration. One shared fixture tests both.
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- **Go rejects unknown and missing fields in options JSON** (server, CLI, `LoadOptions`, PDF) —
|
|
47
|
+
an error with the JSON path and the nearest correct name (`thresholds[0].lnie: unknown field
|
|
48
|
+
(did you mean "line"?)`), and `name`/`data` are required. TypeScript-only theme fields
|
|
49
|
+
(tooltip, minimap) are accepted. Before, a typo was silently ignored. Three test templates
|
|
50
|
+
carried such dead fields; the `thresholds_demo` label positions now actually apply.
|
|
51
|
+
- **Handbook** — demos appear as preview images that open the live demo instead of iframes;
|
|
52
|
+
new sections for the features of 1.13–1.17 and a chapter on the Svelte package.
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- **Several charts on one page wrote the same ids** (`series-pump` five times) — invalid HTML,
|
|
56
|
+
and `getElementById` found the wrong chart. New `idPrefix` option (TS and Go) prefixes every
|
|
57
|
+
id, and `SVGRenderer({ idPrefix })` / `SetIDPrefix` the `<defs>` ids; the Svelte component
|
|
58
|
+
sets one per instance.
|
|
59
|
+
- **Value axes around 1000 labelled several ticks "1.0k"** (a pressure axis 995–1030 hPa) —
|
|
60
|
+
the default format shortens to k/M only when the tick step allows it (k from a step of 100);
|
|
61
|
+
otherwise the number is written out: 1000, 1010, 1030.
|
|
62
|
+
- **The type declarations carried two different `SeriesStyle` interfaces** — go-to-definition
|
|
63
|
+
could land on the internal, flat one. It is now `FlatSeriesStyle` (as in Go); the public
|
|
64
|
+
`SeriesStyle` is unchanged.
|
|
65
|
+
- **Markers of a series with gaps repeated their ids** (TS) — numbered per run, so every gap
|
|
66
|
+
restarted at `-marker-0` and the ids differed from Go's. Now one marker group per series,
|
|
67
|
+
numbered across all runs, as in Go.
|
|
68
|
+
- **A gap/highlight label with `rotate: 'auto'` that fits neither across nor upright is left
|
|
69
|
+
out** (TS and Go) — in a small chart it stuck out over the axes, and `autoMargin` made room
|
|
70
|
+
for it until the plot area was gone.
|
|
71
|
+
- **Go measured range labels at the legend font size** for `rotate: 'auto'` — a 10 px gap label
|
|
72
|
+
near the limit turned in Go but not in TS.
|
|
73
|
+
|
|
22
74
|
## [1.16.0] - 2026-10-07
|
|
23
75
|
|
|
24
76
|
### Added
|
package/README.de.md
CHANGED
|
@@ -158,32 +158,6 @@ Sowohl die TypeScript- als auch die Go-Bibliothek:
|
|
|
158
158
|
|
|
159
159
|
---
|
|
160
160
|
|
|
161
|
-
## 🔭 Ausblick: kleinere SVGs
|
|
162
|
-
|
|
163
|
-
Ein Diagramm trägt mehr Bytes mit sich, als es müsste. Gemessen an allen 41
|
|
164
|
-
Vergleichsdiagrammen (234 KB): **36 % der Ausgabe sind Darstellungsattribute** — `stroke` an
|
|
165
|
-
1282 Elementen, `stroke-width` an 1256, `fill` an 973, jedes an jedem Kind wiederholt.
|
|
166
|
-
|
|
167
|
-
SVG vererbt die meisten davon. Einmal an der `<g>` statt an jedem Kind, und dieselben Bilder
|
|
168
|
-
werden **15,9 % kleiner — 37,2 KB**.
|
|
169
|
-
|
|
170
|
-
Zwei Dinge, die naheliegen und nicht stimmen:
|
|
171
|
-
|
|
172
|
-
- **Es ist keine CSS-Sache.** Kein `<style>`-Block, keine Klassenregeln, kein Präfix. Ein
|
|
173
|
-
`<style>`-Block spräche etwa dieselbe Ersparnis, brächte aber drei Probleme mit: zwei Diagramme
|
|
174
|
-
auf einer Seite gerieten sich über dieselben Regeln in die Quere, unsere Regeln konkurrierten
|
|
175
|
-
mit dem Stilblatt des Aufrufers (heute schlägt jede seiner Regeln ein Darstellungsattribut),
|
|
176
|
-
und erst dadurch bräuchten ids und Klassen einen Namensraum. Reine Vererbung hat nichts davon.
|
|
177
|
-
- **Es sind keine 23 %.** Alles hochzuziehen ergäbe das, änderte aber das Bild: 579
|
|
178
|
-
`<text>`-Elemente stehen in Gruppen mit Linien, und ein `stroke` an der Gruppe gäbe den
|
|
179
|
-
Achsenbeschriftungen eine Kontur — Text ist gefüllt, nicht umrandet. Ein Attribut darf nur
|
|
180
|
-
hoch, wenn jedes Kind ohne dieses Attribut davon wirklich unberührt bleibt. Diese Regel lässt
|
|
181
|
-
15,9 % übrig.
|
|
182
|
-
|
|
183
|
-
Es greift in die Ausgabe jedes Diagramms ein, ist also nichts für eine Patch-Fassung.
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
161
|
## 🐞 Fehler gefunden?
|
|
188
162
|
|
|
189
163
|
Issues liegen unter
|
|
@@ -304,11 +278,13 @@ ein Bildschirm oder ein Drucker auflöst — 0,001 px sind bei 300 dpi drei Taus
|
|
|
304
278
|
Punktes — und es ist der Grund für die kleinen Dateien: ungekürzt brauchte dasselbe Diagramm
|
|
305
279
|
921 KB.
|
|
306
280
|
|
|
307
|
-
##
|
|
281
|
+
## Früher in Überlegung
|
|
308
282
|
|
|
309
|
-
|
|
283
|
+
Offen ist gerade nichts. Drei Punkte von hier sind erledigt und stehen jetzt woanders:
|
|
310
284
|
|
|
311
|
-
|
|
285
|
+
- **Svelte-Wrapper** → [`ml-time-graph-svelte`](https://www.npmjs.com/package/ml-time-graph-svelte),
|
|
286
|
+
dieselbe Fassung wie dieses Paket; Anleitung in Kapitel 7 des
|
|
287
|
+
[Handbuchs](https://mlcgo.eu/books/mlctimegraph/).
|
|
312
288
|
|
|
313
289
|
- **Woher kommen meine Daten?** → `toSeries` / `toDataPoints`, siehe oben beim Quickstart.
|
|
314
290
|
- **„Live"-Darstellung** → `setData()` auf einer bestehenden Instanz, neu zeichnen, fertig.
|
package/README.md
CHANGED
|
@@ -158,31 +158,6 @@ Both the TypeScript and Go libraries:
|
|
|
158
158
|
|
|
159
159
|
---
|
|
160
160
|
|
|
161
|
-
## 🔭 Outlook: smaller SVGs
|
|
162
|
-
|
|
163
|
-
A chart's SVG carries more bytes than it needs to. Measured across all 41 reference charts
|
|
164
|
-
(234 KB): **36 % of the output is presentation attributes** — `stroke` on 1282 elements,
|
|
165
|
-
`stroke-width` on 1256, `fill` on 973, and so on, each one repeated on every child.
|
|
166
|
-
|
|
167
|
-
SVG inherits most of them. Written once on the `<g>` instead of on every child, the same
|
|
168
|
-
pictures come out **15.9 % smaller — 37.2 KB**.
|
|
169
|
-
|
|
170
|
-
Two things that sound right and are not:
|
|
171
|
-
|
|
172
|
-
- **It is not a CSS feature.** No `<style>` block, no class rules, no prefix. A `<style>` block
|
|
173
|
-
would save about as much and bring three problems with it: two charts on one page would fight
|
|
174
|
-
over the same rules, our rules would start competing with the caller's stylesheet (today every
|
|
175
|
-
caller rule wins over a presentation attribute), and only then would ids and classes need
|
|
176
|
-
namespacing. Plain inheritance has none of that.
|
|
177
|
-
- **It is not 23 %.** Lifting everything would be, but it would change the picture: 579 `<text>`
|
|
178
|
-
elements sit in groups with lines, and moving `stroke` up would give axis labels an outline —
|
|
179
|
-
text is filled, not stroked. An attribute may only move up when every child without it is
|
|
180
|
-
genuinely unaffected. That rule is what leaves 15.9 %.
|
|
181
|
-
|
|
182
|
-
It touches the output of every chart, so it is not a patch release.
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
161
|
## 🐞 Found a bug?
|
|
187
162
|
|
|
188
163
|
Issues live at
|
|
@@ -298,11 +273,13 @@ Coordinates are written with three decimals. That is far beyond what any screen
|
|
|
298
273
|
resolves — 0.001 px is three thousandths of a point at 300 dpi — and it is what keeps the
|
|
299
274
|
files small: written in full, that same chart took 921 KB.
|
|
300
275
|
|
|
301
|
-
##
|
|
276
|
+
## Formerly under consideration
|
|
302
277
|
|
|
303
|
-
|
|
278
|
+
Nothing is open right now. Three items that used to sit here are done, and live elsewhere now:
|
|
304
279
|
|
|
305
|
-
|
|
280
|
+
- **Svelte wrapper** → [`ml-time-graph-svelte`](https://www.npmjs.com/package/ml-time-graph-svelte),
|
|
281
|
+
same version as this package; manual in chapter 7 of the
|
|
282
|
+
[handbook](https://mlcgo.eu/books/mlctimegraph/).
|
|
306
283
|
|
|
307
284
|
- **Where does my data come from?** → `toSeries` / `toDataPoints`, see the Quickstart above.
|
|
308
285
|
- **"Live" rendering** → `setData()` on an existing instance, then re-render. No second chart,
|
package/USAGE.md
CHANGED
|
@@ -346,6 +346,33 @@ style: { fill: { regions: [
|
|
|
346
346
|
] } }
|
|
347
347
|
```
|
|
348
348
|
|
|
349
|
+
#### Only where two lines disagree — `where`
|
|
350
|
+
|
|
351
|
+
Two sensors that should read the same — top and bottom of a fridge — are two lines. The
|
|
352
|
+
stretch where they drift apart is the actual message, and `where` marks exactly that:
|
|
353
|
+
|
|
354
|
+
```ts
|
|
355
|
+
{ name: 'Top', data: top, style: { fill: { regions: [{
|
|
356
|
+
from: 'series', to: { series: 'Bottom' },
|
|
357
|
+
where: { exceeds: 2, maxAgeMs: 30 * 60_000 }, // |Bottom − Top| > 2, readings ≤ 30 min old
|
|
358
|
+
fill: { color: '#ef444433', hatch: 'classic-diagonal' },
|
|
359
|
+
}] } } },
|
|
360
|
+
{ name: 'Bottom', data: bottom, style: { line: { shape: 'step' } } }, // reports on change only
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
- **Strictly greater:** exactly `exceeds` apart counts as agreeing.
|
|
364
|
+
- `side: 'above'` / `'below'` — only where `to` lies more than `exceeds` above / below
|
|
365
|
+
`from`; default `'both'`.
|
|
366
|
+
- `maxAgeMs` — where one side's last reading is older, there is no statement and no area
|
|
367
|
+
(as `holdAlign` does). A gap ends the area.
|
|
368
|
+
- **Decided on the readings, drawn on the lines.** The windows are found on the readings
|
|
369
|
+
joined by straight lines — a step holds its value and jumps at the timestamp, the same
|
|
370
|
+
basis as `divergenceExcursions`. The area itself is the usual one between the *drawn*
|
|
371
|
+
curves, clipped to those windows with vertical edges. A sensor that reports on change
|
|
372
|
+
should therefore be drawn as a step: then line and decision agree exactly.
|
|
373
|
+
- Smoothed lines work. `monotone` stays within the readings, so the edges sit on the line;
|
|
374
|
+
`catmull-rom` and `akima` can overshoot, and `warnings()` says so.
|
|
375
|
+
|
|
349
376
|
## Legend
|
|
350
377
|
|
|
351
378
|
```ts
|
|
@@ -462,6 +489,26 @@ and it is the default: a filled area down to the baseline would otherwise swallo
|
|
|
462
489
|
Set `grid: { ..., layer: 'back' }` when you want exactly that — the grid behind the data, covered
|
|
463
490
|
by an opaque fill. Markers, annotations and labels come after the grid in both cases.
|
|
464
491
|
|
|
492
|
+
### Which series share an axis — `axisGroups`
|
|
493
|
+
|
|
494
|
+
Grouping by unit alone is wrong for multi-channel devices: −75 °C, 5 °C and 23 °C on one
|
|
495
|
+
80 K scale flatten the two warmer curves into lines. One axis per series is the opposite
|
|
496
|
+
mistake: three fridges at 2–8 °C on three scales. `axisGroups` suggests the middle — same
|
|
497
|
+
unit **and** nearby ranges share an axis; a gap larger than the larger range gets its own:
|
|
498
|
+
|
|
499
|
+
```ts
|
|
500
|
+
import { axisGroups } from 'ml-time-graph';
|
|
501
|
+
|
|
502
|
+
const { indices, axes } = axisGroups(probes.map((p) => ({ unit: p.unit, data: p.data })));
|
|
503
|
+
new MLTimeGraph({
|
|
504
|
+
series: probes.map((p, i) => ({ name: p.name, data: p.data, yAxisIndex: indices[i] })),
|
|
505
|
+
axes: { y: axes }, // [{ position: 'left', label: '°C' }, { position: 'right', … }]
|
|
506
|
+
});
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
A pure function — nothing is applied for you, and the input order is kept so axes do not jump
|
|
510
|
+
when a series is added. Pass `min`/`max` instead of `data` when you know them.
|
|
511
|
+
|
|
465
512
|
### Room at the edge — `padding`
|
|
466
513
|
|
|
467
514
|
The computed domain ends exactly at the smallest and largest reading, and the plot
|
|
@@ -761,6 +808,38 @@ band. And a gap band's default fill is white at 15% opacity, which is
|
|
|
761
808
|
invisible on a white chart; `style: 'dashed_border'` draws the edges you can
|
|
762
809
|
actually see, or give the region its own `fill`.
|
|
763
810
|
|
|
811
|
+
### A device that went quiet — `gaps.atEnd`
|
|
812
|
+
|
|
813
|
+
A line that simply ends says nothing; in monitoring, a sensor that stopped reporting is the
|
|
814
|
+
most important news on the screen. `gaps.atEnd` marks it: when a series' last reading lies
|
|
815
|
+
more than `afterMs` before *now*, a hatched region runs from that reading to now.
|
|
816
|
+
|
|
817
|
+
```ts
|
|
818
|
+
gaps: {
|
|
819
|
+
atEnd: {
|
|
820
|
+
afterMs: 30 * 60_000, // the device's "no data" threshold
|
|
821
|
+
label: 'keine Daten seit {since} ({duration})', // -> "keine Daten seit 14:32 (38 min)"
|
|
822
|
+
// now: Date.now(), // default: end of the time axis
|
|
823
|
+
},
|
|
824
|
+
},
|
|
825
|
+
series: [
|
|
826
|
+
{ name: 'Fridge', data },
|
|
827
|
+
{ name: 'Door', data: door, gaps: { atEnd: false } }, // reports on change only
|
|
828
|
+
{ name: 'Freezer', data: freezer, gaps: { atEnd: { afterMs: 3_600_000 } } }, // own threshold
|
|
829
|
+
]
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
- **Now** is passed in or is the end of the time axis — the library reads no clock, so
|
|
833
|
+
screen, PDF and tests agree.
|
|
834
|
+
- **Strictly greater:** exactly `afterMs` old is not an outage yet. A series with no reading
|
|
835
|
+
in the window gets no region; series that went quiet at the same moment share one.
|
|
836
|
+
- **Text:** none unless you give one. `{since}` is the time in the chart's format (`locale`,
|
|
837
|
+
`timeZone`), with the date when it was another day than now; `{duration}` is
|
|
838
|
+
language-neutral (`45 min`, `3 h 12 min`, `2 d 4 h`). In TypeScript `label` can also be
|
|
839
|
+
`(sinceMs, durationMs) => string`; JSON (Go) takes the placeholder string.
|
|
840
|
+
- **Look:** hatched with dashed edges, the label turns when it does not fit. `atEnd.style`
|
|
841
|
+
changes it; the chart-wide `gaps.style` does not apply here (its `band` does).
|
|
842
|
+
|
|
764
843
|
## Statistic overlays
|
|
765
844
|
|
|
766
845
|
Computed at render time from the series' raw data; each overlay has its own
|
|
@@ -1003,6 +1082,26 @@ interaction in your app, or pull the optional `Zoom` / `Minimap` helpers from th
|
|
|
1003
1082
|
[`ml-time-graph/interaction`](#package-exports) subpath. See the demo gallery's
|
|
1004
1083
|
"Fridge" (range slider) and "Interaction" pages.
|
|
1005
1084
|
|
|
1085
|
+
### In Svelte — `ml-time-graph-svelte`
|
|
1086
|
+
|
|
1087
|
+
Everything in this section — width from the container, `autoMargin`, a tooltip over
|
|
1088
|
+
`pointsAt`, `zeigerImSvg`, a clickable legend, dark mode through `theme`, print, export —
|
|
1089
|
+
comes ready-made as a Svelte 5 component:
|
|
1090
|
+
|
|
1091
|
+
```svelte
|
|
1092
|
+
<script lang="ts">
|
|
1093
|
+
import { TimeGraph, Legend } from "ml-time-graph-svelte";
|
|
1094
|
+
let hidden = $state(new Set<string>());
|
|
1095
|
+
let legend = $state([]);
|
|
1096
|
+
</script>
|
|
1097
|
+
|
|
1098
|
+
<Legend items={legend} bind:hidden />
|
|
1099
|
+
<TimeGraph {options} height={260} zoomable bind:hidden bind:legend />
|
|
1100
|
+
```
|
|
1101
|
+
|
|
1102
|
+
`options` are exactly the options described here. The component's README is its manual;
|
|
1103
|
+
the demo pages `svelte.html` and `svelte_dashboard.html` show every feature with source.
|
|
1104
|
+
|
|
1006
1105
|
## Server-side rendering (Node)
|
|
1007
1106
|
|
|
1008
1107
|
`SVGRenderer` needs no DOM, so the same code runs in Node — set explicit
|
|
@@ -1127,6 +1226,20 @@ build `.series--${slugify(name)}` from a name you hold.
|
|
|
1127
1226
|
Reach for the `id` when there is one chart in the document, or when you have scoped the
|
|
1128
1227
|
lookup yourself (`container.querySelector('#…')` rather than `document.getElementById`).
|
|
1129
1228
|
|
|
1229
|
+
**`idPrefix` removes the collision.** Give each chart on a page its own prefix, and pass the
|
|
1230
|
+
same one to the renderer so the `<defs>` (clip paths, hatch patterns, shadows) are covered
|
|
1231
|
+
too:
|
|
1232
|
+
|
|
1233
|
+
```ts
|
|
1234
|
+
const chart = new MLTimeGraph({ ...options, idPrefix: 'fridge-2' });
|
|
1235
|
+
const svg = new SVGRenderer({ idPrefix: 'fridge-2' }).render(chart.renderCommands()).content;
|
|
1236
|
+
// → id="fridge-2-series-temperature", id="fridge-2-clip-plot-…"; classes unchanged
|
|
1237
|
+
```
|
|
1238
|
+
|
|
1239
|
+
The prefix is stable as long as you pass the same one — do not generate it per render. The
|
|
1240
|
+
Go port takes the same `idPrefix` in its JSON options (server and CLI apply it to the defs
|
|
1241
|
+
as well). `ml-time-graph-svelte` gives every `<TimeGraph>` its own prefix automatically.
|
|
1242
|
+
|
|
1130
1243
|
### Provenance
|
|
1131
1244
|
|
|
1132
1245
|
Every SVG names the library and version that drew it, as the first child of the root:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { M as MLTimeGraphOptions, L as LegendItem, R as Renderer, a as LayoutResult, b as Margin,
|
|
2
|
-
export { h as AxisLabelsStyle, i as AxisStyle, G as GridLineStyle, j as GridStyle, T as TextMetrics, k as Theme, l as TickConfig, m as drawMarker, n as estimateMetrics, o as getDefaultTheme, p as liberationMetrics, r as resetDefaultTheme, s as setDefaultTheme, q as slugify } from './marker_renderer-
|
|
3
|
-
import { e as AnySeries, i as Annotation, a as DrawCommand, T as TimeScale, L as LinearScale, 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 './
|
|
4
|
-
export { v as AggregatedShowAs, w as AggregationConfig, x as AggregationMode, y as AnnotationKind, z as AxisOrientation, A as AxisPosition, B as DataPointRef, E as EnumMap, C as FillBound, I as FillRegion, J as FillSide, K as FillStyle, N as
|
|
1
|
+
import { M as MLTimeGraphOptions, L as LegendItem, R as Renderer, a as LayoutResult, 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-BsiVseet.js';
|
|
2
|
+
export { h as AxisLabelsStyle, i as AxisStyle, G as GridLineStyle, j as GridStyle, T as TextMetrics, k as Theme, l as TickConfig, m as drawMarker, n as estimateMetrics, o as getDefaultTheme, p as liberationMetrics, r as resetDefaultTheme, s as setDefaultTheme, q as slugify } from './marker_renderer-BsiVseet.js';
|
|
3
|
+
import { e as AnySeries, i as Annotation, a as DrawCommand, T as TimeScale, L as LinearScale, 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-DdltSMkw.js';
|
|
4
|
+
export { v as AggregatedShowAs, w as AggregationConfig, x as AggregationMode, y as AnnotationKind, z as AxisOrientation, A as AxisPosition, B as DataPointRef, E as EnumMap, C as FillBound, I as FillRegion, J as FillSide, K as FillStyle, N as FillWhere, O as GapConfig, Q as GapLabel, U as GapRegion, V as GapStyle, W as GapsAtEnd, G as GridLayer, X as LineShape, Y as LineStyle, Z as MarkerStyle, _ as MovingAverageType, $ as SVGLineStyle, a0 as SensorType, a1 as SeriesGaps, a2 as SeriesOverlay, a3 as SeriesOverlayKind, a4 as SeriesType, a5 as ShadowStyle, a6 as SolidDashStyle, a7 as ThresholdLabelConfig, a8 as getLineStyle, a9 as resolveDash } from './types-DdltSMkw.js';
|
|
5
5
|
|
|
6
6
|
/*!
|
|
7
7
|
* MLTimeGraph — Copyright (c) 2026 Michael Lechner
|
|
@@ -95,6 +95,7 @@ interface PointsAtOptions {
|
|
|
95
95
|
|
|
96
96
|
declare class MLTimeGraph {
|
|
97
97
|
private readonly _layout;
|
|
98
|
+
private readonly _idPraefix?;
|
|
98
99
|
private readonly _renderer?;
|
|
99
100
|
private readonly _locale?;
|
|
100
101
|
private readonly _timeZone?;
|
|
@@ -119,6 +120,7 @@ declare class MLTimeGraph {
|
|
|
119
120
|
private readonly _gapsBand?;
|
|
120
121
|
private readonly _gapsAutoDetect;
|
|
121
122
|
private readonly _gapsMinGapMs;
|
|
123
|
+
private readonly _gapsAtEnd?;
|
|
122
124
|
private _annotations;
|
|
123
125
|
private readonly _annotationBands;
|
|
124
126
|
private readonly _disabledAnnotations;
|
|
@@ -229,6 +231,14 @@ declare class MLTimeGraph {
|
|
|
229
231
|
* when they have none) -- `hidden` and `pointsAt` cannot tell them apart.
|
|
230
232
|
*/
|
|
231
233
|
warnings(): string[];
|
|
234
|
+
/**
|
|
235
|
+
* `where` an einer Flaeche entscheidet an den Messwerten. Ist eine der
|
|
236
|
+
* beiden Kurven mit catmull-rom oder akima geglaettet, kann sie ueber die
|
|
237
|
+
* Messwerte hinausschwingen -- dann trifft die Flaeche die Linie am Rand des
|
|
238
|
+
* Fensters nicht genau. 'monotone' schwingt nicht ueber. Gegenstueck:
|
|
239
|
+
* ueberschwinger in go-time-graph/pkg/chart/warnings.go.
|
|
240
|
+
*/
|
|
241
|
+
private _ueberschwinger;
|
|
232
242
|
/**
|
|
233
243
|
* The points under the pointer at (x, y), in SVG pixels -- for a tooltip
|
|
234
244
|
* that gets data instead of HTML. Valid after `renderCommands()`, like
|
|
@@ -278,6 +288,42 @@ interface AutoMarginOptions {
|
|
|
278
288
|
*/
|
|
279
289
|
declare function autoMargin(options: MLTimeGraphOptions, opts?: AutoMarginOptions): Margin;
|
|
280
290
|
|
|
291
|
+
/*!
|
|
292
|
+
* MLTimeGraph — Copyright (c) 2026 Michael Lechner
|
|
293
|
+
* MIT with Attribution: free use incl. commercial requires visible credit to
|
|
294
|
+
* "Michael Lechner". Commercial license (no attribution) on request. See LICENSE.
|
|
295
|
+
*/
|
|
296
|
+
|
|
297
|
+
/** One series as far as the axis assignment cares. Give `min`/`max`, or `data`. */
|
|
298
|
+
interface AxisGroupInput {
|
|
299
|
+
/** The unit -- series with different units never share an axis. */
|
|
300
|
+
unit: string;
|
|
301
|
+
min?: number;
|
|
302
|
+
max?: number;
|
|
303
|
+
/** Instead of min/max: the readings (nulls are skipped). */
|
|
304
|
+
data?: ReadonlyArray<{
|
|
305
|
+
value?: number | null;
|
|
306
|
+
}>;
|
|
307
|
+
}
|
|
308
|
+
interface AxisGroups {
|
|
309
|
+
/** Per input, in input order: its axis (0 = first axis) -- use as `yAxisIndex`. */
|
|
310
|
+
indices: number[];
|
|
311
|
+
/** One entry per axis, for `axes.y`: the unit as label, first left, the others right. */
|
|
312
|
+
axes: YAxisConfig[];
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Suggest which series share a value axis: same unit AND nearby ranges -- a
|
|
316
|
+
* gap larger than the larger range gets its own axis. Input order is kept, so
|
|
317
|
+
* axes do not jump when a series is added; a series without values joins the
|
|
318
|
+
* first axis of its unit. A pure function: nothing is applied to a chart.
|
|
319
|
+
*
|
|
320
|
+
* ```ts
|
|
321
|
+
* const { indices, axes } = axisGroups(series.map((s) => ({ unit: s.unit, data: s.data })));
|
|
322
|
+
* new MLTimeGraph({ series: series.map((s, i) => ({ ...s, yAxisIndex: indices[i] })), axes: { y: axes } });
|
|
323
|
+
* ```
|
|
324
|
+
*/
|
|
325
|
+
declare function axisGroups(items: ReadonlyArray<AxisGroupInput>): AxisGroups;
|
|
326
|
+
|
|
281
327
|
/*!
|
|
282
328
|
* MLTimeGraph — Copyright (c) 2026 Michael Lechner
|
|
283
329
|
* MIT with Attribution: free use incl. commercial requires visible credit to
|
|
@@ -835,6 +881,13 @@ declare class SVGRenderer extends Renderer {
|
|
|
835
881
|
height?: number | string;
|
|
836
882
|
/** Optional solid background colour, drawn as a full-size rect (e.g. "white"). */
|
|
837
883
|
background?: string;
|
|
884
|
+
/**
|
|
885
|
+
* Prefix for the ids this renderer writes into `<defs>` (clip paths, hatch
|
|
886
|
+
* patterns, shadows). Pass the chart's `idPrefix` so two charts on one page
|
|
887
|
+
* share no id at all. Identical charts would otherwise both write
|
|
888
|
+
* `clip-plot-<hash>`.
|
|
889
|
+
*/
|
|
890
|
+
idPrefix?: string;
|
|
838
891
|
});
|
|
839
892
|
/** Set a solid background colour, drawn as a full-size rect behind the chart. */
|
|
840
893
|
setBackgroundColor(color: string): void;
|
|
@@ -1092,6 +1145,6 @@ declare function mergeOptions(...layers: (OptionsLayer | undefined)[]): MLTimeGr
|
|
|
1092
1145
|
* Monate spaeter eine Datei aus einem Stapel von Berichten in der Hand haelt,
|
|
1093
1146
|
* kann sonst nicht feststellen, welcher Stand sie gezeichnet hat.
|
|
1094
1147
|
*/
|
|
1095
|
-
declare const VERSION = "1.
|
|
1148
|
+
declare const VERSION = "1.17.0";
|
|
1096
1149
|
|
|
1097
|
-
export { AggregatedPoint, AggregatedSeries, Annotation, AnnotationBandBuilder, AnnotationBandConfig, AnnotationBandItem, AnnotationBandItemBuilder, AnnotationBuilder, AnnotationPointShape, AnySeries, type AutoMarginOptions, AxesConfig, DataPoint, DrawCommand, type FieldAccessor, type FillBetweenThresholdsInput, FillSpec, Gap, GapsConfig, GraphBuilder, HatchVariant, Highlight, HighlightBuilder, LabelAnchor, LegendItem, LegendOptions, LegendOrientation, LegendPosition, type LimitStatsPoint, LineDashStyle, LineVariant, MLTimeGraph, MLTimeGraphOptions, Margin, Marker, MarkerBuilder, MarkerLineStyle, type MktPoint, type OptionsLayer, type PointAt, PointStyleType, type PointsAtOptions, RangeLabelPosition, SVGRenderer, SeriesStyle, SmoothingType, type StatsAggregatedPoint, type StdDevPoint, TextBaseline, Threshold, ThresholdBuilder, ThresholdFill, ThresholdLabelPosition, type TimeInput, TimeSeries, TimeSeriesBuilder, type ToDataPointsSpec, type TooltipOptions, type TooltipSample, VERSION, XAxisConfig, YAxisConfig, attachTooltip, autoMargin, fillBetweenThresholds, mergeOptions, mount, parseAggregated, parseDataPoint, parseSeries, toDataPoints, toSeries, zeigerImSvg };
|
|
1150
|
+
export { AggregatedPoint, AggregatedSeries, Annotation, AnnotationBandBuilder, AnnotationBandConfig, AnnotationBandItem, AnnotationBandItemBuilder, AnnotationBuilder, AnnotationPointShape, AnySeries, type AutoMarginOptions, AxesConfig, type AxisGroupInput, type AxisGroups, DataPoint, DrawCommand, type FieldAccessor, type FillBetweenThresholdsInput, FillSpec, Gap, GapsConfig, GraphBuilder, HatchVariant, Highlight, HighlightBuilder, LabelAnchor, LegendItem, LegendOptions, LegendOrientation, LegendPosition, type LimitStatsPoint, LineDashStyle, LineVariant, MLTimeGraph, MLTimeGraphOptions, Margin, Marker, MarkerBuilder, MarkerLineStyle, type MktPoint, type OptionsLayer, type PointAt, PointStyleType, type PointsAtOptions, RangeLabelPosition, SVGRenderer, SeriesStyle, SmoothingType, type StatsAggregatedPoint, type StdDevPoint, TextBaseline, Threshold, ThresholdBuilder, ThresholdFill, ThresholdLabelPosition, type TimeInput, TimeSeries, TimeSeriesBuilder, type ToDataPointsSpec, type TooltipOptions, type TooltipSample, VERSION, XAxisConfig, YAxisConfig, attachTooltip, autoMargin, axisGroups, fillBetweenThresholds, mergeOptions, mount, parseAggregated, parseDataPoint, parseSeries, toDataPoints, toSeries, zeigerImSvg };
|