@tetacom/svg-charts 1.1.10 → 1.1.13

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.
Files changed (48) hide show
  1. package/chart/base/series-base.component.d.ts +4 -6
  2. package/chart/chart/chart.component.d.ts +10 -3
  3. package/chart/chart-container/annotation/annotation.component.d.ts +22 -13
  4. package/chart/chart-container/chart-container.component.d.ts +3 -3
  5. package/chart/chart-container/gridlines/gridlines.component.d.ts +3 -1
  6. package/chart/chart-container/plotband/plot-band.component.d.ts +5 -2
  7. package/chart/chart-container/plotline/plotline.component.d.ts +4 -2
  8. package/chart/chart-container/series/area-series/area-series.component.d.ts +6 -14
  9. package/chart/chart-container/series/line/line-series.component.d.ts +3 -14
  10. package/chart/chart-container/series/linear-series-base.d.ts +30 -0
  11. package/chart/chart-container/series-host/series-host.component.d.ts +4 -8
  12. package/chart/chart-container/tooltip/tooltip.component.d.ts +1 -1
  13. package/chart/chart.module.d.ts +18 -17
  14. package/chart/directives/zoomable.directive.d.ts +9 -4
  15. package/chart/model/annotation.d.ts +8 -18
  16. package/chart/model/i-chart-config.d.ts +9 -1
  17. package/chart/service/brush.service.d.ts +3 -2
  18. package/chart/service/chart.service.d.ts +8 -0
  19. package/esm2020/chart/base/series-base.component.mjs +8 -6
  20. package/esm2020/chart/chart/chart.component.mjs +75 -19
  21. package/esm2020/chart/chart-container/annotation/annotation.component.mjs +66 -44
  22. package/esm2020/chart/chart-container/chart-container.component.mjs +11 -7
  23. package/esm2020/chart/chart-container/gridlines/gridlines.component.mjs +5 -3
  24. package/esm2020/chart/chart-container/plotband/plot-band.component.mjs +12 -6
  25. package/esm2020/chart/chart-container/plotline/plotline.component.mjs +7 -3
  26. package/esm2020/chart/chart-container/series/area-series/area-series.component.mjs +13 -138
  27. package/esm2020/chart/chart-container/series/block-series/block-series.component.mjs +2 -2
  28. package/esm2020/chart/chart-container/series/line/line-series.component.mjs +3 -159
  29. package/esm2020/chart/chart-container/series/linear-series-base.mjs +188 -0
  30. package/esm2020/chart/chart-container/series-host/series-host.component.mjs +9 -24
  31. package/esm2020/chart/chart-container/tooltip/tooltip.component.mjs +5 -5
  32. package/esm2020/chart/chart.module.mjs +4 -1
  33. package/esm2020/chart/default/default-chart-config.mjs +4 -2
  34. package/esm2020/chart/directives/brushable.directive.mjs +3 -2
  35. package/esm2020/chart/directives/zoomable.directive.mjs +79 -54
  36. package/esm2020/chart/model/annotation.mjs +2 -13
  37. package/esm2020/chart/model/i-broadcast-message.mjs +1 -1
  38. package/esm2020/chart/model/i-chart-config.mjs +1 -1
  39. package/esm2020/chart/service/broadcast.service.mjs +9 -3
  40. package/esm2020/chart/service/brush.service.mjs +58 -19
  41. package/esm2020/chart/service/chart.service.mjs +17 -3
  42. package/esm2020/chart/service/scale.service.mjs +9 -3
  43. package/esm2020/chart/service/zoom.service.mjs +5 -2
  44. package/fesm2015/tetacom-svg-charts.mjs +416 -354
  45. package/fesm2015/tetacom-svg-charts.mjs.map +1 -1
  46. package/fesm2020/tetacom-svg-charts.mjs +399 -334
  47. package/fesm2020/tetacom-svg-charts.mjs.map +1 -1
  48. package/package.json +1 -1
@@ -2,14 +2,12 @@ import * as i0 from '@angular/core';
2
2
  import { Injectable, Component, ChangeDetectionStrategy, Input, ViewChild, HostListener, ChangeDetectorRef, Directive, HostBinding, EventEmitter, Output, NgModule } from '@angular/core';
3
3
  import * as i4 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
- import { BehaviorSubject, Subject, map, shareReplay, filter, combineLatest, withLatestFrom, ReplaySubject, tap, takeWhile } from 'rxjs';
5
+ import { BehaviorSubject, Subject, map, shareReplay, filter, combineLatest, withLatestFrom, ReplaySubject, animationFrameScheduler, tap, takeWhile } from 'rxjs';
6
6
  import * as d3 from 'd3';
7
7
  import { zoomIdentity } from 'd3';
8
8
  import { maxIndex } from 'd3-array';
9
- import { throttleTime, tap as tap$1 } from 'rxjs/operators';
9
+ import { throttleTime, debounceTime, tap as tap$1 } from 'rxjs/operators';
10
10
  import * as i3 from '@angular/platform-browser';
11
- import * as d3annotation from 'd3-svg-annotation';
12
- import { annotationBadge, annotationLabel, annotationCallout, annotationCalloutCircle, annotationCalloutCurve, annotationCalloutElbow, annotationCalloutRect, annotationCustomType, annotationXYThreshold } from 'd3-svg-annotation';
13
11
 
14
12
  var ZoomType;
15
13
  (function (ZoomType) {
@@ -54,7 +52,9 @@ const defaultChartConfig = () => ({
54
52
  xAxis: [],
55
53
  yAxis: [],
56
54
  series: [],
57
- gridLines: true,
55
+ gridLines: {
56
+ enable: true
57
+ }
58
58
  });
59
59
 
60
60
  var ScaleType;
@@ -110,16 +110,21 @@ class ChartService {
110
110
  constructor() {
111
111
  this.config$ = new BehaviorSubject(defaultChartConfig());
112
112
  this.size$ = new BehaviorSubject(new DOMRectReadOnly());
113
- this.pointerMove$ = new BehaviorSubject(null);
113
+ this.pointerMove$ = new Subject();
114
114
  this.tooltips$ = new BehaviorSubject(new Map());
115
115
  this.plotBandEvent$ = new Subject();
116
116
  this.plotLineMove$ = new Subject();
117
117
  this.pointMove$ = new Subject();
118
118
  this.chartClick$ = new Subject();
119
119
  this.chartContextMenu$ = new Subject();
120
+ this.annotationEvent$ = new Subject();
121
+ this.annotationMove$ = new Subject();
120
122
  this.config = this.config$
121
123
  .asObservable()
122
- .pipe(map(this.setDefaults), map(this.setPreparationData), shareReplay(1));
124
+ .pipe(map(this.setDefaults), map(this.setPreparationData), shareReplay({
125
+ bufferSize: 1,
126
+ refCount: true
127
+ }));
123
128
  this.size = this.size$.asObservable();
124
129
  this.pointerMove = this.pointerMove$.asObservable();
125
130
  this.tooltips = this.tooltips$.asObservable();
@@ -128,6 +133,9 @@ class ChartService {
128
133
  this.pointMove = this.pointMove$.asObservable();
129
134
  this.chartClick = this.chartClick$.asObservable();
130
135
  this.chartContextMenu = this.chartContextMenu$.asObservable();
136
+ this.annotationClick = this.annotationEvent$.asObservable().pipe(filter((_) => { var _a; return ((_a = _ === null || _ === void 0 ? void 0 : _.event) === null || _a === void 0 ? void 0 : _a.type) === 'click'; }));
137
+ this.annotationContextMenu = this.annotationEvent$.asObservable().pipe(filter((_) => { var _a; return ((_a = _ === null || _ === void 0 ? void 0 : _.event) === null || _a === void 0 ? void 0 : _a.type) === 'contextmenu'; }));
138
+ this.annotationMove = this.annotationMove$.asObservable();
131
139
  this.plotBandClick = this.plotBandEvent$
132
140
  .asObservable()
133
141
  .pipe(filter((_) => { var _a; return ((_a = _ === null || _ === void 0 ? void 0 : _.event) === null || _a === void 0 ? void 0 : _a.type) === 'click'; }));
@@ -158,6 +166,12 @@ class ChartService {
158
166
  clearTooltips() {
159
167
  this.tooltips$.next(new Map());
160
168
  }
169
+ emitMoveAnnotation(event) {
170
+ this.annotationMove$.next(event);
171
+ }
172
+ emitAnnotation(event) {
173
+ this.annotationEvent$.next(event);
174
+ }
161
175
  emitPlotband(event) {
162
176
  this.plotBandEvent$.next(event);
163
177
  }
@@ -231,7 +245,10 @@ class ZoomService {
231
245
  constructor() {
232
246
  this.broadcastSubscription = [];
233
247
  this.zoomed$ = new BehaviorSubject(null);
234
- this.zoomed = this.zoomed$.asObservable().pipe(shareReplay(1));
248
+ this.zoomed = this.zoomed$.asObservable().pipe(shareReplay({
249
+ bufferSize: 1,
250
+ refCount: true
251
+ }));
235
252
  }
236
253
  setZoom(zoom) {
237
254
  this.zoomed$.next(zoom);
@@ -505,7 +522,10 @@ class ScaleService {
505
522
  }
506
523
  }
507
524
  return map;
508
- }), shareReplay(1));
525
+ }), shareReplay({
526
+ bufferSize: 1,
527
+ refCount: true
528
+ }));
509
529
  this.yScaleMap = combineLatest([
510
530
  this.chartService.size,
511
531
  this.chartService.config,
@@ -560,7 +580,10 @@ class ScaleService {
560
580
  }
561
581
  }
562
582
  return map;
563
- }), shareReplay(1));
583
+ }), shareReplay({
584
+ bufferSize: 1,
585
+ refCount: true
586
+ }));
564
587
  }
565
588
  }
566
589
  ScaleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ScaleService, deps: [{ token: ChartService }, { token: ZoomService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -607,10 +630,16 @@ class BroadcastService {
607
630
  this.brushEmitter.next(value);
608
631
  }
609
632
  subscribeToZoom(channel) {
610
- return this.zoomEmitter.asObservable().pipe(filter((msg) => channel && msg.channel === channel), shareReplay(1));
633
+ return this.zoomEmitter.asObservable().pipe(filter((msg) => channel && msg.channel === channel), shareReplay({
634
+ bufferSize: 1,
635
+ refCount: true
636
+ }));
611
637
  }
612
638
  subscribeToBrush(channel) {
613
- return this.brushEmitter.asObservable().pipe(filter((msg) => channel && msg.channel === channel), shareReplay(1));
639
+ return this.brushEmitter.asObservable().pipe(filter((msg) => channel && msg.channel === channel), shareReplay({
640
+ bufferSize: 1,
641
+ refCount: true
642
+ }));
614
643
  }
615
644
  }
616
645
  BroadcastService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: BroadcastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -623,59 +652,99 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
623
652
  }], ctorParameters: function () { return []; } });
624
653
 
625
654
  class BrushService {
626
- constructor(broadcastService) {
655
+ constructor(broadcastService, zone) {
627
656
  this.broadcastService = broadcastService;
657
+ this.zone = zone;
628
658
  this.brushMap = new Map()
629
659
  .set(BrushType.x, d3.brushX())
630
660
  .set(BrushType.y, d3.brushY());
631
661
  }
632
662
  applyBrush(svgElement, config, brushScale) {
633
- var _a, _b, _c, _d, _e;
663
+ var _a, _b, _c, _d, _e, _f;
634
664
  (_a = this.broadcastSubscribtion) === null || _a === void 0 ? void 0 : _a.unsubscribe();
635
- if ((_b = config.brush) === null || _b === void 0 ? void 0 : _b.enable) {
636
- this.brush = this.brushMap.get((_d = (_c = config === null || config === void 0 ? void 0 : config.brush) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : BrushType.x);
665
+ (_b = this.brush) === null || _b === void 0 ? void 0 : _b.on('start brush end', null);
666
+ if ((_c = config.brush) === null || _c === void 0 ? void 0 : _c.enable) {
667
+ this.brush = this.brushMap.get((_e = (_d = config === null || config === void 0 ? void 0 : config.brush) === null || _d === void 0 ? void 0 : _d.type) !== null && _e !== void 0 ? _e : BrushType.x);
637
668
  const container = d3.select(svgElement.nativeElement);
638
669
  this.brush.on('start brush end', (_) => {
639
- var _a, _b, _c;
670
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
640
671
  if (_.sourceEvent) {
641
672
  if (!_.selection)
642
673
  return;
643
674
  const [from, to] = _.selection;
644
- if (_.type === 'end' && _.sourceEvent instanceof MouseEvent) {
675
+ if (to - from === 0) {
676
+ const selection = (_b = (_a = this.selection) === null || _a === void 0 ? void 0 : _a.map(brushScale)) !== null && _b !== void 0 ? _b : [(_c = config.brush) === null || _c === void 0 ? void 0 : _c.from, (_d = config.brush) === null || _d === void 0 ? void 0 : _d.to].map(brushScale);
677
+ const halfBrushHeight = (selection[1] - selection[0]) / 2;
678
+ const invertedSelection = [from - halfBrushHeight, to + halfBrushHeight].map(brushScale.invert);
679
+ if (invertedSelection[1] - invertedSelection[0] > ((_e = config.brush) === null || _e === void 0 ? void 0 : _e.max)) {
680
+ container.call(this.brush.move, [invertedSelection[0], invertedSelection[0] + ((_f = config.brush) === null || _f === void 0 ? void 0 : _f.max)].map(brushScale));
681
+ return;
682
+ }
683
+ if (invertedSelection[1] - invertedSelection[0] < ((_g = config.brush) === null || _g === void 0 ? void 0 : _g.min)) {
684
+ container.call(this.brush.move, [invertedSelection[0], invertedSelection[0] + ((_h = config.brush) === null || _h === void 0 ? void 0 : _h.min)].map(brushScale));
685
+ return;
686
+ }
687
+ container.call(this.brush.move, [from - halfBrushHeight, to + halfBrushHeight]);
688
+ return;
689
+ }
690
+ if (brushScale.invert(to) - brushScale.invert(from) > ((_j = config.brush) === null || _j === void 0 ? void 0 : _j.max)) {
691
+ container.call(this.brush.move, this.selection ? [this.selection[0], this.selection[0] + ((_k = config.brush) === null || _k === void 0 ? void 0 : _k.max)].map(brushScale) : [(_l = config.brush) === null || _l === void 0 ? void 0 : _l.from, (_m = config.brush) === null || _m === void 0 ? void 0 : _m.to].map(brushScale));
692
+ return;
693
+ }
694
+ if (brushScale.invert(to) - brushScale.invert(from) < ((_o = config.brush) === null || _o === void 0 ? void 0 : _o.min)) {
695
+ container.call(this.brush.move, this.selection ? [this.selection[0], this.selection[0] + ((_p = config.brush) === null || _p === void 0 ? void 0 : _p.min)].map(brushScale) : [(_q = config.brush) === null || _q === void 0 ? void 0 : _q.from, (_r = config.brush) === null || _r === void 0 ? void 0 : _r.to].map(brushScale));
696
+ return;
697
+ }
698
+ if (_.sourceEvent instanceof MouseEvent) {
645
699
  this.selection = _.selection.map(brushScale.invert);
646
700
  }
647
701
  const brushMessage = new BrushMessage({
648
702
  event: _,
649
703
  selection: [brushScale.invert(from), brushScale.invert(to)],
650
- brushType: (_b = (_a = config === null || config === void 0 ? void 0 : config.brush) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : BrushType.x,
651
- brushScale,
704
+ brushType: (_t = (_s = config === null || config === void 0 ? void 0 : config.brush) === null || _s === void 0 ? void 0 : _s.type) !== null && _t !== void 0 ? _t : BrushType.x,
705
+ brushScale
652
706
  });
653
707
  this.broadcastService.broadcastBrush({
654
- channel: (_c = config === null || config === void 0 ? void 0 : config.zoom) === null || _c === void 0 ? void 0 : _c.syncChannel,
708
+ channel: (_u = config === null || config === void 0 ? void 0 : config.zoom) === null || _u === void 0 ? void 0 : _u.syncChannel,
655
709
  message: brushMessage,
656
710
  });
657
711
  }
658
712
  });
659
- setTimeout(() => {
660
- var _a, _b;
661
- container.call(this.brush);
662
- let domain = brushScale.domain();
663
- if ((_a = config === null || config === void 0 ? void 0 : config.brush) === null || _a === void 0 ? void 0 : _a.from) {
664
- domain[0] = config.brush.from;
665
- }
666
- if ((_b = config === null || config === void 0 ? void 0 : config.brush) === null || _b === void 0 ? void 0 : _b.to) {
667
- domain[1] = config.brush.to;
668
- }
669
- container.call(this.brush.move, this.selection ? this.selection.map(brushScale) : domain.map(brushScale), {});
670
- }, 0);
671
- this.broadcastSubscribtion = this.broadcastService.subscribeToZoom((_e = config === null || config === void 0 ? void 0 : config.zoom) === null || _e === void 0 ? void 0 : _e.syncChannel).pipe(filter((m) => {
713
+ this.zone.runOutsideAngular(() => {
714
+ setTimeout(() => {
715
+ var _a, _b;
716
+ container.call(this.brush);
717
+ let domain = brushScale.domain();
718
+ if ((_a = config === null || config === void 0 ? void 0 : config.brush) === null || _a === void 0 ? void 0 : _a.from) {
719
+ domain[0] = config.brush.from;
720
+ }
721
+ if ((_b = config === null || config === void 0 ? void 0 : config.brush) === null || _b === void 0 ? void 0 : _b.to) {
722
+ domain[1] = config.brush.to;
723
+ }
724
+ container.call(this.brush.move, this.selection ? this.selection.map(brushScale) : domain.map(brushScale), {});
725
+ }, 0);
726
+ });
727
+ this.broadcastSubscribtion = this.broadcastService.subscribeToZoom((_f = config === null || config === void 0 ? void 0 : config.zoom) === null || _f === void 0 ? void 0 : _f.syncChannel).pipe(filter((m) => {
672
728
  return m.message.event.sourceEvent instanceof MouseEvent || m.message.event.sourceEvent instanceof WheelEvent;
673
- }), throttleTime(50, undefined, { trailing: true }), tap((m) => {
729
+ }), throttleTime(0, animationFrameScheduler, { trailing: true }), tap((m) => {
730
+ var _a, _b, _c;
674
731
  const { message: { brushDomain } } = m;
675
732
  container.call(this.brush.move, [
676
733
  brushScale(brushDomain[0]),
677
734
  brushScale(brushDomain[1]),
678
735
  ]);
736
+ if (m.message.event.type === 'end') {
737
+ const brushMessage = new BrushMessage({
738
+ event: null,
739
+ selection: brushDomain,
740
+ brushType: (_b = (_a = config === null || config === void 0 ? void 0 : config.brush) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : BrushType.x,
741
+ brushScale,
742
+ });
743
+ this.broadcastService.broadcastBrush({
744
+ channel: (_c = config === null || config === void 0 ? void 0 : config.zoom) === null || _c === void 0 ? void 0 : _c.syncChannel,
745
+ message: brushMessage,
746
+ });
747
+ }
679
748
  this.selection = brushDomain;
680
749
  })).subscribe();
681
750
  }
@@ -684,14 +753,14 @@ class BrushService {
684
753
  this.selection = null;
685
754
  }
686
755
  }
687
- BrushService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: BrushService, deps: [{ token: BroadcastService }], target: i0.ɵɵFactoryTarget.Injectable });
756
+ BrushService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: BrushService, deps: [{ token: BroadcastService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
688
757
  BrushService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: BrushService, providedIn: 'root' });
689
758
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: BrushService, decorators: [{
690
759
  type: Injectable,
691
760
  args: [{
692
761
  providedIn: 'root',
693
762
  }]
694
- }], ctorParameters: function () { return [{ type: BroadcastService }]; } });
763
+ }], ctorParameters: function () { return [{ type: BroadcastService }, { type: i0.NgZone }]; } });
695
764
 
696
765
  class TooltipComponent {
697
766
  constructor(svc, cdr, zoomService, sanitizer, _zone) {
@@ -711,7 +780,7 @@ class TooltipComponent {
711
780
  });
712
781
  }));
713
782
  this.position = this.svc.pointerMove.pipe(filter((event) => !!event), map((_) => {
714
- return this.getPoisition(_);
783
+ return this.getPosition(_);
715
784
  }), tap(() => this.cdr.detectChanges()));
716
785
  const transformHtml = (html) => {
717
786
  return this.sanitizer.bypassSecurityTrustHtml(html);
@@ -739,7 +808,7 @@ class TooltipComponent {
739
808
  return formatted;
740
809
  }));
741
810
  }
742
- getPoisition(event) {
811
+ getPosition(event) {
743
812
  const centerX = this.size.width / 2;
744
813
  const centerY = this.size.height / 2;
745
814
  const padding = { x: 10, y: 10 };
@@ -757,10 +826,10 @@ class TooltipComponent {
757
826
  }
758
827
  }
759
828
  TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: TooltipComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ZoomService }, { token: i3.DomSanitizer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
760
- TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: TooltipComponent, selector: "teta-tooltip", inputs: { size: "size", config: "config" }, ngImport: i0, template: "<ng-container *ngIf=\"position | async as p\">\n\n <div class=\"chart-tooltip color-text-90 bg-background-50 shadow-2 padding-2 border-radius-1\"\n *ngIf=\"displayTooltips | async as tool\"\n [style.position]=\"'fixed'\"\n [style.opacity]=\"display | async\"\n style=\"pointer-events: none; min-width: 200px;\"\n [style.left]=\"p.left\"\n [style.top]=\"p.top\"\n [style.bottom]=\"p.bottom\"\n [style.right]=\"p.right\"\n [innerHTML]=\"tool\">\n </div>\n</ng-container>\n\n", styles: [":host{position:absolute;z-index:2}\n"], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
829
+ TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: TooltipComponent, selector: "teta-tooltip", inputs: { size: "size", config: "config" }, ngImport: i0, template: "<ng-container *ngIf=\"position | async as p\">\n <div class=\"chart-tooltip color-text-90 bg-background-50 shadow-2 padding-2 border-radius-1\"\n *ngIf=\"displayTooltips | async as tool\"\n [style.position]=\"'fixed'\"\n [style.opacity]=\"display | async\"\n style=\"pointer-events: none; min-width: 200px;\"\n [style.left]=\"p.left\"\n [style.top]=\"p.top\"\n [style.bottom]=\"p.bottom\"\n [style.right]=\"p.right\"\n [innerHTML]=\"tool\">\n </div>\n</ng-container>\n", styles: [":host{position:absolute;z-index:2}\n"], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
761
830
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: TooltipComponent, decorators: [{
762
831
  type: Component,
763
- args: [{ selector: 'teta-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"position | async as p\">\n\n <div class=\"chart-tooltip color-text-90 bg-background-50 shadow-2 padding-2 border-radius-1\"\n *ngIf=\"displayTooltips | async as tool\"\n [style.position]=\"'fixed'\"\n [style.opacity]=\"display | async\"\n style=\"pointer-events: none; min-width: 200px;\"\n [style.left]=\"p.left\"\n [style.top]=\"p.top\"\n [style.bottom]=\"p.bottom\"\n [style.right]=\"p.right\"\n [innerHTML]=\"tool\">\n </div>\n</ng-container>\n\n", styles: [":host{position:absolute;z-index:2}\n"] }]
832
+ args: [{ selector: 'teta-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"position | async as p\">\n <div class=\"chart-tooltip color-text-90 bg-background-50 shadow-2 padding-2 border-radius-1\"\n *ngIf=\"displayTooltips | async as tool\"\n [style.position]=\"'fixed'\"\n [style.opacity]=\"display | async\"\n style=\"pointer-events: none; min-width: 200px;\"\n [style.left]=\"p.left\"\n [style.top]=\"p.top\"\n [style.bottom]=\"p.bottom\"\n [style.right]=\"p.right\"\n [innerHTML]=\"tool\">\n </div>\n</ng-container>\n", styles: [":host{position:absolute;z-index:2}\n"] }]
764
833
  }], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ZoomService }, { type: i3.DomSanitizer }, { type: i0.NgZone }]; }, propDecorators: { size: [{
765
834
  type: Input
766
835
  }], config: [{
@@ -889,16 +958,18 @@ class GridlinesComponent {
889
958
  }
890
959
  }
891
960
  GridlinesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: GridlinesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
892
- GridlinesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: GridlinesComponent, selector: "[teta-gridlines]", inputs: { size: "size", xScaleMap: "xScaleMap", yScaleMap: "yScaleMap" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngFor=\"let tick of tickYValues\">\n <svg:line [attr.x1]=\"0\" stroke=\"red\"\n [attr.y1]=\"yScaleMap.get(0)(tick)\"\n [attr.x2]=\"size?.width\"\n [attr.y2]=\"yScaleMap.get(0)(tick)\"></svg:line>\n</ng-container>\n\n<ng-container *ngFor=\"let tick of tickXValues\">\n <svg:line [attr.x1]=\"xScaleMap.get(0)(tick)\"\n stroke=\"red\"\n [attr.y1]=\"0\"\n [attr.x2]=\"xScaleMap.get(0)(tick)\"\n [attr.y2]=\"size?.height\"></svg:line>\n</ng-container>\n", styles: [":host{shape-rendering:crispEdges}:host line{stroke-dasharray:1,4;stroke:var(--color-text-20)}\n"], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
961
+ GridlinesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: GridlinesComponent, selector: "[teta-gridlines]", inputs: { size: "size", xScaleMap: "xScaleMap", yScaleMap: "yScaleMap", config: "config" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"config.gridLines?.showY !== false\" >\n <ng-container *ngFor=\"let tick of tickYValues\">\n <svg:line [attr.x1]=\"0\" stroke=\"red\"\n [attr.y1]=\"yScaleMap.get(0)(tick)\"\n [attr.x2]=\"size?.width\"\n [attr.y2]=\"yScaleMap.get(0)(tick)\"></svg:line>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"config.gridLines?.showX !== false\" >\n <ng-container *ngFor=\"let tick of tickXValues\">\n <svg:line [attr.x1]=\"xScaleMap.get(0)(tick)\"\n stroke=\"red\"\n [attr.y1]=\"0\"\n [attr.x2]=\"xScaleMap.get(0)(tick)\"\n [attr.y2]=\"size?.height\"></svg:line>\n </ng-container>\n</ng-container>\n", styles: [":host{shape-rendering:crispEdges}:host line{stroke-dasharray:1,4;stroke:var(--color-text-20)}\n"], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
893
962
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: GridlinesComponent, decorators: [{
894
963
  type: Component,
895
- args: [{ selector: '[teta-gridlines]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let tick of tickYValues\">\n <svg:line [attr.x1]=\"0\" stroke=\"red\"\n [attr.y1]=\"yScaleMap.get(0)(tick)\"\n [attr.x2]=\"size?.width\"\n [attr.y2]=\"yScaleMap.get(0)(tick)\"></svg:line>\n</ng-container>\n\n<ng-container *ngFor=\"let tick of tickXValues\">\n <svg:line [attr.x1]=\"xScaleMap.get(0)(tick)\"\n stroke=\"red\"\n [attr.y1]=\"0\"\n [attr.x2]=\"xScaleMap.get(0)(tick)\"\n [attr.y2]=\"size?.height\"></svg:line>\n</ng-container>\n", styles: [":host{shape-rendering:crispEdges}:host line{stroke-dasharray:1,4;stroke:var(--color-text-20)}\n"] }]
964
+ args: [{ selector: '[teta-gridlines]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"config.gridLines?.showY !== false\" >\n <ng-container *ngFor=\"let tick of tickYValues\">\n <svg:line [attr.x1]=\"0\" stroke=\"red\"\n [attr.y1]=\"yScaleMap.get(0)(tick)\"\n [attr.x2]=\"size?.width\"\n [attr.y2]=\"yScaleMap.get(0)(tick)\"></svg:line>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"config.gridLines?.showX !== false\" >\n <ng-container *ngFor=\"let tick of tickXValues\">\n <svg:line [attr.x1]=\"xScaleMap.get(0)(tick)\"\n stroke=\"red\"\n [attr.y1]=\"0\"\n [attr.x2]=\"xScaleMap.get(0)(tick)\"\n [attr.y2]=\"size?.height\"></svg:line>\n </ng-container>\n</ng-container>\n", styles: [":host{shape-rendering:crispEdges}:host line{stroke-dasharray:1,4;stroke:var(--color-text-20)}\n"] }]
896
965
  }], ctorParameters: function () { return []; }, propDecorators: { size: [{
897
966
  type: Input
898
967
  }], xScaleMap: [{
899
968
  type: Input
900
969
  }], yScaleMap: [{
901
970
  type: Input
971
+ }], config: [{
972
+ type: Input
902
973
  }] } });
903
974
 
904
975
  class PlotBandComponent {
@@ -934,7 +1005,7 @@ class PlotBandComponent {
934
1005
  const grabElements = d3
935
1006
  .select(this.element.nativeElement)
936
1007
  .selectAll('.grabber');
937
- const drag = d3
1008
+ this.dragElements = d3
938
1009
  .drag()
939
1010
  .subject(() => {
940
1011
  if (this.axis.orientation === AxisOrientation.x) {
@@ -943,7 +1014,8 @@ class PlotBandComponent {
943
1014
  if (this.axis.orientation === AxisOrientation.y) {
944
1015
  return { y: plotbandElement.attr('y') };
945
1016
  }
946
- })
1017
+ });
1018
+ const drag = this.dragElements
947
1019
  .on('start drag end', (event, d) => {
948
1020
  let bandSize = parseFloat(plotbandElement.attr(this.axis.orientation === AxisOrientation.x ? 'width' : 'height'));
949
1021
  d.from = this.scale.invert(event[AxisOrientation[this.axis.orientation]]);
@@ -955,8 +1027,9 @@ class PlotBandComponent {
955
1027
  this.cdr.detectChanges();
956
1028
  });
957
1029
  let grabberKey;
958
- const resize = d3
959
- .drag()
1030
+ this.resizeElements = d3
1031
+ .drag();
1032
+ const resize = this.resizeElements
960
1033
  .on('start drag end', (event, d) => {
961
1034
  requestAnimationFrame(() => {
962
1035
  var _a, _b, _c, _d;
@@ -1003,6 +1076,10 @@ class PlotBandComponent {
1003
1076
  grabElements.call(resize);
1004
1077
  }
1005
1078
  }
1079
+ ngOnDestroy() {
1080
+ this.dragElements.on('start drag end', null);
1081
+ this.resizeElements.on('start drag end', null);
1082
+ }
1006
1083
  get bandSize() {
1007
1084
  return Math.abs(this.scale(this.plotBand.to) - this.scale(this.plotBand.from));
1008
1085
  }
@@ -1064,7 +1141,7 @@ class PlotlineComponent {
1064
1141
  const grabElement = d3
1065
1142
  .select(this.element.nativeElement)
1066
1143
  .selectAll('.grabber');
1067
- const drag = d3
1144
+ this.dragElements = d3
1068
1145
  .drag()
1069
1146
  .subject(() => {
1070
1147
  if (this.axis.orientation === AxisOrientation.y) {
@@ -1073,7 +1150,8 @@ class PlotlineComponent {
1073
1150
  if (this.axis.orientation === AxisOrientation.x) {
1074
1151
  return { x: plotlineElement.attr('x1') };
1075
1152
  }
1076
- })
1153
+ });
1154
+ const drag = this.dragElements
1077
1155
  .on('start drag end', (event, d) => {
1078
1156
  d.value = this.scale.invert(event[AxisOrientation[this.axis.orientation]]);
1079
1157
  this.emit({
@@ -1088,6 +1166,9 @@ class PlotlineComponent {
1088
1166
  grabElement.call(drag);
1089
1167
  }
1090
1168
  }
1169
+ ngOnDestroy() {
1170
+ this.dragElements.on('start drag end', null);
1171
+ }
1091
1172
  emit(event) {
1092
1173
  this.chartService.emitPlotline(event);
1093
1174
  }
@@ -1116,61 +1197,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
1116
1197
  type: Input
1117
1198
  }] } });
1118
1199
 
1119
- class AnnotationComponent {
1120
- constructor() { }
1121
- ngOnInit() { }
1122
- ngAfterViewInit() {
1123
- this._node = d3.select(this.node.nativeElement);
1124
- this.drawAnnotations();
1125
- }
1126
- drawAnnotations() {
1127
- var _a;
1128
- if (!this.node)
1129
- return;
1130
- const annotations = (_a = this.annotations) === null || _a === void 0 ? void 0 : _a.map((annotation) => {
1131
- var _a, _b, _c;
1132
- const x = this.xScaleMap.get(annotation.xAxisIndex);
1133
- const y = this.yScaleMap.get(annotation.yAxisIndex);
1134
- return {
1135
- note: annotation.note,
1136
- connector: annotation.connector,
1137
- x: x((_a = annotation.point) === null || _a === void 0 ? void 0 : _a.x),
1138
- y: y((_b = annotation.point) === null || _b === void 0 ? void 0 : _b.y),
1139
- dx: annotation.dx,
1140
- dy: annotation.dy,
1141
- type: (_c = annotation.type) !== null && _c !== void 0 ? _c : d3annotation.annotationLabel,
1142
- className: annotation.className,
1143
- };
1144
- });
1145
- this._makeAnnotations = d3annotation
1146
- .annotation()
1147
- .annotations(annotations !== null && annotations !== void 0 ? annotations : [])
1148
- .editMode(false);
1149
- this._node.call(this._makeAnnotations);
1150
- }
1151
- ngOnChanges(changes) {
1152
- if (changes.hasOwnProperty('xScaleMap') &&
1153
- changes.hasOwnProperty('yScaleMap')) {
1154
- this.drawAnnotations();
1155
- }
1156
- }
1157
- }
1158
- AnnotationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: AnnotationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1159
- AnnotationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: AnnotationComponent, selector: "[teta-annotation]", inputs: { annotations: "annotations", xScaleMap: "xScaleMap", yScaleMap: "yScaleMap" }, viewQueries: [{ propertyName: "node", first: true, predicate: ["svg"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<svg:g #svg></svg:g>\n", styles: [""] });
1160
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: AnnotationComponent, decorators: [{
1161
- type: Component,
1162
- args: [{ selector: '[teta-annotation]', template: "<svg:g #svg></svg:g>\n", styles: [""] }]
1163
- }], ctorParameters: function () { return []; }, propDecorators: { annotations: [{
1164
- type: Input
1165
- }], xScaleMap: [{
1166
- type: Input
1167
- }], yScaleMap: [{
1168
- type: Input
1169
- }], node: [{
1170
- type: ViewChild,
1171
- args: ['svg']
1172
- }] } });
1173
-
1174
1200
  class SeriesBaseComponent {
1175
1201
  constructor(svc, cdr, scaleService, zoomService, element) {
1176
1202
  this.svc = svc;
@@ -1179,6 +1205,12 @@ class SeriesBaseComponent {
1179
1205
  this.zoomService = zoomService;
1180
1206
  this.element = element;
1181
1207
  }
1208
+ set config(config) {
1209
+ this._config = config;
1210
+ }
1211
+ get config() {
1212
+ return this._config;
1213
+ }
1182
1214
  set series(series) {
1183
1215
  this._series = series;
1184
1216
  }
@@ -1189,7 +1221,7 @@ class SeriesBaseComponent {
1189
1221
  }
1190
1222
  }
1191
1223
  SeriesBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SeriesBaseComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1192
- SeriesBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: SeriesBaseComponent, selector: "ng-component", inputs: { config: "config", series: "series", size: "size", rect: "rect" }, ngImport: i0, template: '', isInline: true });
1224
+ SeriesBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: SeriesBaseComponent, selector: "ng-component", inputs: { config: "config", series: "series" }, ngImport: i0, template: '', isInline: true });
1193
1225
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SeriesBaseComponent, decorators: [{
1194
1226
  type: Component,
1195
1227
  args: [{
@@ -1199,10 +1231,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
1199
1231
  type: Input
1200
1232
  }], series: [{
1201
1233
  type: Input
1202
- }], size: [{
1203
- type: Input
1204
- }], rect: [{
1205
- type: Input
1206
1234
  }] } });
1207
1235
 
1208
1236
  var DragPointType;
@@ -1212,7 +1240,7 @@ var DragPointType;
1212
1240
  DragPointType[DragPointType["xy"] = 2] = "xy";
1213
1241
  })(DragPointType || (DragPointType = {}));
1214
1242
 
1215
- class LineSeriesComponent extends SeriesBaseComponent {
1243
+ class LinearSeriesBase extends SeriesBaseComponent {
1216
1244
  constructor(svc, cdr, scaleService, zoomService, element) {
1217
1245
  super(svc, cdr, scaleService, zoomService, element);
1218
1246
  this.svc = svc;
@@ -1246,6 +1274,14 @@ class LineSeriesComponent extends SeriesBaseComponent {
1246
1274
  return line(this.series.data);
1247
1275
  }));
1248
1276
  }
1277
+ ngOnDestroy() {
1278
+ var _a;
1279
+ (_a = this.markers) === null || _a === void 0 ? void 0 : _a.on('start drag end', null);
1280
+ this.svc.setTooltip({
1281
+ point: null,
1282
+ series: this.series,
1283
+ });
1284
+ }
1249
1285
  ngAfterViewInit() {
1250
1286
  var _a;
1251
1287
  const drag = (node, event, d) => {
@@ -1267,13 +1303,13 @@ class LineSeriesComponent extends SeriesBaseComponent {
1267
1303
  });
1268
1304
  this.cdr.detectChanges();
1269
1305
  };
1270
- const dragMarkers = d3
1306
+ this.markers = d3
1271
1307
  .drag()
1272
1308
  .subject(function (event, d) {
1273
1309
  const node = d3.select(this);
1274
1310
  return { x: node.attr('cx'), y: node.attr('cy') };
1275
- })
1276
- .on('start drag end', function (event, d) {
1311
+ });
1312
+ const dragMarkers = this.markers.on('start drag end', function (event, d) {
1277
1313
  const node = d3.select(this);
1278
1314
  drag(node, event, d);
1279
1315
  });
@@ -1378,6 +1414,25 @@ class LineSeriesComponent extends SeriesBaseComponent {
1378
1414
  }
1379
1415
  }
1380
1416
  }
1417
+ LinearSeriesBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: LinearSeriesBase, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1418
+ LinearSeriesBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: LinearSeriesBase, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
1419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: LinearSeriesBase, decorators: [{
1420
+ type: Component,
1421
+ args: [{
1422
+ template: '',
1423
+ }]
1424
+ }], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
1425
+
1426
+ class LineSeriesComponent extends LinearSeriesBase {
1427
+ constructor(svc, cdr, scaleService, zoomService, element) {
1428
+ super(svc, cdr, scaleService, zoomService, element);
1429
+ this.svc = svc;
1430
+ this.cdr = cdr;
1431
+ this.scaleService = scaleService;
1432
+ this.zoomService = zoomService;
1433
+ this.element = element;
1434
+ }
1435
+ }
1381
1436
  LineSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: LineSeriesComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1382
1437
  LineSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: LineSeriesComponent, selector: "svg:svg[teta-line-series]", usesInheritance: true, ngImport: i0, template: "<svg:path\n class=\"line\"\n [attr.d]=\"path | async\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n fill=\"none\">\n</svg:path>\n<ng-container *ngIf=\"transform | async as t\">\n <svg:circle\n *ngIf=\"t.x !== undefined && t.y!== undefined\"\n r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate('+ t.x +', '+ t.y +')'\"\n >\n </svg:circle>\n</ng-container>\n\n<ng-container *ngIf=\"getMarkers() as markers\">\n <svg:circle\n class=\"marker\"\n *ngFor=\"let point of markers\"\n [class.draggable-marker]=\"point?.marker?.draggable\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"x(point.x)\"\n [attr.cy]=\"y(point.y)\"\n >\n </svg:circle>\n</ng-container>\n\n\n\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1383
1438
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: LineSeriesComponent, decorators: [{
@@ -1481,7 +1536,7 @@ class BlockSeriesComponent extends SeriesBaseComponent {
1481
1536
  this.id = (Date.now() + Math.random()).toString(36);
1482
1537
  }
1483
1538
  ngOnInit() {
1484
- const defaultVisiblePixels = 1;
1539
+ const defaultVisiblePixels = 0;
1485
1540
  this.x = this.scaleService.xScaleMap.pipe(map((_) => _.get(this.series.xAxisIndex)));
1486
1541
  this.y = this.scaleService.yScaleMap.pipe(map((_) => _.get(this.series.yAxisIndex)));
1487
1542
  this.displayPoints = this.y.pipe(map((y) => {
@@ -1579,7 +1634,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
1579
1634
  args: [{ selector: 'svg:svg[teta-block-area-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n y: y | async,\n x: x | async,\n points: displayPoints | async\n} as data\">\n <svg:defs *ngIf=\"series?.fillType === fillType.gradient\">\n <svg:linearGradient [id]=\"'gradient-fill-' + id\"\n gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config?.inverted ? '0%' : '100%'\"\n [attr.x2]=\"config?.inverted ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.9\"></svg:stop>\n </svg:linearGradient>\n </svg:defs>\n <ng-container *ngFor=\"let point of data.points\">\n <svg:g (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\">\n <svg:rect\n *ngIf=\"!!config.inverted\"\n [attr.x]=\"data.x(0) < data.x(point.x) ? data.x(0) : data.x(point.x)\"\n [attr.y]=\"data.y(point.y)\"\n [attr.height]=\"data.y(point.y1) - data.y(point.y)\"\n [attr.width]=\"data.x(0) < data.x(point.x) ? data.x(point.x) - data.x(0) : data.x(0) - data.x(point.x)\"\n [attr.stroke]=\"point.iconId ? '' : point.color ?? series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n [attr.fill]=\"series.fillType === fillType.gradient ? 'url(#gradient-fill-'+id+')' : point.iconId ? 'url(#pattern'+point.iconId+')' : point.color ?? series.color\"\n [attr.fill-opacity]=\"series.style?.fillOpacity\">\n </svg:rect>\n <svg:rect\n *ngIf=\"!config.inverted\"\n [attr.x]=\"data.x(point.x)\"\n [attr.y]=\"data.y(0)\"\n [attr.height]=\"data.y(0) - data.y(point.y)\"\n [attr.width]=\"data.x(point.x1) - data.x(point.x)\"\n [attr.stroke]=\"point.iconId ? '' : point.color ?? series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n [attr.fill]=\"series.fillType === fillType.gradient ? 'url(#gradient-fill-'+id+')' : point.iconId ? 'url(#pattern'+point.iconId+')' : point.color ?? series.color\"\n [attr.fill-opacity]=\"series.style?.fillOpacity\">\n </svg:rect>\n <svg:text *ngIf=\"point.text\"\n x=\"50%\"\n [attr.y]=\"(data.y(point.y1) + data.y(point.y)) / 2\"\n alignment-baseline=\"middle\"\n text-anchor=\"middle\">{{ point.text }}\n </svg:text>\n\n <!-- <svg:line x1=\"0\" x2=\"100%\" [attr.y1]=\"data.y(point.y)\" [attr.y2]=\"data.y(point.y)\" [attr.stroke]=\"point.iconId ? 'var(&#45;&#45;color-text-10)' : point.color ?? series.color\"></svg:line>-->\n <!-- <svg:line x1=\"0\" x2=\"100%\" [attr.y1]=\"data.y(point.y1)\" [attr.y2]=\"data.y(point.y1)\" [attr.stroke]=\"point.iconId ? 'var(&#45;&#45;color-text-10)' : point.color ?? series.color\"></svg:line>-->\n\n </svg:g>\n </ng-container>\n\n\n</ng-container>\n", styles: [""] }]
1580
1635
  }], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
1581
1636
 
1582
- class AreaSeriesComponent extends SeriesBaseComponent {
1637
+ class AreaSeriesComponent extends LinearSeriesBase {
1583
1638
  constructor(svc, cdr, scaleService, zoomService, element) {
1584
1639
  super(svc, cdr, scaleService, zoomService, element);
1585
1640
  this.svc = svc;
@@ -1592,15 +1647,14 @@ class AreaSeriesComponent extends SeriesBaseComponent {
1592
1647
  this.id = (Date.now() + Math.random()).toString(36);
1593
1648
  }
1594
1649
  ngOnInit() {
1595
- this.transform = this.svc.pointerMove.pipe(withLatestFrom(this.scaleService.xScaleMap, this.scaleService.yScaleMap), map((data) => {
1596
- const [event, x, y] = data;
1597
- return this.getTransform(event, x, y);
1598
- }), tap(() => this.cdr.detectChanges()));
1599
- this.path = combineLatest([
1650
+ super.ngOnInit();
1651
+ this.areaPath = combineLatest([
1600
1652
  this.scaleService.xScaleMap,
1601
1653
  this.scaleService.yScaleMap,
1602
- ]).pipe(withLatestFrom(this.scaleService.xAxisMap, this.scaleService.yAxisMap), map((data) => {
1603
- const [[x, y], xAxisMap, yAxisMap] = data;
1654
+ ]).pipe(map((data) => {
1655
+ const [x, y] = data;
1656
+ this.x = x.get(this.series.xAxisIndex);
1657
+ this.y = y.get(this.series.yAxisIndex);
1604
1658
  this.x = x.get(this.series.xAxisIndex);
1605
1659
  this.y = y.get(this.series.yAxisIndex);
1606
1660
  const area = d3
@@ -1616,138 +1670,12 @@ class AreaSeriesComponent extends SeriesBaseComponent {
1616
1670
  return area(this.series.data);
1617
1671
  }));
1618
1672
  }
1619
- ngAfterViewInit() {
1620
- var _a;
1621
- const drag = (node, event, d) => {
1622
- var _a, _b, _c, _d;
1623
- if (((_a = d.marker) === null || _a === void 0 ? void 0 : _a.dragType) === DragPointType.x ||
1624
- ((_b = d.marker) === null || _b === void 0 ? void 0 : _b.dragType) === DragPointType.xy) {
1625
- d.x = this.x.invert(event.x);
1626
- }
1627
- if (((_c = d.marker) === null || _c === void 0 ? void 0 : _c.dragType) === DragPointType.y ||
1628
- ((_d = d.marker) === null || _d === void 0 ? void 0 : _d.dragType) === DragPointType.xy) {
1629
- d.y = this.y.invert(event.y);
1630
- }
1631
- this.svc.emitPoint({
1632
- target: {
1633
- series: this.series,
1634
- point: d,
1635
- },
1636
- event,
1637
- });
1638
- this.cdr.detectChanges();
1639
- };
1640
- const dragMarkers = d3
1641
- .drag()
1642
- .subject(function (event, d) {
1643
- const node = d3.select(this);
1644
- return { x: node.attr('cx'), y: node.attr('cy') };
1645
- })
1646
- .on('start drag end', function (event, d) {
1647
- const node = d3.select(this);
1648
- drag(node, event, d);
1649
- });
1650
- const draggableMarkers = (_a = this.series.data) === null || _a === void 0 ? void 0 : _a.filter((_) => { var _a; return (_ === null || _ === void 0 ? void 0 : _.marker) && ((_a = _ === null || _ === void 0 ? void 0 : _.marker) === null || _a === void 0 ? void 0 : _a.draggable); });
1651
- const element = d3
1652
- .select(this.element.nativeElement)
1653
- .selectAll('.draggable-marker')
1654
- .data(draggableMarkers);
1655
- element.call(dragMarkers);
1656
- this.svgElement = d3
1657
- .select(this.element.nativeElement)
1658
- .select('.line')
1659
- .node();
1660
- }
1661
- getMarkers() {
1662
- var _a;
1663
- return (_a = this.series.data) === null || _a === void 0 ? void 0 : _a.filter((_) => _ === null || _ === void 0 ? void 0 : _.marker);
1664
- }
1665
- getTransform(event, x, y) {
1666
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1667
- const mouse = [event === null || event === void 0 ? void 0 : event.offsetX, event === null || event === void 0 ? void 0 : event.offsetY];
1668
- const foundX = x.get(this.series.xAxisIndex);
1669
- const foundY = y.get(this.series.yAxisIndex);
1670
- const tooltipTracking = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.tooltip) === null || _b === void 0 ? void 0 : _b.tracking;
1671
- const lineIntersection = (p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) => {
1672
- const rV = {};
1673
- let s1_x, s1_y, s2_x, s2_y;
1674
- s1_x = p1_x - p0_x;
1675
- s1_y = p1_y - p0_y;
1676
- s2_x = p3_x - p2_x;
1677
- s2_y = p3_y - p2_y;
1678
- let s, t;
1679
- s =
1680
- (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) /
1681
- (-s2_x * s1_y + s1_x * s2_y);
1682
- t =
1683
- (s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) /
1684
- (-s2_x * s1_y + s1_x * s2_y);
1685
- if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {
1686
- // Collision detected
1687
- rV.x = p0_x + t * s1_x;
1688
- rV.y = p0_y + t * s1_y;
1689
- }
1690
- return rV;
1691
- };
1692
- if (tooltipTracking === TooltipTracking.x) {
1693
- const bisect = d3.bisector((_) => _.x).right;
1694
- const pointer = mouse[0];
1695
- const x0 = foundX.invert(pointer);
1696
- const filtered = this.series.data.filter((_) => _.y !== null && _.x !== null);
1697
- const rightId = bisect(filtered, x0);
1698
- const range = foundY.range();
1699
- const intersect = lineIntersection(pointer, range[0], pointer, range[1], foundX((_c = filtered[rightId - 1]) === null || _c === void 0 ? void 0 : _c.x), foundY((_d = filtered[rightId - 1]) === null || _d === void 0 ? void 0 : _d.y), foundX((_e = filtered[rightId]) === null || _e === void 0 ? void 0 : _e.x), foundY((_f = filtered[rightId]) === null || _f === void 0 ? void 0 : _f.y));
1700
- const x = foundX.invert(intersect.x);
1701
- const y = foundY.invert(intersect.y);
1702
- if (x !== null && x !== undefined && !isNaN(x) && y !== null && y !== undefined && !isNaN(y)) {
1703
- this.svc.setTooltip({
1704
- point: { x: foundX.invert(intersect.x), y: foundY.invert(intersect.y) },
1705
- series: this.series,
1706
- });
1707
- }
1708
- else {
1709
- this.svc.setTooltip({
1710
- point: null,
1711
- series: this.series,
1712
- });
1713
- }
1714
- return {
1715
- x: intersect.x,
1716
- y: intersect.y,
1717
- };
1718
- }
1719
- if (tooltipTracking === TooltipTracking.y) {
1720
- const bisect = d3.bisector((_) => _.y).right;
1721
- const y0 = foundY.invert(mouse[1]);
1722
- const rightId = bisect(this.series.data, y0);
1723
- const range = foundX.range();
1724
- const intersect = lineIntersection(range[0], mouse[1], range[1], mouse[1], foundX((_g = this.series.data[rightId - 1]) === null || _g === void 0 ? void 0 : _g.x), foundY((_h = this.series.data[rightId - 1]) === null || _h === void 0 ? void 0 : _h.y), foundX((_j = this.series.data[rightId]) === null || _j === void 0 ? void 0 : _j.x), foundY((_k = this.series.data[rightId]) === null || _k === void 0 ? void 0 : _k.y));
1725
- const x = foundX.invert(intersect.x);
1726
- const y = foundY.invert(intersect.y);
1727
- if (x !== null && x !== undefined && !isNaN(x) && y !== null && y !== undefined && !isNaN(y)) {
1728
- this.svc.setTooltip({
1729
- point: { x: foundX.invert(intersect.x), y: foundY.invert(intersect.y) },
1730
- series: this.series,
1731
- });
1732
- }
1733
- else {
1734
- this.svc.setTooltip({
1735
- point: null,
1736
- series: this.series,
1737
- });
1738
- }
1739
- return {
1740
- x: intersect.x,
1741
- y: intersect.y,
1742
- };
1743
- }
1744
- }
1745
1673
  }
1746
1674
  AreaSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: AreaSeriesComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1747
- AreaSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: AreaSeriesComponent, selector: "svg:svg[teta-area-series]", usesInheritance: true, ngImport: i0, template: "<svg:defs *ngIf=\"series?.fillType === fillType.gradient\">\n <svg:linearGradient [id]=\"'gradient-fill-' + id\" gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config?.inverted || series?.fillDirection === fillDirection.y ? '0%' : '100%'\"\n [attr.x2]=\"config?.inverted || series?.fillDirection === fillDirection.y ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.9\"></svg:stop>\n </svg:linearGradient>\n</svg:defs>\n<svg:path\n class=\"area\"\n [attr.d]=\"path | async\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n [attr.fill-opacity]=\"series.style?.fillOpacity\"\n [attr.fill]=\"series.fillType === fillType.gradient ? 'url(#gradient-fill-'+id+')' : series.style.fill ?? series.color\">\n</svg:path>\n<ng-container *ngIf=\"transform | async as t\">\n <svg:circle\n *ngIf=\"t.x !== undefined && t.y!== undefined\"\n r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate('+ t.x +', '+ t.y +')'\"\n >\n </svg:circle>\n</ng-container>\n\n<ng-container *ngIf=\"getMarkers() as markers\">\n <svg:circle\n class=\"marker\"\n *ngFor=\"let point of markers\"\n [class.draggable-marker]=\"point?.marker?.draggable\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"x(point.x)\"\n [attr.cy]=\"y(point.y)\"\n >\n </svg:circle>\n</ng-container>\n\n\n\n", styles: [""], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1675
+ AreaSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: AreaSeriesComponent, selector: "svg:svg[teta-area-series]", usesInheritance: true, ngImport: i0, template: "<svg:defs *ngIf=\"series?.fillType === fillType.gradient\">\n <svg:linearGradient [id]=\"'gradient-fill-' + id\" gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config?.inverted || series?.fillDirection === fillDirection.y ? '0%' : '100%'\"\n [attr.x2]=\"config?.inverted || series?.fillDirection === fillDirection.y ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.8\"></svg:stop>\n </svg:linearGradient>\n</svg:defs>\n<svg:path\n class=\"area\"\n *ngIf=\"series?.fillType === fillType.gradient\"\n [attr.d]=\"areaPath | async\"\n [attr.stroke-width]=\"0\"\n [attr.fill-opacity]=\"series.style?.fillOpacity\"\n [attr.fill]=\"series.fillType === fillType.gradient ? 'url(#gradient-fill-'+id+')' : series.style.fill ?? series.color\">\n</svg:path>\n<svg:path\n class=\"area\"\n fill=\"none\"\n [attr.d]=\"path | async\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\">\n</svg:path>\n<ng-container *ngIf=\"transform | async as t\">\n <svg:circle\n *ngIf=\"t.x !== undefined && t.y!== undefined\"\n r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate('+ t.x +', '+ t.y +')'\"\n >\n </svg:circle>\n</ng-container>\n<ng-container *ngIf=\"getMarkers() as markers\">\n <svg:circle\n class=\"marker\"\n *ngFor=\"let point of markers\"\n [class.draggable-marker]=\"point?.marker?.draggable\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"x(point.x)\"\n [attr.cy]=\"y(point.y)\"\n >\n </svg:circle>\n</ng-container>\n\n\n\n", styles: [""], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1748
1676
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: AreaSeriesComponent, decorators: [{
1749
1677
  type: Component,
1750
- args: [{ selector: 'svg:svg[teta-area-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:defs *ngIf=\"series?.fillType === fillType.gradient\">\n <svg:linearGradient [id]=\"'gradient-fill-' + id\" gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config?.inverted || series?.fillDirection === fillDirection.y ? '0%' : '100%'\"\n [attr.x2]=\"config?.inverted || series?.fillDirection === fillDirection.y ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.9\"></svg:stop>\n </svg:linearGradient>\n</svg:defs>\n<svg:path\n class=\"area\"\n [attr.d]=\"path | async\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n [attr.fill-opacity]=\"series.style?.fillOpacity\"\n [attr.fill]=\"series.fillType === fillType.gradient ? 'url(#gradient-fill-'+id+')' : series.style.fill ?? series.color\">\n</svg:path>\n<ng-container *ngIf=\"transform | async as t\">\n <svg:circle\n *ngIf=\"t.x !== undefined && t.y!== undefined\"\n r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate('+ t.x +', '+ t.y +')'\"\n >\n </svg:circle>\n</ng-container>\n\n<ng-container *ngIf=\"getMarkers() as markers\">\n <svg:circle\n class=\"marker\"\n *ngFor=\"let point of markers\"\n [class.draggable-marker]=\"point?.marker?.draggable\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"x(point.x)\"\n [attr.cy]=\"y(point.y)\"\n >\n </svg:circle>\n</ng-container>\n\n\n\n", styles: [""] }]
1678
+ args: [{ selector: 'svg:svg[teta-area-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:defs *ngIf=\"series?.fillType === fillType.gradient\">\n <svg:linearGradient [id]=\"'gradient-fill-' + id\" gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config?.inverted || series?.fillDirection === fillDirection.y ? '0%' : '100%'\"\n [attr.x2]=\"config?.inverted || series?.fillDirection === fillDirection.y ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series.color\" stop-opacity=\"0.8\"></svg:stop>\n </svg:linearGradient>\n</svg:defs>\n<svg:path\n class=\"area\"\n *ngIf=\"series?.fillType === fillType.gradient\"\n [attr.d]=\"areaPath | async\"\n [attr.stroke-width]=\"0\"\n [attr.fill-opacity]=\"series.style?.fillOpacity\"\n [attr.fill]=\"series.fillType === fillType.gradient ? 'url(#gradient-fill-'+id+')' : series.style.fill ?? series.color\">\n</svg:path>\n<svg:path\n class=\"area\"\n fill=\"none\"\n [attr.d]=\"path | async\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\">\n</svg:path>\n<ng-container *ngIf=\"transform | async as t\">\n <svg:circle\n *ngIf=\"t.x !== undefined && t.y!== undefined\"\n r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate('+ t.x +', '+ t.y +')'\"\n >\n </svg:circle>\n</ng-container>\n<ng-container *ngIf=\"getMarkers() as markers\">\n <svg:circle\n class=\"marker\"\n *ngFor=\"let point of markers\"\n [class.draggable-marker]=\"point?.marker?.draggable\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"x(point.x)\"\n [attr.cy]=\"y(point.y)\"\n >\n </svg:circle>\n</ng-container>\n\n\n\n", styles: [""] }]
1751
1679
  }], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
1752
1680
 
1753
1681
  const defaultSeriesTypeMapping = new Map()
@@ -1759,16 +1687,9 @@ const defaultSeriesTypeMapping = new Map()
1759
1687
  .set(SeriesType.blockArea, BlockAreaSeriesComponent);
1760
1688
 
1761
1689
  class SeriesHostComponent {
1762
- constructor(viewContainerRef, chartService) {
1690
+ constructor(viewContainerRef) {
1763
1691
  this.viewContainerRef = viewContainerRef;
1764
- this.chartService = chartService;
1765
1692
  this._init = false;
1766
- this.chartService.size
1767
- .pipe(tap(() => {
1768
- var _a;
1769
- (_a = this._componentRef) === null || _a === void 0 ? void 0 : _a.injector.get(ChangeDetectorRef).detectChanges();
1770
- }))
1771
- .subscribe();
1772
1693
  }
1773
1694
  ngOnInit() {
1774
1695
  if (!SeriesBaseComponent.isPrototypeOf(this.series.component)) {
@@ -1778,24 +1699,21 @@ class SeriesHostComponent {
1778
1699
  this._componentRef = this.viewContainerRef.createComponent(this.series.component);
1779
1700
  this._componentRef.instance.config = this.config;
1780
1701
  this._componentRef.instance.series = this.series;
1781
- this._componentRef.instance.size = this.size;
1782
- this._componentRef.instance.rect = this.rect;
1783
1702
  this._init = true;
1784
1703
  }
1785
- ngOnDestroy() { }
1704
+ ngOnDestroy() {
1705
+ this._componentRef.destroy();
1706
+ }
1786
1707
  ngOnChanges(changes) {
1787
- if (this._init && changes.hasOwnProperty('series')) {
1708
+ if (this._init && (changes.hasOwnProperty('series') || changes.hasOwnProperty('config'))) {
1788
1709
  this._componentRef.instance.config = this.config;
1789
1710
  this._componentRef.instance.series = this.series;
1790
- this._componentRef.instance.size = this.size;
1791
- this._componentRef.instance.rect = this.rect;
1792
- this._componentRef.injector.get(ChangeDetectorRef).markForCheck();
1793
1711
  this._componentRef.injector.get(ChangeDetectorRef).detectChanges();
1794
1712
  }
1795
1713
  }
1796
1714
  }
1797
- SeriesHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SeriesHostComponent, deps: [{ token: i0.ViewContainerRef }, { token: ChartService }], target: i0.ɵɵFactoryTarget.Component });
1798
- SeriesHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: SeriesHostComponent, selector: "[teta-series-host]", inputs: { config: "config", series: "series", size: "size", rect: "rect" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1715
+ SeriesHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SeriesHostComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
1716
+ SeriesHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: SeriesHostComponent, selector: "[teta-series-host]", inputs: { config: "config", series: "series" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1799
1717
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: SeriesHostComponent, decorators: [{
1800
1718
  type: Component,
1801
1719
  args: [{
@@ -1803,23 +1721,121 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
1803
1721
  template: '',
1804
1722
  changeDetection: ChangeDetectionStrategy.OnPush,
1805
1723
  }]
1806
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: ChartService }]; }, propDecorators: { config: [{
1724
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { config: [{
1807
1725
  type: Input
1808
1726
  }], series: [{
1809
1727
  type: Input
1810
- }], size: [{
1811
- type: Input
1812
- }], rect: [{
1728
+ }] } });
1729
+
1730
+ class AnnotationComponent {
1731
+ constructor(scaleService, cdr, chartService) {
1732
+ this.scaleService = scaleService;
1733
+ this.cdr = cdr;
1734
+ this.chartService = chartService;
1735
+ this.x = this.scaleService.xScaleMap.pipe(map((_) => { var _a; return _.get((_a = this.annotation.xAxisIndex) !== null && _a !== void 0 ? _a : 0); }));
1736
+ this.y = this.scaleService.yScaleMap.pipe(map((_) => { var _a; return _.get((_a = this.annotation.yAxisIndex) !== null && _a !== void 0 ? _a : 0); }));
1737
+ this.drag = d3.drag();
1738
+ }
1739
+ set annotation(annotation) {
1740
+ this._annotation = annotation;
1741
+ }
1742
+ get annotation() {
1743
+ return this._annotation;
1744
+ }
1745
+ set node(node) {
1746
+ this._node = node;
1747
+ this.init();
1748
+ this.cdr.detectChanges();
1749
+ }
1750
+ get node() {
1751
+ return this._node;
1752
+ }
1753
+ click(event) {
1754
+ this.chartService.emitAnnotation({
1755
+ event,
1756
+ target: this.annotation
1757
+ });
1758
+ }
1759
+ contextMenu(event) {
1760
+ this.chartService.emitAnnotation({
1761
+ event,
1762
+ target: this.annotation
1763
+ });
1764
+ }
1765
+ ngOnDestroy() {
1766
+ this.drag.on('drag end', null);
1767
+ }
1768
+ init() {
1769
+ d3.select(this.node.nativeElement).datum(this.annotation);
1770
+ if (this.annotation.draggable) {
1771
+ this.drag.on('drag end', (event, d) => {
1772
+ d.dx += event.dx;
1773
+ d.dy += event.dy;
1774
+ this.cdr.detectChanges();
1775
+ this.chartService.emitMoveAnnotation({
1776
+ event,
1777
+ target: d
1778
+ });
1779
+ });
1780
+ d3.select(this.node.nativeElement).call(this.drag);
1781
+ }
1782
+ }
1783
+ }
1784
+ AnnotationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: AnnotationComponent, deps: [{ token: ScaleService }, { token: i0.ChangeDetectorRef }, { token: ChartService }], target: i0.ɵɵFactoryTarget.Component });
1785
+ AnnotationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: AnnotationComponent, selector: "[teta-annotation]", inputs: { annotation: "annotation" }, host: { listeners: { "click": "click($event)", "contextmenu": "contextMenu($event)" } }, viewQueries: [{ propertyName: "node", first: true, predicate: ["annotationNode"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"{\n x: x | async,\n y: y | async\n } as data\">\n <svg:circle\n [attr.r]=\"annotation.style?.radius ?? 5\"\n [attr.cx]=\"data.x(annotation.point.x)\"\n [attr.fill]=\"annotation?.style?.fill ?? 'var(--color-text-90)'\"\n [attr.cy]=\"data.y(annotation.point.y)\">\n </svg:circle>\n <svg:line\n [attr.x1]=\"data.x(annotation.point.x)\"\n [attr.y1]=\"data.y(annotation.point.y)\"\n [attr.x2]=\"data.x(annotation.point.x) + (annotation.dx ?? 0)\"\n [attr.y2]=\"data.y(annotation.point.y) + (annotation.dy ?? 0)\"\n [attr.stroke]=\"annotation.style?.stroke ?? 'var(--color-text-90)'\"\n [attr.stroke-width]=\"annotation.style?.strokeWidth ?? 1\"\n [attr.stroke-dasharray]=\"annotation.style?.strokeDasharray ?? null\"\n >\n </svg:line>\n <svg:foreignObject\n class=\"position-absolute\"\n [attr.width]=\"node?.nativeElement.offsetWidth ?? 0\"\n [attr.height]=\"node?.nativeElement.offsetHeight ?? 0\"\n [attr.x]=\"data.x(annotation.point.x) + (annotation.dx ?? 0) - 10\"\n [attr.y]=\"data.y(annotation.point.y) + (annotation.dy ?? 0) - 10\">\n <div\n #annotationNode\n [style.background-color]=\"annotation.style?.fill ?? 'var(--color-text-90)'\"\n [style.cursor]=\"annotation?.draggable ? 'move' : 'default'\"\n class=\"color-text-10 padding-h-2\"\n style=\"border-radius: 2px; display: inline-block;\">\n <ng-container *ngIf=\"annotation.template;else default\">\n <ng-container *ngTemplateOutlet=\"annotation.template;context: {$implicit: annotation}\"></ng-container>\n </ng-container>\n </div>\n </svg:foreignObject>\n</ng-container>\n<ng-template #default>\n {{ annotation.note?.label}}\n</ng-template>\n", styles: [""], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1786
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: AnnotationComponent, decorators: [{
1787
+ type: Component,
1788
+ args: [{ selector: '[teta-annotation]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n x: x | async,\n y: y | async\n } as data\">\n <svg:circle\n [attr.r]=\"annotation.style?.radius ?? 5\"\n [attr.cx]=\"data.x(annotation.point.x)\"\n [attr.fill]=\"annotation?.style?.fill ?? 'var(--color-text-90)'\"\n [attr.cy]=\"data.y(annotation.point.y)\">\n </svg:circle>\n <svg:line\n [attr.x1]=\"data.x(annotation.point.x)\"\n [attr.y1]=\"data.y(annotation.point.y)\"\n [attr.x2]=\"data.x(annotation.point.x) + (annotation.dx ?? 0)\"\n [attr.y2]=\"data.y(annotation.point.y) + (annotation.dy ?? 0)\"\n [attr.stroke]=\"annotation.style?.stroke ?? 'var(--color-text-90)'\"\n [attr.stroke-width]=\"annotation.style?.strokeWidth ?? 1\"\n [attr.stroke-dasharray]=\"annotation.style?.strokeDasharray ?? null\"\n >\n </svg:line>\n <svg:foreignObject\n class=\"position-absolute\"\n [attr.width]=\"node?.nativeElement.offsetWidth ?? 0\"\n [attr.height]=\"node?.nativeElement.offsetHeight ?? 0\"\n [attr.x]=\"data.x(annotation.point.x) + (annotation.dx ?? 0) - 10\"\n [attr.y]=\"data.y(annotation.point.y) + (annotation.dy ?? 0) - 10\">\n <div\n #annotationNode\n [style.background-color]=\"annotation.style?.fill ?? 'var(--color-text-90)'\"\n [style.cursor]=\"annotation?.draggable ? 'move' : 'default'\"\n class=\"color-text-10 padding-h-2\"\n style=\"border-radius: 2px; display: inline-block;\">\n <ng-container *ngIf=\"annotation.template;else default\">\n <ng-container *ngTemplateOutlet=\"annotation.template;context: {$implicit: annotation}\"></ng-container>\n </ng-container>\n </div>\n </svg:foreignObject>\n</ng-container>\n<ng-template #default>\n {{ annotation.note?.label}}\n</ng-template>\n", styles: [""] }]
1789
+ }], ctorParameters: function () { return [{ type: ScaleService }, { type: i0.ChangeDetectorRef }, { type: ChartService }]; }, propDecorators: { annotation: [{
1813
1790
  type: Input
1791
+ }], node: [{
1792
+ type: ViewChild,
1793
+ args: ['annotationNode', { static: false }]
1794
+ }], click: [{
1795
+ type: HostListener,
1796
+ args: ['click', ['$event']]
1797
+ }], contextMenu: [{
1798
+ type: HostListener,
1799
+ args: ['contextmenu', ['$event']]
1814
1800
  }] } });
1815
1801
 
1816
1802
  class ZoomableDirective {
1817
- constructor(elementRef, zoomService, broadcastService) {
1803
+ constructor(elementRef, zoomService, broadcastService, zone) {
1818
1804
  this.elementRef = elementRef;
1819
1805
  this.zoomService = zoomService;
1820
1806
  this.broadcastService = broadcastService;
1807
+ this.zone = zone;
1821
1808
  this.zoomable = false;
1822
1809
  this.alive = true;
1810
+ this.currentTransform = zoomIdentity;
1811
+ this.zoomed = (event) => {
1812
+ var _a, _b, _c;
1813
+ if (event.sourceEvent) {
1814
+ if (Object.keys(event.sourceEvent).length !== 0) {
1815
+ if (this.currentTransform === event.transform && event.type !== 'end') {
1816
+ return;
1817
+ }
1818
+ const origin = this.brushScale.copy().domain(this.zoomAxis.extremes);
1819
+ let domain = ((_a = this.config.zoom) === null || _a === void 0 ? void 0 : _a.type) === ZoomType.y ?
1820
+ event.transform.rescaleY(origin).domain() :
1821
+ event.transform.rescaleX(origin).domain();
1822
+ const message = new ZoomMessage({
1823
+ event,
1824
+ axis: this.zoomAxis,
1825
+ brushDomain: domain
1826
+ });
1827
+ this.broadcastService.broadcastZoom({
1828
+ channel: (_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.zoom) === null || _c === void 0 ? void 0 : _c.syncChannel,
1829
+ message,
1830
+ });
1831
+ }
1832
+ this.zoomService.setZoom({
1833
+ event,
1834
+ target: this.zoomAxis
1835
+ });
1836
+ this.currentTransform = event.transform;
1837
+ }
1838
+ };
1823
1839
  }
1824
1840
  ngOnInit() {
1825
1841
  var _a, _b, _c, _d;
@@ -1828,47 +1844,30 @@ class ZoomableDirective {
1828
1844
  }
1829
1845
  }
1830
1846
  ngAfterViewInit() {
1831
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1832
- const enable = ((_b = (_a = this.axis) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.zoom) || ((_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.zoom) === null || _d === void 0 ? void 0 : _d.enable);
1847
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1848
+ const enable = ((_b = (_a = this.axis) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.zoom) && ((_c = this.axis) === null || _c === void 0 ? void 0 : _c.options.visible) || ((_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.zoom) === null || _e === void 0 ? void 0 : _e.enable);
1833
1849
  if (!enable) {
1834
1850
  return;
1835
1851
  }
1836
1852
  this._element = d3.select(this.elementRef.nativeElement);
1837
1853
  this.zoom = d3
1838
1854
  .zoom()
1839
- .scaleExtent([0, Infinity])
1840
1855
  .extent([
1841
1856
  [0, 0],
1842
1857
  [this.size.width, this.size.height],
1843
1858
  ]);
1844
- const commonZoomAxis = Axis.createAxis(((_e = this.config) === null || _e === void 0 ? void 0 : _e.zoom.type) === ZoomType.x ? AxisOrientation.x : AxisOrientation.y, this.config, 0, true);
1845
- this.zoomAxis = (_f = this.axis) !== null && _f !== void 0 ? _f : commonZoomAxis;
1846
- const zoomed = (event) => {
1847
- var _a, _b, _c;
1848
- if (enable) {
1849
- if (event.sourceEvent) {
1850
- this.zoomService.setZoom({
1851
- event,
1852
- target: this.zoomAxis
1853
- });
1854
- const message = new ZoomMessage({
1855
- event,
1856
- axis: this.zoomAxis,
1857
- brushDomain: ((_a = this.config.brush) === null || _a === void 0 ? void 0 : _a.type) === BrushType.x
1858
- ? this.brushScale.domain()
1859
- : this.brushScale.domain(),
1860
- });
1861
- this.broadcastService.broadcastZoom({
1862
- channel: (_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.zoom) === null || _c === void 0 ? void 0 : _c.syncChannel,
1863
- message,
1864
- });
1865
- }
1866
- }
1867
- };
1868
- this.zoom.on('start zoom end', zoomed);
1869
- this._element.call(this.zoom);
1859
+ const commonZoomAxis = Axis.createAxis(((_f = this.config) === null || _f === void 0 ? void 0 : _f.zoom.type) === ZoomType.x ? AxisOrientation.x : AxisOrientation.y, this.config, 0, true);
1860
+ this.zoomAxis = (_g = this.axis) !== null && _g !== void 0 ? _g : commonZoomAxis;
1861
+ if (enable) {
1862
+ const maxZoom = ((_h = this.config.zoom) === null || _h === void 0 ? void 0 : _h.max) ? (this.zoomAxis.extremes[1] - this.zoomAxis.extremes[0]) / ((_j = this.config.zoom) === null || _j === void 0 ? void 0 : _j.max) : 0;
1863
+ const minZoom = ((_k = this.config.zoom) === null || _k === void 0 ? void 0 : _k.min) ? (this.zoomAxis.extremes[1] - this.zoomAxis.extremes[0]) / ((_l = this.config.zoom) === null || _l === void 0 ? void 0 : _l.min) : Infinity;
1864
+ this.zoom.scaleExtent([maxZoom, minZoom]);
1865
+ console.log(this.zoom.scaleExtent());
1866
+ this.zoom.on('start zoom end', this.zoomed);
1867
+ this._element.call(this.zoom);
1868
+ }
1870
1869
  // Subscribe to zoom events
1871
- this.broadcastService.subscribeToZoom((_g = this.config) === null || _g === void 0 ? void 0 : _g.zoom.syncChannel).pipe(takeWhile((_) => this.alive), filter((m) => m.message.event.sourceEvent instanceof MouseEvent || m.message.event.sourceEvent instanceof WheelEvent), throttleTime(50, undefined, { trailing: true }), filter((m) => {
1870
+ this.broadcastService.subscribeToZoom((_m = this.config) === null || _m === void 0 ? void 0 : _m.zoom.syncChannel).pipe(filter((m) => m.message.event.sourceEvent instanceof MouseEvent || m.message.event.sourceEvent instanceof WheelEvent), debounceTime(30), filter((m) => {
1872
1871
  var _a, _b, _c, _d;
1873
1872
  return this.zoomAxis.index === ((_b = (_a = m.message) === null || _a === void 0 ? void 0 : _a.axis) === null || _b === void 0 ? void 0 : _b.index) && this.zoomAxis.orientation === ((_d = (_c = m.message) === null || _c === void 0 ? void 0 : _c.axis) === null || _d === void 0 ? void 0 : _d.orientation);
1874
1873
  }), tap$1((m) => {
@@ -1876,40 +1875,53 @@ class ZoomableDirective {
1876
1875
  if (currentTransform !== m.message.event.transform) {
1877
1876
  this._element.call(this.zoom.transform, m.message.event.transform, null, {});
1878
1877
  }
1879
- })).subscribe();
1878
+ }), takeWhile((_) => this.alive)).subscribe();
1880
1879
  // Subscribe to brush events x or y
1881
- if ((((_h = this.config.brush) === null || _h === void 0 ? void 0 : _h.type) === BrushType.x && this.zoomAxis.orientation === AxisOrientation.x) || (((_j = this.config.brush) === null || _j === void 0 ? void 0 : _j.type) === BrushType.y && this.zoomAxis.orientation === AxisOrientation.y)) {
1882
- this.broadcastService.subscribeToBrush((_k = this.config) === null || _k === void 0 ? void 0 : _k.zoom.syncChannel).pipe(takeWhile((_) => this.alive), throttleTime(50, undefined, { trailing: true }), filter((m) => Boolean(m.message.selection)), tap$1((m) => {
1883
- var _a, _b;
1884
- const s = m.message.selection;
1885
- this.brushScale.domain(m.message.brushScale.domain());
1886
- const domain = this.brushScale.domain();
1887
- const scale = (domain[1] - domain[0]) / (s[1] - s[0]);
1888
- let transform = zoomIdentity.scale(scale);
1889
- if (((_a = m.message) === null || _a === void 0 ? void 0 : _a.brushType) === BrushType.x) {
1890
- transform = transform.translate(-this.brushScale(s[0]), 0);
1891
- }
1892
- if (((_b = m.message) === null || _b === void 0 ? void 0 : _b.brushType) === BrushType.y) {
1893
- transform = transform.translate(0, -this.brushScale(s[0]));
1880
+ if ((((_o = this.config.brush) === null || _o === void 0 ? void 0 : _o.type) === BrushType.x && this.zoomAxis.orientation === AxisOrientation.x) ||
1881
+ (((_p = this.config.brush) === null || _p === void 0 ? void 0 : _p.type) === BrushType.y && this.zoomAxis.orientation === AxisOrientation.y)) {
1882
+ this.broadcastService.subscribeToBrush((_q = this.config) === null || _q === void 0 ? void 0 : _q.zoom.syncChannel).pipe(debounceTime(30), filter((m) => Boolean(m.message.selection)), tap$1((m) => {
1883
+ const currentTransform = d3.zoomTransform(this.elementRef.nativeElement);
1884
+ if (!m.message.event && this.currentSelection && currentTransform.k !== 1) {
1885
+ return;
1894
1886
  }
1895
- this._element.call(this.zoom.transform, transform, null, {});
1896
- })).subscribe();
1887
+ this.currentSelection = m.message.selection;
1888
+ this.zone.runOutsideAngular(() => {
1889
+ setTimeout(() => {
1890
+ this.updateZoom(m);
1891
+ }, 100);
1892
+ });
1893
+ }), takeWhile((_) => this.alive)).subscribe();
1897
1894
  }
1898
1895
  }
1899
- ngOnChanges(changes) {
1900
- }
1901
1896
  ngOnDestroy() {
1897
+ var _a;
1898
+ (_a = this.zoom) === null || _a === void 0 ? void 0 : _a.on('start zoom end', null);
1902
1899
  this.alive = false;
1903
1900
  }
1901
+ updateZoom(m) {
1902
+ var _a, _b;
1903
+ const s = m.message.selection;
1904
+ this.brushScale.domain(this.zoomAxis.extremes);
1905
+ const domain = this.brushScale.domain();
1906
+ const scale = (domain[1] - domain[0]) / (s[1] - s[0]);
1907
+ let transform = zoomIdentity.scale(scale);
1908
+ if (((_a = m.message) === null || _a === void 0 ? void 0 : _a.brushType) === BrushType.x) {
1909
+ transform = transform.translate(-this.brushScale(s[0]), 0);
1910
+ }
1911
+ if (((_b = m.message) === null || _b === void 0 ? void 0 : _b.brushType) === BrushType.y) {
1912
+ transform = transform.translate(0, -this.brushScale(s[0]));
1913
+ }
1914
+ this._element.transition().duration(150).call(this.zoom.transform, transform, null, {});
1915
+ }
1904
1916
  }
1905
- ZoomableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ZoomableDirective, deps: [{ token: i0.ElementRef }, { token: ZoomService }, { token: BroadcastService }], target: i0.ɵɵFactoryTarget.Directive });
1906
- ZoomableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.1", type: ZoomableDirective, selector: "[tetaZoomable]", inputs: { config: "config", axis: "axis", size: "size", brushScale: "brushScale" }, host: { properties: { "class.zoomable": "this.zoomable" } }, usesOnChanges: true, ngImport: i0 });
1917
+ ZoomableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ZoomableDirective, deps: [{ token: i0.ElementRef }, { token: ZoomService }, { token: BroadcastService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1918
+ ZoomableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.1", type: ZoomableDirective, selector: "[tetaZoomable]", inputs: { config: "config", axis: "axis", size: "size", brushScale: "brushScale" }, host: { properties: { "class.zoomable": "this.zoomable" } }, ngImport: i0 });
1907
1919
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ZoomableDirective, decorators: [{
1908
1920
  type: Directive,
1909
1921
  args: [{
1910
1922
  selector: '[tetaZoomable]',
1911
1923
  }]
1912
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ZoomService }, { type: BroadcastService }]; }, propDecorators: { config: [{
1924
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ZoomService }, { type: BroadcastService }, { type: i0.NgZone }]; }, propDecorators: { config: [{
1913
1925
  type: Input
1914
1926
  }], axis: [{
1915
1927
  type: Input
@@ -1929,7 +1941,8 @@ class BrushableDirective {
1929
1941
  this.element = element;
1930
1942
  }
1931
1943
  ngOnInit() { }
1932
- ngAfterViewInit() { }
1944
+ ngAfterViewInit() {
1945
+ }
1933
1946
  ngOnChanges(changes) {
1934
1947
  if (changes.hasOwnProperty('config')) {
1935
1948
  this.brushService.clearPreviousSelection();
@@ -1980,7 +1993,10 @@ class ChartContainerComponent {
1980
1993
  return ((_a = config.brush) === null || _a === void 0 ? void 0 : _a.type) === BrushType.x
1981
1994
  ? x.get(0)
1982
1995
  : y.get(0);
1983
- }), shareReplay(1));
1996
+ }), shareReplay({
1997
+ bufferSize: 1,
1998
+ refCount: true
1999
+ }));
1984
2000
  this.visibleRect = combineLatest([
1985
2001
  this.size,
1986
2002
  this.xAxisMap,
@@ -2027,7 +2043,8 @@ class ChartContainerComponent {
2027
2043
  });
2028
2044
  this._observer.observe(this._elementRef.nativeElement);
2029
2045
  }
2030
- ngAfterViewInit() {
2046
+ ngOnDestroy() {
2047
+ this._observer.disconnect();
2031
2048
  }
2032
2049
  getTranslate(axis, size) {
2033
2050
  return combineLatest([this.xAxisMap, this.yAxisMap]).pipe(map((data) => {
@@ -2099,10 +2116,10 @@ class ChartContainerComponent {
2099
2116
  }
2100
2117
  }
2101
2118
  ChartContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartContainerComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2102
- ChartContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ChartContainerComponent, selector: "teta-chart-container", ngImport: i0, template: "<ng-container *ngIf=\"{\n size: size | async,\n config: config | async,\n xAxisMap: xAxisMap | async,\n yAxisMap: yAxisMap | async,\n xScaleMap: xScaleMap | async,\n yScaleMap: yScaleMap | async,\n visibleRect: visibleRect | async,\n brushScale: brushScale | async\n} as data\">\n <teta-tooltip *ngIf=\"data.config?.tooltip?.enable\"\n [size]=\"data.size\"\n [config]=\"data.config\"></teta-tooltip>\n\n <svg height=\"100%\" width=\"100%\" class=\"position-absolute\">\n <g class=\"y-axis-container\">\n <ng-container *ngFor=\"let item of data.yAxisMap | keyvalue; trackBy: identify\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-y-axis\n [axis]=\"item.value\"\n [scale]=\"data.yScaleMap.get(item.key)\"\n [size]=\"data.size\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.size\"\n [attr.x]=\"item.value.options.opposite ? 0 : -item.value.selfSize\"\n [attr.y]=\"0\"\n [attr.height]=\"data.size.height\"\n [attr.width]=\"item.value.selfSize\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></rect>\n </ng-container>\n\n </ng-container>\n </g>\n <g class=\"x-axis-container\">\n <ng-container *ngFor=\"let item of data.xAxisMap | keyvalue; trackBy: identify\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-x-axis\n [axis]=\"item.value\"\n [scale]=\"data.xScaleMap.get(item.key)\"\n [size]=\"data.size\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.size\"\n [attr.x]=\"0\"\n [attr.y]=\"0\"\n [attr.width]=\"data.size.width\"\n [attr.height]=\"item.value.selfSize\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></rect>\n </ng-container>\n </ng-container>\n </g>\n </svg>\n <ng-container *ngIf=\"data.visibleRect?.width > 0 && data.visibleRect?.height > 0\">\n <svg\n tetaBrushable\n tetaZoomable\n [size]=\"data.size\"\n [brushScale]=\"data.brushScale\"\n [config]=\"data.config\"\n [attr.width]=\"data.visibleRect.width\"\n [attr.height]=\"data.visibleRect.height\"\n [attr.transform]=\"'translate('+ data.visibleRect.x +', '+ data.visibleRect.y +')'\"\n [attr.viewBox]=\"'0 0 ' + data.visibleRect.width + ' ' + data.visibleRect.height\"\n (contextmenu)=\"contextMenu($event, data.xScaleMap, data.yScaleMap)\"\n (click)=\"click($event, data.xScaleMap, data.yScaleMap)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousemove)=\"mouseMove($event)\">\n <g class=\"gridlines\"\n teta-gridlines\n *ngIf=\"data.config.gridLines !== false\"\n [size]=\"data.size\"\n [xScaleMap]=\"data.xScaleMap\"\n [yScaleMap]=\"data.yScaleMap\"></g>\n\n <g class=\"x-axis-plotband-container\">\n <ng-container *ngFor=\"let axis of data.config.xAxis; let i = index\">\n <g teta-plot-band *ngFor=\"let plotBand of axis.plotBands\"\n [plotBand]=\"plotBand\"\n [scale]=\"data.xScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.xAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"y-axis-plotband-container\">\n <ng-container *ngFor=\"let axis of data.config.yAxis; let i = index\">\n <g teta-plot-band *ngFor=\"let plotBand of axis.plotBands\"\n [plotBand]=\"plotBand\"\n [scale]=\"data.yScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.yAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"x-axis-plotline-container\">\n <ng-container *ngFor=\"let axis of data.config.xAxis; let i = index\">\n <g teta-plot-line *ngFor=\"let plotLine of axis.plotLines\"\n [plotLine]=\"plotLine\"\n [scale]=\"data.xScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.xAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"y-axis-plotline-container\">\n <ng-container *ngFor=\"let axis of data.config.yAxis; let i = index\">\n <g teta-plot-line *ngFor=\"let plotLine of axis.plotLines\"\n [plotLine]=\"plotLine\"\n [scale]=\"data.yScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.yAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"annotations\">\n <g teta-annotation\n [xScaleMap]=\"data.xScaleMap\"\n [yScaleMap]=\"data.yScaleMap\"\n [annotations]=\"data.config.annotations\"></g>\n </g>\n <g class=\"series-container\">\n <g teta-series-host\n *ngFor=\"let series of data.config.series\"\n [config]=\"data.config\"\n [series]=\"series\"\n [size]=\"data.size\"></g>\n </g>\n\n </svg>\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;flex-grow:1;min-width:0;min-height:0}:host .zoomable:hover{cursor:grab}:host .zoomable:active{cursor:grabbing}\n"], components: [{ type: TooltipComponent, selector: "teta-tooltip", inputs: ["size", "config"] }, { type: YAxisComponent, selector: "[teta-y-axis]", inputs: ["axis", "scale", "size"] }, { type: XAxisComponent, selector: "[teta-x-axis]", inputs: ["axis", "scale", "size"] }, { type: GridlinesComponent, selector: "[teta-gridlines]", inputs: ["size", "xScaleMap", "yScaleMap"] }, { type: PlotBandComponent, selector: "[teta-plot-band]", inputs: ["plotBand", "axis", "scale", "size"] }, { type: PlotlineComponent, selector: "[teta-plot-line]", inputs: ["plotLine", "size", "axis", "scale"] }, { type: AnnotationComponent, selector: "[teta-annotation]", inputs: ["annotations", "xScaleMap", "yScaleMap"] }, { type: SeriesHostComponent, selector: "[teta-series-host]", inputs: ["config", "series", "size", "rect"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: ZoomableDirective, selector: "[tetaZoomable]", inputs: ["config", "axis", "size", "brushScale"] }, { type: BrushableDirective, selector: "svg:svg[tetaBrushable]", inputs: ["config", "size", "brushScale"] }], pipes: { "async": i4.AsyncPipe, "keyvalue": i4.KeyValuePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2119
+ ChartContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ChartContainerComponent, selector: "teta-chart-container", ngImport: i0, template: "<ng-container *ngIf=\"{\n size: size | async,\n config: config | async,\n xAxisMap: xAxisMap | async,\n yAxisMap: yAxisMap | async,\n xScaleMap: xScaleMap | async,\n yScaleMap: yScaleMap | async,\n visibleRect: visibleRect | async,\n brushScale: brushScale | async\n} as data\" xmlns:svg=\"http://www.w3.org/1999/html\">\n <teta-tooltip *ngIf=\"data.config?.tooltip?.enable\"\n [size]=\"data.size\"\n [config]=\"data.config\"></teta-tooltip>\n\n <svg height=\"100%\" width=\"100%\" class=\"position-absolute\">\n <g class=\"y-axis-container\">\n <ng-container *ngFor=\"let item of data.yAxisMap | keyvalue;\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-y-axis\n [axis]=\"item.value\"\n [scale]=\"data.yScaleMap.get(item.key)\"\n [size]=\"data.size\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.size\"\n [attr.x]=\"item.value.options.opposite ? 0 : -item.value.selfSize\"\n [attr.y]=\"0\"\n [attr.height]=\"data.size.height\"\n [attr.width]=\"item.value.selfSize\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></rect>\n </ng-container>\n\n </ng-container>\n </g>\n <g class=\"x-axis-container\">\n <ng-container *ngFor=\"let item of data.xAxisMap | keyvalue;\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-x-axis\n [axis]=\"item.value\"\n [scale]=\"data.xScaleMap.get(item.key)\"\n [size]=\"data.size\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.size\"\n [attr.x]=\"0\"\n [attr.y]=\"0\"\n [attr.width]=\"data.size.width\"\n [attr.height]=\"item.value.selfSize\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></rect>\n </ng-container>\n </ng-container>\n </g>\n </svg>\n <ng-container *ngIf=\"data.visibleRect?.width > 0 && data.visibleRect?.height > 0\">\n <svg\n tetaBrushable\n tetaZoomable\n [size]=\"data.size\"\n [brushScale]=\"data.brushScale\"\n [config]=\"data.config\"\n [attr.width]=\"data.visibleRect.width\"\n [attr.height]=\"data.visibleRect.height\"\n [attr.transform]=\"'translate('+ data.visibleRect.x +', '+ data.visibleRect.y +')'\"\n [attr.viewBox]=\"'0 0 ' + data.visibleRect.width + ' ' + data.visibleRect.height\"\n (contextmenu)=\"contextMenu($event, data.xScaleMap, data.yScaleMap)\"\n (click)=\"click($event, data.xScaleMap, data.yScaleMap)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousemove)=\"mouseMove($event)\">\n <g class=\"gridlines\"\n teta-gridlines\n *ngIf=\"data.config.gridLines?.enable !== false\"\n [size]=\"data.size\"\n [config]=\"data.config\"\n [xScaleMap]=\"data.xScaleMap\"\n [yScaleMap]=\"data.yScaleMap\"></g>\n\n <g class=\"x-axis-plotband-container\">\n <ng-container *ngFor=\"let axis of data.config.xAxis; let i = index\">\n <g teta-plot-band *ngFor=\"let plotBand of axis.plotBands\"\n [plotBand]=\"plotBand\"\n [scale]=\"data.xScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.xAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"y-axis-plotband-container\">\n <ng-container *ngFor=\"let axis of data.config.yAxis; let i = index\">\n <g teta-plot-band *ngFor=\"let plotBand of axis.plotBands\"\n [plotBand]=\"plotBand\"\n [scale]=\"data.yScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.yAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"x-axis-plotline-container\">\n <ng-container *ngFor=\"let axis of data.config.xAxis; let i = index\">\n <g teta-plot-line *ngFor=\"let plotLine of axis.plotLines\"\n [plotLine]=\"plotLine\"\n [scale]=\"data.xScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.xAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"y-axis-plotline-container\">\n <ng-container *ngFor=\"let axis of data.config.yAxis; let i = index\">\n <g teta-plot-line *ngFor=\"let plotLine of axis.plotLines\"\n [plotLine]=\"plotLine\"\n [scale]=\"data.yScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.yAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"series-container\">\n <g teta-series-host\n *ngFor=\"let series of data.config.series\"\n [config]=\"data.config\"\n [series]=\"series\"></g>\n </g>\n <g class=\"annotations\">\n <g teta-annotation\n *ngFor=\"let annotation of data.config.annotations\"\n [annotation]=\"annotation\"></g>\n </g>\n </svg>\n\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;flex-grow:1;min-width:0;min-height:0}:host .zoomable:hover{cursor:grab}:host .zoomable:active{cursor:grabbing}\n"], components: [{ type: TooltipComponent, selector: "teta-tooltip", inputs: ["size", "config"] }, { type: YAxisComponent, selector: "[teta-y-axis]", inputs: ["axis", "scale", "size"] }, { type: XAxisComponent, selector: "[teta-x-axis]", inputs: ["axis", "scale", "size"] }, { type: GridlinesComponent, selector: "[teta-gridlines]", inputs: ["size", "xScaleMap", "yScaleMap", "config"] }, { type: PlotBandComponent, selector: "[teta-plot-band]", inputs: ["plotBand", "axis", "scale", "size"] }, { type: PlotlineComponent, selector: "[teta-plot-line]", inputs: ["plotLine", "size", "axis", "scale"] }, { type: SeriesHostComponent, selector: "[teta-series-host]", inputs: ["config", "series"] }, { type: AnnotationComponent, selector: "[teta-annotation]", inputs: ["annotation"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: ZoomableDirective, selector: "[tetaZoomable]", inputs: ["config", "axis", "size", "brushScale"] }, { type: BrushableDirective, selector: "svg:svg[tetaBrushable]", inputs: ["config", "size", "brushScale"] }], pipes: { "async": i4.AsyncPipe, "keyvalue": i4.KeyValuePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2103
2120
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartContainerComponent, decorators: [{
2104
2121
  type: Component,
2105
- args: [{ selector: 'teta-chart-container', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n size: size | async,\n config: config | async,\n xAxisMap: xAxisMap | async,\n yAxisMap: yAxisMap | async,\n xScaleMap: xScaleMap | async,\n yScaleMap: yScaleMap | async,\n visibleRect: visibleRect | async,\n brushScale: brushScale | async\n} as data\">\n <teta-tooltip *ngIf=\"data.config?.tooltip?.enable\"\n [size]=\"data.size\"\n [config]=\"data.config\"></teta-tooltip>\n\n <svg height=\"100%\" width=\"100%\" class=\"position-absolute\">\n <g class=\"y-axis-container\">\n <ng-container *ngFor=\"let item of data.yAxisMap | keyvalue; trackBy: identify\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-y-axis\n [axis]=\"item.value\"\n [scale]=\"data.yScaleMap.get(item.key)\"\n [size]=\"data.size\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.size\"\n [attr.x]=\"item.value.options.opposite ? 0 : -item.value.selfSize\"\n [attr.y]=\"0\"\n [attr.height]=\"data.size.height\"\n [attr.width]=\"item.value.selfSize\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></rect>\n </ng-container>\n\n </ng-container>\n </g>\n <g class=\"x-axis-container\">\n <ng-container *ngFor=\"let item of data.xAxisMap | keyvalue; trackBy: identify\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-x-axis\n [axis]=\"item.value\"\n [scale]=\"data.xScaleMap.get(item.key)\"\n [size]=\"data.size\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.size\"\n [attr.x]=\"0\"\n [attr.y]=\"0\"\n [attr.width]=\"data.size.width\"\n [attr.height]=\"item.value.selfSize\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></rect>\n </ng-container>\n </ng-container>\n </g>\n </svg>\n <ng-container *ngIf=\"data.visibleRect?.width > 0 && data.visibleRect?.height > 0\">\n <svg\n tetaBrushable\n tetaZoomable\n [size]=\"data.size\"\n [brushScale]=\"data.brushScale\"\n [config]=\"data.config\"\n [attr.width]=\"data.visibleRect.width\"\n [attr.height]=\"data.visibleRect.height\"\n [attr.transform]=\"'translate('+ data.visibleRect.x +', '+ data.visibleRect.y +')'\"\n [attr.viewBox]=\"'0 0 ' + data.visibleRect.width + ' ' + data.visibleRect.height\"\n (contextmenu)=\"contextMenu($event, data.xScaleMap, data.yScaleMap)\"\n (click)=\"click($event, data.xScaleMap, data.yScaleMap)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousemove)=\"mouseMove($event)\">\n <g class=\"gridlines\"\n teta-gridlines\n *ngIf=\"data.config.gridLines !== false\"\n [size]=\"data.size\"\n [xScaleMap]=\"data.xScaleMap\"\n [yScaleMap]=\"data.yScaleMap\"></g>\n\n <g class=\"x-axis-plotband-container\">\n <ng-container *ngFor=\"let axis of data.config.xAxis; let i = index\">\n <g teta-plot-band *ngFor=\"let plotBand of axis.plotBands\"\n [plotBand]=\"plotBand\"\n [scale]=\"data.xScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.xAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"y-axis-plotband-container\">\n <ng-container *ngFor=\"let axis of data.config.yAxis; let i = index\">\n <g teta-plot-band *ngFor=\"let plotBand of axis.plotBands\"\n [plotBand]=\"plotBand\"\n [scale]=\"data.yScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.yAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"x-axis-plotline-container\">\n <ng-container *ngFor=\"let axis of data.config.xAxis; let i = index\">\n <g teta-plot-line *ngFor=\"let plotLine of axis.plotLines\"\n [plotLine]=\"plotLine\"\n [scale]=\"data.xScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.xAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"y-axis-plotline-container\">\n <ng-container *ngFor=\"let axis of data.config.yAxis; let i = index\">\n <g teta-plot-line *ngFor=\"let plotLine of axis.plotLines\"\n [plotLine]=\"plotLine\"\n [scale]=\"data.yScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.yAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"annotations\">\n <g teta-annotation\n [xScaleMap]=\"data.xScaleMap\"\n [yScaleMap]=\"data.yScaleMap\"\n [annotations]=\"data.config.annotations\"></g>\n </g>\n <g class=\"series-container\">\n <g teta-series-host\n *ngFor=\"let series of data.config.series\"\n [config]=\"data.config\"\n [series]=\"series\"\n [size]=\"data.size\"></g>\n </g>\n\n </svg>\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;flex-grow:1;min-width:0;min-height:0}:host .zoomable:hover{cursor:grab}:host .zoomable:active{cursor:grabbing}\n"] }]
2122
+ args: [{ selector: 'teta-chart-container', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n size: size | async,\n config: config | async,\n xAxisMap: xAxisMap | async,\n yAxisMap: yAxisMap | async,\n xScaleMap: xScaleMap | async,\n yScaleMap: yScaleMap | async,\n visibleRect: visibleRect | async,\n brushScale: brushScale | async\n} as data\" xmlns:svg=\"http://www.w3.org/1999/html\">\n <teta-tooltip *ngIf=\"data.config?.tooltip?.enable\"\n [size]=\"data.size\"\n [config]=\"data.config\"></teta-tooltip>\n\n <svg height=\"100%\" width=\"100%\" class=\"position-absolute\">\n <g class=\"y-axis-container\">\n <ng-container *ngFor=\"let item of data.yAxisMap | keyvalue;\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-y-axis\n [axis]=\"item.value\"\n [scale]=\"data.yScaleMap.get(item.key)\"\n [size]=\"data.size\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.size\"\n [attr.x]=\"item.value.options.opposite ? 0 : -item.value.selfSize\"\n [attr.y]=\"0\"\n [attr.height]=\"data.size.height\"\n [attr.width]=\"item.value.selfSize\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></rect>\n </ng-container>\n\n </ng-container>\n </g>\n <g class=\"x-axis-container\">\n <ng-container *ngFor=\"let item of data.xAxisMap | keyvalue;\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-x-axis\n [axis]=\"item.value\"\n [scale]=\"data.xScaleMap.get(item.key)\"\n [size]=\"data.size\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.size\"\n [attr.x]=\"0\"\n [attr.y]=\"0\"\n [attr.width]=\"data.size.width\"\n [attr.height]=\"item.value.selfSize\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></rect>\n </ng-container>\n </ng-container>\n </g>\n </svg>\n <ng-container *ngIf=\"data.visibleRect?.width > 0 && data.visibleRect?.height > 0\">\n <svg\n tetaBrushable\n tetaZoomable\n [size]=\"data.size\"\n [brushScale]=\"data.brushScale\"\n [config]=\"data.config\"\n [attr.width]=\"data.visibleRect.width\"\n [attr.height]=\"data.visibleRect.height\"\n [attr.transform]=\"'translate('+ data.visibleRect.x +', '+ data.visibleRect.y +')'\"\n [attr.viewBox]=\"'0 0 ' + data.visibleRect.width + ' ' + data.visibleRect.height\"\n (contextmenu)=\"contextMenu($event, data.xScaleMap, data.yScaleMap)\"\n (click)=\"click($event, data.xScaleMap, data.yScaleMap)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousemove)=\"mouseMove($event)\">\n <g class=\"gridlines\"\n teta-gridlines\n *ngIf=\"data.config.gridLines?.enable !== false\"\n [size]=\"data.size\"\n [config]=\"data.config\"\n [xScaleMap]=\"data.xScaleMap\"\n [yScaleMap]=\"data.yScaleMap\"></g>\n\n <g class=\"x-axis-plotband-container\">\n <ng-container *ngFor=\"let axis of data.config.xAxis; let i = index\">\n <g teta-plot-band *ngFor=\"let plotBand of axis.plotBands\"\n [plotBand]=\"plotBand\"\n [scale]=\"data.xScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.xAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"y-axis-plotband-container\">\n <ng-container *ngFor=\"let axis of data.config.yAxis; let i = index\">\n <g teta-plot-band *ngFor=\"let plotBand of axis.plotBands\"\n [plotBand]=\"plotBand\"\n [scale]=\"data.yScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.yAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"x-axis-plotline-container\">\n <ng-container *ngFor=\"let axis of data.config.xAxis; let i = index\">\n <g teta-plot-line *ngFor=\"let plotLine of axis.plotLines\"\n [plotLine]=\"plotLine\"\n [scale]=\"data.xScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.xAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"y-axis-plotline-container\">\n <ng-container *ngFor=\"let axis of data.config.yAxis; let i = index\">\n <g teta-plot-line *ngFor=\"let plotLine of axis.plotLines\"\n [plotLine]=\"plotLine\"\n [scale]=\"data.yScaleMap.get(i)\"\n [size]=\"data.size\"\n [axis]=\"data.yAxisMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"series-container\">\n <g teta-series-host\n *ngFor=\"let series of data.config.series\"\n [config]=\"data.config\"\n [series]=\"series\"></g>\n </g>\n <g class=\"annotations\">\n <g teta-annotation\n *ngFor=\"let annotation of data.config.annotations\"\n [annotation]=\"annotation\"></g>\n </g>\n </svg>\n\n </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;flex-grow:1;min-width:0;min-height:0}:host .zoomable:hover{cursor:grab}:host .zoomable:active{cursor:grabbing}\n"] }]
2106
2123
  }], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
2107
2124
 
2108
2125
  class LegendComponent {
@@ -2133,9 +2150,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
2133
2150
  }] } });
2134
2151
 
2135
2152
  class ChartComponent {
2136
- constructor(_svc, _zoomService) {
2137
- this._svc = _svc;
2153
+ constructor(chartService, _zoomService, _scaleService) {
2154
+ this.chartService = chartService;
2138
2155
  this._zoomService = _zoomService;
2156
+ this._scaleService = _scaleService;
2157
+ this.pointerMove = new EventEmitter();
2139
2158
  this.plotBandsMove = new EventEmitter();
2140
2159
  this.plotBandClick = new EventEmitter();
2141
2160
  this.plotBandContextMenu = new EventEmitter();
@@ -2143,45 +2162,90 @@ class ChartComponent {
2143
2162
  this.pointMove = new EventEmitter();
2144
2163
  this.chartClick = new EventEmitter();
2145
2164
  this.chartContextMenu = new EventEmitter();
2165
+ this.annotationContextMenu = new EventEmitter();
2166
+ this.annotationClick = new EventEmitter();
2167
+ this.annotationMove = new EventEmitter();
2146
2168
  this._alive = true;
2147
- this.svcConfig = this._svc.config;
2169
+ this.svcConfig = this.chartService.config;
2148
2170
  this.hasSeriesData = this.svcConfig.pipe(map((_) => { var _a, _b; return ((_a = _.series) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((_b = _.series) === null || _b === void 0 ? void 0 : _b.some((_) => { var _a; return ((_a = _.data) === null || _a === void 0 ? void 0 : _a.length) > 0; })); }));
2149
2171
  }
2150
2172
  set config(config) {
2151
- this._svc.setConfig(config);
2173
+ this.chartService.setConfig(config);
2152
2174
  }
2153
2175
  ngOnChanges(changes) {
2154
2176
  }
2155
2177
  ngOnInit() {
2156
- this._svc.plotBandEvent
2178
+ this.chartService.pointerMove
2179
+ .pipe(takeWhile(() => this._alive), withLatestFrom(this._scaleService.xScaleMap, this._scaleService.yScaleMap, this.chartService.config))
2180
+ .subscribe((data) => {
2181
+ var _a;
2182
+ const [event, x, y, config] = data;
2183
+ const tooltipTracking = (_a = config === null || config === void 0 ? void 0 : config.tooltip) === null || _a === void 0 ? void 0 : _a.tracking;
2184
+ if (tooltipTracking === TooltipTracking.y) {
2185
+ const result = new Map();
2186
+ y.forEach((value, key) => {
2187
+ result.set(key, value.invert(event.offsetY));
2188
+ });
2189
+ this.pointerMove.emit({
2190
+ event: event,
2191
+ target: result
2192
+ });
2193
+ }
2194
+ else {
2195
+ const result = new Map();
2196
+ x.forEach((value, key) => {
2197
+ result.set(key, value.invert(event.offsetX));
2198
+ });
2199
+ this.pointerMove.emit({
2200
+ event: event,
2201
+ target: result
2202
+ });
2203
+ }
2204
+ });
2205
+ this.chartService.plotBandEvent
2157
2206
  .pipe(takeWhile(() => this._alive))
2158
2207
  .subscribe((_) => {
2159
2208
  this.plotBandsMove.emit(_);
2160
2209
  });
2161
- this._svc.plotLineMove.pipe(takeWhile(() => this._alive)).subscribe((_) => {
2210
+ this.chartService.plotLineMove.pipe(takeWhile(() => this._alive)).subscribe((_) => {
2162
2211
  this.plotLinesMove.emit(_);
2163
2212
  });
2164
- this._svc.pointMove.pipe(takeWhile(() => this._alive)).subscribe((_) => {
2213
+ this.chartService.pointMove.pipe(takeWhile(() => this._alive)).subscribe((_) => {
2165
2214
  this.pointMove.emit(_);
2166
2215
  });
2167
- this._svc.chartClick
2216
+ this.chartService.chartClick
2168
2217
  .pipe(takeWhile(() => this._alive)).subscribe((_) => {
2169
2218
  this.chartClick.emit(_);
2170
2219
  });
2171
- this._svc.chartContextMenu
2220
+ this.chartService.chartContextMenu
2172
2221
  .pipe(takeWhile(() => this._alive)).subscribe((_) => {
2173
2222
  this.chartContextMenu.emit(_);
2174
2223
  });
2175
- this._svc.plotBandClick
2224
+ this.chartService.plotBandClick
2176
2225
  .pipe(takeWhile(() => this._alive))
2177
2226
  .subscribe((_) => {
2178
2227
  this.plotBandClick.emit(_);
2179
2228
  });
2180
- this._svc.plotBandContextMenu
2229
+ this.chartService.plotBandContextMenu
2181
2230
  .pipe(takeWhile(() => this._alive))
2182
2231
  .subscribe((_) => {
2183
2232
  this.plotBandContextMenu.emit(_);
2184
2233
  });
2234
+ this.chartService.annotationContextMenu
2235
+ .pipe(takeWhile(() => this._alive))
2236
+ .subscribe((_) => {
2237
+ this.annotationContextMenu.emit(_);
2238
+ });
2239
+ this.chartService.annotationClick
2240
+ .pipe(takeWhile(() => this._alive))
2241
+ .subscribe((_) => {
2242
+ this.annotationClick.emit(_);
2243
+ });
2244
+ this.chartService.annotationMove
2245
+ .pipe(takeWhile(() => this._alive))
2246
+ .subscribe((_) => {
2247
+ this.annotationMove.emit(_);
2248
+ });
2185
2249
  }
2186
2250
  ngAfterViewInit() {
2187
2251
  }
@@ -2193,12 +2257,14 @@ class ChartComponent {
2193
2257
  });
2194
2258
  }
2195
2259
  }
2196
- ChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartComponent, deps: [{ token: ChartService }, { token: ZoomService }], target: i0.ɵɵFactoryTarget.Component });
2197
- ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ChartComponent, selector: "teta-svg-chart", inputs: { config: "config" }, outputs: { plotBandsMove: "plotBandsMove", plotBandClick: "plotBandClick", plotBandContextMenu: "plotBandContextMenu", plotLinesMove: "plotLinesMove", pointMove: "pointMove", chartClick: "chartClick", chartContextMenu: "chartContextMenu" }, providers: [ChartService, ZoomService, ScaleService, BrushService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"{\n hasSeriesData: hasSeriesData | async,\n svcConfig: svcConfig | async\n} as data\">\n <ng-container *ngIf=\"data.hasSeriesData === true else noData\">\n <div class=\"column column_auto\">\n <teta-chart-container class=\"chart-container\"></teta-chart-container>\n </div>\n <teta-legend *ngIf=\"data.svcConfig.legend?.enable === true\" [series]=\"data.svcConfig.series\"></teta-legend>\n </ng-container>\n</ng-container>\n<ng-template #noData>\n <div class=\"column column_auto align-center justify-content-center\">\n <span class=\"font-body-3 color-text-40\">\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442</span>\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;flex-direction:column;height:100%;width:100%}\n"], components: [{ type: ChartContainerComponent, selector: "teta-chart-container" }, { type: LegendComponent, selector: "teta-legend", inputs: ["series"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2260
+ ChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartComponent, deps: [{ token: ChartService }, { token: ZoomService }, { token: ScaleService }], target: i0.ɵɵFactoryTarget.Component });
2261
+ ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ChartComponent, selector: "teta-svg-chart", inputs: { config: "config" }, outputs: { pointerMove: "pointerMove", plotBandsMove: "plotBandsMove", plotBandClick: "plotBandClick", plotBandContextMenu: "plotBandContextMenu", plotLinesMove: "plotLinesMove", pointMove: "pointMove", chartClick: "chartClick", chartContextMenu: "chartContextMenu", annotationContextMenu: "annotationContextMenu", annotationClick: "annotationClick", annotationMove: "annotationMove" }, providers: [ChartService, ZoomService, ScaleService, BrushService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"{\n hasSeriesData: hasSeriesData | async,\n svcConfig: svcConfig | async\n} as data\">\n <ng-container *ngIf=\"data.hasSeriesData === true else noData\">\n <div class=\"column column_auto\">\n <teta-chart-container class=\"chart-container\"></teta-chart-container>\n </div>\n <teta-legend *ngIf=\"data.svcConfig.legend?.enable === true\" [series]=\"data.svcConfig.series\"></teta-legend>\n </ng-container>\n</ng-container>\n<ng-template #noData>\n <div class=\"column column_auto align-center justify-content-center\">\n <span class=\"font-body-3 color-text-40\">\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442</span>\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;flex-direction:column;height:100%;width:100%}\n"], components: [{ type: ChartContainerComponent, selector: "teta-chart-container" }, { type: LegendComponent, selector: "teta-legend", inputs: ["series"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2198
2262
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartComponent, decorators: [{
2199
2263
  type: Component,
2200
2264
  args: [{ selector: 'teta-svg-chart', providers: [ChartService, ZoomService, ScaleService, BrushService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n hasSeriesData: hasSeriesData | async,\n svcConfig: svcConfig | async\n} as data\">\n <ng-container *ngIf=\"data.hasSeriesData === true else noData\">\n <div class=\"column column_auto\">\n <teta-chart-container class=\"chart-container\"></teta-chart-container>\n </div>\n <teta-legend *ngIf=\"data.svcConfig.legend?.enable === true\" [series]=\"data.svcConfig.series\"></teta-legend>\n </ng-container>\n</ng-container>\n<ng-template #noData>\n <div class=\"column column_auto align-center justify-content-center\">\n <span class=\"font-body-3 color-text-40\">\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442</span>\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;flex-direction:column;height:100%;width:100%}\n"] }]
2201
- }], ctorParameters: function () { return [{ type: ChartService }, { type: ZoomService }]; }, propDecorators: { plotBandsMove: [{
2265
+ }], ctorParameters: function () { return [{ type: ChartService }, { type: ZoomService }, { type: ScaleService }]; }, propDecorators: { pointerMove: [{
2266
+ type: Output
2267
+ }], plotBandsMove: [{
2202
2268
  type: Output
2203
2269
  }], plotBandClick: [{
2204
2270
  type: Output
@@ -2212,6 +2278,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
2212
2278
  type: Output
2213
2279
  }], chartContextMenu: [{
2214
2280
  type: Output
2281
+ }], annotationContextMenu: [{
2282
+ type: Output
2283
+ }], annotationClick: [{
2284
+ type: Output
2285
+ }], annotationMove: [{
2286
+ type: Output
2215
2287
  }], config: [{
2216
2288
  type: Input
2217
2289
  }] } });
@@ -2224,6 +2296,7 @@ ChartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "1
2224
2296
  ChartContainerComponent,
2225
2297
  LegendComponent,
2226
2298
  SeriesBaseComponent,
2299
+ LinearSeriesBase,
2227
2300
  LineSeriesComponent,
2228
2301
  GridlinesComponent,
2229
2302
  XAxisComponent,
@@ -2257,6 +2330,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
2257
2330
  ChartContainerComponent,
2258
2331
  LegendComponent,
2259
2332
  SeriesBaseComponent,
2333
+ LinearSeriesBase,
2260
2334
  LineSeriesComponent,
2261
2335
  GridlinesComponent,
2262
2336
  XAxisComponent,
@@ -2318,18 +2392,6 @@ class PlotLine {
2318
2392
  }
2319
2393
  }
2320
2394
 
2321
- const annotationMap = [
2322
- annotationBadge,
2323
- annotationLabel,
2324
- annotationCallout,
2325
- annotationCalloutCircle,
2326
- annotationCalloutCurve,
2327
- annotationCalloutElbow,
2328
- annotationCalloutRect,
2329
- annotationCustomType,
2330
- annotationXYThreshold,
2331
- ];
2332
-
2333
2395
  /*
2334
2396
  * Public API Surface of chart
2335
2397
  */