ml-time-graph 1.12.0 → 1.13.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,67 @@ release notes, and every change is in `git log` in full.
19
19
 
20
20
  ---
21
21
 
22
+ ## [1.13.0] - 2026-10-07
23
+
24
+ ### Added
25
+ - **`holdAlign` — probes that do not report at the same time.** `divergenceExcursions` and
26
+ `spatialDelta` match readings by their exact timestamp; a probe that reports only on change and
27
+ one that reports every minute almost never share one, so a real divergence went unseen.
28
+ `holdAlign(sensors, maxAgeMs)` lays every probe onto the union of all timestamps and carries its
29
+ last reading forward for at most `maxAgeMs` — after that the probe has no value, because a silent
30
+ probe is not one that agrees. A gap marker ends the hold at once; `maxAgeMs <= 0` keeps exact
31
+ matching. In `ml-time-analyze` and as `analyze.HoldAlign` in Go.
32
+ - **Go: `analyze.SpatialDelta` and `analyze.DivergenceExcursions`** — the Go port had none of the
33
+ spatial analysis. Same decisions as TypeScript: the limit is strictly greater, a timestamp with
34
+ fewer than two readings ends an episode, `endTime` is the last reading over the limit, a
35
+ one-reading episode lasts 0 ms and passes `minDurationMs: 0`, and the probes named are those at
36
+ the peak. On a tie the FIRST probe of the input wins in both ports.
37
+ - **A shared fixture for analysis results.** `go-time-graph/test_data/analyze/divergence.json` is
38
+ read by the Go and the TypeScript tests alike (in its own directory: every `*.json` directly
39
+ under `test_data/` is taken for a chart template), with expectations worked out by hand. Until now
40
+ only the renderer had parity templates — a difference between the two divergence detectors would
41
+ have passed every existing check.
42
+ - **Fill regions between two smoothed series follow both lines exactly** — each edge is its
43
+ series' own curve (own runs, own smoothing type), clipped to where both have values. New
44
+ draw-command field `smoothTailType`. Go: `FillSpecRenderContext.FremdeReihe`; `FremdeSerie` is
45
+ deprecated.
46
+
47
+ - **`grid: true` / `grid: false`** on an axis — short for `{ major: {} }` / `{ major: false }`.
48
+
49
+ ### Changed
50
+ - **SVG about a quarter smaller.** Grid, axes and series markers write their shared styles once,
51
+ on a group (axes: lines first, then labels). The image is pixel-identical. Draw commands keep
52
+ every attribute; markers now come in a `series-markers` group, and groups carry the marker
53
+ `sharedStyles`. PDF output is byte-identical.
54
+
55
+ ### Fixed
56
+ - **`smoothingType` had no effect on min/max/avg series (TypeScript only).** A chart asking for
57
+ `monotone` or `akima` on an aggregated series got Catmull-Rom, while the Go port drew the curve
58
+ asked for. Also affected `LineSeries` and `renderSplitLine` via `ml-time-graph/internals`.
59
+ - **`fillToMax` / `fillToMin` did not follow smoothed min/max/avg lines.** The fill had straight
60
+ edges and stuck out past the curves between data points. New draw-command field `smoothTail`;
61
+ custom renderers in Go use `renderer.SmoothPathFor(pts, cmd)`.
62
+ - **Go could not read `grid.major: false`** — the whole chart failed to load.
63
+ - **`major: false` alone switched the grid on** for the other direction (TypeScript). Now the grid
64
+ is on only when some axis switches it on.
65
+ - **Array-form `style.line` (TypeScript only):** fill smoothing, `gapThreshold` and legend colour
66
+ now come from the first entry, as in Go. Before, the fill stayed straight under a smoothed line.
67
+
68
+ ### Removed
69
+ - **`ZonedLineSeries`, `Zone`, `ZonedFill`, `ZonedLineConfig` (via `ml-time-graph/internals`).** A
70
+ second, older implementation of the zone colouring the chart already does for
71
+ `colorByThresholds`. Set `colorByThresholds` on the series instead.
72
+
73
+
74
+ ## [1.12.1] - 2026-10-06
75
+
76
+ ### Fixed
77
+ - **`SKILLS.md` still called the built-in legend non-interactive.** The entry under *Traps* told
78
+ you that toggling a series meant `legend.position: 'separate'` and drawing the legend yourself —
79
+ true until 1.12.0, and wrong in the very release that changed it. The file ships inside the
80
+ package and is the first thing a coding assistant reads, so a stale trap there points every
81
+ reader at a detour that no longer exists. No code changed.
82
+
22
83
  ## [1.12.0] - 2026-10-06
23
84
 
24
85
  ### Added
package/SKILLS.md CHANGED
@@ -270,6 +270,11 @@ travel in JSON, so the server cannot run yours. Same chart, two renderers, two l
270
270
  the browser is the only renderer; use a generated table when both have to agree. `estimateMetrics`
271
271
  (exported) reproduces the layout of versions before 1.10.0.
272
272
 
273
+ ### Grid
274
+ `axes: { x: { grid: true } }` — a grid in both directions; one axis is enough. `grid: false` on
275
+ the other axis leaves that direction out; a `false` alone switches nothing on. `true` is short for
276
+ `{ major: {} }`; use the object form for colour, minor lines or `layer`.
277
+
273
278
  ### Minor Ticks & Grid
274
279
  ```ts
275
280
  axes: {
@@ -521,8 +526,12 @@ scratch image.
521
526
  - **`resolveDash()` vs `getLineStyle()`:** `dashed` and `dotted` predate the scalable dash table and keep fixed SVG patterns (`"4,4"` and `"2,4"`) in the renderer for backwards compatibility. `getLineStyle()` returns the scalable table (`"6, 4"` for width 2). Anyone rendering custom legend swatches must call `resolveDash(variant, width)` so the swatch matches what is actually drawn.
522
527
  - **Markers do not inherit `line.width`:** `style.markers` carries its own pen — `strokeWidth`, `stroke`, `fill`. That is usually what you want (a 10 px line with 10 px marker outlines is a blob), but it means a marker stays hairline-thin when the line gets thick, and nothing tells you. Set `markers.strokeWidth` explicitly whenever `line.width` leaves the default.
523
528
  - **Marker suppression at threshold:** `style.markers.threshold` (and default `theme.pointThreshold = 100`) hides point markers when series sample count exceeds it to prevent visual crowding. Crucially, `chart.legendItems()` also omits the `marker` property when points are suppressed, because a symbol in the legend missing from the curve states something untrue.
524
- - **Built-in legend is static SVG:** Built-in legends (`inside-right`, `above`, `below`, …) are
525
- non-interactive SVG elements. For interactive series toggling or HTML layout below the chart, use `legend: { position: 'separate' }` and render HTML buttons from `chart.legendItems()` using `drawMarker()` and `SVGRenderer` or `resolveDash()`.
529
+ - **A built-in legend carries no behaviour, but it is reachable.** Until 1.12.0 this entry said a
530
+ built-in legend was "non-interactive" and that toggling meant `position: 'separate'` and drawing
531
+ it yourself. That is no longer true: every entry is its own group with the same stable key as its
532
+ series (`#legend-<id>` → `#series-<id>`), and `legend.itemClass` adds your own hook. The library
533
+ still ships no click handler — you write one, and one on the chart is enough. `'separate'` remains
534
+ the way when the legend belongs in HTML, or needs to do more than toggle.
526
535
  - **An annotation's `dash` takes a variant, not a pattern:** the type is `'dashed' | 'dotted'`. A raw SVG pattern like `'5,5'` is not rejected — it draws a solid line, in both libraries.
527
536
  - **One option is still accepted and does nothing:** `series.sensorType` is in the types and the parser reads it, but no renderer acts on it — in either library. Setting it to `'enum'` does not label the axis; that is `series.enumMap`, which 1.10.0 wired up. Until 1.10.0 this list also held `ticks.minor`, `grid.minor` and `enumMap` itself: three fields the types promised and both renderers swallowed. Nothing warns you; the picture just stays as it was.
528
537
  - **CSS classes are not namespaced:** the chart uses plain names like `.series` and `.time-axis`. Inline the SVG into a page whose stylesheet has a `.series` rule and that rule applies to the chart. Scope your own selectors, and suspect the host page when an embedded chart looks wrong but the standalone file does not.
package/USAGE.md CHANGED
@@ -445,10 +445,17 @@ new MLTimeGraph({
445
445
  });
446
446
  ```
447
447
 
448
- **A grid is drawn only when you ask for one.** Set `grid: { major: {} }` on either axis and
449
- both get one; leave it out and there is none. (Before 1.5.1 the Go port drew a grid when
450
- nothing was configured while the TypeScript side drew none — the same JSON gave two
451
- different charts.)
448
+ **A grid is drawn only when you ask for one.** Set `grid: true` — short for
449
+ `grid: { major: {} }` — on either axis and both directions get one; leave it out and there is
450
+ none. `grid: false` (or `major: false`) on the other axis leaves that direction out:
451
+
452
+ ```ts
453
+ axes: { x: { grid: true } } // both directions
454
+ axes: { x: { grid: true }, left: { grid: false } } // vertical lines only
455
+ ```
456
+
457
+ A `false` alone switches nothing on. (Before 1.5.1 the Go port drew a grid when nothing was
458
+ configured while the TypeScript side drew none — the same JSON gave two different charts.)
452
459
 
453
460
  **The grid is drawn over the series, not under it.** That is what `grid.layer: 'front'` means,
454
461
  and it is the default: a filled area down to the baseline would otherwise swallow the lines.
@@ -553,6 +553,28 @@ interface DivergenceEpisode {
553
553
  */
554
554
  declare function divergenceExcursions(sensors: NamedSeries[], opts: DivergenceOptions): DivergenceEpisode[];
555
555
 
556
+ /*!
557
+ * MLTimeGraph — Copyright (c) 2026 Michael Lechner
558
+ * MIT with Attribution: free use incl. commercial requires visible credit to
559
+ * "Michael Lechner". Commercial license (no attribution) on request. See LICENSE.
560
+ */
561
+
562
+ /**
563
+ * Bringt Fuehler auf die sortierte Vereinigung aller Zeitstempel. Zu jedem
564
+ * Zeitpunkt gilt fuer jeden Fuehler sein letzter Messwert -- solange er
565
+ * hoechstens `maxAgeMs` alt ist; danach `null` (keine Aussage, nicht "einig").
566
+ *
567
+ * Eine Luecken-Marke (`value: null`) bricht das Halten ab. `maxAgeMs <= 0` heisst:
568
+ * nur der exakte Zeitstempel zaehlt -- dasselbe wie ohne Ausrichtung. Die
569
+ * Messwerte eines Fuehlers werden nach Zeit geordnet (stabil); bei gleichem
570
+ * Zeitstempel gilt der letzte. Die Eingabe bleibt unveraendert.
571
+ *
572
+ * @example
573
+ * // Unten meldet nur bei Aenderung, Oben jede Minute:
574
+ * divergenceExcursions(holdAlign([oben, unten], 10 * 60_000), { maxDelta: 2 });
575
+ */
576
+ declare function holdAlign(sensors: NamedSeries[], maxAgeMs: number): NamedSeries[];
577
+
556
578
  /*!
557
579
  * MLTimeGraph — Copyright (c) 2026 Michael Lechner
558
580
  * MIT with Attribution: free use incl. commercial requires visible credit to
@@ -658,4 +680,4 @@ interface F0Opts {
658
680
  */
659
681
  declare function f0Sterilization(data: DataPoint[], opts?: F0Opts): number;
660
682
 
661
- export { type AggregatedPoint, type AggregationConfig, type AggregationMode, type AggregationThresholds, type ComputeLimitsOpts, DEFAULT_ACTIVATION_ENERGY, type DataPoint, type DivergenceEpisode, type DivergenceOptions, type F0Opts, type HotColdSpotsResult, type LimitExcursion, type LimitStats, type LimitStatsPoint, type LongTermInsight, type MktPoint, type NamedSeries, PRODUCT_PROFILES, type PredictOpts, type PredictResult, type ProductConfig, type ProductType, type SensorStat, SeriesProcessor, type SpatialPoint, type StatsAggregatedPoint, StatsAggregator, type StatsResult, type StdDevPoint, type TrendFit, type TrendPoint, aggregateBySlot, aggregateWithStats, analyzeLongTermTrends, computeLimitExcursions, createAggr, currentTrend, detectGaps, divergenceExcursions, downsample, f0Sterilization, hotColdSpots, linearFit, mkt, predictTimeToThreshold, rollingEma, rollingMean, rollingMkt, rollingStdDev, rollingTrend, sampleStdDev, spatialDelta, stdDev, varianceCoefficient };
683
+ export { type AggregatedPoint, type AggregationConfig, type AggregationMode, type AggregationThresholds, type ComputeLimitsOpts, DEFAULT_ACTIVATION_ENERGY, type DataPoint, type DivergenceEpisode, type DivergenceOptions, type F0Opts, type HotColdSpotsResult, type LimitExcursion, type LimitStats, type LimitStatsPoint, type LongTermInsight, type MktPoint, type NamedSeries, PRODUCT_PROFILES, type PredictOpts, type PredictResult, type ProductConfig, type ProductType, type SensorStat, SeriesProcessor, type SpatialPoint, type StatsAggregatedPoint, StatsAggregator, type StatsResult, type StdDevPoint, type TrendFit, type TrendPoint, aggregateBySlot, aggregateWithStats, analyzeLongTermTrends, computeLimitExcursions, createAggr, currentTrend, detectGaps, divergenceExcursions, downsample, f0Sterilization, holdAlign, hotColdSpots, linearFit, mkt, predictTimeToThreshold, rollingEma, rollingMean, rollingMkt, rollingStdDev, rollingTrend, sampleStdDev, spatialDelta, stdDev, varianceCoefficient };
@@ -1,4 +1,4 @@
1
- var I=class{static interpolateDataPoint(n,i,l){return {time:n.time+Math.round(l*(i.time-n.time)),value:(n.value??0)+l*((i.value??0)-(n.value??0)),synthetic:true}}static interpolateAggregatedPoint(n,i,l){let u=(e,t)=>e!==null&&t!==null?e+l*(t-e):null;return {time:n.time+l*(i.time-n.time),min:u(n.min,i.min),max:u(n.max,i.max),avg:u(n.avg,i.avg),count:Math.round(n.count+l*(i.count-n.count))}}static getRuns(n,i,l=0){let u=[...n].sort((r,o)=>r.time-o.time),e=[],t=[],a=null;for(let r of u){let o=i(r),m=l>0&&a&&r.time-a.time>l;(o||m)&&t.length&&(e.push(t),t=[]),o||t.push(r),a=r;}return t.length&&e.push(t),e}static splitByBoundaries(n,i,l,u){if(n.length===0)return [];if(i.length===0)return [{data:n,zoneIndex:0,zoneLow:Number.NEGATIVE_INFINITY}];let e=[...i].sort((m,s)=>m-s),t=[],a=m=>m<=0?Number.NEGATIVE_INFINITY:e[m-1],r=m=>{let s=0;for(let f=0;f<e.length&&m>=e[f];f++)s=f+1;return s},o=[n[0]];for(let m=1;m<n.length;m++){let s=n[m-1],f=n[m],g=l(s),d=l(f),p;d>g?p=e.filter(v=>v>g&&v<=d):d<g?p=e.filter(v=>v>=d&&v<g).reverse():p=[];let x=g;for(let v of p){let b=(v-g)/(d-g),h=u(s,f,b);o.push(h);let c=r((x+v)/2);t.push({data:o,zoneIndex:c,zoneLow:a(c)}),o=[h],x=v;}(p.length===0||p[p.length-1]!==d)&&o.push(f);}if(o.length>1||n.length===1){let m=l(o[0]),s=l(o[o.length-1]),f=r((m+s)/2);t.push({data:o,zoneIndex:f,zoneLow:a(f)});}return t}static splitByThreshold(n,i,l,u){let e=this.splitByBoundaries(n,[i],l,u),t={above:[],below:[]};for(let a of e)a.zoneIndex===0?t.below.push(a.data):t.above.push(a.data);return t}},H={pharma_cold:{limitLow:2,limitHigh:8,activationEnergy:83144},pharma_ambient:{limitLow:15,limitHigh:25,activationEnergy:83144},blood:{limitLow:2,limitHigh:6,activationEnergy:83144},food_chilled:{limitLow:0,limitHigh:4},frozen:{limitLow:-40,limitHigh:-18}},D=8.314462618,N=273.15;function T(n,i,l,u=1){let e=i.filter(h=>h.value!==null&&h.value!==void 0&&!Number.isNaN(h.value)).map(h=>h.value);if(!e.length)return {time:n,min:null,max:null,avg:null,mkt:null,deltaMkt:null,stdDev:null,minutesAboveHigh:l?0:null,minutesBelowLow:l?0:null,count:0};let t=1/0,a=-1/0,r=0;for(let h of e)h<t&&(t=h),h>a&&(a=h),r+=h;let o=r/e.length,m=l?0:null,s=l?0:null;if(l)for(let h=0;h<i.length;h++){let c=i[h];if(c.value!==null&&c.value!==void 0){let M=i[h+1],w=(M?M.time-c.time:0)/(1e3*60);c.value>l.limitHigh&&(m+=w),c.value<l.limitLow&&(s+=w);}}let f=0,g=0,d=(l?.activationEnergy??83144)/D;for(let h of e){f+=Math.pow(h-o,2);let c=h+N;g+=Math.exp(-d/c);}let p=f/e.length,x=Math.sqrt(p),v=null,b=null;if(e.length>=u){let h=g/e.length,c=d/-Math.log(h);v=Number((c-N).toFixed(2)),b=Number((v-o).toFixed(2));}return {time:n,min:Number(t.toFixed(2)),max:Number(a.toFixed(2)),avg:Number(o.toFixed(2)),mkt:v,deltaMkt:b,stdDev:Number(x.toFixed(2)),minutesAboveHigh:m!==null?Number(m.toFixed(1)):null,minutesBelowLow:s!==null?Number(s.toFixed(1)):null,count:e.length}}function S(n,i="hourly",l,u,e=1){if(!n.length)return [];let t=i==="hourly"?36e5:i==="daily"?864e5:l??3600*1e3,a=[...n].sort((s,f)=>s.time-f.time),r=[],o=a[0].time,m=[];for(let s of a){for(;s.time-o>=t;)r.push(T(o,m,u,e)),o+=t,m=[];m.push(s);}return r.push(T(o,m,u,e)),r}function z(n,i){let l=1/0,u=-1/0,e=0;for(let a of i)a<l&&(l=a),a>u&&(u=a),e+=a;let t=e/i.length;return {time:n,min:l,max:u,avg:t,count:i.length}}function B(n,i=6e4){if(n.length<2)return [];let l=[...n].sort((e,t)=>e.time-t.time),u=[];for(let e=1;e<l.length;e++)l[e].time-l[e-1].time>i&&u.push({startTime:l[e-1].time,endTime:l[e].time});return u}function _(n){let i=[],l=0,u=0,e=0,t=0;for(let a of n)a.count>0&&(e++,a.minutesAboveHigh&&(l+=a.minutesAboveHigh),a.stdDev&&a.stdDev>u&&(u=a.stdDev),a.deltaMkt&&a.deltaMkt>2&&t++);return e===0?[]:(l>120&&i.push({type:"critical",message:`Kritische Gesamtbelastung: Das Produkt war im gesamten Zeitraum insgesamt ${Math.round(l)} Minuten zu warm.`,metric:"Total Excursion Time"}),t>e*.15&&i.push({type:"warning",message:"Frequent thermal shocks detected. The kinetic temperature deviates strongly from the average (possible regular door openings).",metric:"Delta MKT Instability"}),u>4&&i.push({type:"warning",message:`High instability measured. Maximum standard deviation was ${u}\xB0C. The cooling system controls imprecisely.`,metric:"Standard Deviation Peak"}),i)}function C(n,i){if(n.length<=i)return n;let l=[],u=Math.ceil(n.length/i);l.push(n[0]);for(let e=1;e<n.length;e+=u)l.push(n[Math.min(e,n.length-1)]);return l}function P(n,i="hourly",l){let u={limitLow:l.low,limitHigh:l.high,activationEnergy:l.activationEnergy};return S(n,i,l.interval,u,l.minCountForMkt??1)}var q=class{static compute(n){let i=n.map(r=>r.value).filter(r=>r!==null).sort((r,o)=>r-o);if(i.length===0)return {min:NaN,max:NaN,avg:NaN,mean:NaN,median:NaN,stdDev:NaN,count:0};let l=i.length,u=i.reduce((r,o)=>r+o,0)/l,e=l%2===1?i[Math.floor(l/2)]:(i[l/2-1]+i[l/2])/2,t=i.reduce((r,o)=>r+Math.pow(o-u,2),0)/l,a=Math.sqrt(t);return {min:i[0],max:i[l-1],avg:u,mean:u,median:e,stdDev:a,count:l}}static computeInRange(n,i,l){let u=n.filter(e=>e.time>=i&&e.time<=l);return this.compute(u)}};function G(n,i){let l=typeof n=="number"?n:n.mean,u=typeof n=="number"?i??NaN:n.stdDev;return !Number.isFinite(l)||!Number.isFinite(u)||l===0?null:Math.abs(u/l)*100}var R=83144;function k(n,i=83144){let l=i/8.314,u=0,e=0;for(let a of n)a!==null&&(u+=Math.exp(-l/(a+273.15)),e++);if(e===0)return null;let t=u/e;return l/-Math.log(t)-273.15}function V(n,i,l=83144){let u=new Array(n.length),e=0;for(let t=0;t<n.length;t++){let a=n[t].time,r=a-i;for(;e<t&&n[e].time<r;)e++;let o=n.slice(e,t+1).map(s=>s.value),m=k(o,l);u[t]={time:a,value:m,synthetic:true};}return u}function A(n){let i=0,l=0;for(let t of n)t!==null&&(i+=t,l++);if(l===0)return null;let u=i/l,e=0;for(let t of n){if(t===null)continue;let a=t-u;e+=a*a;}return Math.sqrt(e/l)}function E(n){let i=0,l=0;for(let t of n)t!==null&&(i+=t,l++);if(l<2)return null;let u=i/l,e=0;for(let t of n){if(t===null)continue;let a=t-u;e+=a*a;}return Math.sqrt(e/(l-1))}function K(n,i,l=false){let u=new Array(n.length),e=0,t=l?E:A;for(let a=0;a<n.length;a++){let r=n[a].time,o=r-i;for(;e<a&&n[e].time<o;)e++;let m=n.slice(e,a+1).map(f=>f.value),s=t(m);u[a]={time:r,value:s,synthetic:true};}return u}function O(n,i){let l=new Array(n.length),u=0;for(let e=0;e<n.length;e++){let t=n[e].time,a=t-i;for(;u<e&&n[u].time<a;)u++;let r=0,o=0;for(let m=u;m<=e;m++){let s=n[m].value;s!==null&&(r+=s,o++);}l[e]={time:t,value:o===0?null:r/o,synthetic:true};}return l}function U(n,i){let l=new Array(n.length),u=null,e=0;for(let t=0;t<n.length;t++){let a=n[t].time,r=n[t].value;if(r===null){l[t]={time:a,value:u,synthetic:true};continue}if(u===null||i<=0)u=r;else {let o=1-Math.exp(-(a-e)/i);u=r*o+u*(1-o);}e=a,l[t]={time:a,value:u,synthetic:true};}return l}function Y(n,i){let{high:l,low:u}=i,e={msAboveHigh:0,msBelowLow:0,globalMax:null,globalMin:null,excursions:[]},t=null;for(let a=0;a<n.length;a++){let r=n[a];if(r.value===null){t&&(e.excursions.push(t),t=null);continue}(e.globalMax===null||r.value>e.globalMax)&&(e.globalMax=r.value),(e.globalMin===null||r.value<e.globalMin)&&(e.globalMin=r.value);let o=l!==void 0&&r.value>l,m=u!==void 0&&r.value<u,s=o?"above":m?"below":null,f=n[a-1];if(f&&f.value!==null&&s!==null){let g=r.time-f.time;s==="above"?e.msAboveHigh+=g:e.msBelowLow+=g;}if(s===null){t&&(e.excursions.push(t),t=null);continue}t&&t.side===s?(t.endTime=r.time,t.durationMs=t.endTime-t.startTime,(s==="above"&&r.value>t.extremum||s==="below"&&r.value<t.extremum)&&(t.extremum=r.value)):(t&&e.excursions.push(t),t={startTime:r.time,endTime:r.time,side:s,extremum:r.value,durationMs:0});}return t&&e.excursions.push(t),e}function L(n){if(n.length===0)return [];let i=new Map;for(let u of n)for(let e of u.data){if(e.value===null)continue;let t=i.get(e.time);t||(t=[],i.set(e.time,t)),t.push({name:u.name,value:e.value});}let l=[];for(let u of [...i.keys()].sort((e,t)=>e-t)){let e=i.get(u);if(e.length===0){l.push({time:u,min:null,max:null,delta:null,minSensor:null,maxSensor:null});continue}let t=e[0],a=e[0];for(let r=1;r<e.length;r++)e[r].value<t.value&&(t=e[r]),e[r].value>a.value&&(a=e[r]);l.push({time:u,min:t.value,max:a.value,delta:e.length<2?null:a.value-t.value,minSensor:t.name,maxSensor:a.name});}return l}function $(n){let i=[];for(let e of n){let t=0,a=0,r=1/0,o=-1/0;for(let m of e.data)m.value!==null&&(t+=m.value,a++,m.value<r&&(r=m.value),m.value>o&&(o=m.value));a!==0&&i.push({name:e.name,mean:t/a,min:r,max:o,count:a});}if(i.length===0)return {sensors:[],hottest:null,coldest:null,meanDelta:null};let l=i[0],u=i[0];for(let e=1;e<i.length;e++)i[e].mean>l.mean&&(l=i[e]),i[e].mean<u.mean&&(u=i[e]);return {sensors:i,hottest:l,coldest:u,meanDelta:l.mean-u.mean}}function W(n,i){let{maxDelta:l,minDurationMs:u=0}=i,e=[],t=null,a=()=>{t&&t.durationMs>=u&&e.push(t),t=null;};for(let r of L(n)){if(r.delta===null||r.delta<=l){a();continue}t?(t.endTime=r.time,t.durationMs=t.endTime-t.startTime,r.delta>t.peakDelta&&(t.peakDelta=r.delta,t.peakTime=r.time,t.maxSensor=r.maxSensor,t.minSensor=r.minSensor)):t={startTime:r.time,endTime:r.time,durationMs:0,peakDelta:r.delta,peakTime:r.time,maxSensor:r.maxSensor,minSensor:r.minSensor};}return a(),e}function y(n){let i=0,l=0,u=0,e=0,t=0;for(let m of n)m.value!==null&&(i++,l+=m.time,u+=m.value,e+=m.time*m.value,t+=m.time*m.time);if(i<2)return null;let a=i*t-l*l;if(a===0)return null;let r=(i*e-l*u)/a,o=(u-r*l)/i;return {slope:r,intercept:o,n:i}}function F(n,i){if(n.length===0)return null;let l=n[n.length-1].time,u=l-i,e=n.filter(t=>t.time>=u&&t.time<=l);return y(e)}function Z(n,i){let l=[],u=0;for(let e=0;e<n.length;e++){let t=n[e].time,a=t-i;for(;u<n.length&&n[u].time<a;)u++;let r=y(n.slice(u,e+1));l.push({time:t,fit:r});}return l}function j(n,i,l={}){let u=l.lookbackMs??9e5,e=l.side??"either";if(n.length===0)return null;let t=n[n.length-1];if(t.value===null)return null;let a=F(n,u);if(!a||a.slope===0)return null;let r=a.slope>0&&t.value<i,o=a.slope<0&&t.value>i;if(e==="above"&&!r||e==="below"&&!o||e==="either"&&!r&&!o)return null;let m=(i-a.intercept)/a.slope,s=m-t.time;return s<=0?null:{msUntil:s,eta:m,fit:a,currentValue:t.value}}function J(n,i={}){let l=i.refTempCelsius??121.11,u=i.zValueKelvin??10,e=0;for(let t=0;t<n.length-1;t++){let a=n[t],r=n[t+1];if(a.value===null||r.value===null)continue;let o=(r.time-a.time)/6e4;if(o<=0)continue;let m=Math.pow(10,(a.value-l)/u),s=Math.pow(10,(r.value-l)/u);e+=(m+s)/2*o;}return e}/*!
1
+ var I=class{static interpolateDataPoint(l,i,n){return {time:l.time+Math.round(n*(i.time-l.time)),value:(l.value??0)+n*((i.value??0)-(l.value??0)),synthetic:true}}static interpolateAggregatedPoint(l,i,n){let u=(e,t)=>e!==null&&t!==null?e+n*(t-e):null;return {time:l.time+n*(i.time-l.time),min:u(l.min,i.min),max:u(l.max,i.max),avg:u(l.avg,i.avg),count:Math.round(l.count+n*(i.count-l.count))}}static getRuns(l,i,n=0){let u=[...l].sort((r,o)=>r.time-o.time),e=[],t=[],a=null;for(let r of u){let o=i(r),m=n>0&&a&&r.time-a.time>n;(o||m)&&t.length&&(e.push(t),t=[]),o||t.push(r),a=r;}return t.length&&e.push(t),e}static splitByBoundaries(l,i,n,u){if(l.length===0)return [];if(i.length===0)return [{data:l,zoneIndex:0,zoneLow:Number.NEGATIVE_INFINITY}];let e=[...i].sort((m,s)=>m-s),t=[],a=m=>m<=0?Number.NEGATIVE_INFINITY:e[m-1],r=m=>{let s=0;for(let h=0;h<e.length&&m>=e[h];h++)s=h+1;return s},o=[l[0]];for(let m=1;m<l.length;m++){let s=l[m-1],h=l[m],g=n(s),d=n(h),p;d>g?p=e.filter(v=>v>g&&v<=d):d<g?p=e.filter(v=>v>=d&&v<g).reverse():p=[];let x=g;for(let v of p){let b=(v-g)/(d-g),f=u(s,h,b);o.push(f);let c=r((x+v)/2);t.push({data:o,zoneIndex:c,zoneLow:a(c)}),o=[f],x=v;}(p.length===0||p[p.length-1]!==d)&&o.push(h);}if(o.length>1||l.length===1){let m=n(o[0]),s=n(o[o.length-1]),h=r((m+s)/2);t.push({data:o,zoneIndex:h,zoneLow:a(h)});}return t}static splitByThreshold(l,i,n,u){let e=this.splitByBoundaries(l,[i],n,u),t={above:[],below:[]};for(let a of e)a.zoneIndex===0?t.below.push(a.data):t.above.push(a.data);return t}},H={pharma_cold:{limitLow:2,limitHigh:8,activationEnergy:83144},pharma_ambient:{limitLow:15,limitHigh:25,activationEnergy:83144},blood:{limitLow:2,limitHigh:6,activationEnergy:83144},food_chilled:{limitLow:0,limitHigh:4},frozen:{limitLow:-40,limitHigh:-18}},D=8.314462618,N=273.15;function T(l,i,n,u=1){let e=i.filter(f=>f.value!==null&&f.value!==void 0&&!Number.isNaN(f.value)).map(f=>f.value);if(!e.length)return {time:l,min:null,max:null,avg:null,mkt:null,deltaMkt:null,stdDev:null,minutesAboveHigh:n?0:null,minutesBelowLow:n?0:null,count:0};let t=1/0,a=-1/0,r=0;for(let f of e)f<t&&(t=f),f>a&&(a=f),r+=f;let o=r/e.length,m=n?0:null,s=n?0:null;if(n)for(let f=0;f<i.length;f++){let c=i[f];if(c.value!==null&&c.value!==void 0){let M=i[f+1],w=(M?M.time-c.time:0)/(1e3*60);c.value>n.limitHigh&&(m+=w),c.value<n.limitLow&&(s+=w);}}let h=0,g=0,d=(n?.activationEnergy??83144)/D;for(let f of e){h+=Math.pow(f-o,2);let c=f+N;g+=Math.exp(-d/c);}let p=h/e.length,x=Math.sqrt(p),v=null,b=null;if(e.length>=u){let f=g/e.length,c=d/-Math.log(f);v=Number((c-N).toFixed(2)),b=Number((v-o).toFixed(2));}return {time:l,min:Number(t.toFixed(2)),max:Number(a.toFixed(2)),avg:Number(o.toFixed(2)),mkt:v,deltaMkt:b,stdDev:Number(x.toFixed(2)),minutesAboveHigh:m!==null?Number(m.toFixed(1)):null,minutesBelowLow:s!==null?Number(s.toFixed(1)):null,count:e.length}}function S(l,i="hourly",n,u,e=1){if(!l.length)return [];let t=i==="hourly"?36e5:i==="daily"?864e5:n??3600*1e3,a=[...l].sort((s,h)=>s.time-h.time),r=[],o=a[0].time,m=[];for(let s of a){for(;s.time-o>=t;)r.push(T(o,m,u,e)),o+=t,m=[];m.push(s);}return r.push(T(o,m,u,e)),r}function z(l,i){let n=1/0,u=-1/0,e=0;for(let a of i)a<n&&(n=a),a>u&&(u=a),e+=a;let t=e/i.length;return {time:l,min:n,max:u,avg:t,count:i.length}}function B(l,i=6e4){if(l.length<2)return [];let n=[...l].sort((e,t)=>e.time-t.time),u=[];for(let e=1;e<n.length;e++)n[e].time-n[e-1].time>i&&u.push({startTime:n[e-1].time,endTime:n[e].time});return u}function _(l){let i=[],n=0,u=0,e=0,t=0;for(let a of l)a.count>0&&(e++,a.minutesAboveHigh&&(n+=a.minutesAboveHigh),a.stdDev&&a.stdDev>u&&(u=a.stdDev),a.deltaMkt&&a.deltaMkt>2&&t++);return e===0?[]:(n>120&&i.push({type:"critical",message:`Kritische Gesamtbelastung: Das Produkt war im gesamten Zeitraum insgesamt ${Math.round(n)} Minuten zu warm.`,metric:"Total Excursion Time"}),t>e*.15&&i.push({type:"warning",message:"Frequent thermal shocks detected. The kinetic temperature deviates strongly from the average (possible regular door openings).",metric:"Delta MKT Instability"}),u>4&&i.push({type:"warning",message:`High instability measured. Maximum standard deviation was ${u}\xB0C. The cooling system controls imprecisely.`,metric:"Standard Deviation Peak"}),i)}function C(l,i){if(l.length<=i)return l;let n=[],u=Math.ceil(l.length/i);n.push(l[0]);for(let e=1;e<l.length;e+=u)n.push(l[Math.min(e,l.length-1)]);return n}function P(l,i="hourly",n){let u={limitLow:n.low,limitHigh:n.high,activationEnergy:n.activationEnergy};return S(l,i,n.interval,u,n.minCountForMkt??1)}var q=class{static compute(l){let i=l.map(r=>r.value).filter(r=>r!==null).sort((r,o)=>r-o);if(i.length===0)return {min:NaN,max:NaN,avg:NaN,mean:NaN,median:NaN,stdDev:NaN,count:0};let n=i.length,u=i.reduce((r,o)=>r+o,0)/n,e=n%2===1?i[Math.floor(n/2)]:(i[n/2-1]+i[n/2])/2,t=i.reduce((r,o)=>r+Math.pow(o-u,2),0)/n,a=Math.sqrt(t);return {min:i[0],max:i[n-1],avg:u,mean:u,median:e,stdDev:a,count:n}}static computeInRange(l,i,n){let u=l.filter(e=>e.time>=i&&e.time<=n);return this.compute(u)}};function G(l,i){let n=typeof l=="number"?l:l.mean,u=typeof l=="number"?i??NaN:l.stdDev;return !Number.isFinite(n)||!Number.isFinite(u)||n===0?null:Math.abs(u/n)*100}var R=83144;function k(l,i=83144){let n=i/8.314,u=0,e=0;for(let a of l)a!==null&&(u+=Math.exp(-n/(a+273.15)),e++);if(e===0)return null;let t=u/e;return n/-Math.log(t)-273.15}function V(l,i,n=83144){let u=new Array(l.length),e=0;for(let t=0;t<l.length;t++){let a=l[t].time,r=a-i;for(;e<t&&l[e].time<r;)e++;let o=l.slice(e,t+1).map(s=>s.value),m=k(o,n);u[t]={time:a,value:m,synthetic:true};}return u}function A(l){let i=0,n=0;for(let t of l)t!==null&&(i+=t,n++);if(n===0)return null;let u=i/n,e=0;for(let t of l){if(t===null)continue;let a=t-u;e+=a*a;}return Math.sqrt(e/n)}function E(l){let i=0,n=0;for(let t of l)t!==null&&(i+=t,n++);if(n<2)return null;let u=i/n,e=0;for(let t of l){if(t===null)continue;let a=t-u;e+=a*a;}return Math.sqrt(e/(n-1))}function K(l,i,n=false){let u=new Array(l.length),e=0,t=n?E:A;for(let a=0;a<l.length;a++){let r=l[a].time,o=r-i;for(;e<a&&l[e].time<o;)e++;let m=l.slice(e,a+1).map(h=>h.value),s=t(m);u[a]={time:r,value:s,synthetic:true};}return u}function O(l,i){let n=new Array(l.length),u=0;for(let e=0;e<l.length;e++){let t=l[e].time,a=t-i;for(;u<e&&l[u].time<a;)u++;let r=0,o=0;for(let m=u;m<=e;m++){let s=l[m].value;s!==null&&(r+=s,o++);}n[e]={time:t,value:o===0?null:r/o,synthetic:true};}return n}function U(l,i){let n=new Array(l.length),u=null,e=0;for(let t=0;t<l.length;t++){let a=l[t].time,r=l[t].value;if(r===null){n[t]={time:a,value:u,synthetic:true};continue}if(u===null||i<=0)u=r;else {let o=1-Math.exp(-(a-e)/i);u=r*o+u*(1-o);}e=a,n[t]={time:a,value:u,synthetic:true};}return n}function Y(l,i){let{high:n,low:u}=i,e={msAboveHigh:0,msBelowLow:0,globalMax:null,globalMin:null,excursions:[]},t=null;for(let a=0;a<l.length;a++){let r=l[a];if(r.value===null){t&&(e.excursions.push(t),t=null);continue}(e.globalMax===null||r.value>e.globalMax)&&(e.globalMax=r.value),(e.globalMin===null||r.value<e.globalMin)&&(e.globalMin=r.value);let o=n!==void 0&&r.value>n,m=u!==void 0&&r.value<u,s=o?"above":m?"below":null,h=l[a-1];if(h&&h.value!==null&&s!==null){let g=r.time-h.time;s==="above"?e.msAboveHigh+=g:e.msBelowLow+=g;}if(s===null){t&&(e.excursions.push(t),t=null);continue}t&&t.side===s?(t.endTime=r.time,t.durationMs=t.endTime-t.startTime,(s==="above"&&r.value>t.extremum||s==="below"&&r.value<t.extremum)&&(t.extremum=r.value)):(t&&e.excursions.push(t),t={startTime:r.time,endTime:r.time,side:s,extremum:r.value,durationMs:0});}return t&&e.excursions.push(t),e}function L(l){if(l.length===0)return [];let i=new Map;for(let u of l)for(let e of u.data){if(e.value===null)continue;let t=i.get(e.time);t||(t=[],i.set(e.time,t)),t.push({name:u.name,value:e.value});}let n=[];for(let u of [...i.keys()].sort((e,t)=>e-t)){let e=i.get(u);if(e.length===0){n.push({time:u,min:null,max:null,delta:null,minSensor:null,maxSensor:null});continue}let t=e[0],a=e[0];for(let r=1;r<e.length;r++)e[r].value<t.value&&(t=e[r]),e[r].value>a.value&&(a=e[r]);n.push({time:u,min:t.value,max:a.value,delta:e.length<2?null:a.value-t.value,minSensor:t.name,maxSensor:a.name});}return n}function $(l){let i=[];for(let e of l){let t=0,a=0,r=1/0,o=-1/0;for(let m of e.data)m.value!==null&&(t+=m.value,a++,m.value<r&&(r=m.value),m.value>o&&(o=m.value));a!==0&&i.push({name:e.name,mean:t/a,min:r,max:o,count:a});}if(i.length===0)return {sensors:[],hottest:null,coldest:null,meanDelta:null};let n=i[0],u=i[0];for(let e=1;e<i.length;e++)i[e].mean>n.mean&&(n=i[e]),i[e].mean<u.mean&&(u=i[e]);return {sensors:i,hottest:n,coldest:u,meanDelta:n.mean-u.mean}}function W(l,i){let{maxDelta:n,minDurationMs:u=0}=i,e=[],t=null,a=()=>{t&&t.durationMs>=u&&e.push(t),t=null;};for(let r of L(l)){if(r.delta===null||r.delta<=n){a();continue}t?(t.endTime=r.time,t.durationMs=t.endTime-t.startTime,r.delta>t.peakDelta&&(t.peakDelta=r.delta,t.peakTime=r.time,t.maxSensor=r.maxSensor,t.minSensor=r.minSensor)):t={startTime:r.time,endTime:r.time,durationMs:0,peakDelta:r.delta,peakTime:r.time,maxSensor:r.maxSensor,minSensor:r.minSensor};}return a(),e}function Z(l,i){let n=i>0?i:0,u=new Set,e=l.map(a=>{let r=[...a.data].sort((o,m)=>o.time-m.time);for(let o of r)u.add(o.time);return r}),t=[...u].sort((a,r)=>a-r);return l.map((a,r)=>{let o=e[r],m=-1,s=t.map(h=>{for(;m+1<o.length&&o[m+1].time<=h;)m++;let g=m>=0?o[m]:void 0,d=g&&g.value!==null&&h-g.time<=n?g.value:null;return {time:h,value:d}});return {name:a.name,data:s}})}function y(l){let i=0,n=0,u=0,e=0,t=0;for(let m of l)m.value!==null&&(i++,n+=m.time,u+=m.value,e+=m.time*m.value,t+=m.time*m.time);if(i<2)return null;let a=i*t-n*n;if(a===0)return null;let r=(i*e-n*u)/a,o=(u-r*n)/i;return {slope:r,intercept:o,n:i}}function F(l,i){if(l.length===0)return null;let n=l[l.length-1].time,u=n-i,e=l.filter(t=>t.time>=u&&t.time<=n);return y(e)}function j(l,i){let n=[],u=0;for(let e=0;e<l.length;e++){let t=l[e].time,a=t-i;for(;u<l.length&&l[u].time<a;)u++;let r=y(l.slice(u,e+1));n.push({time:t,fit:r});}return n}function J(l,i,n={}){let u=n.lookbackMs??9e5,e=n.side??"either";if(l.length===0)return null;let t=l[l.length-1];if(t.value===null)return null;let a=F(l,u);if(!a||a.slope===0)return null;let r=a.slope>0&&t.value<i,o=a.slope<0&&t.value>i;if(e==="above"&&!r||e==="below"&&!o||e==="either"&&!r&&!o)return null;let m=(i-a.intercept)/a.slope,s=m-t.time;return s<=0?null:{msUntil:s,eta:m,fit:a,currentValue:t.value}}function Q(l,i={}){let n=i.refTempCelsius??121.11,u=i.zValueKelvin??10,e=0;for(let t=0;t<l.length-1;t++){let a=l[t],r=l[t+1];if(a.value===null||r.value===null)continue;let o=(r.time-a.time)/6e4;if(o<=0)continue;let m=Math.pow(10,(a.value-n)/u),s=Math.pow(10,(r.value-n)/u);e+=(m+s)/2*o;}return e}/*!
2
2
  * MLTimeGraph — Copyright (c) 2026 Michael Lechner
3
3
  * MIT with Attribution: free use incl. commercial requires visible credit to
4
4
  * "Michael Lechner". Commercial license (no attribution) on request. See LICENSE.
@@ -12,4 +12,4 @@ var I=class{static interpolateDataPoint(n,i,l){return {time:n.time+Math.round(l*
12
12
  * MLTimeGraph — Copyright (c) 2026 Michael Lechner
13
13
  * MIT with Attribution: free use incl. commercial requires visible credit to
14
14
  * "Michael Lechner". Commercial license (no attribution) on request. See LICENSE.
15
- */export{R as DEFAULT_ACTIVATION_ENERGY,H as PRODUCT_PROFILES,I as SeriesProcessor,q as StatsAggregator,S as aggregateBySlot,P as aggregateWithStats,_ as analyzeLongTermTrends,Y as computeLimitExcursions,z as createAggr,F as currentTrend,B as detectGaps,W as divergenceExcursions,C as downsample,J as f0Sterilization,$ as hotColdSpots,y as linearFit,k as mkt,j as predictTimeToThreshold,U as rollingEma,O as rollingMean,V as rollingMkt,K as rollingStdDev,Z as rollingTrend,E as sampleStdDev,L as spatialDelta,A as stdDev,G as varianceCoefficient};
15
+ */export{R as DEFAULT_ACTIVATION_ENERGY,H as PRODUCT_PROFILES,I as SeriesProcessor,q as StatsAggregator,S as aggregateBySlot,P as aggregateWithStats,_ as analyzeLongTermTrends,Y as computeLimitExcursions,z as createAggr,F as currentTrend,B as detectGaps,W as divergenceExcursions,C as downsample,Q as f0Sterilization,Z as holdAlign,$ as hotColdSpots,y as linearFit,k as mkt,J as predictTimeToThreshold,U as rollingEma,O as rollingMean,V as rollingMkt,K as rollingStdDev,j as rollingTrend,E as sampleStdDev,L as spatialDelta,A as stdDev,G as varianceCoefficient};
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, A as AxesConfig, X as XAxisConfig, Y as YAxisConfig, c as LegendOptions, d as LegendPosition, e as LegendOrientation, f as Marker, g as RenderOutput } from './marker_renderer-D5TfGx8R.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-D5TfGx8R.js';
3
- import { d as AnySeries, h as Annotation, a as DrawCommand, T as TimeScale, L as LinearScale, f as Gap, g as GapsConfig, e as Threshold, H as Highlight, i as AnnotationBandConfig, k as SeriesStyle, b as LineVariant, S as SmoothingType, F as FillSpec, l as TimeSeries, m as LineDashStyle, n as ThresholdFill, j 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 './scale-BStQU_t-.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 GapConfig, O as GapLabel, Q as GapRegion, U as GapStyle, G as GridLayer, V as LineShape, W as LineStyle, X as MarkerStyle, Y as MovingAverageType, Z as SVGLineStyle, _ as SensorType, $ as SeriesOverlay, a0 as SeriesOverlayKind, a1 as SeriesType, a2 as ShadowStyle, a3 as SolidDashStyle, a4 as ThresholdLabelConfig, a5 as getLineStyle, a6 as resolveDash } from './scale-BStQU_t-.js';
1
+ import { M as MLTimeGraphOptions, L as LegendItem, R as Renderer, a as LayoutResult, b as Margin, A as AxesConfig, X as XAxisConfig, Y as YAxisConfig, c as LegendOptions, d as LegendPosition, e as LegendOrientation, f as Marker, g as RenderOutput } from './marker_renderer-C5rNViFi.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-C5rNViFi.js';
3
+ import { d as AnySeries, h as Annotation, a as DrawCommand, T as TimeScale, L as LinearScale, f as Gap, g as GapsConfig, e as Threshold, H as Highlight, i as AnnotationBandConfig, k as SeriesStyle, b as LineVariant, S as SmoothingType, F as FillSpec, l as TimeSeries, m as LineDashStyle, n as ThresholdFill, j 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 './scale-CDPJGYpZ.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 GapConfig, O as GapLabel, Q as GapRegion, U as GapStyle, G as GridLayer, V as LineShape, W as LineStyle, X as MarkerStyle, Y as MovingAverageType, Z as SVGLineStyle, _ as SensorType, $ as SeriesOverlay, a0 as SeriesOverlayKind, a1 as SeriesType, a2 as ShadowStyle, a3 as SolidDashStyle, a4 as ThresholdLabelConfig, a5 as getLineStyle, a6 as resolveDash } from './scale-CDPJGYpZ.js';
5
5
 
6
6
  /*!
7
7
  * MLTimeGraph — Copyright (c) 2026 Michael Lechner
@@ -65,12 +65,20 @@ declare class MLTimeGraph {
65
65
  enableAnnotation(id: string): void;
66
66
  private _axisIndexOf;
67
67
  private _timesOf;
68
- private _valuesOf;
69
68
  /**
70
69
  * Compute the chart's renderer-agnostic draw commands.
71
70
  */
72
71
  renderCommands(): DrawCommand[];
73
72
  /** Build the draw commands for a single series based on its type. */
73
+ /**
74
+ * Wie die Linie einer skalaren Reihe gezeichnet wird: ihr Grund-Eintrag,
75
+ * ihre Form und die Lueckenschwelle, nach der sie bricht.
76
+ *
77
+ * Eine Stelle, weil zwei sie brauchen: das Zeichnen der Reihe selbst, und
78
+ * eine Flaeche in einer ANDEREN Reihe, die bis an diese Linie reicht -- sie
79
+ * muss deren Kurve treffen, nicht eine aehnliche (B-20261007-02).
80
+ */
81
+ private _linienGrundlage;
74
82
  private _renderSeries;
75
83
  private _interpolateValue;
76
84
  legendItems(): LegendItem[];
@@ -87,24 +95,6 @@ declare class MLTimeGraph {
87
95
  * keine Vorlage zeigt, prueft nichts (edge_serien_ohne_farbe).
88
96
  */
89
97
  private _palettenFarbe;
90
- /**
91
- * Die Zustaende der Reihen an EINER Achse, aufsteigend -- oder undefined,
92
- * wenn keine Reihe dort eine `enumMap` hat.
93
- *
94
- * Mehrere Reihen auf derselben Achse duerfen verschiedene Karten mitbringen;
95
- * zusammengelegt wird die Vereinigung, damit kein Zustand ohne Strich bleibt.
96
- */
97
- private _zustaendeVon;
98
- /**
99
- * Beschriftung eines Zustands; unbekannte Werte behalten ihre Zahl.
100
- *
101
- * Nennen zwei Reihen denselben Wert verschieden -- eine Pumpe "Running", ein
102
- * Ventil "Open" --, gewinnt die ERSTE. Das ist keine Loesung des Konflikts,
103
- * sondern eine feste Regel dafuer: eine Achse hat EIN Vokabular, und wer zwei
104
- * braucht, braucht zwei Achsen. Vorher gewann die zuletzt genannte Reihe, und
105
- * die Achse trug eine Mischung aus beiden.
106
- */
107
- private _zustandName;
108
98
  private _legendItems;
109
99
  get renderer(): Renderer | undefined;
110
100
  get layout(): LayoutResult;
@@ -611,7 +601,7 @@ declare class SVGRenderer extends Renderer {
611
601
  render(commands: DrawCommand[]): RenderOutput;
612
602
  _toSVG(cmd: DrawCommand): string;
613
603
  /** Register or retrieve a hatch pattern by variant. Returns the pattern id for use as fill="url(#id)". */
614
- _hatchPattern(variant: string, fillColor: string | undefined): string;
604
+ _hatchPattern(variant: HatchVariant, fillColor: string | undefined): string;
615
605
  _path(c: Extract<DrawCommand, {
616
606
  type: "path";
617
607
  }>): string;
@@ -862,6 +852,6 @@ declare function mergeOptions(...layers: (OptionsLayer | undefined)[]): MLTimeGr
862
852
  * Monate spaeter eine Datei aus einem Stapel von Berichten in der Hand haelt,
863
853
  * kann sonst nicht feststellen, welcher Stand sie gezeichnet hat.
864
854
  */
865
- declare const VERSION = "1.12.0";
855
+ declare const VERSION = "1.13.0";
866
856
 
867
857
  export { AggregatedPoint, AggregatedSeries, Annotation, AnnotationBandBuilder, AnnotationBandConfig, AnnotationBandItem, AnnotationBandItemBuilder, AnnotationBuilder, AnnotationPointShape, AnySeries, 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, PointStyleType, 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, fillBetweenThresholds, mergeOptions, mount, parseAggregated, parseDataPoint, parseSeries, toDataPoints, toSeries };