@tetacom/svg-charts 1.2.1 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chart/chart/chart.component.d.ts +2 -1
- package/chart/chart-container/chart-container.component.d.ts +5 -6
- package/chart/chart-container/series/linear-series-base.d.ts +2 -2
- package/chart/chart-container/series/scatter-series/scatter-series.component.d.ts +0 -1
- package/chart/chart-container/x-axis/x-axis.component.d.ts +2 -4
- package/chart/core/axis/axis.d.ts +3 -0
- package/chart/model/i-broadcast-message.d.ts +2 -2
- package/chart/service/chart.service.d.ts +4 -0
- package/chart/service/scale.service.d.ts +2 -0
- package/esm2020/chart/base/series-base.component.mjs +3 -3
- package/esm2020/chart/chart/chart.component.mjs +12 -4
- package/esm2020/chart/chart-container/annotation/annotation.component.mjs +6 -6
- package/esm2020/chart/chart-container/chart-container.component.mjs +21 -30
- package/esm2020/chart/chart-container/crosshair/crosshair.component.mjs +3 -3
- package/esm2020/chart/chart-container/gridlines/gridlines.component.mjs +14 -8
- package/esm2020/chart/chart-container/plotband/plot-band.component.mjs +3 -3
- package/esm2020/chart/chart-container/plotline/plotline.component.mjs +3 -3
- package/esm2020/chart/chart-container/series/area-series/area-series.component.mjs +8 -8
- package/esm2020/chart/chart-container/series/bar/bar-series.component.mjs +8 -8
- package/esm2020/chart/chart-container/series/block-area-series/block-area-series.component.mjs +6 -6
- package/esm2020/chart/chart-container/series/block-series/block-series.component.mjs +6 -6
- package/esm2020/chart/chart-container/series/line/line-series.component.mjs +3 -3
- package/esm2020/chart/chart-container/series/linear-series-base.mjs +47 -41
- package/esm2020/chart/chart-container/series/scatter-series/scatter-series.component.mjs +6 -6
- package/esm2020/chart/chart-container/series-host/series-host.component.mjs +3 -3
- package/esm2020/chart/chart-container/tooltip/tooltip.component.mjs +3 -3
- package/esm2020/chart/chart-container/x-axis/x-axis.component.mjs +6 -30
- package/esm2020/chart/chart-container/y-axis/y-axis.component.mjs +6 -6
- package/esm2020/chart/chart.module.mjs +4 -4
- package/esm2020/chart/core/axis/axis.mjs +7 -1
- package/esm2020/chart/default/default-axis-config.mjs +2 -2
- package/esm2020/chart/directives/brushable.directive.mjs +5 -6
- package/esm2020/chart/directives/zoomable.directive.mjs +49 -16
- package/esm2020/chart/legend/legend.component.mjs +3 -3
- package/esm2020/chart/model/i-broadcast-message.mjs +2 -2
- package/esm2020/chart/service/broadcast.service.mjs +3 -3
- package/esm2020/chart/service/brush.service.mjs +23 -20
- package/esm2020/chart/service/chart.service.mjs +9 -4
- package/esm2020/chart/service/scale.service.mjs +137 -4
- package/esm2020/chart/service/zoom.service.mjs +5 -5
- package/fesm2015/tetacom-svg-charts.mjs +404 -231
- package/fesm2015/tetacom-svg-charts.mjs.map +1 -1
- package/fesm2020/tetacom-svg-charts.mjs +391 -225
- package/fesm2020/tetacom-svg-charts.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -3,12 +3,13 @@ import { Injectable, Component, Input, ChangeDetectionStrategy, ChangeDetectorRe
|
|
|
3
3
|
import * as i4 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { __awaiter } from 'tslib';
|
|
6
|
-
import { BehaviorSubject, Subject, of, withLatestFrom, map, shareReplay, filter, lastValueFrom, take, combineLatest, ReplaySubject, tap, takeWhile, animationFrameScheduler } from 'rxjs';
|
|
6
|
+
import { BehaviorSubject, Subject, of, withLatestFrom, map, shareReplay, filter, lastValueFrom, take, combineLatest, ReplaySubject, tap, takeWhile, combineLatestWith, observeOn, animationFrameScheduler } from 'rxjs';
|
|
7
7
|
import * as d3 from 'd3';
|
|
8
8
|
import { zoomIdentity } from 'd3';
|
|
9
9
|
import objectHash from 'object-hash';
|
|
10
10
|
import { maxIndex } from 'd3-array';
|
|
11
|
-
import { tap as tap$1
|
|
11
|
+
import { debounceTime, tap as tap$1 } from 'rxjs/operators';
|
|
12
|
+
import { tetaZoneFull } from '@tetacom/ng-components';
|
|
12
13
|
import * as i3 from '@angular/platform-browser';
|
|
13
14
|
|
|
14
15
|
var ZoomType;
|
|
@@ -94,7 +95,7 @@ const defaultAxisConfig = {
|
|
|
94
95
|
scaleType: {
|
|
95
96
|
type: ScaleType.linear,
|
|
96
97
|
},
|
|
97
|
-
niceTicks:
|
|
98
|
+
niceTicks: false,
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
var SeriesType;
|
|
@@ -148,6 +149,7 @@ class ChartService {
|
|
|
148
149
|
this.chartContextMenu$ = new Subject();
|
|
149
150
|
this.annotationEvent$ = new Subject();
|
|
150
151
|
this.annotationMove$ = new Subject();
|
|
152
|
+
this.zoomInstance$ = new Subject();
|
|
151
153
|
this.id = of((Date.now() + Math.random()).toString(36));
|
|
152
154
|
this.config = this.config$.asObservable().pipe(withLatestFrom(this.id), map(this.setDefaults), map(this.setPreparationData), map(this.restoreLocalStorage), shareReplay({
|
|
153
155
|
bufferSize: 1,
|
|
@@ -174,6 +176,7 @@ class ChartService {
|
|
|
174
176
|
this.plotBandContextMenu = this.plotBandEvent$
|
|
175
177
|
.asObservable()
|
|
176
178
|
.pipe(filter((_) => { var _a; return ((_a = _ === null || _ === void 0 ? void 0 : _.event) === null || _a === void 0 ? void 0 : _a.type) === 'contextmenu'; }));
|
|
179
|
+
this.zoomInstance = this.zoomInstance$.asObservable();
|
|
177
180
|
}
|
|
178
181
|
setConfig(config) {
|
|
179
182
|
this.clearTooltips();
|
|
@@ -242,6 +245,9 @@ class ChartService {
|
|
|
242
245
|
emitChartContextMenu(event) {
|
|
243
246
|
this.chartContextMenu$.next(event);
|
|
244
247
|
}
|
|
248
|
+
emitZoomInstance(event) {
|
|
249
|
+
this.zoomInstance$.next(event);
|
|
250
|
+
}
|
|
245
251
|
saveCookie(config) {
|
|
246
252
|
var _a;
|
|
247
253
|
if (!config.name)
|
|
@@ -332,9 +338,9 @@ class ChartService {
|
|
|
332
338
|
}
|
|
333
339
|
}
|
|
334
340
|
ChartService._hiddenSeriesPostfix = 'hidden_series';
|
|
335
|
-
ChartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
336
|
-
ChartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
337
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
341
|
+
ChartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
342
|
+
ChartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartService, providedIn: 'root' });
|
|
343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartService, decorators: [{
|
|
338
344
|
type: Injectable,
|
|
339
345
|
args: [{
|
|
340
346
|
providedIn: 'root',
|
|
@@ -354,7 +360,7 @@ class ZoomService {
|
|
|
354
360
|
this.scaleHashMap = new Map();
|
|
355
361
|
this.elementHashMap = new Map();
|
|
356
362
|
this.zoomHashMap = new Map();
|
|
357
|
-
this.zoomed$ = new BehaviorSubject(
|
|
363
|
+
this.zoomed$ = new BehaviorSubject({});
|
|
358
364
|
this.zoomed = this.zoomed$.asObservable().pipe(shareReplay({
|
|
359
365
|
bufferSize: 1,
|
|
360
366
|
refCount: true
|
|
@@ -413,9 +419,9 @@ class ZoomService {
|
|
|
413
419
|
currentElement.transition().call(currentZoom.transform, zoomIdentity, null, new MouseEvent('resetZoom'));
|
|
414
420
|
}
|
|
415
421
|
}
|
|
416
|
-
ZoomService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
417
|
-
ZoomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
418
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
422
|
+
ZoomService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ZoomService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
423
|
+
ZoomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ZoomService, providedIn: 'root' });
|
|
424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ZoomService, decorators: [{
|
|
419
425
|
type: Injectable,
|
|
420
426
|
args: [{
|
|
421
427
|
providedIn: 'root',
|
|
@@ -561,6 +567,9 @@ class Axis {
|
|
|
561
567
|
setOriginDomain(domain) {
|
|
562
568
|
this._originDomain = domain;
|
|
563
569
|
}
|
|
570
|
+
setScale(scale) {
|
|
571
|
+
this._scale = scale;
|
|
572
|
+
}
|
|
564
573
|
setSelfSize() {
|
|
565
574
|
this._selfSize = new AxisSizeBuilder().build(this);
|
|
566
575
|
}
|
|
@@ -573,6 +582,9 @@ class Axis {
|
|
|
573
582
|
: this.chartConfig.yAxis[this.index];
|
|
574
583
|
this._options = options;
|
|
575
584
|
}
|
|
585
|
+
get scale() {
|
|
586
|
+
return this._scale;
|
|
587
|
+
}
|
|
576
588
|
get extremes() {
|
|
577
589
|
return this._extremes;
|
|
578
590
|
}
|
|
@@ -702,6 +714,143 @@ class ScaleService {
|
|
|
702
714
|
bufferSize: 1,
|
|
703
715
|
refCount: true,
|
|
704
716
|
}));
|
|
717
|
+
this.xMap = combineLatest([
|
|
718
|
+
this.chartService.size,
|
|
719
|
+
this.chartService.config,
|
|
720
|
+
this.zoomService.zoomed,
|
|
721
|
+
]).pipe(map((data) => {
|
|
722
|
+
var _a;
|
|
723
|
+
const [size, config, zoom] = data;
|
|
724
|
+
const xAxisMap = new Map();
|
|
725
|
+
const yAxisMap = new Map();
|
|
726
|
+
config.yAxis.map((_, index) => {
|
|
727
|
+
yAxisMap.set(index, Axis.createAxis(AxisOrientation.y, config, index));
|
|
728
|
+
});
|
|
729
|
+
config.xAxis.map((_, index) => {
|
|
730
|
+
xAxisMap.set(index, Axis.createAxis(AxisOrientation.x, config, index));
|
|
731
|
+
});
|
|
732
|
+
const left = Array.from(yAxisMap.values())
|
|
733
|
+
.filter((_) => { var _a, _b; return ((_a = _.options) === null || _a === void 0 ? void 0 : _a.visible) && ((_b = _.options) === null || _b === void 0 ? void 0 : _b.opposite); })
|
|
734
|
+
.reduce((acc, cur) => acc + cur.selfSize, 0);
|
|
735
|
+
const right = Array.from(yAxisMap.values())
|
|
736
|
+
.filter((_) => { var _a, _b; return ((_a = _.options) === null || _a === void 0 ? void 0 : _a.visible) && ((_b = _.options) === null || _b === void 0 ? void 0 : _b.opposite) !== true; })
|
|
737
|
+
.reduce((acc, cur) => acc + cur.selfSize, 0);
|
|
738
|
+
const finalWidth = (size.width || 0) - left - right;
|
|
739
|
+
xAxisMap.forEach((axis) => {
|
|
740
|
+
var _a, _b;
|
|
741
|
+
let domain = axis.extremes;
|
|
742
|
+
if (axis === null || axis === void 0 ? void 0 : axis.options.inverted) {
|
|
743
|
+
domain = [...axis.extremes].reverse();
|
|
744
|
+
}
|
|
745
|
+
let scale = this.scaleMapping
|
|
746
|
+
.get(axis.options.scaleType.type)()
|
|
747
|
+
.domain(domain)
|
|
748
|
+
.range([0, finalWidth - config.bounds.right]);
|
|
749
|
+
if (axis.options.niceTicks) {
|
|
750
|
+
scale.nice();
|
|
751
|
+
}
|
|
752
|
+
if (axis.options.scaleType.type === ScaleType.log) {
|
|
753
|
+
scale.base(axis.options.scaleType.base);
|
|
754
|
+
}
|
|
755
|
+
axis.setScale(scale);
|
|
756
|
+
axis.setOriginDomain(scale.domain());
|
|
757
|
+
const hasCache = this.transformCacheX.has(axis.index);
|
|
758
|
+
const shouldRestore = ((_a = zoom === null || zoom === void 0 ? void 0 : zoom.target) === null || _a === void 0 ? void 0 : _a.orientation) !== AxisOrientation.x ||
|
|
759
|
+
((_b = zoom.target) === null || _b === void 0 ? void 0 : _b.index) !== axis.index;
|
|
760
|
+
if (hasCache && shouldRestore) {
|
|
761
|
+
const restoredTransform = this.transformCacheX.get(axis.index);
|
|
762
|
+
axis.setScale(restoredTransform.rescaleX(scale));
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
if (zoom) {
|
|
766
|
+
const event = zoom.event;
|
|
767
|
+
if (((_a = zoom.target) === null || _a === void 0 ? void 0 : _a.orientation) === AxisOrientation.x) {
|
|
768
|
+
if (xAxisMap.has(zoom.target.index)) {
|
|
769
|
+
const x = xAxisMap.get(zoom.target.index);
|
|
770
|
+
const rescaled = event.transform.rescaleX(x.scale);
|
|
771
|
+
x.setScale(rescaled);
|
|
772
|
+
const axis = xAxisMap.get(zoom.target.index);
|
|
773
|
+
this.transformCacheX.set(axis.index, event.transform);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
return xAxisMap;
|
|
778
|
+
}), shareReplay({
|
|
779
|
+
bufferSize: 1,
|
|
780
|
+
refCount: true,
|
|
781
|
+
}));
|
|
782
|
+
this.yMap = combineLatest([
|
|
783
|
+
this.chartService.size,
|
|
784
|
+
this.chartService.config,
|
|
785
|
+
this.zoomService.zoomed,
|
|
786
|
+
]).pipe(map((data) => {
|
|
787
|
+
var _a, _b, _c;
|
|
788
|
+
const [size, config, zoom] = data;
|
|
789
|
+
const xAxisMap = new Map();
|
|
790
|
+
const yAxisMap = new Map();
|
|
791
|
+
config.yAxis.map((_, index) => {
|
|
792
|
+
yAxisMap.set(index, Axis.createAxis(AxisOrientation.y, config, index));
|
|
793
|
+
});
|
|
794
|
+
config.xAxis.map((_, index) => {
|
|
795
|
+
xAxisMap.set(index, Axis.createAxis(AxisOrientation.x, config, index));
|
|
796
|
+
});
|
|
797
|
+
const top = Array.from(xAxisMap.values())
|
|
798
|
+
.filter((_) => { var _a, _b; return ((_a = _.options) === null || _a === void 0 ? void 0 : _a.visible) && ((_b = _.options) === null || _b === void 0 ? void 0 : _b.opposite); })
|
|
799
|
+
.reduce((acc, cur) => acc + cur.selfSize, 0);
|
|
800
|
+
const bottom = Array.from(xAxisMap.values())
|
|
801
|
+
.filter((_) => { var _a, _b; return ((_a = _.options) === null || _a === void 0 ? void 0 : _a.visible) && ((_b = _.options) === null || _b === void 0 ? void 0 : _b.opposite) !== true; })
|
|
802
|
+
.reduce((acc, cur) => acc + cur.selfSize, 0);
|
|
803
|
+
const finalHeight = (size.height || 0) -
|
|
804
|
+
top -
|
|
805
|
+
bottom -
|
|
806
|
+
((_a = config === null || config === void 0 ? void 0 : config.bounds) === null || _a === void 0 ? void 0 : _a.top) -
|
|
807
|
+
((_b = config.bounds) === null || _b === void 0 ? void 0 : _b.bottom);
|
|
808
|
+
yAxisMap.forEach((axis) => {
|
|
809
|
+
var _a, _b;
|
|
810
|
+
let domain = axis.extremes;
|
|
811
|
+
if (axis.orientation === AxisOrientation.y) {
|
|
812
|
+
domain = [...axis.extremes].reverse();
|
|
813
|
+
}
|
|
814
|
+
if (axis === null || axis === void 0 ? void 0 : axis.options.inverted) {
|
|
815
|
+
domain = domain.reverse();
|
|
816
|
+
}
|
|
817
|
+
const scale = this.scaleMapping
|
|
818
|
+
.get(axis.options.scaleType.type)()
|
|
819
|
+
.domain(domain)
|
|
820
|
+
.range([config.bounds.top, finalHeight]);
|
|
821
|
+
if (axis.options.niceTicks) {
|
|
822
|
+
scale.nice();
|
|
823
|
+
}
|
|
824
|
+
if (axis.options.scaleType.type === ScaleType.log) {
|
|
825
|
+
scale.base(axis.options.scaleType.base);
|
|
826
|
+
}
|
|
827
|
+
axis.setScale(scale);
|
|
828
|
+
axis.setOriginDomain(scale.domain());
|
|
829
|
+
const hasCache = this.transformCacheY.has(axis.index);
|
|
830
|
+
const shouldRestore = ((_a = zoom === null || zoom === void 0 ? void 0 : zoom.target) === null || _a === void 0 ? void 0 : _a.orientation) !== AxisOrientation.y ||
|
|
831
|
+
((_b = zoom.target) === null || _b === void 0 ? void 0 : _b.index) !== axis.index;
|
|
832
|
+
if (hasCache && shouldRestore) {
|
|
833
|
+
const restoredTransform = this.transformCacheY.get(axis.index);
|
|
834
|
+
axis.setScale(restoredTransform.rescaleY(scale));
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
if (zoom) {
|
|
838
|
+
const event = zoom.event;
|
|
839
|
+
if (((_c = zoom.target) === null || _c === void 0 ? void 0 : _c.orientation) === AxisOrientation.y) {
|
|
840
|
+
if (yAxisMap.has(zoom.target.index)) {
|
|
841
|
+
const y = yAxisMap.get(zoom.target.index);
|
|
842
|
+
const rescaled = event.transform.rescaleY(y.scale);
|
|
843
|
+
y.setScale(rescaled);
|
|
844
|
+
const axis = yAxisMap.get(zoom.target.index);
|
|
845
|
+
this.transformCacheY.set(axis.index, event.transform);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
return yAxisMap;
|
|
850
|
+
}), shareReplay({
|
|
851
|
+
bufferSize: 1,
|
|
852
|
+
refCount: true,
|
|
853
|
+
}));
|
|
705
854
|
this.yScaleMap = combineLatest([
|
|
706
855
|
this.chartService.size,
|
|
707
856
|
this.chartService.config,
|
|
@@ -769,9 +918,9 @@ class ScaleService {
|
|
|
769
918
|
}));
|
|
770
919
|
}
|
|
771
920
|
}
|
|
772
|
-
ScaleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
773
|
-
ScaleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
921
|
+
ScaleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ScaleService, deps: [{ token: ChartService }, { token: ZoomService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
922
|
+
ScaleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ScaleService, providedIn: 'root' });
|
|
923
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ScaleService, decorators: [{
|
|
775
924
|
type: Injectable,
|
|
776
925
|
args: [{
|
|
777
926
|
providedIn: 'root',
|
|
@@ -789,7 +938,7 @@ class ZoomMessage {
|
|
|
789
938
|
constructor(options) {
|
|
790
939
|
this.event = options === null || options === void 0 ? void 0 : options.event;
|
|
791
940
|
this.axis = options === null || options === void 0 ? void 0 : options.axis;
|
|
792
|
-
this.
|
|
941
|
+
this.domain = options.domain;
|
|
793
942
|
this.chartId = options === null || options === void 0 ? void 0 : options.chartId;
|
|
794
943
|
this.style = options === null || options === void 0 ? void 0 : options.style;
|
|
795
944
|
}
|
|
@@ -828,9 +977,9 @@ class BroadcastService {
|
|
|
828
977
|
}));
|
|
829
978
|
}
|
|
830
979
|
}
|
|
831
|
-
BroadcastService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
832
|
-
BroadcastService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
833
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
980
|
+
BroadcastService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BroadcastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
981
|
+
BroadcastService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BroadcastService, providedIn: 'root' });
|
|
982
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BroadcastService, decorators: [{
|
|
834
983
|
type: Injectable,
|
|
835
984
|
args: [{
|
|
836
985
|
providedIn: 'root',
|
|
@@ -946,30 +1095,33 @@ class BrushService {
|
|
|
946
1095
|
(window.TouchEvent &&
|
|
947
1096
|
m.message.event.sourceEvent instanceof TouchEvent));
|
|
948
1097
|
}), tap((m) => {
|
|
949
|
-
var _a, _b, _c, _d, _e
|
|
950
|
-
const { message: {
|
|
1098
|
+
var _a, _b, _c, _d, _e;
|
|
1099
|
+
const { message: { domain }, } = m;
|
|
951
1100
|
if ((((_a = m.message) === null || _a === void 0 ? void 0 : _a.axis.index) === 0 &&
|
|
952
1101
|
((_b = m.message) === null || _b === void 0 ? void 0 : _b.axis.orientation) === AxisOrientation.y &&
|
|
953
1102
|
((_c = config.brush) === null || _c === void 0 ? void 0 : _c.type) === BrushType.y) ||
|
|
954
1103
|
(((_d = m.message) === null || _d === void 0 ? void 0 : _d.axis.orientation) === AxisOrientation.x &&
|
|
955
1104
|
((_e = config.brush) === null || _e === void 0 ? void 0 : _e.type) === BrushType.x)) {
|
|
956
1105
|
container.call(this.brush.move, [
|
|
957
|
-
brushScale(
|
|
958
|
-
brushScale(
|
|
1106
|
+
brushScale(domain[0]),
|
|
1107
|
+
brushScale(domain[1]),
|
|
959
1108
|
]);
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
}
|
|
972
|
-
this.
|
|
1109
|
+
this.selection = domain;
|
|
1110
|
+
}
|
|
1111
|
+
}), debounceTime(30), tap((m) => {
|
|
1112
|
+
var _a, _b, _c;
|
|
1113
|
+
const { message: { domain }, } = m;
|
|
1114
|
+
if (m.message.event.type === 'zoom') {
|
|
1115
|
+
const brushMessage = new BrushMessage({
|
|
1116
|
+
event: null,
|
|
1117
|
+
selection: domain,
|
|
1118
|
+
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,
|
|
1119
|
+
brushScale,
|
|
1120
|
+
});
|
|
1121
|
+
this.broadcastService.broadcastBrush({
|
|
1122
|
+
channel: (_c = config === null || config === void 0 ? void 0 : config.zoom) === null || _c === void 0 ? void 0 : _c.syncChannel,
|
|
1123
|
+
message: brushMessage,
|
|
1124
|
+
});
|
|
973
1125
|
}
|
|
974
1126
|
}))
|
|
975
1127
|
.subscribe();
|
|
@@ -979,9 +1131,9 @@ class BrushService {
|
|
|
979
1131
|
this.selection = null;
|
|
980
1132
|
}
|
|
981
1133
|
}
|
|
982
|
-
BrushService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
983
|
-
BrushService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
984
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1134
|
+
BrushService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BrushService, deps: [{ token: BroadcastService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1135
|
+
BrushService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BrushService, providedIn: 'root' });
|
|
1136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BrushService, decorators: [{
|
|
985
1137
|
type: Injectable,
|
|
986
1138
|
args: [{
|
|
987
1139
|
providedIn: 'root',
|
|
@@ -1011,9 +1163,9 @@ class SeriesBaseComponent {
|
|
|
1011
1163
|
ngOnInit() {
|
|
1012
1164
|
}
|
|
1013
1165
|
}
|
|
1014
|
-
SeriesBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1015
|
-
SeriesBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1016
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1166
|
+
SeriesBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SeriesBaseComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1167
|
+
SeriesBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: SeriesBaseComponent, selector: "ng-component", inputs: { config: "config", series: "series" }, ngImport: i0, template: '', isInline: true });
|
|
1168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SeriesBaseComponent, decorators: [{
|
|
1017
1169
|
type: Component,
|
|
1018
1170
|
args: [{
|
|
1019
1171
|
template: '',
|
|
@@ -1042,35 +1194,43 @@ class LinearSeriesBase extends SeriesBaseComponent {
|
|
|
1042
1194
|
this.defaultClipPointsMapping = new Map();
|
|
1043
1195
|
}
|
|
1044
1196
|
ngOnInit() {
|
|
1045
|
-
const filterX = (min, max) => (point, idx, arr) =>
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
(
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
(arr[idx
|
|
1052
|
-
(
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1197
|
+
const filterX = (min, max) => (point, idx, arr) => {
|
|
1198
|
+
const bigger = min > max ? min : max;
|
|
1199
|
+
const smaller = min > max ? max : min;
|
|
1200
|
+
return (point.x <= bigger ||
|
|
1201
|
+
point.x1 <= bigger ||
|
|
1202
|
+
(arr[idx - 1] && arr[idx - 1].x <= bigger) ||
|
|
1203
|
+
(arr[idx - 1] && arr[idx - 1].x1 <= bigger)) &&
|
|
1204
|
+
(point.x >= smaller ||
|
|
1205
|
+
point.x1 >= smaller ||
|
|
1206
|
+
(arr[idx + 1] && arr[idx + 1].x >= smaller) ||
|
|
1207
|
+
(arr[idx + 1] && arr[idx + 1].x1 >= smaller));
|
|
1208
|
+
};
|
|
1209
|
+
const filterY = (min, max) => (point, idx, arr) => {
|
|
1210
|
+
const bigger = min > max ? min : max;
|
|
1211
|
+
const smaller = min > max ? max : min;
|
|
1212
|
+
return (point.y <= bigger ||
|
|
1213
|
+
point.y1 <= bigger ||
|
|
1214
|
+
(arr[idx - 1] && arr[idx - 1].y <= bigger) ||
|
|
1215
|
+
(arr[idx - 1] && arr[idx - 1].y1 <= bigger)) &&
|
|
1216
|
+
(point.y >= smaller ||
|
|
1217
|
+
point.y1 >= smaller ||
|
|
1218
|
+
(arr[idx + 1] && arr[idx + 1].y >= smaller) ||
|
|
1219
|
+
(arr[idx + 1] && arr[idx + 1].y1 >= smaller));
|
|
1220
|
+
};
|
|
1061
1221
|
this.defaultClipPointsMapping.set(ClipPointsDirection.x, filterX);
|
|
1062
1222
|
this.defaultClipPointsMapping.set(ClipPointsDirection.y, filterY);
|
|
1063
|
-
this.transform = this.svc.pointerMove.pipe(withLatestFrom(this.scaleService.
|
|
1223
|
+
this.transform = this.svc.pointerMove.pipe(withLatestFrom(this.scaleService.xMap, this.scaleService.yMap), map((data) => {
|
|
1064
1224
|
const [event, x, y] = data;
|
|
1065
|
-
return this.getTransform(event, x, y);
|
|
1225
|
+
return this.getTransform(event, x.get(this.series.xAxisIndex).scale, y.get(this.series.yAxisIndex).scale);
|
|
1066
1226
|
}), tap(() => setTimeout(() => this.cdr.detectChanges())));
|
|
1067
1227
|
this.path = combineLatest([
|
|
1068
|
-
this.scaleService.
|
|
1069
|
-
this.scaleService.
|
|
1228
|
+
this.scaleService.xMap,
|
|
1229
|
+
this.scaleService.yMap,
|
|
1070
1230
|
]).pipe(map((data) => {
|
|
1071
1231
|
const [x, y] = data;
|
|
1072
|
-
this.x = x.get(this.series.xAxisIndex);
|
|
1073
|
-
this.y = y.get(this.series.yAxisIndex);
|
|
1232
|
+
this.x = x.get(this.series.xAxisIndex).scale;
|
|
1233
|
+
this.y = y.get(this.series.yAxisIndex).scale;
|
|
1074
1234
|
const filter = this.defaultClipPointsMapping.get(this.series.clipPointsDirection);
|
|
1075
1235
|
const line = d3
|
|
1076
1236
|
.line()
|
|
@@ -1158,8 +1318,6 @@ class LinearSeriesBase extends SeriesBaseComponent {
|
|
|
1158
1318
|
return null;
|
|
1159
1319
|
}
|
|
1160
1320
|
const mouse = [event === null || event === void 0 ? void 0 : event.offsetX, event === null || event === void 0 ? void 0 : event.offsetY];
|
|
1161
|
-
const foundX = scaleX.get(this.series.xAxisIndex);
|
|
1162
|
-
const foundY = scaleY.get(this.series.yAxisIndex);
|
|
1163
1321
|
const tooltipTracking = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.tooltip) === null || _b === void 0 ? void 0 : _b.tracking;
|
|
1164
1322
|
const lineIntersection = (p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) => {
|
|
1165
1323
|
const rV = {};
|
|
@@ -1185,18 +1343,18 @@ class LinearSeriesBase extends SeriesBaseComponent {
|
|
|
1185
1343
|
if (tooltipTracking === TooltipTracking.x) {
|
|
1186
1344
|
const bisect = d3.bisector((_) => _.x).right;
|
|
1187
1345
|
const pointer = mouse[0];
|
|
1188
|
-
let x0 =
|
|
1346
|
+
let x0 = scaleX.invert(pointer);
|
|
1189
1347
|
if (x0 instanceof Date) {
|
|
1190
1348
|
x0 = x0.getTime();
|
|
1191
1349
|
}
|
|
1192
1350
|
const rightId = bisect(this.series.data, x0);
|
|
1193
|
-
const range =
|
|
1194
|
-
const intersect = lineIntersection(pointer, range[0], pointer, range[1],
|
|
1195
|
-
const x =
|
|
1196
|
-
const y =
|
|
1351
|
+
const range = scaleY.range();
|
|
1352
|
+
const intersect = lineIntersection(pointer, range[0], pointer, range[1], scaleX((_c = this.series.data[rightId - 1]) === null || _c === void 0 ? void 0 : _c.x), scaleY((_d = this.series.data[rightId - 1]) === null || _d === void 0 ? void 0 : _d.y), scaleX((_e = this.series.data[rightId]) === null || _e === void 0 ? void 0 : _e.x), scaleY((_f = this.series.data[rightId]) === null || _f === void 0 ? void 0 : _f.y));
|
|
1353
|
+
const x = scaleX.invert(intersect.x);
|
|
1354
|
+
const y = scaleY.invert(intersect.y);
|
|
1197
1355
|
if (x !== null && x !== undefined && !isNaN(x) && y !== null && y !== undefined && !isNaN(y)) {
|
|
1198
1356
|
this.svc.setTooltip({
|
|
1199
|
-
point: { x:
|
|
1357
|
+
point: { x: scaleX.invert(intersect.x), y: scaleY.invert(intersect.y) },
|
|
1200
1358
|
series: this.series,
|
|
1201
1359
|
});
|
|
1202
1360
|
}
|
|
@@ -1213,18 +1371,18 @@ class LinearSeriesBase extends SeriesBaseComponent {
|
|
|
1213
1371
|
}
|
|
1214
1372
|
if (tooltipTracking === TooltipTracking.y) {
|
|
1215
1373
|
const bisect = d3.bisector((_) => _.y).right;
|
|
1216
|
-
let y0 =
|
|
1374
|
+
let y0 = scaleY.invert(mouse[1]);
|
|
1217
1375
|
if (y0 instanceof Date) {
|
|
1218
1376
|
y0 = y0.getTime();
|
|
1219
1377
|
}
|
|
1220
1378
|
const rightId = bisect(this.series.data, y0);
|
|
1221
|
-
const range =
|
|
1222
|
-
const intersect = lineIntersection(range[0], mouse[1], range[1], mouse[1],
|
|
1223
|
-
const x =
|
|
1224
|
-
const y =
|
|
1379
|
+
const range = scaleX.range();
|
|
1380
|
+
const intersect = lineIntersection(range[0], mouse[1], range[1], mouse[1], scaleX((_g = this.series.data[rightId - 1]) === null || _g === void 0 ? void 0 : _g.x), scaleY((_h = this.series.data[rightId - 1]) === null || _h === void 0 ? void 0 : _h.y), scaleX((_j = this.series.data[rightId]) === null || _j === void 0 ? void 0 : _j.x), scaleY((_k = this.series.data[rightId]) === null || _k === void 0 ? void 0 : _k.y));
|
|
1381
|
+
const x = scaleX.invert(intersect.x);
|
|
1382
|
+
const y = scaleY.invert(intersect.y);
|
|
1225
1383
|
if (x !== null && x !== undefined && !isNaN(x) && y !== null && y !== undefined && !isNaN(y)) {
|
|
1226
1384
|
this.svc.setTooltip({
|
|
1227
|
-
point: { x:
|
|
1385
|
+
point: { x: scaleX.invert(intersect.x), y: scaleY.invert(intersect.y) },
|
|
1228
1386
|
series: this.series,
|
|
1229
1387
|
});
|
|
1230
1388
|
}
|
|
@@ -1241,9 +1399,9 @@ class LinearSeriesBase extends SeriesBaseComponent {
|
|
|
1241
1399
|
}
|
|
1242
1400
|
}
|
|
1243
1401
|
}
|
|
1244
|
-
LinearSeriesBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1245
|
-
LinearSeriesBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1246
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1402
|
+
LinearSeriesBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LinearSeriesBase, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1403
|
+
LinearSeriesBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: LinearSeriesBase, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
1404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LinearSeriesBase, decorators: [{
|
|
1247
1405
|
type: Component,
|
|
1248
1406
|
args: [{
|
|
1249
1407
|
template: '',
|
|
@@ -1260,9 +1418,9 @@ class LineSeriesComponent extends LinearSeriesBase {
|
|
|
1260
1418
|
this.element = element;
|
|
1261
1419
|
}
|
|
1262
1420
|
}
|
|
1263
|
-
LineSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1264
|
-
LineSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1421
|
+
LineSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LineSeriesComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1422
|
+
LineSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", 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 !=null && t?.y!=null\"\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: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1423
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LineSeriesComponent, decorators: [{
|
|
1266
1424
|
type: Component,
|
|
1267
1425
|
args: [{ selector: 'svg:svg[teta-line-series]', changeDetection: ChangeDetectionStrategy.OnPush, 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 !=null && t?.y!=null\"\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: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"] }]
|
|
1268
1426
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
|
|
@@ -1282,8 +1440,8 @@ class BarSeriesComponent extends SeriesBaseComponent {
|
|
|
1282
1440
|
const count = _.series.filter((_) => _.type === SeriesType.bar && _.xAxisIndex === this.series.xAxisIndex);
|
|
1283
1441
|
return count.length;
|
|
1284
1442
|
}));
|
|
1285
|
-
this.x1 = this.scaleService.
|
|
1286
|
-
const x = _.get(this.series.xAxisIndex);
|
|
1443
|
+
this.x1 = this.scaleService.xMap.pipe(map((_) => {
|
|
1444
|
+
const x = _.get(this.series.xAxisIndex).scale;
|
|
1287
1445
|
const range = x.range();
|
|
1288
1446
|
const domain = this.series.data.map((_) => _.x);
|
|
1289
1447
|
return d3
|
|
@@ -1292,8 +1450,8 @@ class BarSeriesComponent extends SeriesBaseComponent {
|
|
|
1292
1450
|
.domain(domain)
|
|
1293
1451
|
.padding(0.1);
|
|
1294
1452
|
}));
|
|
1295
|
-
this.x = this.scaleService.
|
|
1296
|
-
this.y = this.scaleService.
|
|
1453
|
+
this.x = this.scaleService.xMap.pipe(map((_) => _.get(this.series.xAxisIndex).scale));
|
|
1454
|
+
this.y = this.scaleService.yMap.pipe(map((_) => _.get(this.series.yAxisIndex).scale));
|
|
1297
1455
|
}
|
|
1298
1456
|
mouseenter(point) {
|
|
1299
1457
|
this.svc.setTooltip({
|
|
@@ -1309,9 +1467,9 @@ class BarSeriesComponent extends SeriesBaseComponent {
|
|
|
1309
1467
|
}
|
|
1310
1468
|
ngOnChanges(changes) { }
|
|
1311
1469
|
}
|
|
1312
|
-
BarSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1313
|
-
BarSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1314
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1470
|
+
BarSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BarSeriesComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1471
|
+
BarSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: BarSeriesComponent, selector: "svg:svg[teta-bar-series]", usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"{\n x: x | async,\n x1: x1 | async,\n y: y | async,\n barSeriesCount: barSeriesCount | async\n} as data\">\n <ng-container *ngIf=\"data.barSeriesCount > 1\">\n <svg:rect\n *ngFor=\"let point of series.data\"\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.x]=\"data.x(point.x) + (series.id * data.x1.bandwidth() / data.barSeriesCount)\"\n [attr.y]=\"point.y > 0 ? data.y(point.y) : data.y(0)\"\n [attr.width]=\"data.x1.bandwidth() / data.barSeriesCount\"\n [attr.height]=\"Math.abs(data.y(point.y) - data.y(0))\"\n [attr.fill]=\"series.color\"\n ></svg:rect>\n </ng-container>\n <ng-container *ngIf=\"data.barSeriesCount === 1\">\n <svg:rect\n *ngFor=\"let point of series.data\"\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.x]=\"data.x(point.x)\"\n [attr.y]=\"point.y > 0 ? data.y(point.y) : data.y(0)\"\n [attr.width]=\"data.x1.bandwidth()\"\n [attr.height]=\"Math.abs(data.y(point.y) - data.y(0))\"\n [attr.fill]=\"point.color ?? series.color\"\n ></svg:rect>\n </ng-container>\n</ng-container>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BarSeriesComponent, decorators: [{
|
|
1315
1473
|
type: Component,
|
|
1316
1474
|
args: [{ selector: 'svg:svg[teta-bar-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n x: x | async,\n x1: x1 | async,\n y: y | async,\n barSeriesCount: barSeriesCount | async\n} as data\">\n <ng-container *ngIf=\"data.barSeriesCount > 1\">\n <svg:rect\n *ngFor=\"let point of series.data\"\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.x]=\"data.x(point.x) + (series.id * data.x1.bandwidth() / data.barSeriesCount)\"\n [attr.y]=\"point.y > 0 ? data.y(point.y) : data.y(0)\"\n [attr.width]=\"data.x1.bandwidth() / data.barSeriesCount\"\n [attr.height]=\"Math.abs(data.y(point.y) - data.y(0))\"\n [attr.fill]=\"series.color\"\n ></svg:rect>\n </ng-container>\n <ng-container *ngIf=\"data.barSeriesCount === 1\">\n <svg:rect\n *ngFor=\"let point of series.data\"\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.x]=\"data.x(point.x)\"\n [attr.y]=\"point.y > 0 ? data.y(point.y) : data.y(0)\"\n [attr.width]=\"data.x1.bandwidth()\"\n [attr.height]=\"Math.abs(data.y(point.y) - data.y(0))\"\n [attr.fill]=\"point.color ?? series.color\"\n ></svg:rect>\n </ng-container>\n</ng-container>\n\n" }]
|
|
1317
1475
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
|
|
@@ -1326,8 +1484,8 @@ class ScatterSeriesComponent extends SeriesBaseComponent {
|
|
|
1326
1484
|
this.element = element;
|
|
1327
1485
|
}
|
|
1328
1486
|
ngOnInit() {
|
|
1329
|
-
this.x = this.scaleService.
|
|
1330
|
-
this.y = this.scaleService.
|
|
1487
|
+
this.x = this.scaleService.xMap.pipe(map(_ => _.get(this.series.xAxisIndex).scale));
|
|
1488
|
+
this.y = this.scaleService.yMap.pipe(map(_ => _.get(this.series.yAxisIndex).scale));
|
|
1331
1489
|
}
|
|
1332
1490
|
ngAfterViewInit() {
|
|
1333
1491
|
}
|
|
@@ -1344,9 +1502,9 @@ class ScatterSeriesComponent extends SeriesBaseComponent {
|
|
|
1344
1502
|
});
|
|
1345
1503
|
}
|
|
1346
1504
|
}
|
|
1347
|
-
ScatterSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1348
|
-
ScatterSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1349
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1505
|
+
ScatterSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ScatterSeriesComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1506
|
+
ScatterSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: ScatterSeriesComponent, selector: "svg:svg[teta-scatter-series]", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"{\n y: y | async,\n x: x | async\n} as scales\">\n <svg:circle\n class=\"line\"\n *ngFor=\"let point of series.data\"\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.cx]=\"scales.x(point.x)\"\n [attr.cy]=\"scales.y(point.y)\"\n [attr.r]=\"series.style?.radius ?? 1\"\n [attr.stroke]=\"point.color ?? series.color\"\n [attr.fill]=\"point.color ?? series.color\"\n [attr.stroke-width]=\"series.style?.strokeWidth\">\n </svg:circle>\n</ng-container>\n\n\n\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ScatterSeriesComponent, decorators: [{
|
|
1350
1508
|
type: Component,
|
|
1351
1509
|
args: [{ selector: 'svg:svg[teta-scatter-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n y: y | async,\n x: x | async\n} as scales\">\n <svg:circle\n class=\"line\"\n *ngFor=\"let point of series.data\"\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.cx]=\"scales.x(point.x)\"\n [attr.cy]=\"scales.y(point.y)\"\n [attr.r]=\"series.style?.radius ?? 1\"\n [attr.stroke]=\"point.color ?? series.color\"\n [attr.fill]=\"point.color ?? series.color\"\n [attr.stroke-width]=\"series.style?.strokeWidth\">\n </svg:circle>\n</ng-container>\n\n\n\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"] }]
|
|
1352
1510
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
|
|
@@ -1365,8 +1523,8 @@ class BlockSeriesComponent extends SeriesBaseComponent {
|
|
|
1365
1523
|
}
|
|
1366
1524
|
ngOnInit() {
|
|
1367
1525
|
const defaultVisiblePixels = 0;
|
|
1368
|
-
this.x = this.scaleService.
|
|
1369
|
-
this.y = this.scaleService.
|
|
1526
|
+
this.x = this.scaleService.xMap.pipe(map((_) => _.get(this.series.xAxisIndex).scale));
|
|
1527
|
+
this.y = this.scaleService.yMap.pipe(map((_) => _.get(this.series.yAxisIndex).scale));
|
|
1370
1528
|
this.displayPoints = this.y.pipe(map((y) => {
|
|
1371
1529
|
return this.series.data.filter((point, index, arr) => {
|
|
1372
1530
|
var _a, _b, _c, _d;
|
|
@@ -1397,9 +1555,9 @@ class BlockSeriesComponent extends SeriesBaseComponent {
|
|
|
1397
1555
|
ngAfterViewInit() {
|
|
1398
1556
|
}
|
|
1399
1557
|
}
|
|
1400
|
-
BlockSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1401
|
-
BlockSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1558
|
+
BlockSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BlockSeriesComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1559
|
+
BlockSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: BlockSeriesComponent, selector: "svg:svg[teta-block-series]", usesInheritance: true, ngImport: i0, 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\" 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 x=\"0\"\n [attr.y]=\"data.y(point.y)\"\n [attr.height]=\"Math.abs(data.y(point.y1) - data.y(point.y))\"\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 width=\"100%\">\n </svg:rect>\n <svg:text *ngIf=\"point.text && data.y(point.y1) - data.y(point.y) > 8\"\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 <svg:line x1=\"0\" x2=\"100%\" [attr.y1]=\"data.y(point.y)\" [attr.y2]=\"data.y(point.y)\"\n [attr.stroke]=\"point.iconId ? 'var(--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)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : point.color ?? series.color\"></svg:line>\n </svg:g>\n </ng-container>\n\n\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1560
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BlockSeriesComponent, decorators: [{
|
|
1403
1561
|
type: Component,
|
|
1404
1562
|
args: [{ selector: 'svg:svg[teta-block-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\" 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 x=\"0\"\n [attr.y]=\"data.y(point.y)\"\n [attr.height]=\"Math.abs(data.y(point.y1) - data.y(point.y))\"\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 width=\"100%\">\n </svg:rect>\n <svg:text *ngIf=\"point.text && data.y(point.y1) - data.y(point.y) > 8\"\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 <svg:line x1=\"0\" x2=\"100%\" [attr.y1]=\"data.y(point.y)\" [attr.y2]=\"data.y(point.y)\"\n [attr.stroke]=\"point.iconId ? 'var(--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)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : point.color ?? series.color\"></svg:line>\n </svg:g>\n </ng-container>\n\n\n</ng-container>\n" }]
|
|
1405
1563
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
|
|
@@ -1418,8 +1576,8 @@ class BlockAreaSeriesComponent extends SeriesBaseComponent {
|
|
|
1418
1576
|
}
|
|
1419
1577
|
ngOnInit() {
|
|
1420
1578
|
const defaultVisiblePixels = 0;
|
|
1421
|
-
this.x = this.scaleService.
|
|
1422
|
-
this.y = this.scaleService.
|
|
1579
|
+
this.x = this.scaleService.xMap.pipe(map((_) => _.get(this.series.xAxisIndex).scale));
|
|
1580
|
+
this.y = this.scaleService.yMap.pipe(map((_) => _.get(this.series.yAxisIndex).scale));
|
|
1423
1581
|
this.displayPoints = this.y.pipe(map((y) => {
|
|
1424
1582
|
return this.series.data.filter((point, index, arr) => {
|
|
1425
1583
|
var _a, _b, _c, _d;
|
|
@@ -1450,9 +1608,9 @@ class BlockAreaSeriesComponent extends SeriesBaseComponent {
|
|
|
1450
1608
|
});
|
|
1451
1609
|
}
|
|
1452
1610
|
}
|
|
1453
|
-
BlockAreaSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1454
|
-
BlockAreaSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1455
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1611
|
+
BlockAreaSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BlockAreaSeriesComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1612
|
+
BlockAreaSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: BlockAreaSeriesComponent, selector: "svg:svg[teta-block-area-series]", usesInheritance: true, ngImport: i0, 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]=\"Math.abs(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]=\"Math.abs(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(--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(--color-text-10)' : point.color ?? series.color\"></svg:line>-->\n\n </svg:g>\n </ng-container>\n\n\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1613
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BlockAreaSeriesComponent, decorators: [{
|
|
1456
1614
|
type: Component,
|
|
1457
1615
|
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]=\"Math.abs(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]=\"Math.abs(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(--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(--color-text-10)' : point.color ?? series.color\"></svg:line>-->\n\n </svg:g>\n </ng-container>\n\n\n</ng-container>\n" }]
|
|
1458
1616
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
|
|
@@ -1472,12 +1630,12 @@ class AreaSeriesComponent extends LinearSeriesBase {
|
|
|
1472
1630
|
ngOnInit() {
|
|
1473
1631
|
super.ngOnInit();
|
|
1474
1632
|
this.areaPath = combineLatest([
|
|
1475
|
-
this.scaleService.
|
|
1476
|
-
this.scaleService.
|
|
1633
|
+
this.scaleService.xMap,
|
|
1634
|
+
this.scaleService.yMap,
|
|
1477
1635
|
]).pipe(map((data) => {
|
|
1478
1636
|
const [x, y] = data;
|
|
1479
|
-
this.x = x.get(this.series.xAxisIndex);
|
|
1480
|
-
this.y = y.get(this.series.yAxisIndex);
|
|
1637
|
+
this.x = x.get(this.series.xAxisIndex).scale;
|
|
1638
|
+
this.y = y.get(this.series.yAxisIndex).scale;
|
|
1481
1639
|
const area = d3
|
|
1482
1640
|
.area()
|
|
1483
1641
|
.defined((point) => point.x !== null &&
|
|
@@ -1506,9 +1664,9 @@ class AreaSeriesComponent extends LinearSeriesBase {
|
|
|
1506
1664
|
}));
|
|
1507
1665
|
}
|
|
1508
1666
|
}
|
|
1509
|
-
AreaSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1510
|
-
AreaSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1511
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1667
|
+
AreaSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: AreaSeriesComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1668
|
+
AreaSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", 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 [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 !=null && t?.y !=null\"\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: [""], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1669
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: AreaSeriesComponent, decorators: [{
|
|
1512
1670
|
type: Component,
|
|
1513
1671
|
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 [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 !=null && t?.y !=null\"\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" }]
|
|
1514
1672
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
|
|
@@ -1547,9 +1705,9 @@ class SeriesHostComponent {
|
|
|
1547
1705
|
}
|
|
1548
1706
|
}
|
|
1549
1707
|
}
|
|
1550
|
-
SeriesHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1551
|
-
SeriesHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1552
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1708
|
+
SeriesHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SeriesHostComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1709
|
+
SeriesHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: SeriesHostComponent, selector: "[teta-series-host]", inputs: { config: "config", series: "series" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1710
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SeriesHostComponent, decorators: [{
|
|
1553
1711
|
type: Component,
|
|
1554
1712
|
args: [{
|
|
1555
1713
|
selector: '[teta-series-host]',
|
|
@@ -1567,17 +1725,23 @@ class GridlinesComponent {
|
|
|
1567
1725
|
this.svc = svc;
|
|
1568
1726
|
this.chartService = chartService;
|
|
1569
1727
|
this.config = this.chartService.config;
|
|
1570
|
-
this.tickYValues = this.svc.
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1728
|
+
this.tickYValues = this.svc.yMap.pipe(map((_) => {
|
|
1729
|
+
const ratio = this.size.height / 40;
|
|
1730
|
+
return _.get(0).scale.ticks(ratio);
|
|
1731
|
+
}));
|
|
1732
|
+
this.tickXValues = this.svc.xMap.pipe(map((_) => {
|
|
1733
|
+
const ratio = this.size.width / 40;
|
|
1734
|
+
return _.get(0).scale.ticks(ratio);
|
|
1735
|
+
}));
|
|
1736
|
+
this.y = this.svc.yMap.pipe(map((_) => _.get(0).scale));
|
|
1737
|
+
this.x = this.svc.xMap.pipe(map((_) => _.get(0).scale));
|
|
1574
1738
|
}
|
|
1575
1739
|
ngAfterViewInit() {
|
|
1576
1740
|
}
|
|
1577
1741
|
}
|
|
1578
|
-
GridlinesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1579
|
-
GridlinesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1580
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1742
|
+
GridlinesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: GridlinesComponent, deps: [{ token: ScaleService }, { token: ChartService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1743
|
+
GridlinesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: GridlinesComponent, selector: "[teta-gridlines]", inputs: { size: "size" }, ngImport: i0, template: "<ng-container *ngIf=\"{\n xValues: tickXValues | async,\n yValues: tickYValues | async,\n x: x | async,\n y: y | async,\n config: config | async\n} as data\">\n <ng-container *ngIf=\"data.config.gridLines?.showY !== false\">\n <ng-container *ngFor=\"let tick of data.yValues\">\n <svg:line [attr.x1]=\"0\"\n [attr.y1]=\"data.y(tick)\"\n [attr.x2]=\"size?.width\"\n [attr.y2]=\"data.y(tick)\"></svg:line>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"data.config.gridLines?.showX !== false\">\n <ng-container *ngFor=\"let tick of data.xValues\">\n <svg:line [attr.x1]=\"data.x(tick)\"\n [attr.y1]=\"0\"\n [attr.x2]=\"data.x(tick)\"\n [attr.y2]=\"size?.height\"></svg:line>\n </ng-container>\n </ng-container>\n\n</ng-container>\n\n\n", styles: [":host{shape-rendering:crispEdges}:host line{stroke:var(--color-text-10)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1744
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: GridlinesComponent, decorators: [{
|
|
1581
1745
|
type: Component,
|
|
1582
1746
|
args: [{ selector: '[teta-gridlines]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n xValues: tickXValues | async,\n yValues: tickYValues | async,\n x: x | async,\n y: y | async,\n config: config | async\n} as data\">\n <ng-container *ngIf=\"data.config.gridLines?.showY !== false\">\n <ng-container *ngFor=\"let tick of data.yValues\">\n <svg:line [attr.x1]=\"0\"\n [attr.y1]=\"data.y(tick)\"\n [attr.x2]=\"size?.width\"\n [attr.y2]=\"data.y(tick)\"></svg:line>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"data.config.gridLines?.showX !== false\">\n <ng-container *ngFor=\"let tick of data.xValues\">\n <svg:line [attr.x1]=\"data.x(tick)\"\n [attr.y1]=\"0\"\n [attr.x2]=\"data.x(tick)\"\n [attr.y2]=\"size?.height\"></svg:line>\n </ng-container>\n </ng-container>\n\n</ng-container>\n\n\n", styles: [":host{shape-rendering:crispEdges}:host line{stroke:var(--color-text-10)}\n"] }]
|
|
1583
1747
|
}], ctorParameters: function () { return [{ type: ScaleService }, { type: ChartService }]; }, propDecorators: { size: [{
|
|
@@ -1588,8 +1752,9 @@ class XAxisComponent {
|
|
|
1588
1752
|
constructor(scaleService) {
|
|
1589
1753
|
this.scaleService = scaleService;
|
|
1590
1754
|
this._alive = true;
|
|
1591
|
-
this.x = this.scaleService.
|
|
1592
|
-
|
|
1755
|
+
this.x = this.scaleService.xMap.pipe(map((_) => {
|
|
1756
|
+
var _a;
|
|
1757
|
+
return (_a = _.get(this.axis.index)) === null || _a === void 0 ? void 0 : _a.scale;
|
|
1593
1758
|
}));
|
|
1594
1759
|
}
|
|
1595
1760
|
getLabelTransform() {
|
|
@@ -1599,34 +1764,10 @@ class XAxisComponent {
|
|
|
1599
1764
|
ngOnDestroy() {
|
|
1600
1765
|
this._alive = false;
|
|
1601
1766
|
}
|
|
1602
|
-
ngAfterViewInit() {
|
|
1603
|
-
// this.draw();
|
|
1604
|
-
}
|
|
1605
|
-
draw() {
|
|
1606
|
-
// if (!this.node || !this.axis) {
|
|
1607
|
-
// return;
|
|
1608
|
-
// }
|
|
1609
|
-
//
|
|
1610
|
-
// const axis = this.axis.options.opposite
|
|
1611
|
-
// ? d3
|
|
1612
|
-
// .axisTop(this.scale)
|
|
1613
|
-
// .tickFormat(
|
|
1614
|
-
// this.axis.options.tickFormat ?? this.axis.defaultFormatter()
|
|
1615
|
-
// )
|
|
1616
|
-
// : d3
|
|
1617
|
-
// .axisBottom(this.scale)
|
|
1618
|
-
// .tickFormat(
|
|
1619
|
-
// this.axis.options.tickFormat ?? this.axis.defaultFormatter()
|
|
1620
|
-
// );
|
|
1621
|
-
//
|
|
1622
|
-
// d3.select(this.node.nativeElement)
|
|
1623
|
-
// .call(axis)
|
|
1624
|
-
// .call((_) => _.select('.domain').remove());
|
|
1625
|
-
}
|
|
1626
1767
|
}
|
|
1627
|
-
XAxisComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1628
|
-
XAxisComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1629
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1768
|
+
XAxisComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XAxisComponent, deps: [{ token: ScaleService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1769
|
+
XAxisComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: XAxisComponent, selector: "[teta-x-axis]", inputs: { axis: "axis", size: "size" }, ngImport: i0, template: "<ng-container *ngIf=\"x | async as scale\">\n <svg:g text-anchor=\"middle\" *ngFor=\"let tick of scale.ticks()\" [attr.transform]=\"'translate('+ scale(tick) +', 0)'\">\n <text fill=\"var(--color-text-70)\" [attr.dy]=\"axis.options.opposite ? '-0.71em' : '0.71em'\" [attr.y]=\"axis.options.opposite ? 0 : 9\">{{ this.axis.options.tickFormat ? this.axis.options.tickFormat(tick) : this.axis.defaultFormatter()(tick) }}</text>\n <line stroke=\"var(--color-text-30)\" [attr.y2]=\"axis.options.opposite ? -6 : 6\"></line>\n </svg:g>\n\n <svg:g class=\"label-axis font-caption\" [attr.transform]=\"getLabelTransform()\">\n <text fill=\"var(--color-text-70)\" text-anchor=\"middle\" dominant-baseline=\"middle\">{{ axis.options.title }}</text>\n </svg:g>\n</ng-container>\n\n", styles: [":host .tick{stroke:var(--color-text-20)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: XAxisComponent, decorators: [{
|
|
1630
1771
|
type: Component,
|
|
1631
1772
|
args: [{ selector: '[teta-x-axis]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"x | async as scale\">\n <svg:g text-anchor=\"middle\" *ngFor=\"let tick of scale.ticks()\" [attr.transform]=\"'translate('+ scale(tick) +', 0)'\">\n <text fill=\"var(--color-text-70)\" [attr.dy]=\"axis.options.opposite ? '-0.71em' : '0.71em'\" [attr.y]=\"axis.options.opposite ? 0 : 9\">{{ this.axis.options.tickFormat ? this.axis.options.tickFormat(tick) : this.axis.defaultFormatter()(tick) }}</text>\n <line stroke=\"var(--color-text-30)\" [attr.y2]=\"axis.options.opposite ? -6 : 6\"></line>\n </svg:g>\n\n <svg:g class=\"label-axis font-caption\" [attr.transform]=\"getLabelTransform()\">\n <text fill=\"var(--color-text-70)\" text-anchor=\"middle\" dominant-baseline=\"middle\">{{ axis.options.title }}</text>\n </svg:g>\n</ng-container>\n\n", styles: [":host .tick{stroke:var(--color-text-20)}\n"] }]
|
|
1632
1773
|
}], ctorParameters: function () { return [{ type: ScaleService }]; }, propDecorators: { axis: [{
|
|
@@ -1639,8 +1780,9 @@ class YAxisComponent {
|
|
|
1639
1780
|
constructor(scaleService) {
|
|
1640
1781
|
this.scaleService = scaleService;
|
|
1641
1782
|
this._alive = true;
|
|
1642
|
-
this.y = this.scaleService.
|
|
1643
|
-
|
|
1783
|
+
this.y = this.scaleService.yMap.pipe(map((_) => {
|
|
1784
|
+
var _a;
|
|
1785
|
+
return (_a = _.get(this.axis.index)) === null || _a === void 0 ? void 0 : _a.scale;
|
|
1644
1786
|
}));
|
|
1645
1787
|
}
|
|
1646
1788
|
ngOnInit() { }
|
|
@@ -1655,9 +1797,9 @@ class YAxisComponent {
|
|
|
1655
1797
|
: -this.axis.selfSize}, ${this.size.height / 2}) rotate(-90)`;
|
|
1656
1798
|
}
|
|
1657
1799
|
}
|
|
1658
|
-
YAxisComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1659
|
-
YAxisComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1660
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1800
|
+
YAxisComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: YAxisComponent, deps: [{ token: ScaleService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1801
|
+
YAxisComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: YAxisComponent, selector: "[teta-y-axis]", inputs: { axis: "axis", size: "size" }, ngImport: i0, template: "<ng-container *ngIf=\"y | async as scale\">\n <svg:g [attr.text-anchor]=\"axis.options.opposite ? 'start' : 'end'\" *ngFor=\"let tick of scale.ticks()\" [attr.transform]=\"'translate(0, '+ scale(tick) +')'\">\n <text fill=\"var(--color-text-70)\" dy=\"0.32em\" [attr.x]=\"axis.options.opposite ? 10 : -9\">{{ this.axis.options.tickFormat ? this.axis.options.tickFormat(tick) : this.axis.defaultFormatter()(tick) }}</text>\n <line stroke=\"var(--color-text-30)\" [attr.x2]=\"axis.options.opposite ? 6 : -6\"></line>\n </svg:g>\n\n <svg:g class=\"label-axis font-caption\" [attr.transform]=\"getLabelTransform()\">\n <text [attr.dy]=\"axis.options.opposite ? '-4px' : '4px'\" text-anchor=\"middle\" [attr.dominant-baseline]=\"axis.options.opposite ? 'auto' : 'hanging'\">{{ axis.options.title }}</text>\n </svg:g>\n</ng-container>\n\n", styles: [":host{shape-rendering:crispEdges}:host .label-axis{fill:var(--color-text-70)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1802
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: YAxisComponent, decorators: [{
|
|
1661
1803
|
type: Component,
|
|
1662
1804
|
args: [{ selector: '[teta-y-axis]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"y | async as scale\">\n <svg:g [attr.text-anchor]=\"axis.options.opposite ? 'start' : 'end'\" *ngFor=\"let tick of scale.ticks()\" [attr.transform]=\"'translate(0, '+ scale(tick) +')'\">\n <text fill=\"var(--color-text-70)\" dy=\"0.32em\" [attr.x]=\"axis.options.opposite ? 10 : -9\">{{ this.axis.options.tickFormat ? this.axis.options.tickFormat(tick) : this.axis.defaultFormatter()(tick) }}</text>\n <line stroke=\"var(--color-text-30)\" [attr.x2]=\"axis.options.opposite ? 6 : -6\"></line>\n </svg:g>\n\n <svg:g class=\"label-axis font-caption\" [attr.transform]=\"getLabelTransform()\">\n <text [attr.dy]=\"axis.options.opposite ? '-4px' : '4px'\" text-anchor=\"middle\" [attr.dominant-baseline]=\"axis.options.opposite ? 'auto' : 'hanging'\">{{ axis.options.title }}</text>\n </svg:g>\n</ng-container>\n\n", styles: [":host{shape-rendering:crispEdges}:host .label-axis{fill:var(--color-text-70)}\n"] }]
|
|
1663
1805
|
}], ctorParameters: function () { return [{ type: ScaleService }]; }, propDecorators: { axis: [{
|
|
@@ -1724,9 +1866,9 @@ class PlotlineComponent {
|
|
|
1724
1866
|
return this.size.width;
|
|
1725
1867
|
}
|
|
1726
1868
|
}
|
|
1727
|
-
PlotlineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1728
|
-
PlotlineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1729
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
1869
|
+
PlotlineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PlotlineComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: ZoomService }, { token: ScaleService }, { token: ChartService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1870
|
+
PlotlineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PlotlineComponent, selector: "[teta-plot-line]", inputs: { plotLine: "plotLine", size: "size", axis: "axis", scale: "scale" }, ngImport: i0, template: "<svg:line class=\"plotline\"\n [attr.stroke]=\"plotLine.style?.stroke || 'red'\"\n [attr.stroke-width]=\"plotLine.style?.strokeWidth || 4\"\n [attr.stroke-dasharray]=\"plotLine.style?.strokeDasharray\"\n [attr.x1]=\"axis.orientation === orientation.x ? value : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? value : width\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : value\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : value\">\n</svg:line>\n\n\n<svg:text\n *ngIf=\"axis.orientation === orientation.x\"\n text-anchor=\"middle\"\n dominant-baseline=\"central\"\n class=\"label font-title-2 fill-text-70\"\n [attr.x]=\"value\"\n dy=\"-2em\"\n [attr.transform]=\"'rotate(-90, '+ value +',' + height / 2 + ')'\"\n [attr.y]=\"height / 2\">{{plotLine.label}}\n</svg:text>\n\n<svg:text\n *ngIf=\"axis.orientation === orientation.y\"\n text-anchor=\"middle\"\n class=\"label font-title-2 fill-text-70\"\n dominant-baseline=\"central\"\n [attr.x]=\"value\"\n [attr.y]=\"width / 2\">{{plotLine.label}}\n</svg:text>\n\n<svg:line class=\"grabber\"\n\n [class.x-grabber]=\"axis.orientation === orientation.x\"\n [class.y-grabber]=\"axis.orientation === orientation.y\"\n [attr.stroke]=\"'red'\"\n [attr.stroke-width]=\"8\"\n opacity=\"0\"\n [attr.x1]=\"axis.orientation === orientation.x ? value : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? value : width\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : value\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : value\">\n</svg:line>\n", styles: [":host .x-grabber{cursor:col-resize}:host .y-grabber{cursor:row-resize}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1871
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PlotlineComponent, decorators: [{
|
|
1730
1872
|
type: Component,
|
|
1731
1873
|
args: [{ selector: '[teta-plot-line]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:line class=\"plotline\"\n [attr.stroke]=\"plotLine.style?.stroke || 'red'\"\n [attr.stroke-width]=\"plotLine.style?.strokeWidth || 4\"\n [attr.stroke-dasharray]=\"plotLine.style?.strokeDasharray\"\n [attr.x1]=\"axis.orientation === orientation.x ? value : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? value : width\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : value\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : value\">\n</svg:line>\n\n\n<svg:text\n *ngIf=\"axis.orientation === orientation.x\"\n text-anchor=\"middle\"\n dominant-baseline=\"central\"\n class=\"label font-title-2 fill-text-70\"\n [attr.x]=\"value\"\n dy=\"-2em\"\n [attr.transform]=\"'rotate(-90, '+ value +',' + height / 2 + ')'\"\n [attr.y]=\"height / 2\">{{plotLine.label}}\n</svg:text>\n\n<svg:text\n *ngIf=\"axis.orientation === orientation.y\"\n text-anchor=\"middle\"\n class=\"label font-title-2 fill-text-70\"\n dominant-baseline=\"central\"\n [attr.x]=\"value\"\n [attr.y]=\"width / 2\">{{plotLine.label}}\n</svg:text>\n\n<svg:line class=\"grabber\"\n\n [class.x-grabber]=\"axis.orientation === orientation.x\"\n [class.y-grabber]=\"axis.orientation === orientation.y\"\n [attr.stroke]=\"'red'\"\n [attr.stroke-width]=\"8\"\n opacity=\"0\"\n [attr.x1]=\"axis.orientation === orientation.x ? value : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? value : width\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : value\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : value\">\n</svg:line>\n", styles: [":host .x-grabber{cursor:col-resize}:host .y-grabber{cursor:row-resize}\n"] }]
|
|
1732
1874
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: ZoomService }, { type: ScaleService }, { type: ChartService }, { type: i0.ElementRef }]; }, propDecorators: { plotLine: [{
|
|
@@ -1867,9 +2009,9 @@ class PlotBandComponent {
|
|
|
1867
2009
|
return (_d = d.style.plotBand) === null || _d === void 0 ? void 0 : _d.fill;
|
|
1868
2010
|
}
|
|
1869
2011
|
}
|
|
1870
|
-
PlotBandComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1871
|
-
PlotBandComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1872
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2012
|
+
PlotBandComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PlotBandComponent, deps: [{ token: ScaleService }, { token: ZoomService }, { token: ChartService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2013
|
+
PlotBandComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PlotBandComponent, selector: "[teta-plot-band]", inputs: { plotBand: "plotBand", axis: "axis", scale: "scale", size: "size" }, host: { listeners: { "click": "click($event)", "contextmenu": "contextMenu($event)" } }, ngImport: i0, template: "<svg:rect\n class=\"plotband\" xmlns:svg=\"http://www.w3.org/1999/html\"\n [class.draggable]=\"plotBand?.draggable === true\"\n [attr.fill]=\"getFill(plotBand)\"\n [attr.opacity]=\"plotBand.style?.plotBand?.opacity\"\n [attr.height]=\"axis.orientation === orientation.x ? height : bandSize\"\n [attr.width]=\"axis.orientation === orientation.x ? bandSize : width\"\n [attr.y]=\"axis.orientation === orientation.y ? from : null\"\n [attr.x]=\"axis.orientation === orientation.x ? from : null\">\n</svg:rect>\n\n<svg:text\n *ngIf=\"axis.orientation === orientation.x\"\n text-anchor=\"middle\"\n dominant-baseline=\"central\"\n class=\"label font-title-2 fill-text-70\"\n [attr.x]=\"getTextCenter()\"\n [attr.transform]=\"'rotate(-90, '+ getTextCenter() +',' + height / 2 + ')'\"\n [attr.y]=\"height / 2\">{{plotBand.label}}\n</svg:text>\n\n<svg:text\n *ngIf=\"axis.orientation === orientation.y\"\n text-anchor=\"middle\"\n class=\"label font-title-2 fill-text-70\"\n dominant-baseline=\"central\"\n [attr.x]=\"getTextCenter()\"\n [attr.y]=\"width / 2\">{{plotBand.label}}\n</svg:text>\n\n<svg:line class=\"display-grabber\"\n *ngIf=\"plotBand.showGrabbers && plotBand.resizable\"\n [attr.stroke]=\"plotBand.style?.grabbers?.stroke || 'red'\"\n [attr.stroke-width]=\"plotBand.style?.grabbers?.strokeWidth || 4\"\n [attr.stroke-dasharray]=\"plotBand.style?.grabbers?.strokeDasharray\"\n [attr.x1]=\"axis.orientation === orientation.x ? from : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? from : width\"\n [attr.data-grabber]=\"'from'\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : from\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : from\">\n</svg:line>\n\n<svg:line class=\"display-grabber\"\n *ngIf=\"plotBand.showGrabbers && plotBand.resizable\"\n [attr.stroke]=\"plotBand.style?.grabbers?.stroke || 'red'\"\n [attr.stroke-width]=\"plotBand.style?.grabbers?.strokeWidth || 4\"\n [attr.stroke-dasharray]=\"plotBand.style?.grabbers?.strokeDasharray\"\n [attr.x1]=\"axis.orientation === orientation.x ? to : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? to : width\"\n [attr.data-grabber]=\"'to'\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : to\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : to\">\n</svg:line>\n\n<svg:line class=\"grabber\"\n *ngIf=\"plotBand.resizable\"\n [class.x-grabber]=\"axis.orientation === orientation.x\"\n [class.y-grabber]=\"axis.orientation === orientation.y\"\n [class.resizeable]=\"plotBand?.resizable\"\n [attr.stroke]=\"'red'\"\n [attr.stroke-width]=\"8\"\n opacity=\"0\"\n [attr.x1]=\"axis.orientation === orientation.x ? from : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? from : width\"\n [attr.data-grabber]=\"'from'\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : from\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : from\">\n</svg:line>\n\n<svg:line class=\"grabber\"\n *ngIf=\"plotBand.resizable\"\n [class.x-grabber]=\"axis.orientation === orientation.x\"\n [class.y-grabber]=\"axis.orientation === orientation.y\"\n [class.resizeable]=\"plotBand?.resizable\"\n [attr.stroke]=\"'red'\"\n [attr.stroke-width]=\"8\"\n opacity=\"0\"\n [attr.x1]=\"axis.orientation === orientation.x ? to : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? to : width\"\n [attr.data-grabber]=\"'to'\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : to\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : to\">\n</svg:line>\n\n\n", styles: [":host .draggable rect:hover{cursor:grab}:host .draggable rect:active{cursor:grabbing}:host .x-grabber.resizeable{cursor:col-resize}:host .y-grabber.resizeable{cursor:row-resize}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2014
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PlotBandComponent, decorators: [{
|
|
1873
2015
|
type: Component,
|
|
1874
2016
|
args: [{ selector: '[teta-plot-band]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:rect\n class=\"plotband\" xmlns:svg=\"http://www.w3.org/1999/html\"\n [class.draggable]=\"plotBand?.draggable === true\"\n [attr.fill]=\"getFill(plotBand)\"\n [attr.opacity]=\"plotBand.style?.plotBand?.opacity\"\n [attr.height]=\"axis.orientation === orientation.x ? height : bandSize\"\n [attr.width]=\"axis.orientation === orientation.x ? bandSize : width\"\n [attr.y]=\"axis.orientation === orientation.y ? from : null\"\n [attr.x]=\"axis.orientation === orientation.x ? from : null\">\n</svg:rect>\n\n<svg:text\n *ngIf=\"axis.orientation === orientation.x\"\n text-anchor=\"middle\"\n dominant-baseline=\"central\"\n class=\"label font-title-2 fill-text-70\"\n [attr.x]=\"getTextCenter()\"\n [attr.transform]=\"'rotate(-90, '+ getTextCenter() +',' + height / 2 + ')'\"\n [attr.y]=\"height / 2\">{{plotBand.label}}\n</svg:text>\n\n<svg:text\n *ngIf=\"axis.orientation === orientation.y\"\n text-anchor=\"middle\"\n class=\"label font-title-2 fill-text-70\"\n dominant-baseline=\"central\"\n [attr.x]=\"getTextCenter()\"\n [attr.y]=\"width / 2\">{{plotBand.label}}\n</svg:text>\n\n<svg:line class=\"display-grabber\"\n *ngIf=\"plotBand.showGrabbers && plotBand.resizable\"\n [attr.stroke]=\"plotBand.style?.grabbers?.stroke || 'red'\"\n [attr.stroke-width]=\"plotBand.style?.grabbers?.strokeWidth || 4\"\n [attr.stroke-dasharray]=\"plotBand.style?.grabbers?.strokeDasharray\"\n [attr.x1]=\"axis.orientation === orientation.x ? from : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? from : width\"\n [attr.data-grabber]=\"'from'\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : from\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : from\">\n</svg:line>\n\n<svg:line class=\"display-grabber\"\n *ngIf=\"plotBand.showGrabbers && plotBand.resizable\"\n [attr.stroke]=\"plotBand.style?.grabbers?.stroke || 'red'\"\n [attr.stroke-width]=\"plotBand.style?.grabbers?.strokeWidth || 4\"\n [attr.stroke-dasharray]=\"plotBand.style?.grabbers?.strokeDasharray\"\n [attr.x1]=\"axis.orientation === orientation.x ? to : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? to : width\"\n [attr.data-grabber]=\"'to'\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : to\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : to\">\n</svg:line>\n\n<svg:line class=\"grabber\"\n *ngIf=\"plotBand.resizable\"\n [class.x-grabber]=\"axis.orientation === orientation.x\"\n [class.y-grabber]=\"axis.orientation === orientation.y\"\n [class.resizeable]=\"plotBand?.resizable\"\n [attr.stroke]=\"'red'\"\n [attr.stroke-width]=\"8\"\n opacity=\"0\"\n [attr.x1]=\"axis.orientation === orientation.x ? from : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? from : width\"\n [attr.data-grabber]=\"'from'\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : from\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : from\">\n</svg:line>\n\n<svg:line class=\"grabber\"\n *ngIf=\"plotBand.resizable\"\n [class.x-grabber]=\"axis.orientation === orientation.x\"\n [class.y-grabber]=\"axis.orientation === orientation.y\"\n [class.resizeable]=\"plotBand?.resizable\"\n [attr.stroke]=\"'red'\"\n [attr.stroke-width]=\"8\"\n opacity=\"0\"\n [attr.x1]=\"axis.orientation === orientation.x ? to : 0\"\n [attr.x2]=\"axis.orientation === orientation.x ? to : width\"\n [attr.data-grabber]=\"'to'\"\n [attr.y1]=\"axis.orientation === orientation.x ? 0 : to\"\n [attr.y2]=\"axis.orientation === orientation.x ? height : to\">\n</svg:line>\n\n\n", styles: [":host .draggable rect:hover{cursor:grab}:host .draggable rect:active{cursor:grabbing}:host .x-grabber.resizeable{cursor:col-resize}:host .y-grabber.resizeable{cursor:row-resize}\n"] }]
|
|
1875
2017
|
}], ctorParameters: function () { return [{ type: ScaleService }, { type: ZoomService }, { type: ChartService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { plotBand: [{
|
|
@@ -1966,9 +2108,9 @@ class TooltipComponent {
|
|
|
1966
2108
|
return format(input);
|
|
1967
2109
|
}
|
|
1968
2110
|
}
|
|
1969
|
-
TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
1970
|
-
TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
1971
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2111
|
+
TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: TooltipComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ZoomService }, { token: i3.DomSanitizer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
2112
|
+
TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: TooltipComponent, selector: "teta-tooltip", inputs: { size: "size", config: "config" }, ngImport: i0, template: "<ng-container *ngIf=\"position | async as p\">\n <ng-container *ngIf=\"tooltips | async as t\">\n <div class=\"chart-tooltip color-text-90 bg-background-50 shadow-2\"\n [style.position]=\"'fixed'\"\n *ngIf=\"t.length > 0\"\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 >\n <ng-container *ngIf=\"config.tooltip?.template\">\n <ng-container *ngTemplateOutlet=\"config.tooltip.template; context: {$implicit: t}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"config.tooltip?.format; else default\">\n <div [innerHTML]=\"displayTooltips | async\"></div>\n </ng-container>\n\n <ng-template #default>\n <div *ngIf=\"!config.tooltip?.template\" class=\"padding-2 border-radius-1\">\n <ng-container *ngFor=\"let tooltip of t\">\n <div class=\"display-flex align-center\">\n <span class=\"display-block margin-right-1\" [style.width.px]=\"10\" [style.height.px]=\"2\"\n [style.background-color]=\"tooltip.series?.color\"></span>\n <span class=\"font-title-3\">\n {{ tooltip.series?.name }}\n <span class=\"font-body-3\">\n x: {{ format(tooltip.point?.x) }}\n y: {{ format(tooltip.point?.y) }}\n </span>\n </span>\n </div>\n </ng-container>\n </div>\n </ng-template>\n </div>\n </ng-container>\n</ng-container>\n\n\n\n", styles: [":host{position:absolute;z-index:2}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
1972
2114
|
type: Component,
|
|
1973
2115
|
args: [{ selector: 'teta-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"position | async as p\">\n <ng-container *ngIf=\"tooltips | async as t\">\n <div class=\"chart-tooltip color-text-90 bg-background-50 shadow-2\"\n [style.position]=\"'fixed'\"\n *ngIf=\"t.length > 0\"\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 >\n <ng-container *ngIf=\"config.tooltip?.template\">\n <ng-container *ngTemplateOutlet=\"config.tooltip.template; context: {$implicit: t}\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"config.tooltip?.format; else default\">\n <div [innerHTML]=\"displayTooltips | async\"></div>\n </ng-container>\n\n <ng-template #default>\n <div *ngIf=\"!config.tooltip?.template\" class=\"padding-2 border-radius-1\">\n <ng-container *ngFor=\"let tooltip of t\">\n <div class=\"display-flex align-center\">\n <span class=\"display-block margin-right-1\" [style.width.px]=\"10\" [style.height.px]=\"2\"\n [style.background-color]=\"tooltip.series?.color\"></span>\n <span class=\"font-title-3\">\n {{ tooltip.series?.name }}\n <span class=\"font-body-3\">\n x: {{ format(tooltip.point?.x) }}\n y: {{ format(tooltip.point?.y) }}\n </span>\n </span>\n </div>\n </ng-container>\n </div>\n </ng-template>\n </div>\n </ng-container>\n</ng-container>\n\n\n\n", styles: [":host{position:absolute;z-index:2}\n"] }]
|
|
1974
2116
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ZoomService }, { type: i3.DomSanitizer }, { type: i0.NgZone }]; }, propDecorators: { size: [{
|
|
@@ -2002,7 +2144,7 @@ class ZoomableDirective {
|
|
|
2002
2144
|
const message = new ZoomMessage({
|
|
2003
2145
|
event,
|
|
2004
2146
|
axis: this.axis,
|
|
2005
|
-
|
|
2147
|
+
domain,
|
|
2006
2148
|
chartId: this.config.id,
|
|
2007
2149
|
});
|
|
2008
2150
|
this.broadcastService.broadcastZoom({
|
|
@@ -2071,17 +2213,17 @@ class ZoomableDirective {
|
|
|
2071
2213
|
this.zoom.scaleExtent([maxZoom, minZoom]);
|
|
2072
2214
|
this.zoom.on('zoom end', this.zoomed);
|
|
2073
2215
|
this._element.call(this.zoom).on('dblclick.zoom', null); // Disable dbclick zoom
|
|
2216
|
+
this.chartService.emitZoomInstance(this.zoomService);
|
|
2074
2217
|
if (((_p = (_o = this.config) === null || _o === void 0 ? void 0 : _o.zoom) === null || _p === void 0 ? void 0 : _p.zoomBehavior) === ZoomBehaviorType.wheel) {
|
|
2075
2218
|
this.runWheelZoom();
|
|
2076
2219
|
}
|
|
2077
2220
|
}
|
|
2078
2221
|
// Subscribe to zoom events
|
|
2079
|
-
this.broadcastService.subscribeToZoom((_q = this.config) === null || _q === void 0 ? void 0 : _q.zoom.syncChannel)
|
|
2080
|
-
|
|
2081
|
-
var _a, _b, _c, _d;
|
|
2222
|
+
this.broadcastService.subscribeToZoom((_q = this.config) === null || _q === void 0 ? void 0 : _q.zoom.syncChannel).pipe(takeWhile((_) => this.alive), tap$1((m) => {
|
|
2223
|
+
var _a, _b, _c, _d, _e;
|
|
2082
2224
|
if (this.axis.index === ((_b = (_a = m.message) === null || _a === void 0 ? void 0 : _a.axis) === null || _b === void 0 ? void 0 : _b.index) && this.axis.orientation === ((_d = (_c = m.message) === null || _c === void 0 ? void 0 : _c.axis) === null || _d === void 0 ? void 0 : _d.orientation)) {
|
|
2083
2225
|
const currentZoom = d3.zoomTransform(this._element.node());
|
|
2084
|
-
if (currentZoom !== m.message.event.transform) {
|
|
2226
|
+
if (currentZoom !== m.message.event.transform && this.config.id === ((_e = m.message) === null || _e === void 0 ? void 0 : _e.chartId)) {
|
|
2085
2227
|
this._element.call(this.zoom.transform, m.message.event.transform);
|
|
2086
2228
|
}
|
|
2087
2229
|
}
|
|
@@ -2093,9 +2235,28 @@ class ZoomableDirective {
|
|
|
2093
2235
|
return (this.axis.index === ((_b = (_a = m.message) === null || _a === void 0 ? void 0 : _a.axis) === null || _b === void 0 ? void 0 : _b.index) &&
|
|
2094
2236
|
this.axis.orientation === ((_d = (_c = m.message) === null || _c === void 0 ? void 0 : _c.axis) === null || _d === void 0 ? void 0 : _d.orientation));
|
|
2095
2237
|
}), tap$1((m) => {
|
|
2096
|
-
var _a;
|
|
2238
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2097
2239
|
if (this.config.id !== ((_a = m.message) === null || _a === void 0 ? void 0 : _a.chartId)) {
|
|
2098
|
-
this.
|
|
2240
|
+
this.brushScale.domain(this.axis.originDomain);
|
|
2241
|
+
const scale = Math.abs(this.axis.originDomain[1] - this.axis.originDomain[0]) / Math.abs(m.message.domain[1] - m.message.domain[0]);
|
|
2242
|
+
let transform = zoomIdentity.scale(scale);
|
|
2243
|
+
if (((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.zoom) === null || _c === void 0 ? void 0 : _c.type) === ZoomType.x) {
|
|
2244
|
+
if ((_d = this.config.xAxis[0]) === null || _d === void 0 ? void 0 : _d.inverted) {
|
|
2245
|
+
transform = transform.translate(-this.brushScale(m.message.domain[0]), 0);
|
|
2246
|
+
}
|
|
2247
|
+
else {
|
|
2248
|
+
transform = transform.translate(this.brushScale(-m.message.domain[1]), 0);
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
if (((_f = (_e = this.config) === null || _e === void 0 ? void 0 : _e.zoom) === null || _f === void 0 ? void 0 : _f.type) === ZoomType.y) {
|
|
2252
|
+
if ((_g = this.config.yAxis[0]) === null || _g === void 0 ? void 0 : _g.inverted) {
|
|
2253
|
+
transform = transform.translate(0, -this.brushScale(m.message.domain[0]));
|
|
2254
|
+
}
|
|
2255
|
+
else {
|
|
2256
|
+
transform = transform.translate(0, -this.brushScale(m.message.domain[1]));
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
this._element.call(this.zoom.transform, transform, null, {});
|
|
2099
2260
|
}
|
|
2100
2261
|
}))
|
|
2101
2262
|
.subscribe();
|
|
@@ -2105,8 +2266,12 @@ class ZoomableDirective {
|
|
|
2105
2266
|
(((_s = this.config.brush) === null || _s === void 0 ? void 0 : _s.type) === BrushType.y &&
|
|
2106
2267
|
this.axis.orientation === AxisOrientation.y)) {
|
|
2107
2268
|
this.broadcastService.subscribeToBrush((_t = this.config) === null || _t === void 0 ? void 0 : _t.zoom.syncChannel)
|
|
2108
|
-
.pipe(takeWhile((_) => this.alive),
|
|
2109
|
-
|
|
2269
|
+
.pipe(combineLatestWith(this.chartService.size), takeWhile((_) => this.alive), filter((data) => {
|
|
2270
|
+
const [m] = data;
|
|
2271
|
+
return Boolean(m.message.selection);
|
|
2272
|
+
}), tap$1((data) => {
|
|
2273
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2274
|
+
const [m] = data;
|
|
2110
2275
|
const currentTransform = d3.zoomTransform(this._element.node());
|
|
2111
2276
|
if (!m.message.event &&
|
|
2112
2277
|
this.currentSelection &&
|
|
@@ -2116,15 +2281,25 @@ class ZoomableDirective {
|
|
|
2116
2281
|
const s = m.message.selection;
|
|
2117
2282
|
this.brushScale.domain(this.axis.originDomain);
|
|
2118
2283
|
const domain = this.brushScale.domain();
|
|
2119
|
-
const scale = (domain[1] - domain[0]) / (s[1] - s[0]);
|
|
2284
|
+
const scale = Math.abs(domain[1] - domain[0]) / Math.abs(s[1] - s[0]);
|
|
2120
2285
|
let transform = zoomIdentity.scale(scale);
|
|
2121
2286
|
if (((_a = m.message) === null || _a === void 0 ? void 0 : _a.brushType) === BrushType.x) {
|
|
2122
|
-
|
|
2287
|
+
if ((_b = this.config.xAxis[0]) === null || _b === void 0 ? void 0 : _b.inverted) {
|
|
2288
|
+
transform = transform.translate(-this.brushScale(s[0]), 0);
|
|
2289
|
+
}
|
|
2290
|
+
else {
|
|
2291
|
+
transform = transform.translate(-this.brushScale(s[1]), 0);
|
|
2292
|
+
}
|
|
2123
2293
|
}
|
|
2124
|
-
if (((
|
|
2125
|
-
|
|
2294
|
+
if (((_c = m.message) === null || _c === void 0 ? void 0 : _c.brushType) === BrushType.y) {
|
|
2295
|
+
if ((_d = this.config.yAxis[0]) === null || _d === void 0 ? void 0 : _d.inverted) {
|
|
2296
|
+
transform = transform.translate(0, -this.brushScale(s[0]));
|
|
2297
|
+
}
|
|
2298
|
+
else {
|
|
2299
|
+
transform = transform.translate(0, -this.brushScale(s[1]));
|
|
2300
|
+
}
|
|
2126
2301
|
}
|
|
2127
|
-
if ((
|
|
2302
|
+
if ((_f = (_e = m.message) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.transition) {
|
|
2128
2303
|
this._element.transition().call(this.zoom.transform, transform, null, {});
|
|
2129
2304
|
}
|
|
2130
2305
|
else {
|
|
@@ -2182,7 +2357,7 @@ class ZoomableDirective {
|
|
|
2182
2357
|
type,
|
|
2183
2358
|
},
|
|
2184
2359
|
axis: this.axis,
|
|
2185
|
-
|
|
2360
|
+
domain,
|
|
2186
2361
|
chartId: this.config.id,
|
|
2187
2362
|
});
|
|
2188
2363
|
this.zoomService.fireZoom({
|
|
@@ -2217,9 +2392,9 @@ class ZoomableDirective {
|
|
|
2217
2392
|
});
|
|
2218
2393
|
}
|
|
2219
2394
|
}
|
|
2220
|
-
ZoomableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2221
|
-
ZoomableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.
|
|
2222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2395
|
+
ZoomableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ZoomableDirective, deps: [{ token: i0.ElementRef }, { token: ZoomService }, { token: BroadcastService }, { token: ChartService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2396
|
+
ZoomableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: ZoomableDirective, selector: "[tetaZoomable]", inputs: { config: "config", axis: "axis", size: "size", brushScale: "brushScale", scale: "scale" }, host: { properties: { "class.zoomable": "this.zoomable", "class.crosshair": "this.crosshair" } }, usesOnChanges: true, ngImport: i0 });
|
|
2397
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ZoomableDirective, decorators: [{
|
|
2223
2398
|
type: Directive,
|
|
2224
2399
|
args: [{
|
|
2225
2400
|
selector: '[tetaZoomable]',
|
|
@@ -2249,8 +2424,7 @@ class BrushableDirective {
|
|
|
2249
2424
|
this.element = element;
|
|
2250
2425
|
}
|
|
2251
2426
|
ngOnInit() { }
|
|
2252
|
-
ngAfterViewInit() {
|
|
2253
|
-
}
|
|
2427
|
+
ngAfterViewInit() { }
|
|
2254
2428
|
ngOnChanges(changes) {
|
|
2255
2429
|
var _a, _b;
|
|
2256
2430
|
if (changes.hasOwnProperty('config')) {
|
|
@@ -2261,9 +2435,9 @@ class BrushableDirective {
|
|
|
2261
2435
|
}
|
|
2262
2436
|
}
|
|
2263
2437
|
}
|
|
2264
|
-
BrushableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2265
|
-
BrushableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.
|
|
2266
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2438
|
+
BrushableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BrushableDirective, deps: [{ token: BrushService }, { token: ChartService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2439
|
+
BrushableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: BrushableDirective, selector: "[tetaBrushable]", inputs: { config: "config", brushScale: "brushScale" }, usesOnChanges: true, ngImport: i0 });
|
|
2440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BrushableDirective, decorators: [{
|
|
2267
2441
|
type: Directive,
|
|
2268
2442
|
args: [{
|
|
2269
2443
|
selector: '[tetaBrushable]',
|
|
@@ -2279,8 +2453,8 @@ class AnnotationComponent {
|
|
|
2279
2453
|
this.scaleService = scaleService;
|
|
2280
2454
|
this.cdr = cdr;
|
|
2281
2455
|
this.chartService = chartService;
|
|
2282
|
-
this.x = this.scaleService.
|
|
2283
|
-
this.y = this.scaleService.
|
|
2456
|
+
this.x = this.scaleService.xMap.pipe(map((_) => { var _a; return _.get((_a = this.annotation.xAxisIndex) !== null && _a !== void 0 ? _a : 0).scale; }));
|
|
2457
|
+
this.y = this.scaleService.yMap.pipe(map((_) => { var _a; return _.get((_a = this.annotation.yAxisIndex) !== null && _a !== void 0 ? _a : 0).scale; }));
|
|
2284
2458
|
this.drag = d3.drag();
|
|
2285
2459
|
}
|
|
2286
2460
|
set annotation(annotation) {
|
|
@@ -2328,9 +2502,9 @@ class AnnotationComponent {
|
|
|
2328
2502
|
}
|
|
2329
2503
|
}
|
|
2330
2504
|
}
|
|
2331
|
-
AnnotationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2332
|
-
AnnotationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
2333
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2505
|
+
AnnotationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: AnnotationComponent, deps: [{ token: ScaleService }, { token: i0.ChangeDetectorRef }, { token: ChartService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2506
|
+
AnnotationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", 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 [className]=\"'padding-h-2 ' + annotation.className ?? ''\"\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: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: AnnotationComponent, decorators: [{
|
|
2334
2508
|
type: Component,
|
|
2335
2509
|
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 [className]=\"'padding-h-2 ' + annotation.className ?? ''\"\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" }]
|
|
2336
2510
|
}], ctorParameters: function () { return [{ type: ScaleService }, { type: i0.ChangeDetectorRef }, { type: ChartService }]; }, propDecorators: { annotation: [{
|
|
@@ -2368,9 +2542,9 @@ class CrosshairComponent {
|
|
|
2368
2542
|
}));
|
|
2369
2543
|
}
|
|
2370
2544
|
}
|
|
2371
|
-
CrosshairComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2372
|
-
CrosshairComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
2373
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2545
|
+
CrosshairComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: CrosshairComponent, deps: [{ token: ScaleService }, { token: ChartService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2546
|
+
CrosshairComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: CrosshairComponent, selector: "[teta-crosshair]", inputs: { size: "size" }, ngImport: i0, template: "<ng-container *ngIf=\"transform | async as t\">\n <svg:line [attr.x1]=\"t.x\" y1=\"0\" [attr.x2]=\"t.x\" [attr.y2]=\"size.height\" stroke=\"var(--color-text-90)\" stroke-width=\"0.5\"></svg:line>\n <svg:line x1=\"0\" [attr.y1]=\"t.y\" [attr.x2]=\"size.width\" [attr.y2]=\"t.y\" stroke=\"var(--color-text-90)\" stroke-width=\"0.5\"></svg:line>\n</ng-container>\n", styles: [":host{shape-rendering:crispEdges}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
|
|
2547
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: CrosshairComponent, decorators: [{
|
|
2374
2548
|
type: Component,
|
|
2375
2549
|
args: [{ selector: '[teta-crosshair]', template: "<ng-container *ngIf=\"transform | async as t\">\n <svg:line [attr.x1]=\"t.x\" y1=\"0\" [attr.x2]=\"t.x\" [attr.y2]=\"size.height\" stroke=\"var(--color-text-90)\" stroke-width=\"0.5\"></svg:line>\n <svg:line x1=\"0\" [attr.y1]=\"t.y\" [attr.x2]=\"size.width\" [attr.y2]=\"t.y\" stroke=\"var(--color-text-90)\" stroke-width=\"0.5\"></svg:line>\n</ng-container>\n", styles: [":host{shape-rendering:crispEdges}\n"] }]
|
|
2376
2550
|
}], ctorParameters: function () { return [{ type: ScaleService }, { type: ChartService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { size: [{
|
|
@@ -2394,38 +2568,26 @@ class ChartContainerComponent {
|
|
|
2394
2568
|
this.sumSize = (acc, curr) => acc + curr.selfSize;
|
|
2395
2569
|
this.config = this._svc.config;
|
|
2396
2570
|
this.size = this._svc.size;
|
|
2397
|
-
this.
|
|
2398
|
-
this.xAxisMap = this._scaleService.xAxisMap;
|
|
2399
|
-
this.yScaleMap = this._scaleService.yScaleMap.pipe(throttleTime(0, animationFrameScheduler, { trailing: true }), tap(() => {
|
|
2400
|
-
setTimeout(() => {
|
|
2401
|
-
this._cdr.detectChanges();
|
|
2402
|
-
});
|
|
2403
|
-
}), shareReplay({
|
|
2571
|
+
this.yMap = this._scaleService.yMap.pipe(observeOn(animationFrameScheduler), tetaZoneFull(this._zone), shareReplay({
|
|
2404
2572
|
bufferSize: 1,
|
|
2405
2573
|
refCount: true,
|
|
2406
2574
|
}));
|
|
2407
|
-
this.
|
|
2408
|
-
this._cdr.detectChanges();
|
|
2409
|
-
})), shareReplay({
|
|
2575
|
+
this.xMap = this._scaleService.xMap.pipe(observeOn(animationFrameScheduler), tetaZoneFull(this._zone), shareReplay({
|
|
2410
2576
|
bufferSize: 1,
|
|
2411
2577
|
refCount: true,
|
|
2412
2578
|
}));
|
|
2413
2579
|
this.brushScale = combineLatest([
|
|
2414
|
-
this._scaleService.
|
|
2415
|
-
this._scaleService.
|
|
2580
|
+
this._scaleService.xMap,
|
|
2581
|
+
this._scaleService.yMap,
|
|
2416
2582
|
]).pipe(withLatestFrom(this.config), map((data) => {
|
|
2417
2583
|
var _a, _b;
|
|
2418
2584
|
const [[x, y], config] = data;
|
|
2419
|
-
return ((_a = config.brush) === null || _a === void 0 ? void 0 : _a.type) === BrushType.x || ((_b = config === null || config === void 0 ? void 0 : config.zoom) === null || _b === void 0 ? void 0 : _b.type) === ZoomType.x ? x.get(0) : y.get(0);
|
|
2585
|
+
return ((_a = config.brush) === null || _a === void 0 ? void 0 : _a.type) === BrushType.x || ((_b = config === null || config === void 0 ? void 0 : config.zoom) === null || _b === void 0 ? void 0 : _b.type) === ZoomType.x ? x.get(0).scale : y.get(0).scale;
|
|
2420
2586
|
}), shareReplay({
|
|
2421
2587
|
bufferSize: 1,
|
|
2422
2588
|
refCount: true,
|
|
2423
2589
|
}));
|
|
2424
|
-
this.visibleRect =
|
|
2425
|
-
this.size,
|
|
2426
|
-
this.xAxisMap,
|
|
2427
|
-
this.yAxisMap,
|
|
2428
|
-
]).pipe(throttleTime(0, animationFrameScheduler, { trailing: true }), withLatestFrom(this.config), map((data) => {
|
|
2590
|
+
this.visibleRect = this.size.pipe(combineLatestWith(this.xMap, this.yMap)).pipe(withLatestFrom(this.config), map((data) => {
|
|
2429
2591
|
var _a, _b, _c, _d, _e, _f;
|
|
2430
2592
|
const [[size, x, y], config] = data;
|
|
2431
2593
|
const yAxesArray = [...y.values()];
|
|
@@ -2456,11 +2618,14 @@ class ChartContainerComponent {
|
|
|
2456
2618
|
((_e = config.bounds) === null || _e === void 0 ? void 0 : _e.top) -
|
|
2457
2619
|
((_f = config.bounds) === null || _f === void 0 ? void 0 : _f.bottom),
|
|
2458
2620
|
};
|
|
2459
|
-
}),
|
|
2460
|
-
|
|
2461
|
-
|
|
2621
|
+
}), tetaZoneFull(this._zone), shareReplay({
|
|
2622
|
+
bufferSize: 1,
|
|
2623
|
+
refCount: true,
|
|
2624
|
+
}));
|
|
2462
2625
|
}
|
|
2463
2626
|
ngOnInit() {
|
|
2627
|
+
}
|
|
2628
|
+
ngAfterViewInit() {
|
|
2464
2629
|
this._observer = new ResizeObserver((entries) => {
|
|
2465
2630
|
requestAnimationFrame(() => {
|
|
2466
2631
|
if (!Array.isArray(entries) ||
|
|
@@ -2478,7 +2643,7 @@ class ChartContainerComponent {
|
|
|
2478
2643
|
this._observer.disconnect();
|
|
2479
2644
|
}
|
|
2480
2645
|
getTranslate(axis, size) {
|
|
2481
|
-
return combineLatest([this.
|
|
2646
|
+
return combineLatest([this.xMap, this.yMap]).pipe(withLatestFrom(this.config), map((data) => {
|
|
2482
2647
|
var _a, _b;
|
|
2483
2648
|
const [[x, y], config] = data;
|
|
2484
2649
|
const xAxesArray = [...x.values()];
|
|
@@ -2544,11 +2709,11 @@ class ChartContainerComponent {
|
|
|
2544
2709
|
this._svc.setPointerMove(event);
|
|
2545
2710
|
}
|
|
2546
2711
|
}
|
|
2547
|
-
ChartContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2548
|
-
ChartContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
2549
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2712
|
+
ChartContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartContainerComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
2713
|
+
ChartContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: ChartContainerComponent, selector: "teta-chart-container", ngImport: i0, template: "<ng-container *ngIf=\"{\n size: size | async,\n config: config | async,\n yMap: yMap | async,\n xMap: xMap | 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 <ng-container *ngIf=\"data.visibleRect?.width > 0 && data.visibleRect?.height > 0 && data.xMap.size === data.config?.xAxis?.length && data.yMap.size === data.config?.yAxis?.length\">\n <svg height=\"100%\" width=\"100%\" class=\"position-absolute\">\n <g class=\"y-axis-container\">\n <ng-container *ngFor=\"let item of data.yMap | keyvalue; trackBy: identify\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-y-axis\n [axis]=\"item.value\"\n [size]=\"data.visibleRect\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [scale]=\"data.yMap.get(item.key).scale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.visibleRect\"\n [attr.x]=\"item.value.options.opposite ? 0 : -item.value.selfSize\"\n [attr.y]=\"0\"\n [attr.height]=\"data.visibleRect.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.xMap | keyvalue; trackBy: identify\">\n <ng-container *ngIf=\"item.value.options.visible && data.xMap.size === data.config?.xAxis?.length && data.yMap.size === data.config?.yAxis?.length\">\n <g\n teta-x-axis\n [axis]=\"item.value\"\n [size]=\"data.visibleRect\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [scale]=\"data.xMap.get(item.key).scale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.visibleRect\"\n [attr.x]=\"0\"\n [attr.y]=\"item.value.options.opposite ? -item.value.selfSize : 0\"\n [attr.width]=\"data.visibleRect.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>\n <ng-container *ngIf=\"data.visibleRect?.width > 0 && data.visibleRect?.height > 0 && data.xMap.size === data.config?.xAxis?.length && data.yMap.size === data.config?.yAxis?.length\">\n <svg\n tetaBrushable\n tetaZoomable\n class=\"position-absolute\"\n [size]=\"data.visibleRect\"\n [brushScale]=\"data.brushScale\"\n [scale]=\"data.brushScale\"\n [config]=\"data.config\"\n [axis]=\"data.config?.zoom?.type === zoomType.x ? data.xMap.get(0) : data.yMap.get(0)\"\n [attr.width]=\"data.visibleRect.width\"\n [attr.height]=\"data.visibleRect.height\"\n [attr.viewBox]=\"'0 0 ' + data.visibleRect.width + ' ' + data.visibleRect.height\"\n [style.transform]=\"'translate('+ data.visibleRect.x +'px, '+ data.visibleRect.y +'px)'\"\n (contextmenu)=\"contextMenu($event, data.xMap, data.yMap)\"\n (click)=\"click($event, data.xMap, data.yMap)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousemove)=\"mouseMove($event)\">\n\n <g class=\"gridlines\"\n teta-gridlines\n *ngIf=\"data.config.gridLines?.enable !== false\"\n [size]=\"data.size\"></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.xMap.get(i).scale\"\n [size]=\"data.size\"\n [axis]=\"data.xMap.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.yMap.get(i).scale\"\n [size]=\"data.size\"\n [axis]=\"data.yMap.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.xMap.get(i).scale\"\n [size]=\"data.size\"\n [axis]=\"data.xMap.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.yMap.get(i).scale\"\n [size]=\"data.size\"\n [axis]=\"data.yMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"series-container\">\n <ng-container *ngFor=\"let series of data.config.series\">\n <g teta-series-host\n *ngIf=\"series.visible\"\n [config]=\"data.config\"\n [series]=\"series\"></g>\n </ng-container>\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 <g class=\"crosshair\" *ngIf=\"data.config.tooltip?.showCrosshair\">\n <g teta-crosshair [size]=\"data.visibleRect\"></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}:host .crosshair{cursor:crosshair}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SeriesHostComponent, selector: "[teta-series-host]", inputs: ["config", "series"] }, { kind: "component", type: GridlinesComponent, selector: "[teta-gridlines]", inputs: ["size"] }, { kind: "component", type: XAxisComponent, selector: "[teta-x-axis]", inputs: ["axis", "size"] }, { kind: "component", type: YAxisComponent, selector: "[teta-y-axis]", inputs: ["axis", "size"] }, { kind: "component", type: PlotlineComponent, selector: "[teta-plot-line]", inputs: ["plotLine", "size", "axis", "scale"] }, { kind: "component", type: PlotBandComponent, selector: "[teta-plot-band]", inputs: ["plotBand", "axis", "scale", "size"] }, { kind: "component", type: TooltipComponent, selector: "teta-tooltip", inputs: ["size", "config"] }, { kind: "directive", type: ZoomableDirective, selector: "[tetaZoomable]", inputs: ["config", "axis", "size", "brushScale", "scale"] }, { kind: "directive", type: BrushableDirective, selector: "[tetaBrushable]", inputs: ["config", "brushScale"] }, { kind: "component", type: AnnotationComponent, selector: "[teta-annotation]", inputs: ["annotation"] }, { kind: "component", type: CrosshairComponent, selector: "[teta-crosshair]", inputs: ["size"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartContainerComponent, decorators: [{
|
|
2550
2715
|
type: Component,
|
|
2551
|
-
args: [{ selector: 'teta-chart-container', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n size: size | async,\n config: config | async,\n
|
|
2716
|
+
args: [{ selector: 'teta-chart-container', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n size: size | async,\n config: config | async,\n yMap: yMap | async,\n xMap: xMap | 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 <ng-container *ngIf=\"data.visibleRect?.width > 0 && data.visibleRect?.height > 0 && data.xMap.size === data.config?.xAxis?.length && data.yMap.size === data.config?.yAxis?.length\">\n <svg height=\"100%\" width=\"100%\" class=\"position-absolute\">\n <g class=\"y-axis-container\">\n <ng-container *ngFor=\"let item of data.yMap | keyvalue; trackBy: identify\">\n <ng-container *ngIf=\"item.value.options.visible\">\n <g\n teta-y-axis\n [axis]=\"item.value\"\n [size]=\"data.visibleRect\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [scale]=\"data.yMap.get(item.key).scale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.visibleRect\"\n [attr.x]=\"item.value.options.opposite ? 0 : -item.value.selfSize\"\n [attr.y]=\"0\"\n [attr.height]=\"data.visibleRect.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.xMap | keyvalue; trackBy: identify\">\n <ng-container *ngIf=\"item.value.options.visible && data.xMap.size === data.config?.xAxis?.length && data.yMap.size === data.config?.yAxis?.length\">\n <g\n teta-x-axis\n [axis]=\"item.value\"\n [size]=\"data.visibleRect\"\n [attr.transform]=\"getTranslate(item.value, data.size) | async\"></g>\n <rect\n tetaZoomable\n fill-opacity=\"0\"\n [brushScale]=\"data.brushScale\"\n [scale]=\"data.xMap.get(item.key).scale\"\n [axis]=\"item.value\"\n [config]=\"data.config\"\n [size]=\"data.visibleRect\"\n [attr.x]=\"0\"\n [attr.y]=\"item.value.options.opposite ? -item.value.selfSize : 0\"\n [attr.width]=\"data.visibleRect.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>\n <ng-container *ngIf=\"data.visibleRect?.width > 0 && data.visibleRect?.height > 0 && data.xMap.size === data.config?.xAxis?.length && data.yMap.size === data.config?.yAxis?.length\">\n <svg\n tetaBrushable\n tetaZoomable\n class=\"position-absolute\"\n [size]=\"data.visibleRect\"\n [brushScale]=\"data.brushScale\"\n [scale]=\"data.brushScale\"\n [config]=\"data.config\"\n [axis]=\"data.config?.zoom?.type === zoomType.x ? data.xMap.get(0) : data.yMap.get(0)\"\n [attr.width]=\"data.visibleRect.width\"\n [attr.height]=\"data.visibleRect.height\"\n [attr.viewBox]=\"'0 0 ' + data.visibleRect.width + ' ' + data.visibleRect.height\"\n [style.transform]=\"'translate('+ data.visibleRect.x +'px, '+ data.visibleRect.y +'px)'\"\n (contextmenu)=\"contextMenu($event, data.xMap, data.yMap)\"\n (click)=\"click($event, data.xMap, data.yMap)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousemove)=\"mouseMove($event)\">\n\n <g class=\"gridlines\"\n teta-gridlines\n *ngIf=\"data.config.gridLines?.enable !== false\"\n [size]=\"data.size\"></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.xMap.get(i).scale\"\n [size]=\"data.size\"\n [axis]=\"data.xMap.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.yMap.get(i).scale\"\n [size]=\"data.size\"\n [axis]=\"data.yMap.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.xMap.get(i).scale\"\n [size]=\"data.size\"\n [axis]=\"data.xMap.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.yMap.get(i).scale\"\n [size]=\"data.size\"\n [axis]=\"data.yMap.get(i)\"></g>\n </ng-container>\n </g>\n <g class=\"series-container\">\n <ng-container *ngFor=\"let series of data.config.series\">\n <g teta-series-host\n *ngIf=\"series.visible\"\n [config]=\"data.config\"\n [series]=\"series\"></g>\n </ng-container>\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 <g class=\"crosshair\" *ngIf=\"data.config.tooltip?.showCrosshair\">\n <g teta-crosshair [size]=\"data.visibleRect\"></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}:host .crosshair{cursor:crosshair}\n"] }]
|
|
2552
2717
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
|
|
2553
2718
|
|
|
2554
2719
|
class LegendComponent {
|
|
@@ -2571,9 +2736,9 @@ class LegendComponent {
|
|
|
2571
2736
|
this.chartService.toggleVisibilitySeries([serie.id]);
|
|
2572
2737
|
}
|
|
2573
2738
|
}
|
|
2574
|
-
LegendComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2575
|
-
LegendComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
2576
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2739
|
+
LegendComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LegendComponent, deps: [{ token: ChartService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2740
|
+
LegendComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: LegendComponent, selector: "teta-legend", inputs: { series: "series" }, host: { properties: { "class.padding-bottom-4": "this.classLegend" } }, ngImport: i0, template: "<ng-container *ngFor=\"let serie of series\" class=\"padding-bottom-4\">\n <div *ngIf=\"serie?.showInLegend !== false\">\n <div class=\"legend-item cursor-pointer\" (click)=\"click(serie)\">\n <div class=\"legend-icon-form\" [style.height.px]=\"getHeight(serie)\" [style.background-color]=\"serie.visible ? serie.color : 'var(--color-text-30)'\"></div>\n <div class=\"legend-label\" style=\"user-select: none\" [style.text-decoration]=\"serie.visible ? 'none' : 'line-through'\">{{ serie.name }}</div>\n </div>\n </div>\n</ng-container>\n", styles: [":host{display:flex;grid-gap:8px;flex-wrap:wrap;align-items:center;justify-content:space-evenly}:host .legend-item{display:flex;align-items:center}:host .legend-icon-form{width:12px}:host .legend-label{margin-left:5px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LegendComponent, decorators: [{
|
|
2577
2742
|
type: Component,
|
|
2578
2743
|
args: [{ selector: 'teta-legend', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let serie of series\" class=\"padding-bottom-4\">\n <div *ngIf=\"serie?.showInLegend !== false\">\n <div class=\"legend-item cursor-pointer\" (click)=\"click(serie)\">\n <div class=\"legend-icon-form\" [style.height.px]=\"getHeight(serie)\" [style.background-color]=\"serie.visible ? serie.color : 'var(--color-text-30)'\"></div>\n <div class=\"legend-label\" style=\"user-select: none\" [style.text-decoration]=\"serie.visible ? 'none' : 'line-through'\">{{ serie.name }}</div>\n </div>\n </div>\n</ng-container>\n", styles: [":host{display:flex;grid-gap:8px;flex-wrap:wrap;align-items:center;justify-content:space-evenly}:host .legend-item{display:flex;align-items:center}:host .legend-icon-form{width:12px}:host .legend-label{margin-left:5px}\n"] }]
|
|
2579
2744
|
}], ctorParameters: function () { return [{ type: ChartService }]; }, propDecorators: { series: [{
|
|
@@ -2599,6 +2764,7 @@ class ChartComponent {
|
|
|
2599
2764
|
this.annotationContextMenu = new EventEmitter();
|
|
2600
2765
|
this.annotationClick = new EventEmitter();
|
|
2601
2766
|
this.annotationMove = new EventEmitter();
|
|
2767
|
+
this.zoomServiceInstance = new EventEmitter();
|
|
2602
2768
|
this._alive = true;
|
|
2603
2769
|
this.svcConfig = this.chartService.config;
|
|
2604
2770
|
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; })); }));
|
|
@@ -2680,6 +2846,11 @@ class ChartComponent {
|
|
|
2680
2846
|
.subscribe((_) => {
|
|
2681
2847
|
this.annotationMove.emit(_);
|
|
2682
2848
|
});
|
|
2849
|
+
this.chartService.zoomInstance
|
|
2850
|
+
.pipe(takeWhile(() => this._alive))
|
|
2851
|
+
.subscribe((_) => {
|
|
2852
|
+
this.zoomServiceInstance.emit(_);
|
|
2853
|
+
});
|
|
2683
2854
|
}
|
|
2684
2855
|
ngAfterViewInit() {
|
|
2685
2856
|
}
|
|
@@ -2691,9 +2862,9 @@ class ChartComponent {
|
|
|
2691
2862
|
});
|
|
2692
2863
|
}
|
|
2693
2864
|
}
|
|
2694
|
-
ChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2695
|
-
ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
2696
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2865
|
+
ChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartComponent, deps: [{ token: ChartService }, { token: ZoomService }, { token: ScaleService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2866
|
+
ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", 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", zoomServiceInstance: "zoomServiceInstance" }, 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 position-relative\"></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"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ChartContainerComponent, selector: "teta-chart-container" }, { kind: "component", type: LegendComponent, selector: "teta-legend", inputs: ["series"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartComponent, decorators: [{
|
|
2697
2868
|
type: Component,
|
|
2698
2869
|
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 position-relative\"></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"] }]
|
|
2699
2870
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: ZoomService }, { type: ScaleService }]; }, propDecorators: { pointerMove: [{
|
|
@@ -2718,14 +2889,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
|
|
|
2718
2889
|
type: Output
|
|
2719
2890
|
}], annotationMove: [{
|
|
2720
2891
|
type: Output
|
|
2892
|
+
}], zoomServiceInstance: [{
|
|
2893
|
+
type: Output
|
|
2721
2894
|
}], config: [{
|
|
2722
2895
|
type: Input
|
|
2723
2896
|
}] } });
|
|
2724
2897
|
|
|
2725
2898
|
class ChartModule {
|
|
2726
2899
|
}
|
|
2727
|
-
ChartModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2728
|
-
ChartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.
|
|
2900
|
+
ChartModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2901
|
+
ChartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: ChartModule, declarations: [ChartComponent,
|
|
2729
2902
|
SeriesHostComponent,
|
|
2730
2903
|
ChartContainerComponent,
|
|
2731
2904
|
LegendComponent,
|
|
@@ -2755,8 +2928,8 @@ ChartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "1
|
|
|
2755
2928
|
AreaSeriesComponent,
|
|
2756
2929
|
BlockSeriesComponent,
|
|
2757
2930
|
BlockAreaSeriesComponent] });
|
|
2758
|
-
ChartModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.
|
|
2759
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2931
|
+
ChartModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartModule, imports: [CommonModule] });
|
|
2932
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartModule, decorators: [{
|
|
2760
2933
|
type: NgModule,
|
|
2761
2934
|
args: [{
|
|
2762
2935
|
declarations: [
|