ml-time-graph 1.22.0 → 1.23.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,29 @@ release notes, and every change is in `git log` in full.
19
19
 
20
20
  ---
21
21
 
22
+ ## [1.23.0] - 2026-11-02
23
+
24
+ ### Added
25
+ - **`minItemWidth` on annotation bands** (TS and Go) — short events in long windows stay visible; a
26
+ narrower item widens around its centre.
27
+
28
+ ### Changed
29
+ - **The `gap` draw command** now draws its `label` with any style except `"empty"`. Affects only
30
+ hand-written command lists; charts do not produce this command.
31
+
32
+ ### Fixed
33
+ - **A series line with `width: 0` or style `"none"` is no longer drawn** (TS and Go); markers stay. It
34
+ used to come out at 1 px between the points. In TS, `"none"` works from JSON; the type offers
35
+ `line: false`.
36
+ - **`showInLegend: true` on an annotation band now lists it in the legend** (TS and Go). The field did
37
+ nothing before. The default is now documented as `false`, so existing charts do not change. Such a
38
+ band also appears in `legendItems()`, without a `seriesId`.
39
+
40
+ ### Removed
41
+ - **Gap style `"label"`** (TS and Go), deprecated since 1.17.1. Use `"empty"` with a `label`: it draws
42
+ the same. TypeScript no longer accepts the value; JSON that still has it keeps drawing as before,
43
+ and `warnings()` reports it.
44
+
22
45
  ## [1.22.0] - 2026-10-22
23
46
 
24
47
  ### Security
@@ -218,7 +218,7 @@ Applies to both series kinds and to overlay curves.
218
218
  | Field | Type | Description |
219
219
  |-------|------|-------------|
220
220
  | `id` | `string` | Stable style identifier |
221
- | `line` | `LineStyle \| LineStyle[] \| false` | Single style, per-segment array, or `false` (no line) |
221
+ | `line` | `LineStyle \| LineStyle[] \| false` | Single style, per-segment array, or `false` (no line). `width: 0` or `style: 'none'` on a `LineStyle` also draws no line (`'none'` from JSON; the TS type has `false` for it) |
222
222
  | `fill` | `FillSpec` | Area fill below/above the curve (section 5.1) |
223
223
  | `markers` | `MarkerStyle` | Per-point marker glyphs (distinct from reference markers, section 10) |
224
224
  | `shadow` | `ShadowStyle` | Soft shadow behind the line |
@@ -431,7 +431,7 @@ Two equivalent forms; prefer `GapsConfig`.
431
431
  | `fillOpacity` | `number` | Background opacity |
432
432
  | `labelBaseline` | `'above' \| 'middle' \| 'below'` | Vertical label alignment — **note the value set differs from `AnnotationBandItem.labelBaseline`** |
433
433
  | `rotate` | `number` | Label rotation |
434
- | `style` | `'dashed_border' \| 'empty' \| 'label'` | Rendering mode. `'label'` is **deprecated** and will be removed before 2.0 — use `'empty'` with `label`. |
434
+ | `style` | `'dashed_border' \| 'empty' \| 'filled'` | Rendering mode. `'label'` was removed — use `'empty'` with `label`; JSON that still has it draws like `'empty'` and `warnings()` reports it. |
435
435
 
436
436
  ### 10b. Preferred config form (`gaps: GapsConfig`)
437
437
 
@@ -479,7 +479,8 @@ Bands rendered in a dedicated strip *outside* the plot area, useful for shift/ph
479
479
  | `height` | `number` | `12` | Strip height in px |
480
480
  | `spacing` | `number` | `0` | Extra spacing below the strip, px |
481
481
  | `showAxis` | `boolean` | `false` | Draw a dedicated axis with band tick labels |
482
- | `showInLegend` | `boolean` | `true` | Include in the legend |
482
+ | `showInLegend` | `boolean` | `false` | List in the legend, with the colour of its first item; the legend itself still needs `legend.show` |
483
+ | `minItemWidth` | `number` | `1` | Smallest item width in px; a narrower item widens around its centre and claims no duration |
483
484
  | `background` | `string` | transparent | Strip background color |
484
485
  | `items` | `AnnotationBandItem[]` | **required** | Individual windows inside the strip |
485
486
  | `labels` | `'all' \| 'fit' \| { mode, keep? }` | `'all'` | `'fit'`: draw only the item labels that fit side by side (see below) |
@@ -556,7 +557,7 @@ covered — the label moves past its tick labels. Axis titles on that side keep
556
557
 
557
558
  **GapStyle.display** (4): `empty`, `dashed_border`, `filled`, `bridge_line`
558
559
 
559
- **DrawGapType_t** (3) — legacy `Gap.style`: `dashed_border`, `empty`, `label` (deprecated, removed before 2.0)
560
+ **DrawGapType_t** (3) — legacy `Gap.style`: `dashed_border`, `empty`, `filled`
560
561
 
561
562
  **FillSide:** `above`, `below`
562
563
 
package/USAGE.md CHANGED
@@ -100,7 +100,7 @@ See `demos/adapters.html` — the same chart from four input shapes.
100
100
 
101
101
  Visual styling lives in a nested `style` block — `line`, `fill`, `markers`, `shadow`,
102
102
  `gap`. Any combination is allowed: set `line` for a line, add `fill` for an area
103
- underneath, add `markers` for points, set `style.line: false` for points only.
103
+ underneath, add `markers` for points, set `style.line: false` (or `width: 0`) for points only.
104
104
 
105
105
  ```ts
106
106
  // Raw line
@@ -403,6 +403,10 @@ interface LegendItem {
403
403
  }
404
404
  ```
405
405
 
406
+ An annotation band with `showInLegend: true` is listed after the series. Its `id` starts with
407
+ `band-`, it has no `seriesId`, and no series group belongs to it, so a click handler that hides
408
+ series has to skip it.
409
+
406
410
  Draw the swatch through the same renderer the chart uses, so it cannot drift from the
407
411
  curve it names — a 22×10 line with the series' dashes and, if there is one, its marker:
408
412
 
@@ -1101,8 +1105,8 @@ look different from what you meant. Same texts in Go (`Warnings()`):
1101
1105
  - `side` on a fill region that is not "line against a fixed bound", and `outer` without `side`
1102
1106
  — both are ignored there;
1103
1107
  - `where` on a smoothing that can overshoot (`catmull-rom`, `akima`);
1104
- - deprecated settings (`style: "label"` on a gap, `series.style.gap.label`, `series.sensorType`
1105
- other than `"numeric"`).
1108
+ - removed or deprecated settings (`style: "label"` on a gap, `series.style.gap.label`,
1109
+ `series.sensorType` other than `"numeric"`).
1106
1110
 
1107
1111
  Call it while you author a chart, or log it once; it costs a pass over the options.
1108
1112
 
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-tiiLQTL8.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-Be-IsY5V.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-tiiLQTL8.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-Bo9798aK.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-Be-IsY5V.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-fDUNEN4P.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 SeriesOverlay, a6 as SeriesOverlayKind, a7 as SeriesType, a8 as ShadowStyle, a9 as SolidDashStyle, aa as ThresholdLabelConfig, ab as getLineStyle, ac as resolveDash } from './types-Bo9798aK.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 SeriesOverlay, a6 as SeriesOverlayKind, a7 as SeriesType, a8 as ShadowStyle, a9 as SolidDashStyle, aa as ThresholdLabelConfig, ab as getLineStyle, ac as resolveDash } from './types-fDUNEN4P.js';
7
7
 
8
8
  /*!
9
9
  * MLTimeGraph — Copyright (c) 2026 Michael Lechner
@@ -208,6 +208,12 @@ declare class MLTimeGraph {
208
208
  private _reihenKontext;
209
209
  legendItems(): LegendItem[];
210
210
  private _legendeneintraege;
211
+ /**
212
+ * Die Baender mit ausdruecklichem `showInLegend`. Getrennt von `_legendItems`, denn
213
+ * pointsAt greift dort je Reihe ueber den Index zu.
214
+ * Gegenstueck: bandLegendenEintraege in go-time-graph/pkg/chart/legende.go.
215
+ */
216
+ private _bandLegendItems;
211
217
  /**
212
218
  * Die Farbe einer Reihe ohne eigene Angabe.
213
219
  *
@@ -850,8 +856,10 @@ declare class AnnotationBandBuilder {
850
856
  setHatch(hatch: HatchVariant): this;
851
857
  /** Sets whether to draw a time axis under the band. */
852
858
  setShowAxis(show: boolean): this;
853
- /** Sets whether the band is listed in the chart legend. */
859
+ /** Sets whether the band is listed in the chart legend (default false). */
854
860
  setShowInLegend(show: boolean): this;
861
+ /** Sets the smallest width in pixels an item is drawn with; narrower ones widen around their centre. */
862
+ setMinItemWidth(px: number): this;
855
863
  /**
856
864
  * Sets which item labels are drawn: `"all"` (default) or `"fit"` — only those that fit
857
865
  * side by side; `keep` picks the label that is always drawn.
@@ -1167,7 +1175,7 @@ declare function mergeOptions(...layers: (OptionsLayer | undefined)[]): MLTimeGr
1167
1175
  * Monate spaeter eine Datei aus einem Stapel von Berichten in der Hand haelt,
1168
1176
  * kann sonst nicht feststellen, welcher Stand sie gezeichnet hat.
1169
1177
  */
1170
- declare const VERSION = "1.22.0";
1178
+ declare const VERSION = "1.23.0";
1171
1179
 
1172
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 };
1173
1181
  export type { AutoMarginOptions, AxisGroupInput, AxisGroups, FieldAccessor, FillBetweenThresholdsInput, LimitStatsPoint, MktPoint, OptionsLayer, PointAt, PointsAtOptions, StatsAggregatedPoint, StdDevPoint, TimeInput, ToDataPointsSpec, TooltipOptions, TooltipSample };