@tetacom/ng-components 1.0.26 → 1.0.29
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/component/filter/filter.module.d.ts +2 -1
- package/component/public-api.d.ts +0 -1
- package/component/table/table-body/table-body.component.d.ts +0 -4
- package/component/table/table.module.d.ts +5 -6
- package/directive/click-outside/click-outside.directive.d.ts +3 -2
- package/directive/hint/hint.directive.d.ts +1 -0
- package/esm2020/component/chart-3d/chart3d/chart3d.component.mjs +4 -4
- package/esm2020/component/file-upload/file-item/file-item.component.mjs +4 -4
- package/esm2020/component/filter/filter.module.mjs +6 -2
- package/esm2020/component/filter/numeric-filter/numeric-filter.component.mjs +4 -3
- package/esm2020/component/message/message.service.mjs +3 -3
- package/esm2020/component/public-api.mjs +1 -3
- package/esm2020/component/table/default/numeric-cell/numeric-cell.component.mjs +2 -1
- package/esm2020/component/table/default/string-cell/string-cell.component.mjs +3 -2
- package/esm2020/component/table/table-body/table-body.component.mjs +1 -31
- package/esm2020/component/table/table.module.mjs +1 -5
- package/esm2020/directive/click-outside/click-outside.directive.mjs +10 -5
- package/esm2020/directive/hint/hint.directive.mjs +4 -1
- package/esm2020/directive/only-number/only-number.directive.mjs +3 -2
- package/esm2020/pipe/public-api.mjs +2 -1
- package/esm2020/util/date-util.mjs +8 -5
- package/fesm2015/tetacom-ng-components.mjs +63 -2353
- package/fesm2015/tetacom-ng-components.mjs.map +1 -1
- package/fesm2020/tetacom-ng-components.mjs +61 -2343
- package/fesm2020/tetacom-ng-components.mjs.map +1 -1
- package/package.json +1 -1
- package/pipe/public-api.d.ts +1 -0
- package/component/chart/chart/chart.component.d.ts +0 -39
- package/component/chart/chart.module.d.ts +0 -8
- package/component/chart/core/axis-creator.d.ts +0 -29
- package/component/chart/core/chart.d.ts +0 -70
- package/component/chart/core/public-api.d.ts +0 -2
- package/component/chart/drawer/area-drawer.d.ts +0 -7
- package/component/chart/drawer/bar-drawer.d.ts +0 -8
- package/component/chart/drawer/contour-drawer.d.ts +0 -7
- package/component/chart/drawer/default-drawer-mapping.d.ts +0 -4
- package/component/chart/drawer/line-drawer.d.ts +0 -11
- package/component/chart/drawer/pie-drawer.d.ts +0 -7
- package/component/chart/drawer/public-api.d.ts +0 -6
- package/component/chart/drawer/scatter-drawer.d.ts +0 -15
- package/component/chart/drawer/spline-drawer.d.ts +0 -7
- package/component/chart/legend-drawer/default-drawer-legend-mapping.d.ts +0 -3
- package/component/chart/legend-drawer/gradient-drawer.d.ts +0 -5
- package/component/chart/legend-drawer/swatch-drawer.d.ts +0 -6
- package/component/chart/model/annotation.d.ts +0 -59
- package/component/chart/model/axis-options.d.ts +0 -43
- package/component/chart/model/chart-bounds.d.ts +0 -12
- package/component/chart/model/chart-options.d.ts +0 -51
- package/component/chart/model/enum/axis-type.d.ts +0 -4
- package/component/chart/model/enum/dispatch-type.d.ts +0 -4
- package/component/chart/model/enum/drag-point-type.d.ts +0 -5
- package/component/chart/model/enum/legend-type.d.ts +0 -4
- package/component/chart/model/enum/public-api.d.ts +0 -7
- package/component/chart/model/enum/scale-type.d.ts +0 -7
- package/component/chart/model/enum/scale.d.ts +0 -5
- package/component/chart/model/enum/series-type.d.ts +0 -10
- package/component/chart/model/enum/zoom-type.d.ts +0 -5
- package/component/chart/model/i-drag-event.d.ts +0 -5
- package/component/chart/model/i-drawer-legend.d.ts +0 -12
- package/component/chart/model/i-drawer.d.ts +0 -9
- package/component/chart/model/i-zoom-event.d.ts +0 -8
- package/component/chart/model/plot-band.d.ts +0 -28
- package/component/chart/model/plot-line.d.ts +0 -20
- package/component/chart/model/point/bar-point.d.ts +0 -6
- package/component/chart/model/point/base-point.d.ts +0 -9
- package/component/chart/model/point/contour-point.d.ts +0 -4
- package/component/chart/model/point/marker-options.d.ts +0 -11
- package/component/chart/model/point/public-api.d.ts +0 -3
- package/component/chart/model/point/scatter-point.d.ts +0 -5
- package/component/chart/model/public-api.d.ts +0 -15
- package/component/chart/model/series.d.ts +0 -62
- package/component/chart/model/tooltip-options.d.ts +0 -14
- package/component/chart/public-api.d.ts +0 -5
- package/esm2020/component/chart/chart/chart.component.mjs +0 -164
- package/esm2020/component/chart/chart.module.mjs +0 -18
- package/esm2020/component/chart/core/axis-creator.mjs +0 -82
- package/esm2020/component/chart/core/chart.mjs +0 -1339
- package/esm2020/component/chart/core/public-api.mjs +0 -3
- package/esm2020/component/chart/drawer/area-drawer.mjs +0 -20
- package/esm2020/component/chart/drawer/bar-drawer.mjs +0 -23
- package/esm2020/component/chart/drawer/contour-drawer.mjs +0 -29
- package/esm2020/component/chart/drawer/default-drawer-mapping.mjs +0 -17
- package/esm2020/component/chart/drawer/line-drawer.mjs +0 -152
- package/esm2020/component/chart/drawer/pie-drawer.mjs +0 -4
- package/esm2020/component/chart/drawer/public-api.mjs +0 -7
- package/esm2020/component/chart/drawer/scatter-drawer.mjs +0 -93
- package/esm2020/component/chart/drawer/spline-drawer.mjs +0 -23
- package/esm2020/component/chart/legend-drawer/default-drawer-legend-mapping.mjs +0 -7
- package/esm2020/component/chart/legend-drawer/gradient-drawer.mjs +0 -45
- package/esm2020/component/chart/legend-drawer/swatch-drawer.mjs +0 -62
- package/esm2020/component/chart/model/annotation.mjs +0 -30
- package/esm2020/component/chart/model/axis-options.mjs +0 -26
- package/esm2020/component/chart/model/chart-bounds.mjs +0 -13
- package/esm2020/component/chart/model/chart-options.mjs +0 -37
- package/esm2020/component/chart/model/enum/axis-type.mjs +0 -6
- package/esm2020/component/chart/model/enum/dispatch-type.mjs +0 -6
- package/esm2020/component/chart/model/enum/drag-point-type.mjs +0 -7
- package/esm2020/component/chart/model/enum/legend-type.mjs +0 -6
- package/esm2020/component/chart/model/enum/public-api.mjs +0 -8
- package/esm2020/component/chart/model/enum/scale-type.mjs +0 -9
- package/esm2020/component/chart/model/enum/scale.mjs +0 -7
- package/esm2020/component/chart/model/enum/series-type.mjs +0 -12
- package/esm2020/component/chart/model/enum/zoom-type.mjs +0 -7
- package/esm2020/component/chart/model/i-drag-event.mjs +0 -2
- package/esm2020/component/chart/model/i-drawer-legend.mjs +0 -2
- package/esm2020/component/chart/model/i-drawer.mjs +0 -2
- package/esm2020/component/chart/model/i-zoom-event.mjs +0 -2
- package/esm2020/component/chart/model/plot-band.mjs +0 -18
- package/esm2020/component/chart/model/plot-line.mjs +0 -13
- package/esm2020/component/chart/model/point/bar-point.mjs +0 -2
- package/esm2020/component/chart/model/point/base-point.mjs +0 -2
- package/esm2020/component/chart/model/point/contour-point.mjs +0 -2
- package/esm2020/component/chart/model/point/marker-options.mjs +0 -2
- package/esm2020/component/chart/model/point/public-api.mjs +0 -4
- package/esm2020/component/chart/model/point/scatter-point.mjs +0 -2
- package/esm2020/component/chart/model/public-api.mjs +0 -16
- package/esm2020/component/chart/model/series.mjs +0 -27
- package/esm2020/component/chart/model/tooltip-options.mjs +0 -19
- package/esm2020/component/chart/public-api.mjs +0 -6
|
@@ -16,14 +16,9 @@ import { TranslocoModule, TRANSLOCO_SCOPE } from '@ngneat/transloco';
|
|
|
16
16
|
import { __awaiter } from 'tslib';
|
|
17
17
|
import * as hash from 'object-hash';
|
|
18
18
|
import hash__default from 'object-hash';
|
|
19
|
-
import { SizeStrategy, Datasource, UiScrollModule } from 'ngx-ui-scroll';
|
|
20
|
-
import * as d3 from 'd3';
|
|
21
|
-
import { zoomIdentity } from 'd3';
|
|
22
|
-
import * as d3annotation from 'd3-svg-annotation';
|
|
23
|
-
import { annotationBadge, annotationLabel, annotationCallout, annotationCalloutCircle, annotationCalloutCurve, annotationCalloutElbow, annotationCalloutRect, annotationCustomType, annotationXYThreshold } from 'd3-svg-annotation';
|
|
24
|
-
import { tricontour } from 'd3-tricontour';
|
|
25
19
|
import * as THREE from 'three';
|
|
26
20
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
|
|
21
|
+
import * as d3 from 'd3';
|
|
27
22
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
28
23
|
|
|
29
24
|
class AccordionComponent {
|
|
@@ -538,6 +533,31 @@ var DatePickerMode;
|
|
|
538
533
|
DatePickerMode[DatePickerMode["year"] = 2] = "year";
|
|
539
534
|
})(DatePickerMode || (DatePickerMode = {}));
|
|
540
535
|
|
|
536
|
+
const getPrecision = (a) => {
|
|
537
|
+
if (!isFinite(a)) {
|
|
538
|
+
return 0;
|
|
539
|
+
}
|
|
540
|
+
let e = 1;
|
|
541
|
+
let p = 0;
|
|
542
|
+
while (Math.round(a * e) / e !== a) {
|
|
543
|
+
e *= 10;
|
|
544
|
+
p++;
|
|
545
|
+
}
|
|
546
|
+
return p;
|
|
547
|
+
};
|
|
548
|
+
const formatNumber = (value, decimalLength, chunkDelimiter, decimalDelimiter, chunkLength) => {
|
|
549
|
+
const abs = Math.abs(value);
|
|
550
|
+
if (0 < abs && 1 > abs) {
|
|
551
|
+
const firstDigitIndex = Math.floor(Math.abs(Math.log10(abs)));
|
|
552
|
+
decimalLength += firstDigitIndex;
|
|
553
|
+
}
|
|
554
|
+
const precision = Math.min(getPrecision(value), Math.floor(decimalLength));
|
|
555
|
+
const result = '\\d(?=(\\d{' + chunkLength + '})+' + (precision > 0 ? '\\D' : '$') + ')';
|
|
556
|
+
const num = value.toFixed(precision);
|
|
557
|
+
return (decimalDelimiter ? num.replace('.', decimalDelimiter) : num).replace(new RegExp(result, 'g'), '$&' + chunkDelimiter);
|
|
558
|
+
};
|
|
559
|
+
const prependZero = (input, length) => ('0'.repeat(length) + input).slice(-length);
|
|
560
|
+
|
|
541
561
|
class DateUtil {
|
|
542
562
|
/**
|
|
543
563
|
* Вычесть n-дней
|
|
@@ -586,10 +606,12 @@ class DateUtil {
|
|
|
586
606
|
return '';
|
|
587
607
|
}
|
|
588
608
|
const month = dat.getMonth() + 1;
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
609
|
+
return `${prependZero(dat.getDate(), 2)}.
|
|
610
|
+
${prependZero(month, 2)}.
|
|
611
|
+
${dat.getFullYear()}
|
|
612
|
+
${prependZero(dat.getHours(), 2)}:
|
|
613
|
+
${prependZero(dat.getMinutes(), 2)}:
|
|
614
|
+
${prependZero(dat.getSeconds(), 2)}`;
|
|
593
615
|
}
|
|
594
616
|
/**
|
|
595
617
|
* Подготовка даты к отправке на сервер, чтобы небыло смещения часов
|
|
@@ -1525,31 +1547,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
1525
1547
|
type: Output
|
|
1526
1548
|
}] } });
|
|
1527
1549
|
|
|
1528
|
-
const getPrecision = (a) => {
|
|
1529
|
-
if (!isFinite(a)) {
|
|
1530
|
-
return 0;
|
|
1531
|
-
}
|
|
1532
|
-
let e = 1;
|
|
1533
|
-
let p = 0;
|
|
1534
|
-
while (Math.round(a * e) / e !== a) {
|
|
1535
|
-
e *= 10;
|
|
1536
|
-
p++;
|
|
1537
|
-
}
|
|
1538
|
-
return p;
|
|
1539
|
-
};
|
|
1540
|
-
const formatNumber = (value, decimalLength, chunkDelimiter, decimalDelimiter, chunkLength) => {
|
|
1541
|
-
const abs = Math.abs(value);
|
|
1542
|
-
if (0 < abs && 1 > abs) {
|
|
1543
|
-
const firstDigitIndex = Math.floor(Math.abs(Math.log10(abs)));
|
|
1544
|
-
decimalLength += firstDigitIndex;
|
|
1545
|
-
}
|
|
1546
|
-
const precision = Math.min(getPrecision(value), Math.floor(decimalLength));
|
|
1547
|
-
const result = '\\d(?=(\\d{' + chunkLength + '})+' + (precision > 0 ? '\\D' : '$') + ')';
|
|
1548
|
-
const num = value.toFixed(precision);
|
|
1549
|
-
return (decimalDelimiter ? num.replace('.', decimalDelimiter) : num).replace(new RegExp(result, 'g'), '$&' + chunkDelimiter);
|
|
1550
|
-
};
|
|
1551
|
-
const prependZero = (input, length) => ('0'.repeat(length) + input).slice(-length);
|
|
1552
|
-
|
|
1553
1550
|
class PrependZeroPipe {
|
|
1554
1551
|
transform(value, length) {
|
|
1555
1552
|
if (value === null || value === undefined) {
|
|
@@ -2498,8 +2495,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
2498
2495
|
}] });
|
|
2499
2496
|
|
|
2500
2497
|
class ClickOutsideDirective {
|
|
2501
|
-
constructor(_elementRef) {
|
|
2498
|
+
constructor(_elementRef, _ngZone) {
|
|
2502
2499
|
this._elementRef = _elementRef;
|
|
2500
|
+
this._ngZone = _ngZone;
|
|
2503
2501
|
this.clickOutside = new EventEmitter();
|
|
2504
2502
|
this.rightClick = false;
|
|
2505
2503
|
this._handleEvents = false;
|
|
@@ -2516,7 +2514,11 @@ class ClickOutsideDirective {
|
|
|
2516
2514
|
set tetaClickOutside(val) {
|
|
2517
2515
|
this._handleEvents = val;
|
|
2518
2516
|
if (this._handleEvents) {
|
|
2519
|
-
this.
|
|
2517
|
+
this._ngZone.runOutsideAngular(() => {
|
|
2518
|
+
setTimeout(() => {
|
|
2519
|
+
this.addListener(this.rightClick);
|
|
2520
|
+
});
|
|
2521
|
+
});
|
|
2520
2522
|
}
|
|
2521
2523
|
else {
|
|
2522
2524
|
this.removeListener();
|
|
@@ -2539,14 +2541,14 @@ class ClickOutsideDirective {
|
|
|
2539
2541
|
window.removeEventListener('contextmenu', this.listener);
|
|
2540
2542
|
}
|
|
2541
2543
|
}
|
|
2542
|
-
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2544
|
+
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2543
2545
|
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.1", type: ClickOutsideDirective, selector: "[tetaClickOutside]", inputs: { rightClick: "rightClick", tetaClickOutside: "tetaClickOutside" }, outputs: { clickOutside: "clickOutside" }, ngImport: i0 });
|
|
2544
2546
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
2545
2547
|
type: Directive,
|
|
2546
2548
|
args: [{
|
|
2547
2549
|
selector: '[tetaClickOutside]',
|
|
2548
2550
|
}]
|
|
2549
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { clickOutside: [{
|
|
2551
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { clickOutside: [{
|
|
2550
2552
|
type: Output
|
|
2551
2553
|
}], rightClick: [{
|
|
2552
2554
|
type: Input
|
|
@@ -2666,7 +2668,8 @@ class OnlyNumberDirective {
|
|
|
2666
2668
|
}
|
|
2667
2669
|
else {
|
|
2668
2670
|
if (e.key === ',' && originalValue.indexOf('.') < 0) {
|
|
2669
|
-
this._elementRef.nativeElement.value =
|
|
2671
|
+
this._elementRef.nativeElement.value =
|
|
2672
|
+
`${originalValue.slice(0, cursorPosition)}.${originalValue.slice(cursorPosition)}`;
|
|
2670
2673
|
}
|
|
2671
2674
|
e.preventDefault();
|
|
2672
2675
|
}
|
|
@@ -3352,10 +3355,10 @@ class FileItemComponent {
|
|
|
3352
3355
|
ngOnInit() { }
|
|
3353
3356
|
}
|
|
3354
3357
|
FileItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: FileItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3355
|
-
FileItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: FileItemComponent, selector: "teta-file-item", ngImport: i0, template: "<p>file-item works!</p>\n", styles: [""] });
|
|
3358
|
+
FileItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: FileItemComponent, selector: "teta-file-item", ngImport: i0, template: "<p>file-item works!</p>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3356
3359
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: FileItemComponent, decorators: [{
|
|
3357
3360
|
type: Component,
|
|
3358
|
-
args: [{ selector: 'teta-file-item', template: "<p>file-item works!</p>\n", styles: [""] }]
|
|
3361
|
+
args: [{ selector: 'teta-file-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p>file-item works!</p>\n", styles: [""] }]
|
|
3359
3362
|
}], ctorParameters: function () { return []; } });
|
|
3360
3363
|
|
|
3361
3364
|
class FileUploadModule {
|
|
@@ -3476,10 +3479,10 @@ class NumericFilterComponent extends FilterComponentBase {
|
|
|
3476
3479
|
}
|
|
3477
3480
|
}
|
|
3478
3481
|
NumericFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: NumericFilterComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3479
|
-
NumericFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: NumericFilterComponent, selector: "teta-numeric-filter", inputs: { column: "column", filterOptions: "filterOptions", state: "state" }, outputs: { filterChanged: "filterChanged" }, usesInheritance: true, ngImport: i0, template: "<div class=\"form-row padding-3\">\n <teta-input [label]=\"'\u041E\u0442'\">\n <input class=\"input\" type=\"text\"\n style=\"width: 110px\"\n [ngModel]=\"filter.value?.greaterThan\"\n (ngModelChange)=\"filter.value.greaterThan=$event\"/>\n </teta-input>\n <teta-input [label]=\"'\u0414\u043E'\">\n <input class=\"input\" type=\"text\"\n style=\"width: 110px\"\n [ngModel]=\"filter.value?.lessThan\"\n (ngModelChange)=\"filter.value.lessThan=$event\"/>\n </teta-input>\n</div>\n", styles: [""], components: [{ type: InputComponent, selector: "teta-input", inputs: ["label", "horizontal", "required"] }], directives: [{ type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3482
|
+
NumericFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: NumericFilterComponent, selector: "teta-numeric-filter", inputs: { column: "column", filterOptions: "filterOptions", state: "state" }, outputs: { filterChanged: "filterChanged" }, usesInheritance: true, ngImport: i0, template: "<div class=\"form-row padding-3\">\n <teta-input [label]=\"'\u041E\u0442'\">\n <input class=\"input\" type=\"text\"\n style=\"width: 110px\"\n [tetaOnlyNumber]=\"true\"\n [ngModel]=\"filter.value?.greaterThan\"\n (ngModelChange)=\"filter.value.greaterThan=$event\"/>\n </teta-input>\n <teta-input [label]=\"'\u0414\u043E'\">\n <input class=\"input\" type=\"text\"\n style=\"width: 110px\"\n [tetaOnlyNumber]=\"true\"\n [ngModel]=\"filter.value?.lessThan\"\n (ngModelChange)=\"filter.value.lessThan=$event\"/>\n </teta-input>\n</div>\n", styles: [""], components: [{ type: InputComponent, selector: "teta-input", inputs: ["label", "horizontal", "required"] }], directives: [{ type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: OnlyNumberDirective, selector: "[tetaOnlyNumber]", inputs: ["tetaOnlyNumber", "allowDecimals", "allowSign", "decimalSeparator", "commaSeparator"] }, { type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3480
3483
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: NumericFilterComponent, decorators: [{
|
|
3481
3484
|
type: Component,
|
|
3482
|
-
args: [{ selector: 'teta-numeric-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-row padding-3\">\n <teta-input [label]=\"'\u041E\u0442'\">\n <input class=\"input\" type=\"text\"\n style=\"width: 110px\"\n [ngModel]=\"filter.value?.greaterThan\"\n (ngModelChange)=\"filter.value.greaterThan=$event\"/>\n </teta-input>\n <teta-input [label]=\"'\u0414\u043E'\">\n <input class=\"input\" type=\"text\"\n style=\"width: 110px\"\n [ngModel]=\"filter.value?.lessThan\"\n (ngModelChange)=\"filter.value.lessThan=$event\"/>\n </teta-input>\n</div>\n", styles: [""] }]
|
|
3485
|
+
args: [{ selector: 'teta-numeric-filter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-row padding-3\">\n <teta-input [label]=\"'\u041E\u0442'\">\n <input class=\"input\" type=\"text\"\n style=\"width: 110px\"\n [tetaOnlyNumber]=\"true\"\n [ngModel]=\"filter.value?.greaterThan\"\n (ngModelChange)=\"filter.value.greaterThan=$event\"/>\n </teta-input>\n <teta-input [label]=\"'\u0414\u043E'\">\n <input class=\"input\" type=\"text\"\n style=\"width: 110px\"\n [tetaOnlyNumber]=\"true\"\n [ngModel]=\"filter.value?.lessThan\"\n (ngModelChange)=\"filter.value.lessThan=$event\"/>\n </teta-input>\n</div>\n", styles: [""] }]
|
|
3483
3486
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { column: [{
|
|
3484
3487
|
type: Input
|
|
3485
3488
|
}], filterOptions: [{
|
|
@@ -4695,7 +4698,8 @@ FilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
|
4695
4698
|
DatePickerModule,
|
|
4696
4699
|
RadioModule,
|
|
4697
4700
|
InputModule,
|
|
4698
|
-
CheckboxModule
|
|
4701
|
+
CheckboxModule,
|
|
4702
|
+
OnlyNumberModule], exports: [FilterPanelComponent,
|
|
4699
4703
|
NumericFilterComponent,
|
|
4700
4704
|
StringFilterComponent,
|
|
4701
4705
|
ListFilterComponent,
|
|
@@ -4710,6 +4714,7 @@ FilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
|
4710
4714
|
RadioModule,
|
|
4711
4715
|
InputModule,
|
|
4712
4716
|
CheckboxModule,
|
|
4717
|
+
OnlyNumberModule,
|
|
4713
4718
|
]] });
|
|
4714
4719
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: FilterModule, decorators: [{
|
|
4715
4720
|
type: NgModule,
|
|
@@ -4740,6 +4745,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
4740
4745
|
RadioModule,
|
|
4741
4746
|
InputModule,
|
|
4742
4747
|
CheckboxModule,
|
|
4748
|
+
OnlyNumberModule,
|
|
4743
4749
|
],
|
|
4744
4750
|
}]
|
|
4745
4751
|
}] });
|
|
@@ -4927,7 +4933,7 @@ class FilterState {
|
|
|
4927
4933
|
|
|
4928
4934
|
class MessageService {
|
|
4929
4935
|
constructor() {
|
|
4930
|
-
this._message = new
|
|
4936
|
+
this._message = new ReplaySubject(1);
|
|
4931
4937
|
this._clear = new Subject();
|
|
4932
4938
|
this.message = this._message.asObservable();
|
|
4933
4939
|
this.clear = this._clear.asObservable();
|
|
@@ -6172,6 +6178,9 @@ class HintDirective extends DynamicContentBaseDirective {
|
|
|
6172
6178
|
'hint',
|
|
6173
6179
|
];
|
|
6174
6180
|
}
|
|
6181
|
+
ngOnDestroy() {
|
|
6182
|
+
super.ngOnDestroy();
|
|
6183
|
+
}
|
|
6175
6184
|
}
|
|
6176
6185
|
HintDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HintDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }, { token: DynamicComponentService }, { token: i0.Injector }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6177
6186
|
HintDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.1", type: HintDirective, selector: "[tetaHint]", inputs: { tetaHint: "tetaHint", align: "align", verticalAlign: "verticalAlign", delay: "delay" }, host: { listeners: { "mouseenter": "mouseenter($event)", "mouseleave": "mouseleave($event)", "click": "click($event)" } }, usesInheritance: true, ngImport: i0 });
|
|
@@ -8765,8 +8774,9 @@ class NumericCellComponent extends CellComponentBase {
|
|
|
8765
8774
|
startEdit(initiator, type) {
|
|
8766
8775
|
if ((initiator === null || initiator === void 0 ? void 0 : initiator.column.name) === this.column.name) {
|
|
8767
8776
|
setTimeout(() => {
|
|
8768
|
-
var _a;
|
|
8777
|
+
var _a, _b;
|
|
8769
8778
|
(_a = this.input) === null || _a === void 0 ? void 0 : _a.nativeElement.focus();
|
|
8779
|
+
(_b = this.input) === null || _b === void 0 ? void 0 : _b.nativeElement.select();
|
|
8770
8780
|
this.cdr.markForCheck();
|
|
8771
8781
|
}, 0);
|
|
8772
8782
|
}
|
|
@@ -8905,7 +8915,9 @@ class StringCellComponent extends CellComponentBase {
|
|
|
8905
8915
|
if ((initiator === null || initiator === void 0 ? void 0 : initiator.column.name) === this.column.name) {
|
|
8906
8916
|
this.cdr.markForCheck();
|
|
8907
8917
|
setTimeout(() => {
|
|
8908
|
-
|
|
8918
|
+
var _a, _b;
|
|
8919
|
+
(_a = this.input.nativeElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
8920
|
+
(_b = this.input.nativeElement) === null || _b === void 0 ? void 0 : _b.select();
|
|
8909
8921
|
}, 0);
|
|
8910
8922
|
}
|
|
8911
8923
|
}
|
|
@@ -9116,10 +9128,6 @@ class TableBodyComponent {
|
|
|
9116
9128
|
}
|
|
9117
9129
|
set data(data) {
|
|
9118
9130
|
this._data = data;
|
|
9119
|
-
if (!this.dataSource) {
|
|
9120
|
-
this.createAdapter();
|
|
9121
|
-
}
|
|
9122
|
-
this.resetAdapter();
|
|
9123
9131
|
}
|
|
9124
9132
|
get data() {
|
|
9125
9133
|
return this._data;
|
|
@@ -9220,34 +9228,6 @@ class TableBodyComponent {
|
|
|
9220
9228
|
? accum
|
|
9221
9229
|
: current.data[columnName], null);
|
|
9222
9230
|
}
|
|
9223
|
-
resetAdapter() {
|
|
9224
|
-
var _a;
|
|
9225
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
9226
|
-
yield this.dataSource.adapter.relax();
|
|
9227
|
-
yield this.dataSource.adapter.reset({
|
|
9228
|
-
get: this.getData,
|
|
9229
|
-
settings: {
|
|
9230
|
-
minIndex: 0,
|
|
9231
|
-
maxIndex: ((_a = this._data) === null || _a === void 0 ? void 0 : _a.length) ? this._data.length - 1 : 0,
|
|
9232
|
-
startIndex: 0,
|
|
9233
|
-
itemSize: 24,
|
|
9234
|
-
sizeStrategy: SizeStrategy.Constant,
|
|
9235
|
-
},
|
|
9236
|
-
});
|
|
9237
|
-
yield this.dataSource.adapter.check();
|
|
9238
|
-
});
|
|
9239
|
-
}
|
|
9240
|
-
createAdapter() {
|
|
9241
|
-
this.dataSource = new Datasource({
|
|
9242
|
-
get: this.getData,
|
|
9243
|
-
settings: {
|
|
9244
|
-
startIndex: 0,
|
|
9245
|
-
bufferSize: 2,
|
|
9246
|
-
sizeStrategy: SizeStrategy.Constant,
|
|
9247
|
-
itemSize: 24,
|
|
9248
|
-
},
|
|
9249
|
-
});
|
|
9250
|
-
}
|
|
9251
9231
|
}
|
|
9252
9232
|
TableBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: TableBodyComponent, deps: [{ token: TableService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
9253
9233
|
TableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: TableBodyComponent, selector: "teta-table-body", inputs: { virtual: "virtual", activeRow: "activeRow", rowHeight: "rowHeight", additionalComponent: "additionalComponent", tree: "tree", aggregate: "aggregate", grouping: "grouping", groupRowComponent: "groupRowComponent", openLevels: "openLevels", selectType: "selectType", rowClass: "rowClass" }, host: { properties: { "class.table-body": "this.tableBodyClass" } }, viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], ngImport: i0, template: "<!--<div #viewport class=\"table-body-container table-body-container-virtual\"-->\n<!-- *ngIf=\"virtual\"-->\n<!-- [style.grid-template-columns]=\"getTemplateColumns()\"-->\n<!-- style=\"height: 100%;\">-->\n<!-- <ng-container-->\n<!-- *uiScroll=\"let row of dataSource; let rowIndex = index; let last = last;\" style=\"display: flex;flex-grow: 1\">-->\n<!-- <ng-container *ngTemplateOutlet=\"bodyTemplate; context: {row: row, rowIndex: rowIndex}\"></ng-container>-->\n<!-- </ng-container>-->\n<!-- <ng-container *ngIf=\"aggregate\">-->\n<!-- <ng-container *ngTemplateOutlet=\"aggTemplate;\"></ng-container>-->\n<!-- </ng-container>-->\n<!--</div>-->\n\n<cdk-virtual-scroll-viewport *ngIf=\"virtual\"\n class=\"table-body-container\"\n [itemSize]=\"24\">\n <ng-container *cdkVirtualFor=\"let row of data;templateCacheSize: 0; let rowIndex = index; trackBy: trackRow;\">\n <ng-container *ngTemplateOutlet=\"bodyTemplate; context: {row: row, rowIndex: rowIndex}\"></ng-container>\n </ng-container>\n</cdk-virtual-scroll-viewport>\n\n\n<div *ngIf=\"!virtual\"\n class=\"table-body-container\"\n [style.grid-template-rows]=\"rowHeight + 'px'\"\n [style.grid-auto-rows]=\"rowHeight + 'px'\"\n [style.grid-template-columns]=\"getTemplateColumns()\">\n <ng-container *ngFor=\"let row of data; let rowIndex = index; trackBy: trackRow;\">\n <ng-container *ngTemplateOutlet=\"bodyTemplate; context: {row: row, rowIndex: rowIndex}\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"aggregate\">\n <ng-container *ngTemplateOutlet=\"aggTemplate;\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #bodyTemplate let-row=\"row\" let-rowIndex=\"rowIndex\">\n <div class=\"table-row\"\n (click)=\"setActiveRow(row)\"\n [attr.data-row]=\"rowIndex\"\n [ngClass]=\"rowClass ? rowClass(row, rowIndex) : ''\"\n [class.table-row_virtual]=\"virtual\"\n [style.grid-template-columns]=\"virtual ? getTemplateColumns() : ''\"\n [class.table-row_active]=\"row === activeRow || selectedRows.indexOf(row) >= 0\">\n <ng-container *ngIf=\"!grouping\">\n <div class=\"table-row_locked\"\n *ngIf=\"locked.length > 0\"\n [style.grid-template-columns]=\"getLockedGridTemplateColumns(locked)\"\n [style.zIndex]=\"row === activeRow ? 1 : 'unset'\"\n [style.grid-column-end]=\"getSpan()\">\n <teta-selection-cell *ngIf=\"selectType !== selectTypeEnum.none && locked.length\"\n [row]=\"row\"></teta-selection-cell>\n <teta-cell\n *ngFor=\"let column of locked; let colIndex = index; trackBy: trackColumns;\"\n [attr.data-row]=\"rowIndex\"\n [attr.data-column]=\"column.name\"\n [column]=\"column\"\n [filterOptions]=\"dict[column.name]\"\n [dict]=\"dict\"\n [row]=\"row\"\n [ngClass]=\"column.cellClass\"\n [attr.tabindex]=\"0\"\n ></teta-cell>\n </div>\n <teta-selection-cell *ngIf=\"selectType !== selectTypeEnum.none && locked.length < 1\"\n [row]=\"row\"></teta-selection-cell>\n <teta-cell\n *ngFor=\"let column of unlocked; let colIndex = index; trackBy: trackColumns;\"\n [attr.data-row]=\"rowIndex\"\n [attr.data-column]=\"column.name\"\n [column]=\"column\"\n [filterOptions]=\"dict[column.name]\"\n [dict]=\"dict\"\n [row]=\"row\"\n [ngClass]=\"column.cellClass\"\n [attr.tabindex]=\"0\"\n ></teta-cell>\n </ng-container>\n <ng-container *ngIf=\"grouping\">\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #aggTemplate>\n <div class=\"table-row\"\n *ngIf=\"aggregate\"\n [class.table-row_virtual]=\"virtual\"\n [style.grid-template-columns]=\"virtual ? getTemplateColumns() : ''\">\n <div class=\"table-row_locked\"\n *ngIf=\"locked.length > 0\"\n [style.grid-template-columns]=\"getLockedGridTemplateColumns(locked)\"\n [style.grid-column-end]=\"getSpan()\">\n <div class=\"cell align-center justify-content-center\">\n <teta-icon [name]=\"'sumColor'\"></teta-icon>\n </div>\n <div class=\"cell cell-component justify-content-end\"\n *ngFor=\"let column of locked; let colIndex = index; trackBy: trackColumns;\"\n [attr.data-column]=\"column.name\"\n [ngClass]=\"column.cellClass\"\n [attr.tabindex]=\"0\">\n <span class=\"cell-text cell-text_numeric font-title-3\">\n {{getAggregateText(column)}}:\n {{getAggregateValue(column) | tetaNumber : 2}}\n </span>\n </div>\n </div>\n <div class=\"cell align-center justify-content-center\"\n *ngIf=\"selectType !== selectTypeEnum.none && locked.length < 1\">\n <teta-icon [name]=\"'sumColor'\"></teta-icon>\n </div>\n <div class=\"cell cell-component justify-content-end\"\n *ngFor=\"let column of unlocked; let colIndex = index; trackBy: trackColumns;\"\n [attr.data-column]=\"column.name\"\n [ngClass]=\"column.cellClass\"\n [attr.tabindex]=\"0\">\n <span class=\"cell-text cell-text_numeric font-title-3\">\n {{getAggregateText(column)}}\n {{getAggregateValue(column) | tetaNumber : 2}}\n </span>\n </div>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: i4.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { type: SelectionCellComponent, selector: "teta-selection-cell", inputs: ["row"] }, { type: CellComponent, selector: "teta-cell", inputs: ["column", "filterOptions", "dict", "row"] }, { type: IconComponent, selector: "teta-icon", inputs: ["name", "size", "palette", "class"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i4.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "tetaNumber": NumberPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -9847,7 +9827,6 @@ TableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "1
|
|
|
9847
9827
|
HintModule,
|
|
9848
9828
|
TreeModule,
|
|
9849
9829
|
OnlyNumberModule,
|
|
9850
|
-
UiScrollModule,
|
|
9851
9830
|
ToolbarModule,
|
|
9852
9831
|
ClickOutsideModule,
|
|
9853
9832
|
ResizeDragModule,
|
|
@@ -9879,7 +9858,6 @@ TableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "1
|
|
|
9879
9858
|
HintModule,
|
|
9880
9859
|
TreeModule,
|
|
9881
9860
|
OnlyNumberModule,
|
|
9882
|
-
UiScrollModule,
|
|
9883
9861
|
ToolbarModule,
|
|
9884
9862
|
ClickOutsideModule,
|
|
9885
9863
|
ResizeDragModule,
|
|
@@ -9939,7 +9917,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
9939
9917
|
HintModule,
|
|
9940
9918
|
TreeModule,
|
|
9941
9919
|
OnlyNumberModule,
|
|
9942
|
-
UiScrollModule,
|
|
9943
9920
|
ToolbarModule,
|
|
9944
9921
|
ClickOutsideModule,
|
|
9945
9922
|
ResizeDragModule,
|
|
@@ -10029,2273 +10006,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
|
|
|
10029
10006
|
}]
|
|
10030
10007
|
}] });
|
|
10031
10008
|
|
|
10032
|
-
var Scale;
|
|
10033
|
-
(function (Scale) {
|
|
10034
|
-
Scale["time"] = "time";
|
|
10035
|
-
Scale["number"] = "number";
|
|
10036
|
-
Scale["category"] = "category";
|
|
10037
|
-
})(Scale || (Scale = {}));
|
|
10038
|
-
|
|
10039
|
-
var SeriesType;
|
|
10040
|
-
(function (SeriesType) {
|
|
10041
|
-
SeriesType[SeriesType["area"] = 0] = "area";
|
|
10042
|
-
SeriesType[SeriesType["bar"] = 1] = "bar";
|
|
10043
|
-
SeriesType[SeriesType["line"] = 2] = "line";
|
|
10044
|
-
SeriesType[SeriesType["pie"] = 3] = "pie";
|
|
10045
|
-
SeriesType[SeriesType["scatter"] = 4] = "scatter";
|
|
10046
|
-
SeriesType[SeriesType["spline"] = 5] = "spline";
|
|
10047
|
-
SeriesType[SeriesType["contour"] = 6] = "contour";
|
|
10048
|
-
SeriesType[SeriesType["custom"] = 7] = "custom";
|
|
10049
|
-
})(SeriesType || (SeriesType = {}));
|
|
10050
|
-
|
|
10051
|
-
class AreaDrawer {
|
|
10052
|
-
draw(series, context, scaleX, scaleY) {
|
|
10053
|
-
const points = series.data;
|
|
10054
|
-
const path = d3
|
|
10055
|
-
.area()
|
|
10056
|
-
.x1((d) => (d.x1 != null ? scaleX(d.x1) : scaleX(0)))
|
|
10057
|
-
.x0((d) => scaleX(d.x))
|
|
10058
|
-
.y((d) => scaleY(d.y));
|
|
10059
|
-
context
|
|
10060
|
-
.append('path')
|
|
10061
|
-
.attr('transform', `translate(${0}, 0)`)
|
|
10062
|
-
.attr('fill', series.color)
|
|
10063
|
-
.attr('stroke', series.color)
|
|
10064
|
-
.attr('stroke-width', series.strokeWidth ? series.strokeWidth : 1)
|
|
10065
|
-
.datum(points)
|
|
10066
|
-
.attr('d', path);
|
|
10067
|
-
}
|
|
10068
|
-
}
|
|
10069
|
-
|
|
10070
|
-
class BarDrawer {
|
|
10071
|
-
draw(series, context, scaleX, scaleY) {
|
|
10072
|
-
const points = series.data.filter((_) => _.visible);
|
|
10073
|
-
const barScale = d3
|
|
10074
|
-
.scaleBand()
|
|
10075
|
-
.domain(d3.range(points.length))
|
|
10076
|
-
.range(scaleX.range())
|
|
10077
|
-
.paddingInner(0.2)
|
|
10078
|
-
.paddingOuter(0.2);
|
|
10079
|
-
const u = context.selectAll('rect').data(points);
|
|
10080
|
-
u.enter()
|
|
10081
|
-
.append('rect')
|
|
10082
|
-
.merge(u)
|
|
10083
|
-
.attr('x', (d, i) => barScale(i))
|
|
10084
|
-
.attr('y', (d) => scaleY(d.y))
|
|
10085
|
-
.attr('width', barScale.bandwidth())
|
|
10086
|
-
.attr('height', (d) => Math.abs(scaleY(0) - scaleY(d.y)))
|
|
10087
|
-
.attr('fill', (d) => d.color);
|
|
10088
|
-
u.exit().remove();
|
|
10089
|
-
}
|
|
10090
|
-
}
|
|
10091
|
-
|
|
10092
|
-
var DispatchType;
|
|
10093
|
-
(function (DispatchType) {
|
|
10094
|
-
DispatchType["moveLine"] = "moveLine";
|
|
10095
|
-
DispatchType["movePoint"] = "movePoint";
|
|
10096
|
-
})(DispatchType || (DispatchType = {}));
|
|
10097
|
-
|
|
10098
|
-
var DragPointType;
|
|
10099
|
-
(function (DragPointType) {
|
|
10100
|
-
DragPointType[DragPointType["x"] = 0] = "x";
|
|
10101
|
-
DragPointType[DragPointType["y"] = 1] = "y";
|
|
10102
|
-
DragPointType[DragPointType["xy"] = 2] = "xy";
|
|
10103
|
-
})(DragPointType || (DragPointType = {}));
|
|
10104
|
-
|
|
10105
|
-
class LineDrawer {
|
|
10106
|
-
constructor() {
|
|
10107
|
-
this.dispatch = d3.dispatch(DispatchType.moveLine, DispatchType.movePoint);
|
|
10108
|
-
}
|
|
10109
|
-
draw(series, context, scaleX, scaleY, options) {
|
|
10110
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
10111
|
-
const points = series.data;
|
|
10112
|
-
const markerPoints = points.filter((_) => _.marker);
|
|
10113
|
-
const path = d3
|
|
10114
|
-
.line()
|
|
10115
|
-
.curve(series.curveType)
|
|
10116
|
-
.defined((d) => d.x != null && d.y != null)
|
|
10117
|
-
.x((d) => scaleX(d.x))
|
|
10118
|
-
.y((d) => scaleY(d.y));
|
|
10119
|
-
const seriesIndex = options.series.findIndex((_) => _.id === series.id);
|
|
10120
|
-
context
|
|
10121
|
-
.append('path')
|
|
10122
|
-
.attr('class', (d) => (series === null || series === void 0 ? void 0 : series.drag.enable) ? 'draggable' : `series-${seriesIndex}`)
|
|
10123
|
-
.attr('data-draggable-id', seriesIndex)
|
|
10124
|
-
.attr('fill', 'none')
|
|
10125
|
-
.attr('stroke', series.color)
|
|
10126
|
-
.attr('stroke-dasharray', series === null || series === void 0 ? void 0 : series.strokeDasharray)
|
|
10127
|
-
.attr('stroke-width', series.strokeWidth ? series.strokeWidth : 1)
|
|
10128
|
-
.style('cursor', ((_a = series === null || series === void 0 ? void 0 : series.drag) === null || _a === void 0 ? void 0 : _a.enable) ? 'move' : 'default')
|
|
10129
|
-
.datum(points)
|
|
10130
|
-
.attr('d', path);
|
|
10131
|
-
const u = context.append('g').attr('class', 'grabbers');
|
|
10132
|
-
const emit = (event, target) => {
|
|
10133
|
-
this.dispatch.apply(DispatchType.moveLine, {
|
|
10134
|
-
target,
|
|
10135
|
-
event,
|
|
10136
|
-
});
|
|
10137
|
-
};
|
|
10138
|
-
if (series.drag.enable) {
|
|
10139
|
-
u.selectAll('circle')
|
|
10140
|
-
.data(points)
|
|
10141
|
-
.enter()
|
|
10142
|
-
.append('circle')
|
|
10143
|
-
.attr('data-grabber-id', seriesIndex)
|
|
10144
|
-
.attr('stroke', (_d = (_c = (_b = series === null || series === void 0 ? void 0 : series.drag) === null || _b === void 0 ? void 0 : _b.grabbers) === null || _c === void 0 ? void 0 : _c.stroke) !== null && _d !== void 0 ? _d : series === null || series === void 0 ? void 0 : series.color)
|
|
10145
|
-
.attr('stroke-width', (_g = (_f = (_e = series === null || series === void 0 ? void 0 : series.drag) === null || _e === void 0 ? void 0 : _e.grabbers) === null || _f === void 0 ? void 0 : _f.strokeWidth) !== null && _g !== void 0 ? _g : 1)
|
|
10146
|
-
.attr('fill', (_k = (_j = (_h = series === null || series === void 0 ? void 0 : series.drag) === null || _h === void 0 ? void 0 : _h.grabbers) === null || _j === void 0 ? void 0 : _j.fill) !== null && _k !== void 0 ? _k : series === null || series === void 0 ? void 0 : series.color)
|
|
10147
|
-
.attr('r', (_o = (_m = (_l = series === null || series === void 0 ? void 0 : series.drag) === null || _l === void 0 ? void 0 : _l.grabbers) === null || _m === void 0 ? void 0 : _m.radius) !== null && _o !== void 0 ? _o : 4)
|
|
10148
|
-
.attr('cx', function (d) {
|
|
10149
|
-
return scaleX(d.x);
|
|
10150
|
-
})
|
|
10151
|
-
.attr('cy', function (d) {
|
|
10152
|
-
return scaleY(d.y);
|
|
10153
|
-
})
|
|
10154
|
-
.style('cursor', 'move')
|
|
10155
|
-
.call(d3.drag().on('start drag end', function (event, d) {
|
|
10156
|
-
var _a, _b, _c;
|
|
10157
|
-
d.x = scaleX.invert((_a = event.sourceEvent) === null || _a === void 0 ? void 0 : _a.offsetX);
|
|
10158
|
-
d.y = scaleY.invert((_b = event.sourceEvent) === null || _b === void 0 ? void 0 : _b.offsetY);
|
|
10159
|
-
d3.select(this).attr('cx', scaleX(d.x)).attr('cy', scaleY(d.y));
|
|
10160
|
-
context
|
|
10161
|
-
.select(`[data-draggable-id='${seriesIndex}']`)
|
|
10162
|
-
.attr('d', path);
|
|
10163
|
-
emit(event, series);
|
|
10164
|
-
if ((_c = series === null || series === void 0 ? void 0 : series.drag) === null || _c === void 0 ? void 0 : _c.extendLine) {
|
|
10165
|
-
drawExtendedLine();
|
|
10166
|
-
}
|
|
10167
|
-
}));
|
|
10168
|
-
u.exit().remove();
|
|
10169
|
-
}
|
|
10170
|
-
const drawExtendedLine = () => {
|
|
10171
|
-
context.selectAll(`[data-extended-id='${seriesIndex}']`).remove();
|
|
10172
|
-
const p1 = points[0];
|
|
10173
|
-
const p2 = points[points.length - 1];
|
|
10174
|
-
const distance = Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p2.y, 2));
|
|
10175
|
-
if (distance <= 0) {
|
|
10176
|
-
return;
|
|
10177
|
-
}
|
|
10178
|
-
const extendLength = 50;
|
|
10179
|
-
const extendedEndX = p2.x + ((p2.x - p1.x) / distance) * extendLength;
|
|
10180
|
-
const extendedEndY = p2.y + ((p2.y - p1.y) / distance) * extendLength;
|
|
10181
|
-
const extendedStartX = p1.x - ((p2.x - p1.x) / distance) * extendLength;
|
|
10182
|
-
const extendedStartY = p1.y - ((p2.y - p1.y) / distance) * extendLength;
|
|
10183
|
-
context
|
|
10184
|
-
.append('line')
|
|
10185
|
-
.attr('class', 'extendedLine')
|
|
10186
|
-
.attr('data-extended-id', seriesIndex)
|
|
10187
|
-
.attr('stroke', series === null || series === void 0 ? void 0 : series.color)
|
|
10188
|
-
.attr('stroke-width', series === null || series === void 0 ? void 0 : series.strokeWidth)
|
|
10189
|
-
.attr('stroke-dasharray', series === null || series === void 0 ? void 0 : series.strokeDasharray)
|
|
10190
|
-
.attr('x1', scaleX(p1.x))
|
|
10191
|
-
.attr('y1', scaleY(p1.y))
|
|
10192
|
-
.attr('x2', scaleX(extendedStartX))
|
|
10193
|
-
.attr('y2', scaleY(extendedStartY));
|
|
10194
|
-
context
|
|
10195
|
-
.append('line')
|
|
10196
|
-
.attr('class', 'extendedLine')
|
|
10197
|
-
.attr('data-extended-id', seriesIndex)
|
|
10198
|
-
.attr('stroke', series === null || series === void 0 ? void 0 : series.color)
|
|
10199
|
-
.attr('stroke-width', series === null || series === void 0 ? void 0 : series.strokeWidth)
|
|
10200
|
-
.attr('stroke-dasharray', series === null || series === void 0 ? void 0 : series.strokeDasharray)
|
|
10201
|
-
.attr('x1', scaleX(p2.x))
|
|
10202
|
-
.attr('y1', scaleY(p2.y))
|
|
10203
|
-
.attr('x2', scaleX(extendedEndX))
|
|
10204
|
-
.attr('y2', scaleY(extendedEndY));
|
|
10205
|
-
};
|
|
10206
|
-
if (((_p = series === null || series === void 0 ? void 0 : series.drag) === null || _p === void 0 ? void 0 : _p.extendLine) && (points === null || points === void 0 ? void 0 : points.length)) {
|
|
10207
|
-
drawExtendedLine();
|
|
10208
|
-
}
|
|
10209
|
-
if (markerPoints === null || markerPoints === void 0 ? void 0 : markerPoints.length) {
|
|
10210
|
-
const emit = (event, target) => {
|
|
10211
|
-
this.dispatch.apply(DispatchType.movePoint, {
|
|
10212
|
-
target: series,
|
|
10213
|
-
point: Object.assign({}, target),
|
|
10214
|
-
event,
|
|
10215
|
-
});
|
|
10216
|
-
};
|
|
10217
|
-
context
|
|
10218
|
-
.selectAll(`draggable-marker-${seriesIndex}`)
|
|
10219
|
-
.data(markerPoints)
|
|
10220
|
-
.enter()
|
|
10221
|
-
.append('circle')
|
|
10222
|
-
.attr('class', `draggable-marker-${seriesIndex}`)
|
|
10223
|
-
.attr('r', (d) => { var _a, _b; return ((_b = (_a = d.marker) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.radius) || 5; })
|
|
10224
|
-
.attr('cx', function (d) {
|
|
10225
|
-
return scaleX(d.x);
|
|
10226
|
-
})
|
|
10227
|
-
.attr('cy', function (d) {
|
|
10228
|
-
return scaleY(d.y);
|
|
10229
|
-
})
|
|
10230
|
-
.style('cursor', 'pointer')
|
|
10231
|
-
.style('fill', (d) => { var _a, _b; return ((_b = (_a = d.marker) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.color) || 'none'; })
|
|
10232
|
-
.attr('stroke', (d) => { var _a, _b; return ((_b = (_a = d.marker) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.stroke) || 'none'; })
|
|
10233
|
-
.attr('stroke-width', (d) => { var _a, _b; return ((_b = (_a = d.marker) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.strokeWidth) || 0; });
|
|
10234
|
-
context.selectAll(`.draggable-marker-${seriesIndex}`).call(d3.drag().on('drag start end', function dragged(event, d) {
|
|
10235
|
-
var _a, _b, _c, _d;
|
|
10236
|
-
const node = d3.select(this);
|
|
10237
|
-
if (event.type === 'start') {
|
|
10238
|
-
node.raise().classed('active', true);
|
|
10239
|
-
}
|
|
10240
|
-
if (((_a = d.marker) === null || _a === void 0 ? void 0 : _a.dragType) === DragPointType.x) {
|
|
10241
|
-
d.x = scaleX.invert((_b = event.sourceEvent) === null || _b === void 0 ? void 0 : _b.offsetX);
|
|
10242
|
-
node.attr('cx', scaleX(d.x));
|
|
10243
|
-
}
|
|
10244
|
-
if (((_c = d.marker) === null || _c === void 0 ? void 0 : _c.dragType) === DragPointType.y) {
|
|
10245
|
-
d.y = scaleY.invert((_d = event.sourceEvent) === null || _d === void 0 ? void 0 : _d.offsetY);
|
|
10246
|
-
node.attr('cy', scaleY(d.y));
|
|
10247
|
-
}
|
|
10248
|
-
context.select(`.series-${seriesIndex}`).attr('d', path);
|
|
10249
|
-
emit(event, d);
|
|
10250
|
-
}));
|
|
10251
|
-
}
|
|
10252
|
-
}
|
|
10253
|
-
}
|
|
10254
|
-
|
|
10255
|
-
class PieDrawer {
|
|
10256
|
-
draw(series, context, scaleX, scaleY) { }
|
|
10257
|
-
}
|
|
10258
|
-
|
|
10259
|
-
class SplineDrawer {
|
|
10260
|
-
draw(series, context, scaleX, scaleY) {
|
|
10261
|
-
const points = series.data;
|
|
10262
|
-
const path = d3
|
|
10263
|
-
.line()
|
|
10264
|
-
.curve(d3.curveCatmullRom)
|
|
10265
|
-
.defined((d) => d.x != null && d.y != null)
|
|
10266
|
-
.x((d) => scaleX(d.x))
|
|
10267
|
-
.y((d) => scaleY(d.y));
|
|
10268
|
-
context
|
|
10269
|
-
.append('path')
|
|
10270
|
-
.attr('transform', `translate(${0}, 0)`)
|
|
10271
|
-
.attr('fill', 'none')
|
|
10272
|
-
.attr('stroke', series.color)
|
|
10273
|
-
.attr('stroke-width', series.strokeWidth ? series.strokeWidth : 1)
|
|
10274
|
-
.datum(points)
|
|
10275
|
-
.attr('d', path)
|
|
10276
|
-
.transition()
|
|
10277
|
-
.duration(750);
|
|
10278
|
-
}
|
|
10279
|
-
}
|
|
10280
|
-
|
|
10281
|
-
class ScatterDrawer {
|
|
10282
|
-
constructor() {
|
|
10283
|
-
this._colorToData = {};
|
|
10284
|
-
}
|
|
10285
|
-
draw(series, context, scaleX, scaleY, options) {
|
|
10286
|
-
this._options = options;
|
|
10287
|
-
d3.select(context.node().parentNode).select('.virtual-canvas').remove();
|
|
10288
|
-
if (series.renderTo === 'canvas') {
|
|
10289
|
-
this._context = context;
|
|
10290
|
-
const height = context.node().clientHeight;
|
|
10291
|
-
const width = context.node().clientWidth;
|
|
10292
|
-
const points = series.data;
|
|
10293
|
-
const context2D = context.node().getContext('2d');
|
|
10294
|
-
this._virtualCanvas = d3
|
|
10295
|
-
.select(context.node().parentNode)
|
|
10296
|
-
.append('canvas')
|
|
10297
|
-
.attr('class', 'virtual-canvas')
|
|
10298
|
-
.style('display', 'none');
|
|
10299
|
-
this._virtualCanvas.attr('width', width).attr('height', height);
|
|
10300
|
-
const virtualContext = this._virtualCanvas.node().getContext('2d');
|
|
10301
|
-
context.on('mouseout', () => {
|
|
10302
|
-
d3.select(this._context.node().parentNode)
|
|
10303
|
-
.select('.tooltip-chart')
|
|
10304
|
-
.style('display', 'none');
|
|
10305
|
-
context.on('mousemove', null);
|
|
10306
|
-
});
|
|
10307
|
-
context.on('mouseenter', () => {
|
|
10308
|
-
d3.select(this._context.node().parentNode)
|
|
10309
|
-
.select('.tooltip-chart')
|
|
10310
|
-
.style('display', null);
|
|
10311
|
-
context.on('mousemove', (e) => this.handleMouseMove(e));
|
|
10312
|
-
});
|
|
10313
|
-
points.forEach((d, idx) => {
|
|
10314
|
-
const color = this.getColor(idx);
|
|
10315
|
-
this._colorToData[color] = d;
|
|
10316
|
-
virtualContext.fillStyle = color;
|
|
10317
|
-
context2D.fillStyle = d.color;
|
|
10318
|
-
const cx = scaleX(d.x);
|
|
10319
|
-
const cy = scaleY(d.y);
|
|
10320
|
-
context2D.beginPath();
|
|
10321
|
-
context2D.arc(cx, cy, d.radius, 0, 2 * Math.PI);
|
|
10322
|
-
context2D.closePath();
|
|
10323
|
-
context2D.fill();
|
|
10324
|
-
virtualContext.beginPath();
|
|
10325
|
-
virtualContext.arc(cx, cy, d.radius, 0, 2 * Math.PI);
|
|
10326
|
-
virtualContext.closePath();
|
|
10327
|
-
virtualContext.fill();
|
|
10328
|
-
});
|
|
10329
|
-
}
|
|
10330
|
-
}
|
|
10331
|
-
getColor(index) {
|
|
10332
|
-
return d3
|
|
10333
|
-
.rgb(Math.floor(index / 256 / 256) % 256, Math.floor(index / 256) % 256, index % 256)
|
|
10334
|
-
.toString();
|
|
10335
|
-
}
|
|
10336
|
-
tooltipPosition(event) {
|
|
10337
|
-
const centerX = this._context.node().clientWidth / 2;
|
|
10338
|
-
const centerY = this._context.node().clientHeight / 2;
|
|
10339
|
-
const padding = { x: 10, y: 10 };
|
|
10340
|
-
const scene = {
|
|
10341
|
-
left: event.pageX > centerX ? 'initial' : `${event.pageX + padding.x}px`,
|
|
10342
|
-
top: event.pageY > centerY ? 'initial' : `${event.pageY + padding.y}px`,
|
|
10343
|
-
bottom: event.pageY > centerY
|
|
10344
|
-
? `${window.innerHeight - event.pageY}px`
|
|
10345
|
-
: 'initial',
|
|
10346
|
-
right: event.pageX > centerX
|
|
10347
|
-
? `${window.innerWidth - event.pageX + padding.x}px`
|
|
10348
|
-
: 'initial',
|
|
10349
|
-
};
|
|
10350
|
-
return scene;
|
|
10351
|
-
}
|
|
10352
|
-
handleMouseMove(event) {
|
|
10353
|
-
var _a;
|
|
10354
|
-
const mouse = d3.pointer(event);
|
|
10355
|
-
const virtualContext = this._virtualCanvas.node().getContext('2d');
|
|
10356
|
-
const image = virtualContext.getImageData(mouse[0], mouse[1], 1, 1);
|
|
10357
|
-
const color = d3.rgb.apply(null, image.data).toString();
|
|
10358
|
-
const possibleDatum = this._colorToData[color];
|
|
10359
|
-
const { top, right, bottom, left } = this.tooltipPosition(event);
|
|
10360
|
-
if (possibleDatum) {
|
|
10361
|
-
const formatted = (_a = this._options.tooltip) === null || _a === void 0 ? void 0 : _a.format([possibleDatum]);
|
|
10362
|
-
d3.select(this._context.node().parentNode)
|
|
10363
|
-
.select('.tooltip-chart')
|
|
10364
|
-
.style('z-index', 3)
|
|
10365
|
-
.style('top', top)
|
|
10366
|
-
.style('right', right)
|
|
10367
|
-
.style('bottom', bottom)
|
|
10368
|
-
.style('left', left)
|
|
10369
|
-
.html(formatted);
|
|
10370
|
-
}
|
|
10371
|
-
}
|
|
10372
|
-
}
|
|
10373
|
-
|
|
10374
|
-
class ContourDrawer {
|
|
10375
|
-
draw(series, context, scaleX, scaleY) {
|
|
10376
|
-
const points = series.data;
|
|
10377
|
-
const tricontourFn = tricontour()
|
|
10378
|
-
.x((d) => scaleX(d.x))
|
|
10379
|
-
.y((d) => scaleY(d.y))
|
|
10380
|
-
.value((d) => d.value)
|
|
10381
|
-
.thresholds(30);
|
|
10382
|
-
let contours = tricontourFn(points);
|
|
10383
|
-
const geoFn = d3.geoPath();
|
|
10384
|
-
const color = series === null || series === void 0 ? void 0 : series.colorScale.domain(d3.extent(contours, (d) => d.value));
|
|
10385
|
-
contours = contours.map((_) => (Object.assign(Object.assign({}, _), { color: color(_.value) })));
|
|
10386
|
-
const u = context.selectAll('path').data(contours);
|
|
10387
|
-
u.enter()
|
|
10388
|
-
.append('path')
|
|
10389
|
-
.merge(u)
|
|
10390
|
-
.attr('d', (_) => geoFn(_))
|
|
10391
|
-
.attr('stroke', 'rgba(255, 255,255,0.5)')
|
|
10392
|
-
.attr('stroke-width', 0.5)
|
|
10393
|
-
.attr('fill', (_) => _.color);
|
|
10394
|
-
u.exit().remove();
|
|
10395
|
-
}
|
|
10396
|
-
}
|
|
10397
|
-
|
|
10398
|
-
const defaultDrawerMapping = new Map()
|
|
10399
|
-
.set(SeriesType.area, new AreaDrawer())
|
|
10400
|
-
.set(SeriesType.bar, new BarDrawer())
|
|
10401
|
-
.set(SeriesType.line, new LineDrawer())
|
|
10402
|
-
.set(SeriesType.pie, new PieDrawer())
|
|
10403
|
-
.set(SeriesType.scatter, new ScatterDrawer())
|
|
10404
|
-
.set(SeriesType.spline, new SplineDrawer())
|
|
10405
|
-
.set(SeriesType.contour, new ContourDrawer());
|
|
10406
|
-
|
|
10407
|
-
var LegendType;
|
|
10408
|
-
(function (LegendType) {
|
|
10409
|
-
LegendType[LegendType["swatches"] = 0] = "swatches";
|
|
10410
|
-
LegendType[LegendType["gradient"] = 1] = "gradient";
|
|
10411
|
-
})(LegendType || (LegendType = {}));
|
|
10412
|
-
|
|
10413
|
-
const classTypeLegendMapping = new Map()
|
|
10414
|
-
.set(SeriesType.line, 'line')
|
|
10415
|
-
.set(SeriesType.spline, 'line');
|
|
10416
|
-
class SwatchDrawer {
|
|
10417
|
-
draw(options) {
|
|
10418
|
-
var _a, _b;
|
|
10419
|
-
d3.select(options.context.parentElement)
|
|
10420
|
-
.select('.legend-container')
|
|
10421
|
-
.selectAll('.legend')
|
|
10422
|
-
.remove();
|
|
10423
|
-
const defaultData = (_a = options.series) === null || _a === void 0 ? void 0 : _a.filter((serie) => serie.type !== SeriesType.bar);
|
|
10424
|
-
const barData = (_b = options === null || options === void 0 ? void 0 : options.series) === null || _b === void 0 ? void 0 : _b.filter((serie) => serie.type === SeriesType.bar).reduce((acc, serie) => {
|
|
10425
|
-
const data = serie.data.map((_) => (Object.assign(Object.assign({}, _), { serieType: serie.type, serieIndex: serie.id })));
|
|
10426
|
-
return acc.concat(data);
|
|
10427
|
-
}, []);
|
|
10428
|
-
const legendContainer = d3
|
|
10429
|
-
.select(options.context.parentElement)
|
|
10430
|
-
.select('.legend-container')
|
|
10431
|
-
.append('div')
|
|
10432
|
-
.attr('class', 'legend padding-bottom-4');
|
|
10433
|
-
const defaultLegend = legendContainer
|
|
10434
|
-
.selectAll('div')
|
|
10435
|
-
.data(defaultData)
|
|
10436
|
-
.enter()
|
|
10437
|
-
.append('div')
|
|
10438
|
-
.attr('class', 'item')
|
|
10439
|
-
.style('user-select', 'none');
|
|
10440
|
-
const barLegend = legendContainer
|
|
10441
|
-
.selectAll('.bar')
|
|
10442
|
-
.data(barData)
|
|
10443
|
-
.enter()
|
|
10444
|
-
.append('div')
|
|
10445
|
-
.attr('class', 'item bar')
|
|
10446
|
-
.style('user-select', 'none');
|
|
10447
|
-
defaultLegend
|
|
10448
|
-
.append('div')
|
|
10449
|
-
.attr('class', (_) => classTypeLegendMapping.get(_.type) || 'swatch')
|
|
10450
|
-
.style('background', (_) => { var _a; return _.visible ? (_a = _.color) !== null && _a !== void 0 ? _a : 'black' : 'var(--color-text-10)'; });
|
|
10451
|
-
defaultLegend
|
|
10452
|
-
.append('div')
|
|
10453
|
-
.attr('class', 'label')
|
|
10454
|
-
.text((_) => { var _a; return (_a = _.name) !== null && _a !== void 0 ? _a : 'Без названия'; })
|
|
10455
|
-
.style('text-decoration', (_) => (_.visible ? 'unset' : 'line-through'));
|
|
10456
|
-
barLegend
|
|
10457
|
-
.append('div')
|
|
10458
|
-
.attr('class', 'swatch')
|
|
10459
|
-
.style('background', (_) => { var _a; return _.visible ? (_a = _.color) !== null && _a !== void 0 ? _a : 'black' : 'var(--color-text-10)'; });
|
|
10460
|
-
barLegend
|
|
10461
|
-
.append('div')
|
|
10462
|
-
.attr('class', 'label')
|
|
10463
|
-
.text((_) => { var _a; return (_a = _.label) !== null && _a !== void 0 ? _a : 'Без названия'; })
|
|
10464
|
-
.style('text-decoration', (_) => (_.visible ? 'unset' : 'line-through'));
|
|
10465
|
-
}
|
|
10466
|
-
}
|
|
10467
|
-
|
|
10468
|
-
class GradientDrawer {
|
|
10469
|
-
draw(options) {
|
|
10470
|
-
var _a, _b;
|
|
10471
|
-
const container = d3
|
|
10472
|
-
.select(options.context.parentElement)
|
|
10473
|
-
.select('.legend-container');
|
|
10474
|
-
container.selectAll('.gradient-legend').remove();
|
|
10475
|
-
const svg = container
|
|
10476
|
-
.append('svg')
|
|
10477
|
-
.attr('class', 'gradient-legend')
|
|
10478
|
-
.attr('width', options.width)
|
|
10479
|
-
.attr('height', 32);
|
|
10480
|
-
svg.selectAll('.legend-defs').remove();
|
|
10481
|
-
const extent = d3.extent((_a = options.series[0]) === null || _a === void 0 ? void 0 : _a.data, (d) => d.value);
|
|
10482
|
-
const defs = svg.append('defs').attr('class', 'legend-defs');
|
|
10483
|
-
const linearGradient = defs
|
|
10484
|
-
.append('linearGradient')
|
|
10485
|
-
.attr('id', 'legend-gradient');
|
|
10486
|
-
linearGradient
|
|
10487
|
-
.selectAll('stop')
|
|
10488
|
-
.data([...(_b = options.series[0]) === null || _b === void 0 ? void 0 : _b.data].reverse())
|
|
10489
|
-
.enter()
|
|
10490
|
-
.append('stop')
|
|
10491
|
-
.attr('offset', (d) => ((d.value - extent[0]) / (extent[1] - extent[0])) * 100 + '%')
|
|
10492
|
-
.attr('stop-color', (d) => d.color);
|
|
10493
|
-
const g = svg.append('g').attr('class', 'gradient-legend');
|
|
10494
|
-
g.append('rect')
|
|
10495
|
-
.attr('width', options.width - 80)
|
|
10496
|
-
.attr('transform', 'translate(40, 0)')
|
|
10497
|
-
.attr('height', 4)
|
|
10498
|
-
.style('fill', 'url(#legend-gradient)');
|
|
10499
|
-
const xScale = d3
|
|
10500
|
-
.scaleLinear()
|
|
10501
|
-
.range([80, options.width - 80])
|
|
10502
|
-
.domain(extent)
|
|
10503
|
-
.nice();
|
|
10504
|
-
const tickCount = options.width / 80;
|
|
10505
|
-
const xAxis = d3.axisBottom(xScale).tickSize(8).ticks(tickCount);
|
|
10506
|
-
g.call(xAxis).call((node) => {
|
|
10507
|
-
node.select('.domain').remove();
|
|
10508
|
-
node.selectAll('line').remove();
|
|
10509
|
-
});
|
|
10510
|
-
}
|
|
10511
|
-
}
|
|
10512
|
-
|
|
10513
|
-
const defaultLegendDrawerMapping = new Map()
|
|
10514
|
-
.set(LegendType.swatches, new SwatchDrawer())
|
|
10515
|
-
.set(LegendType.gradient, new GradientDrawer());
|
|
10516
|
-
|
|
10517
|
-
var AxisType;
|
|
10518
|
-
(function (AxisType) {
|
|
10519
|
-
AxisType[AxisType["abscissa"] = 0] = "abscissa";
|
|
10520
|
-
AxisType[AxisType["ordinatus"] = 1] = "ordinatus";
|
|
10521
|
-
})(AxisType || (AxisType = {}));
|
|
10522
|
-
|
|
10523
|
-
class Axis {
|
|
10524
|
-
constructor(options) {
|
|
10525
|
-
this._extents = [0, 0];
|
|
10526
|
-
this._type = options === null || options === void 0 ? void 0 : options.type;
|
|
10527
|
-
this._index = (options === null || options === void 0 ? void 0 : options.index) || 0;
|
|
10528
|
-
this._chartOptions = options === null || options === void 0 ? void 0 : options.chartOptions;
|
|
10529
|
-
this._height = options === null || options === void 0 ? void 0 : options.height;
|
|
10530
|
-
if (this._chartOptions == null) {
|
|
10531
|
-
throw new Error(`No chartOptions for axis ${AxisType[this._type]}`);
|
|
10532
|
-
}
|
|
10533
|
-
this.createExtents();
|
|
10534
|
-
this.width = this.calculateAxisWidth();
|
|
10535
|
-
}
|
|
10536
|
-
get index() {
|
|
10537
|
-
return this._index;
|
|
10538
|
-
}
|
|
10539
|
-
get options() {
|
|
10540
|
-
return this._type === AxisType.abscissa
|
|
10541
|
-
? this._chartOptions.xAxis[this.index]
|
|
10542
|
-
: this._chartOptions.yAxis[this.index];
|
|
10543
|
-
}
|
|
10544
|
-
get extent() {
|
|
10545
|
-
return this._extents;
|
|
10546
|
-
}
|
|
10547
|
-
get type() {
|
|
10548
|
-
return this._type;
|
|
10549
|
-
}
|
|
10550
|
-
get offset() {
|
|
10551
|
-
return this._offset;
|
|
10552
|
-
}
|
|
10553
|
-
get ticks() {
|
|
10554
|
-
return this._ticks;
|
|
10555
|
-
}
|
|
10556
|
-
setOffset(offset) {
|
|
10557
|
-
this._offset = offset;
|
|
10558
|
-
}
|
|
10559
|
-
calculateAxisWidth() {
|
|
10560
|
-
if (this.type === AxisType.abscissa) {
|
|
10561
|
-
return 0;
|
|
10562
|
-
}
|
|
10563
|
-
const y = d3
|
|
10564
|
-
.scaleLinear()
|
|
10565
|
-
.domain([this.extent[0], this.extent[1]])
|
|
10566
|
-
.range([0, this._height])
|
|
10567
|
-
.nice();
|
|
10568
|
-
const body = d3
|
|
10569
|
-
.select('body')
|
|
10570
|
-
.append('svg')
|
|
10571
|
-
.attr('class', 'calculate-offset')
|
|
10572
|
-
.style('position', 'absolute')
|
|
10573
|
-
.style('left', '-9999px');
|
|
10574
|
-
const axis = d3.axisRight(y).tickValues(this.ticks);
|
|
10575
|
-
const element = body.append('g').attr('class', 'font-caption').call(axis);
|
|
10576
|
-
const bBox = element.node().getBBox();
|
|
10577
|
-
d3.selectAll('.calculate-offset').remove();
|
|
10578
|
-
return bBox.width;
|
|
10579
|
-
}
|
|
10580
|
-
createExtents() {
|
|
10581
|
-
var _a, _b, _c, _d, _e, _f;
|
|
10582
|
-
const hasMin = ((_a = this.options) === null || _a === void 0 ? void 0 : _a.min) != null;
|
|
10583
|
-
const hasMax = ((_b = this.options) === null || _b === void 0 ? void 0 : _b.max) != null;
|
|
10584
|
-
if (!hasMin || !hasMax) {
|
|
10585
|
-
const filtered = (_d = (_c = this._chartOptions) === null || _c === void 0 ? void 0 : _c.series) === null || _d === void 0 ? void 0 : _d.filter((serie) => this._index ===
|
|
10586
|
-
serie[this._type === AxisType.abscissa ? 'xAxisIndex' : 'yAxisIndex']);
|
|
10587
|
-
const raw = filtered.map((series) => d3.extent(series === null || series === void 0 ? void 0 : series.data, (point) => this._type === AxisType.abscissa ? point.x : point.y));
|
|
10588
|
-
const merged = [].concat(...(raw !== null && raw !== void 0 ? raw : []));
|
|
10589
|
-
const abs = (num) => Math.abs(num);
|
|
10590
|
-
this._extents = this.options.negative
|
|
10591
|
-
? [-Math.abs(d3.max(merged.map(abs))), d3.max(merged.map(abs))]
|
|
10592
|
-
: [d3.min(merged), d3.max(merged)];
|
|
10593
|
-
}
|
|
10594
|
-
if (hasMin) {
|
|
10595
|
-
this._extents[0] = (_e = this.options) === null || _e === void 0 ? void 0 : _e.min;
|
|
10596
|
-
}
|
|
10597
|
-
if (hasMax) {
|
|
10598
|
-
this._extents[1] = (_f = this.options) === null || _f === void 0 ? void 0 : _f.max;
|
|
10599
|
-
}
|
|
10600
|
-
}
|
|
10601
|
-
}
|
|
10602
|
-
Axis.offsetFactor = 22;
|
|
10603
|
-
|
|
10604
|
-
var ScaleType;
|
|
10605
|
-
(function (ScaleType) {
|
|
10606
|
-
ScaleType[ScaleType["linear"] = 0] = "linear";
|
|
10607
|
-
ScaleType[ScaleType["log"] = 1] = "log";
|
|
10608
|
-
ScaleType[ScaleType["pow"] = 2] = "pow";
|
|
10609
|
-
ScaleType[ScaleType["sqrt"] = 3] = "sqrt";
|
|
10610
|
-
ScaleType[ScaleType["time"] = 4] = "time";
|
|
10611
|
-
})(ScaleType || (ScaleType = {}));
|
|
10612
|
-
|
|
10613
|
-
var ZoomType;
|
|
10614
|
-
(function (ZoomType) {
|
|
10615
|
-
ZoomType[ZoomType["x"] = 0] = "x";
|
|
10616
|
-
ZoomType[ZoomType["y"] = 1] = "y";
|
|
10617
|
-
ZoomType[ZoomType["xy"] = 2] = "xy";
|
|
10618
|
-
})(ZoomType || (ZoomType = {}));
|
|
10619
|
-
|
|
10620
|
-
class TetaChart {
|
|
10621
|
-
constructor(options, element) {
|
|
10622
|
-
this.plotLinesMove$ = new Subject();
|
|
10623
|
-
this.plotBandsMove$ = new Subject();
|
|
10624
|
-
this.seriesMove$ = new Subject();
|
|
10625
|
-
this.pointMove$ = new Subject();
|
|
10626
|
-
this.zoom$ = new Subject();
|
|
10627
|
-
this._container = null;
|
|
10628
|
-
this._width = 0;
|
|
10629
|
-
this._height = 0;
|
|
10630
|
-
this._zoomYCache = new Map();
|
|
10631
|
-
this._zoomXCache = new Map();
|
|
10632
|
-
this._zoom = d3.zoom();
|
|
10633
|
-
this.visibleChartWindowWidth = 0;
|
|
10634
|
-
this._xScales = new Map();
|
|
10635
|
-
this._yScales = new Map();
|
|
10636
|
-
this._clonedX = new Map();
|
|
10637
|
-
this._clonedY = new Map();
|
|
10638
|
-
this.offsetOpposite = 0;
|
|
10639
|
-
this.offsetNonOpposite = 0;
|
|
10640
|
-
this._zoomAdded = false;
|
|
10641
|
-
this._options = options;
|
|
10642
|
-
this.selectNode(element);
|
|
10643
|
-
this.createTooltip();
|
|
10644
|
-
this.plotLinesMove = this.plotLinesMove$.asObservable();
|
|
10645
|
-
this.plotBandsMove = this.plotBandsMove$.asObservable();
|
|
10646
|
-
this.seriesMove = this.seriesMove$.asObservable();
|
|
10647
|
-
this.pointMove = this.pointMove$.asObservable();
|
|
10648
|
-
this.zoom = this.zoom$.asObservable();
|
|
10649
|
-
}
|
|
10650
|
-
redraw(options) {
|
|
10651
|
-
if (options) {
|
|
10652
|
-
this._options = options;
|
|
10653
|
-
}
|
|
10654
|
-
this.createAxis();
|
|
10655
|
-
this.createScales();
|
|
10656
|
-
this.createMarkers();
|
|
10657
|
-
this.createVisibleWindow();
|
|
10658
|
-
this._redraw();
|
|
10659
|
-
this.drawLegend();
|
|
10660
|
-
if (this._commonZoomTransform) {
|
|
10661
|
-
this._chart.call(this._zoom.transform, this._commonZoomTransform);
|
|
10662
|
-
}
|
|
10663
|
-
if (!this._zoomAdded) {
|
|
10664
|
-
this.addZoom();
|
|
10665
|
-
this._zoomAdded = true;
|
|
10666
|
-
}
|
|
10667
|
-
this.addAxesZoom();
|
|
10668
|
-
}
|
|
10669
|
-
setZoom(zoom) {
|
|
10670
|
-
var _a;
|
|
10671
|
-
if (!this._zoom) {
|
|
10672
|
-
return;
|
|
10673
|
-
}
|
|
10674
|
-
this._chart.call(this._zoom.transform, (_a = zoom === null || zoom === void 0 ? void 0 : zoom.zoomTransform) !== null && _a !== void 0 ? _a : zoomIdentity);
|
|
10675
|
-
}
|
|
10676
|
-
setSize(size = { width: 0, height: 0 }) {
|
|
10677
|
-
this._height = size.height;
|
|
10678
|
-
this._width = size.width;
|
|
10679
|
-
this._chart.attr('width', this._width).attr('height', this._height);
|
|
10680
|
-
this._canvas.attr('width', this._width).attr('height', this._height);
|
|
10681
|
-
const extent = [
|
|
10682
|
-
[
|
|
10683
|
-
this.offsetNonOpposite
|
|
10684
|
-
? this.offsetNonOpposite
|
|
10685
|
-
: this._options.bounds.left,
|
|
10686
|
-
this._options.bounds.top,
|
|
10687
|
-
],
|
|
10688
|
-
[
|
|
10689
|
-
this._width -
|
|
10690
|
-
(this.offsetOpposite
|
|
10691
|
-
? this.offsetOpposite
|
|
10692
|
-
: this._options.bounds.right),
|
|
10693
|
-
this._height - this._options.bounds.bottom,
|
|
10694
|
-
],
|
|
10695
|
-
];
|
|
10696
|
-
this._zoom
|
|
10697
|
-
.scaleExtent([1, Infinity])
|
|
10698
|
-
.translateExtent(extent)
|
|
10699
|
-
.extent(extent);
|
|
10700
|
-
}
|
|
10701
|
-
createVisibleWindow() {
|
|
10702
|
-
this.uniqId = (Date.now() + Math.random()).toString(36);
|
|
10703
|
-
this._chart.selectAll('defs').remove();
|
|
10704
|
-
this._chart
|
|
10705
|
-
.append('defs')
|
|
10706
|
-
.append('clipPath')
|
|
10707
|
-
.attr('id', `draw-window-${this.uniqId}`)
|
|
10708
|
-
.append('rect')
|
|
10709
|
-
.attr('x', this.offsetNonOpposite === 0
|
|
10710
|
-
? this._options.bounds.left
|
|
10711
|
-
: this.offsetNonOpposite)
|
|
10712
|
-
.attr('y', this._options.bounds.top)
|
|
10713
|
-
.attr('width', this.visibleChartWindowWidth + 1)
|
|
10714
|
-
.attr('height', this._height -
|
|
10715
|
-
this._options.bounds.bottom -
|
|
10716
|
-
this._options.bounds.top +
|
|
10717
|
-
1 >
|
|
10718
|
-
0
|
|
10719
|
-
? this._height -
|
|
10720
|
-
this._options.bounds.bottom -
|
|
10721
|
-
this._options.bounds.top +
|
|
10722
|
-
1
|
|
10723
|
-
: 0);
|
|
10724
|
-
}
|
|
10725
|
-
createAxis() {
|
|
10726
|
-
this._xAxisList = this._options.xAxis.map((_, index) => new Axis({
|
|
10727
|
-
type: AxisType.abscissa,
|
|
10728
|
-
index,
|
|
10729
|
-
chartOptions: this._options,
|
|
10730
|
-
}));
|
|
10731
|
-
this._yAxisList = this._options.yAxis.map((_, index) => {
|
|
10732
|
-
const axis = new Axis({
|
|
10733
|
-
type: AxisType.ordinatus,
|
|
10734
|
-
index,
|
|
10735
|
-
chartOptions: this._options,
|
|
10736
|
-
height: this._height,
|
|
10737
|
-
});
|
|
10738
|
-
return axis;
|
|
10739
|
-
});
|
|
10740
|
-
const nonTitleOffset = 6;
|
|
10741
|
-
this.offsetNonOpposite = d3.reduce(this._yAxisList.filter((_) => { var _a, _b; return ((_a = _.options) === null || _a === void 0 ? void 0 : _a.opposite) !== true && ((_b = _.options) === null || _b === void 0 ? void 0 : _b.visible); }), (sum, axis) => {
|
|
10742
|
-
var _a;
|
|
10743
|
-
const offset = sum +
|
|
10744
|
-
axis.width +
|
|
10745
|
-
(((_a = axis === null || axis === void 0 ? void 0 : axis.options) === null || _a === void 0 ? void 0 : _a.title) ? Axis.offsetFactor : nonTitleOffset);
|
|
10746
|
-
axis.setOffset(offset);
|
|
10747
|
-
return offset;
|
|
10748
|
-
}, 0);
|
|
10749
|
-
this.offsetOpposite = d3.reduce(this._yAxisList.filter((_) => { var _a, _b; return ((_a = _.options) === null || _a === void 0 ? void 0 : _a.opposite) === true && ((_b = _.options) === null || _b === void 0 ? void 0 : _b.visible); }), (sum, axis) => {
|
|
10750
|
-
var _a;
|
|
10751
|
-
const offset = sum +
|
|
10752
|
-
axis.width +
|
|
10753
|
-
(((_a = axis === null || axis === void 0 ? void 0 : axis.options) === null || _a === void 0 ? void 0 : _a.title) ? Axis.offsetFactor : nonTitleOffset);
|
|
10754
|
-
axis.setOffset(offset);
|
|
10755
|
-
return offset;
|
|
10756
|
-
}, 0);
|
|
10757
|
-
this.visibleChartWindowWidth = this.caluclateChartWidth();
|
|
10758
|
-
}
|
|
10759
|
-
_redraw() {
|
|
10760
|
-
this.drawPlotBands();
|
|
10761
|
-
this.drawPlotLines();
|
|
10762
|
-
this.drawChart();
|
|
10763
|
-
this.drawAxis();
|
|
10764
|
-
this.drawGridLines();
|
|
10765
|
-
this.drawAnnotations();
|
|
10766
|
-
}
|
|
10767
|
-
addZoom() {
|
|
10768
|
-
var _a, _b;
|
|
10769
|
-
if ((_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.zoom) === null || _b === void 0 ? void 0 : _b.enable) {
|
|
10770
|
-
const hasXZoom = [ZoomType.x, ZoomType.xy].includes(this._options.zoom.zoomType);
|
|
10771
|
-
const hasYZoom = [ZoomType.y, ZoomType.xy].includes(this._options.zoom.zoomType);
|
|
10772
|
-
this._chart.call(this._zoom.on('start end zoom', (event) => {
|
|
10773
|
-
if (hasXZoom) {
|
|
10774
|
-
for (const [key, value] of this._clonedX.entries()) {
|
|
10775
|
-
const rescaled = event.transform.rescaleX(value);
|
|
10776
|
-
this._xScales.set(key, rescaled);
|
|
10777
|
-
if (event.sourceEvent) {
|
|
10778
|
-
this.zoom$.next({
|
|
10779
|
-
domain: rescaled.domain(),
|
|
10780
|
-
zoomTransform: event.transform,
|
|
10781
|
-
zoomType: ZoomType.x,
|
|
10782
|
-
event,
|
|
10783
|
-
});
|
|
10784
|
-
}
|
|
10785
|
-
}
|
|
10786
|
-
}
|
|
10787
|
-
if (hasYZoom) {
|
|
10788
|
-
for (const [key, value] of this._clonedY.entries()) {
|
|
10789
|
-
const rescaled = event.transform.rescaleY(value);
|
|
10790
|
-
this._yScales.set(key, rescaled);
|
|
10791
|
-
if (event.type === 'zoom') {
|
|
10792
|
-
if (event.sourceEvent) {
|
|
10793
|
-
this.zoom$.next({
|
|
10794
|
-
domain: rescaled.domain(),
|
|
10795
|
-
zoomTransform: event.transform,
|
|
10796
|
-
zoomType: ZoomType.y,
|
|
10797
|
-
event,
|
|
10798
|
-
});
|
|
10799
|
-
}
|
|
10800
|
-
}
|
|
10801
|
-
}
|
|
10802
|
-
}
|
|
10803
|
-
if (event.type === 'end') {
|
|
10804
|
-
this._commonZoomTransform = event.transform;
|
|
10805
|
-
}
|
|
10806
|
-
this._redraw();
|
|
10807
|
-
}));
|
|
10808
|
-
}
|
|
10809
|
-
}
|
|
10810
|
-
addAxesZoom() {
|
|
10811
|
-
this._chart.selectAll('.zoom-behavior').remove();
|
|
10812
|
-
[...this._yAxisList, ...this._xAxisList]
|
|
10813
|
-
.filter((axis) => axis.options.visible && axis.options.zoom)
|
|
10814
|
-
.forEach((axis) => {
|
|
10815
|
-
const foundNode = this._chart
|
|
10816
|
-
.select(`[data-${axis.type === AxisType.abscissa ? 'x' : 'y'}-scale-id='${axis.index}']`)
|
|
10817
|
-
.node();
|
|
10818
|
-
if (!foundNode) {
|
|
10819
|
-
return;
|
|
10820
|
-
}
|
|
10821
|
-
const bBox = foundNode.getBBox();
|
|
10822
|
-
const translateX = axis.type === AxisType.abscissa
|
|
10823
|
-
? this.offsetNonOpposite
|
|
10824
|
-
? this.offsetNonOpposite
|
|
10825
|
-
: this._options.bounds.left + this.offsetNonOpposite
|
|
10826
|
-
: axis.options.opposite
|
|
10827
|
-
? this._width - axis.offset
|
|
10828
|
-
: axis.offset - bBox.width;
|
|
10829
|
-
const zoom = d3
|
|
10830
|
-
.zoom()
|
|
10831
|
-
.scaleExtent([1, Infinity])
|
|
10832
|
-
.on('zoom end', (event) => {
|
|
10833
|
-
if (axis.type === AxisType.abscissa) {
|
|
10834
|
-
const scale = this._clonedX.get(axis.index);
|
|
10835
|
-
this._xScales.set(axis.index, event.transform.rescaleX(scale));
|
|
10836
|
-
}
|
|
10837
|
-
else {
|
|
10838
|
-
const scale = this._clonedY.get(axis.index);
|
|
10839
|
-
this._yScales.set(axis.index, event.transform.rescaleY(scale));
|
|
10840
|
-
}
|
|
10841
|
-
if (event.type === 'end') {
|
|
10842
|
-
if (axis.type === AxisType.ordinatus) {
|
|
10843
|
-
this._zoomYCache.set(axis.index, event.transform);
|
|
10844
|
-
}
|
|
10845
|
-
if (axis.type === AxisType.abscissa) {
|
|
10846
|
-
this._zoomXCache.set(axis.index, event.transform);
|
|
10847
|
-
this._chart.call(this._zoom.transform, event.transform);
|
|
10848
|
-
}
|
|
10849
|
-
}
|
|
10850
|
-
this._redraw();
|
|
10851
|
-
});
|
|
10852
|
-
const restoredTransform = axis.type === AxisType.ordinatus
|
|
10853
|
-
? this._zoomYCache.get(axis.index)
|
|
10854
|
-
: this._zoomXCache.get(axis.index);
|
|
10855
|
-
this._chart
|
|
10856
|
-
.append('rect')
|
|
10857
|
-
.attr('class', 'zoom-behavior')
|
|
10858
|
-
.attr('height', bBox.height)
|
|
10859
|
-
.attr('width', bBox.width)
|
|
10860
|
-
.attr('transform', `translate(${translateX}, ${axis.type === AxisType.abscissa
|
|
10861
|
-
? this._height - this._options.bounds.bottom
|
|
10862
|
-
: this._options.bounds.top})`)
|
|
10863
|
-
.style('opacity', '0')
|
|
10864
|
-
.style('pointer-events', 'all')
|
|
10865
|
-
.call(zoom.transform, restoredTransform !== null && restoredTransform !== void 0 ? restoredTransform : d3.zoomIdentity)
|
|
10866
|
-
.call(zoom);
|
|
10867
|
-
});
|
|
10868
|
-
}
|
|
10869
|
-
selectNode(element) {
|
|
10870
|
-
this._container = element;
|
|
10871
|
-
d3.select(element.nativeElement).selectAll('.tooltip-chart').remove();
|
|
10872
|
-
d3.select(element.nativeElement).selectAll('svg').remove();
|
|
10873
|
-
d3.select(element.nativeElement).selectAll('canvas').remove();
|
|
10874
|
-
this._chart = d3
|
|
10875
|
-
.select(element.nativeElement)
|
|
10876
|
-
.append('svg')
|
|
10877
|
-
.attr('position', 'relative')
|
|
10878
|
-
.style('z-index', 0);
|
|
10879
|
-
this._canvas = d3
|
|
10880
|
-
.select(element.nativeElement)
|
|
10881
|
-
.append('canvas')
|
|
10882
|
-
.attr('class', 'main-canvas')
|
|
10883
|
-
.style('transform', 'translate(35, 0)')
|
|
10884
|
-
.style('position', 'absolute')
|
|
10885
|
-
.style('z-index', 1);
|
|
10886
|
-
}
|
|
10887
|
-
drawAnnotations() {
|
|
10888
|
-
var _a;
|
|
10889
|
-
this._chart.selectAll('.annotations').remove();
|
|
10890
|
-
const annotations = (_a = this._options.annotations) === null || _a === void 0 ? void 0 : _a.map((annotation) => {
|
|
10891
|
-
var _a, _b;
|
|
10892
|
-
const x = this._xScales.get(annotation.xAxisIndex);
|
|
10893
|
-
const y = this._yScales.get(annotation.yAxisIndex);
|
|
10894
|
-
return {
|
|
10895
|
-
note: annotation.note,
|
|
10896
|
-
connector: annotation.connector,
|
|
10897
|
-
x: x((_a = annotation.point) === null || _a === void 0 ? void 0 : _a.x),
|
|
10898
|
-
y: y((_b = annotation.point) === null || _b === void 0 ? void 0 : _b.y),
|
|
10899
|
-
dx: annotation.dx,
|
|
10900
|
-
dy: annotation.dy,
|
|
10901
|
-
type: annotation.type,
|
|
10902
|
-
className: annotation.className,
|
|
10903
|
-
};
|
|
10904
|
-
});
|
|
10905
|
-
const makeAnnotations = d3annotation
|
|
10906
|
-
.annotation()
|
|
10907
|
-
.annotations(annotations !== null && annotations !== void 0 ? annotations : []);
|
|
10908
|
-
this._chart
|
|
10909
|
-
.append('g')
|
|
10910
|
-
.attr('class', 'annotations')
|
|
10911
|
-
.attr('clip-path', `url(#draw-window-${this.uniqId})`)
|
|
10912
|
-
.call(makeAnnotations)
|
|
10913
|
-
.lower();
|
|
10914
|
-
}
|
|
10915
|
-
drawPlotLines() {
|
|
10916
|
-
this._chart.selectAll('.plotlines').remove();
|
|
10917
|
-
const plotlineGroup = this._chart
|
|
10918
|
-
.append('g')
|
|
10919
|
-
.attr('class', 'plotlines')
|
|
10920
|
-
.style('shape-rendering', 'crispEdges')
|
|
10921
|
-
.attr('clip-path', `url(#draw-window-${this.uniqId})`);
|
|
10922
|
-
this._xAxisList
|
|
10923
|
-
.filter((_) => _.options.plotLines.length > 0)
|
|
10924
|
-
.forEach((axis) => {
|
|
10925
|
-
const [min, max] = axis.extent;
|
|
10926
|
-
const x = this._xScales.get(axis.index);
|
|
10927
|
-
const plotlinesPoints = axis.options.plotLines;
|
|
10928
|
-
const getTextCenterPointPx = (d, idx) => {
|
|
10929
|
-
var _a;
|
|
10930
|
-
return x(((d === null || d === void 0 ? void 0 : d.value) +
|
|
10931
|
-
(plotlinesPoints[idx - 1]
|
|
10932
|
-
? (_a = plotlinesPoints[idx - 1]) === null || _a === void 0 ? void 0 : _a.value
|
|
10933
|
-
: 0)) /
|
|
10934
|
-
2);
|
|
10935
|
-
};
|
|
10936
|
-
const opacity = (d, idx) => {
|
|
10937
|
-
var _a;
|
|
10938
|
-
const displayWidth = 20;
|
|
10939
|
-
const width = x(d === null || d === void 0 ? void 0 : d.value) -
|
|
10940
|
-
x(plotlinesPoints[idx - 1] ? (_a = plotlinesPoints[idx - 1]) === null || _a === void 0 ? void 0 : _a.value : 0);
|
|
10941
|
-
return width <= displayWidth ? 0 : 1;
|
|
10942
|
-
};
|
|
10943
|
-
plotlineGroup
|
|
10944
|
-
.selectAll('.label')
|
|
10945
|
-
.data(plotlinesPoints)
|
|
10946
|
-
.join('text')
|
|
10947
|
-
.attr('class', 'label font-body-3 fill-text-70')
|
|
10948
|
-
.attr('x', getTextCenterPointPx)
|
|
10949
|
-
.attr('y', (d) => this._height / 2)
|
|
10950
|
-
.attr('text-anchor', 'middle')
|
|
10951
|
-
.attr('dominant-baseline', 'central')
|
|
10952
|
-
.attr('transform', (d, idx) => `rotate(-90, ${getTextCenterPointPx(d, idx)}, ${this._height / 2})`)
|
|
10953
|
-
.text((d) => { var _a; return (_a = d === null || d === void 0 ? void 0 : d.label) !== null && _a !== void 0 ? _a : ''; })
|
|
10954
|
-
.style('opacity', opacity);
|
|
10955
|
-
plotlineGroup
|
|
10956
|
-
.selectAll('.plotline')
|
|
10957
|
-
.data(plotlinesPoints)
|
|
10958
|
-
.join('line')
|
|
10959
|
-
.attr('class', 'plotline')
|
|
10960
|
-
.attr('data-plotline-id', (d) => d.id)
|
|
10961
|
-
.attr('x1', (d) => x(d.value))
|
|
10962
|
-
.attr('x2', (d) => x(d.value))
|
|
10963
|
-
.attr('y1', 0)
|
|
10964
|
-
.attr('y2', this._height -
|
|
10965
|
-
this._options.bounds.top -
|
|
10966
|
-
this._options.bounds.bottom)
|
|
10967
|
-
.attr('transform', `translate(0, ${this._options.bounds.top})`)
|
|
10968
|
-
.style('stroke-width', (d) => d.width)
|
|
10969
|
-
.style('stroke', (d) => d.color)
|
|
10970
|
-
.style('stroke-dasharray', (d) => (d.dashed ? '8, 8' : '0, 0'));
|
|
10971
|
-
const emit = (event, plotLine) => {
|
|
10972
|
-
this.plotLinesMove$.next({ event, target: plotLine });
|
|
10973
|
-
};
|
|
10974
|
-
plotlineGroup
|
|
10975
|
-
.selectAll('.drag-plotline')
|
|
10976
|
-
.data(plotlinesPoints)
|
|
10977
|
-
.join('line')
|
|
10978
|
-
.attr('class', 'drag-plotline')
|
|
10979
|
-
.attr('x1', (d) => x(d.value))
|
|
10980
|
-
.attr('x2', (d) => x(d.value))
|
|
10981
|
-
.attr('y1', 0)
|
|
10982
|
-
.attr('y2', this._height -
|
|
10983
|
-
this._options.bounds.top -
|
|
10984
|
-
this._options.bounds.bottom)
|
|
10985
|
-
.attr('transform', `translate(0, ${this._options.bounds.top})`)
|
|
10986
|
-
.style('stroke-width', 8)
|
|
10987
|
-
.style('stroke', 'rgba(0, 0, 0, 0)')
|
|
10988
|
-
.style('cursor', 'col-resize')
|
|
10989
|
-
.call(d3
|
|
10990
|
-
.drag()
|
|
10991
|
-
.on('drag', function (event, d) {
|
|
10992
|
-
var _a, _b;
|
|
10993
|
-
const group = d3.select(this).node().parentElement;
|
|
10994
|
-
const draggedPlotLine = d3
|
|
10995
|
-
.select(group)
|
|
10996
|
-
.select(`[data-plotline-id='${d.id}']`);
|
|
10997
|
-
d.value = x.invert(event.x);
|
|
10998
|
-
const minValue = (_a = d.min) !== null && _a !== void 0 ? _a : min;
|
|
10999
|
-
const maxValue = (_b = d.max) !== null && _b !== void 0 ? _b : max;
|
|
11000
|
-
const borderLeftReached = d.value <= minValue;
|
|
11001
|
-
const borderRightReached = d.value >= maxValue;
|
|
11002
|
-
if (borderLeftReached) {
|
|
11003
|
-
d.value = minValue;
|
|
11004
|
-
}
|
|
11005
|
-
if (borderRightReached) {
|
|
11006
|
-
d.value = maxValue;
|
|
11007
|
-
}
|
|
11008
|
-
d3.select(this).attr('x1', x(d.value)).attr('x2', x(d.value));
|
|
11009
|
-
draggedPlotLine.attr('x1', x(d.value)).attr('x2', x(d.value));
|
|
11010
|
-
emit(event, d);
|
|
11011
|
-
})
|
|
11012
|
-
.on('end', (event, d) => {
|
|
11013
|
-
emit(event, d);
|
|
11014
|
-
}));
|
|
11015
|
-
});
|
|
11016
|
-
this._yAxisList
|
|
11017
|
-
.filter((_) => _.options.plotLines.length > 0)
|
|
11018
|
-
.forEach((axis) => {
|
|
11019
|
-
const [min, max] = axis.extent;
|
|
11020
|
-
const y = this._yScales.get(axis.index);
|
|
11021
|
-
const plotlinesPoints = axis.options.plotLines;
|
|
11022
|
-
plotlineGroup
|
|
11023
|
-
.selectAll('.plotline')
|
|
11024
|
-
.data(plotlinesPoints)
|
|
11025
|
-
.join('line')
|
|
11026
|
-
.attr('class', 'plotline')
|
|
11027
|
-
.attr('data-plotline-id', (d) => d.id)
|
|
11028
|
-
.attr('y1', (d) => y(d.value))
|
|
11029
|
-
.attr('y2', (d) => y(d.value))
|
|
11030
|
-
.attr('x1', 0)
|
|
11031
|
-
.attr('x2', this._width - this._options.bounds.left - this._options.bounds.right)
|
|
11032
|
-
.attr('transform', `translate(${this._options.bounds.left}, 0)`)
|
|
11033
|
-
.style('stroke-width', (d) => d.width)
|
|
11034
|
-
.style('stroke', (d) => d.color)
|
|
11035
|
-
.style('stroke-dasharray', (d) => (d.dashed ? '8, 8' : '0, 0'));
|
|
11036
|
-
const emit = (event, plotLine) => {
|
|
11037
|
-
this.plotLinesMove$.next({ event, target: plotLine });
|
|
11038
|
-
};
|
|
11039
|
-
plotlineGroup
|
|
11040
|
-
.selectAll('.drag-plotline')
|
|
11041
|
-
.data(plotlinesPoints)
|
|
11042
|
-
.join('line')
|
|
11043
|
-
.attr('class', 'drag-plotline')
|
|
11044
|
-
.attr('y1', (d) => y(d.value))
|
|
11045
|
-
.attr('y2', (d) => y(d.value))
|
|
11046
|
-
.attr('x1', 0)
|
|
11047
|
-
.attr('x2', this._width - this._options.bounds.left - this._options.bounds.right)
|
|
11048
|
-
.attr('transform', `translate(${this._options.bounds.left}, 0)`)
|
|
11049
|
-
.style('stroke-width', 8)
|
|
11050
|
-
.style('stroke', 'rgba(0, 0, 0, 0)')
|
|
11051
|
-
.style('cursor', 'row-resize')
|
|
11052
|
-
.call(d3
|
|
11053
|
-
.drag()
|
|
11054
|
-
.on('drag', function (event, d) {
|
|
11055
|
-
var _a, _b;
|
|
11056
|
-
const group = d3.select(this).node().parentElement;
|
|
11057
|
-
const draggedPlotLine = d3
|
|
11058
|
-
.select(group)
|
|
11059
|
-
.select(`[data-plotline-id='${d.id}']`);
|
|
11060
|
-
d.value = y.invert(event.y);
|
|
11061
|
-
const minValue = (_a = d.min) !== null && _a !== void 0 ? _a : min;
|
|
11062
|
-
const maxValue = (_b = d.max) !== null && _b !== void 0 ? _b : max;
|
|
11063
|
-
const borderTopReached = d.value <= minValue;
|
|
11064
|
-
const borderBottomReached = d.value >= maxValue;
|
|
11065
|
-
if (borderTopReached) {
|
|
11066
|
-
d.value = minValue;
|
|
11067
|
-
}
|
|
11068
|
-
if (borderBottomReached) {
|
|
11069
|
-
d.value = maxValue;
|
|
11070
|
-
}
|
|
11071
|
-
d3.select(this).attr('y1', y(d.value)).attr('y2', y(d.value));
|
|
11072
|
-
draggedPlotLine.attr('y1', y(d.value)).attr('y2', y(d.value));
|
|
11073
|
-
emit(event, d);
|
|
11074
|
-
})
|
|
11075
|
-
.on('end', (event, d) => {
|
|
11076
|
-
emit(event, d);
|
|
11077
|
-
}));
|
|
11078
|
-
});
|
|
11079
|
-
}
|
|
11080
|
-
drawPlotBands() {
|
|
11081
|
-
this._chart.selectAll('.plotbands').remove();
|
|
11082
|
-
const plotBandGroup = this._chart
|
|
11083
|
-
.append('g')
|
|
11084
|
-
.attr('class', 'plotbands')
|
|
11085
|
-
.attr('clip-path', `url(#draw-window-${this.uniqId})`);
|
|
11086
|
-
this._xAxisList
|
|
11087
|
-
.filter((_) => _.options.plotBands.length > 0)
|
|
11088
|
-
.forEach((axis) => {
|
|
11089
|
-
const x = this._xScales.get(axis.index);
|
|
11090
|
-
const [min, max] = axis.extent;
|
|
11091
|
-
const plotband = plotBandGroup
|
|
11092
|
-
.append('g')
|
|
11093
|
-
.style('shape-rendering', 'crispEdges');
|
|
11094
|
-
const plotBandHeight = this._height - this._options.bounds.top - this._options.bounds.bottom;
|
|
11095
|
-
const emit = (event, plotBand) => {
|
|
11096
|
-
this.plotBandsMove$.next({
|
|
11097
|
-
event,
|
|
11098
|
-
target: plotBand,
|
|
11099
|
-
});
|
|
11100
|
-
};
|
|
11101
|
-
plotband
|
|
11102
|
-
.selectAll('rect')
|
|
11103
|
-
.data(axis.options.plotBands)
|
|
11104
|
-
.on('start', (_) => {
|
|
11105
|
-
this._chart.selectAll('.marker').style('display', 'none');
|
|
11106
|
-
d3.select(this._container.nativeElement)
|
|
11107
|
-
.select('.tooltip-chart')
|
|
11108
|
-
.style('display', 'none');
|
|
11109
|
-
})
|
|
11110
|
-
.join('rect')
|
|
11111
|
-
.attr('data-plotband-id', (d) => d.id)
|
|
11112
|
-
.attr('x', (d) => x(d.from))
|
|
11113
|
-
.attr('y', 0)
|
|
11114
|
-
.attr('width', (d) => Math.abs(x(d.to) - x(d.from)))
|
|
11115
|
-
.attr('fill', (d) => {
|
|
11116
|
-
if (d.image) {
|
|
11117
|
-
return `url(#${d.image})`;
|
|
11118
|
-
}
|
|
11119
|
-
return d.color;
|
|
11120
|
-
})
|
|
11121
|
-
.style('opacity', (d) => { var _a; return (_a = d.opacity) !== null && _a !== void 0 ? _a : 1; })
|
|
11122
|
-
.attr('height', plotBandHeight > 0 ? plotBandHeight : 0)
|
|
11123
|
-
.attr('transform', `translate(0, ${this._options.bounds.top})`);
|
|
11124
|
-
plotband
|
|
11125
|
-
.selectAll('.line-left')
|
|
11126
|
-
.data(axis.options.plotBands)
|
|
11127
|
-
.join('line')
|
|
11128
|
-
.attr('data-line-left-id', (d) => d.id)
|
|
11129
|
-
.attr('class', 'line-left')
|
|
11130
|
-
.attr('x1', (d) => x(d.from))
|
|
11131
|
-
.attr('x2', (d) => x(d.from))
|
|
11132
|
-
.attr('y1', 0)
|
|
11133
|
-
.attr('y2', this._height -
|
|
11134
|
-
this._options.bounds.top -
|
|
11135
|
-
this._options.bounds.bottom)
|
|
11136
|
-
.attr('transform', `translate(0, ${this._options.bounds.top})`)
|
|
11137
|
-
.style('stroke-width', 1)
|
|
11138
|
-
.style('stroke-dasharray', '8, 8')
|
|
11139
|
-
.style('stroke', 'var(--color-text-90)')
|
|
11140
|
-
.style('opacity', (d) => (d.showGrabbers ? 1 : 0));
|
|
11141
|
-
plotband
|
|
11142
|
-
.selectAll('.drag-left')
|
|
11143
|
-
.data(axis.options.plotBands)
|
|
11144
|
-
.join('line')
|
|
11145
|
-
.attr('x1', (d) => x(d.from))
|
|
11146
|
-
.attr('x2', (d) => x(d.from))
|
|
11147
|
-
.attr('y1', 0)
|
|
11148
|
-
.attr('y2', this._height -
|
|
11149
|
-
this._options.bounds.top -
|
|
11150
|
-
this._options.bounds.bottom)
|
|
11151
|
-
.style('display', (d) => ((d === null || d === void 0 ? void 0 : d.resizable) ? 'unset' : 'none'))
|
|
11152
|
-
.attr('transform', `translate(0, ${this._options.bounds.top})`)
|
|
11153
|
-
.style('stroke-width', 8)
|
|
11154
|
-
.style('stroke', 'rgba(0, 0, 0, 0)')
|
|
11155
|
-
.style('cursor', 'col-resize')
|
|
11156
|
-
.call(d3
|
|
11157
|
-
.drag()
|
|
11158
|
-
.on('drag', function (event, d) {
|
|
11159
|
-
var _a;
|
|
11160
|
-
const group = d3.select(this).node().parentElement;
|
|
11161
|
-
const draggedBand = d3
|
|
11162
|
-
.select(group)
|
|
11163
|
-
.select(`[data-plotband-id='${d.id}']`);
|
|
11164
|
-
const draggedLine = d3
|
|
11165
|
-
.select(group)
|
|
11166
|
-
.select(`[data-line-left-id='${d.id}']`);
|
|
11167
|
-
d.from = x.invert(event.x);
|
|
11168
|
-
const minValue = (_a = d.min) !== null && _a !== void 0 ? _a : min;
|
|
11169
|
-
const borderReached = d.from <= minValue;
|
|
11170
|
-
if (borderReached) {
|
|
11171
|
-
d.from = minValue;
|
|
11172
|
-
}
|
|
11173
|
-
if (d.from >= d.to) {
|
|
11174
|
-
d.from = d.to;
|
|
11175
|
-
}
|
|
11176
|
-
d3.select(this).attr('x1', x(d.from)).attr('x2', x(d.from));
|
|
11177
|
-
draggedBand
|
|
11178
|
-
.attr('x', x(d.from))
|
|
11179
|
-
.attr('width', x(d.to) - x(d.from));
|
|
11180
|
-
draggedLine.attr('x1', x(d.from)).attr('x2', x(d.from));
|
|
11181
|
-
emit(event, d);
|
|
11182
|
-
})
|
|
11183
|
-
.on('end', (event, d) => emit(event, d)));
|
|
11184
|
-
plotband
|
|
11185
|
-
.selectAll('.line-right')
|
|
11186
|
-
.data(axis.options.plotBands)
|
|
11187
|
-
.join('line')
|
|
11188
|
-
.attr('data-line-right-id', (d) => d.id)
|
|
11189
|
-
.attr('class', 'line-right')
|
|
11190
|
-
.attr('x1', (d) => x(d.to))
|
|
11191
|
-
.attr('x2', (d) => x(d.to))
|
|
11192
|
-
.attr('y1', 0)
|
|
11193
|
-
.attr('y2', this._height -
|
|
11194
|
-
this._options.bounds.top -
|
|
11195
|
-
this._options.bounds.bottom)
|
|
11196
|
-
.attr('transform', `translate(0, ${this._options.bounds.top})`)
|
|
11197
|
-
.style('stroke-width', 1)
|
|
11198
|
-
.style('stroke-dasharray', '8, 8')
|
|
11199
|
-
.style('stroke', 'var(--color-text-90)')
|
|
11200
|
-
.style('opacity', (d) => (d.showGrabbers ? 1 : 0));
|
|
11201
|
-
plotband
|
|
11202
|
-
.selectAll('.drag-right')
|
|
11203
|
-
.data(axis.options.plotBands)
|
|
11204
|
-
.join('line')
|
|
11205
|
-
.attr('class', 'drag-right')
|
|
11206
|
-
.style('display', (d) => ((d === null || d === void 0 ? void 0 : d.resizable) ? 'unset' : 'none'))
|
|
11207
|
-
.attr('x1', (d) => x(d.to))
|
|
11208
|
-
.attr('x2', (d) => x(d.to))
|
|
11209
|
-
.attr('y1', 0)
|
|
11210
|
-
.attr('y2', this._height -
|
|
11211
|
-
this._options.bounds.top -
|
|
11212
|
-
this._options.bounds.bottom)
|
|
11213
|
-
.attr('transform', `translate(0, ${this._options.bounds.top})`)
|
|
11214
|
-
.style('stroke-width', 8)
|
|
11215
|
-
.style('stroke', 'rgba(0, 0, 0, 0)')
|
|
11216
|
-
.style('cursor', 'col-resize')
|
|
11217
|
-
.call(d3
|
|
11218
|
-
.drag()
|
|
11219
|
-
.on('drag', function (event, d) {
|
|
11220
|
-
var _a;
|
|
11221
|
-
const group = d3.select(this).node().parentElement;
|
|
11222
|
-
const draggedBand = d3
|
|
11223
|
-
.select(group)
|
|
11224
|
-
.select(`[data-plotband-id='${d.id}']`);
|
|
11225
|
-
const draggedLine = d3
|
|
11226
|
-
.select(group)
|
|
11227
|
-
.select(`[data-line-right-id='${d.id}']`);
|
|
11228
|
-
d.to = x.invert(event.x);
|
|
11229
|
-
const maxValue = (_a = d.max) !== null && _a !== void 0 ? _a : max;
|
|
11230
|
-
const borderReached = d.to >= maxValue;
|
|
11231
|
-
if (borderReached) {
|
|
11232
|
-
d.to = maxValue;
|
|
11233
|
-
}
|
|
11234
|
-
if (d.to <= d.from) {
|
|
11235
|
-
d.to = d.from;
|
|
11236
|
-
}
|
|
11237
|
-
d3.select(this).attr('x1', x(d.to)).attr('x2', x(d.to));
|
|
11238
|
-
draggedBand.attr('width', x(d.to) - x(d.from));
|
|
11239
|
-
draggedLine.attr('x1', x(d.to)).attr('x2', x(d.to));
|
|
11240
|
-
emit(event, d);
|
|
11241
|
-
})
|
|
11242
|
-
.on('end', (event, d) => emit(event, d)));
|
|
11243
|
-
});
|
|
11244
|
-
this._yAxisList
|
|
11245
|
-
.filter((_) => _.options.plotBands.length > 0)
|
|
11246
|
-
.forEach((axis) => {
|
|
11247
|
-
const y = this._yScales.get(axis.index);
|
|
11248
|
-
const [min, max] = axis.extent;
|
|
11249
|
-
const plotband = plotBandGroup
|
|
11250
|
-
.append('g')
|
|
11251
|
-
.style('shape-rendering', 'crispEdges');
|
|
11252
|
-
const plotBandWidth = this._width - this._options.bounds.left - this._options.bounds.right; // TODO add multiaxis support width
|
|
11253
|
-
const emit = (event, plotBand) => {
|
|
11254
|
-
this.plotBandsMove$.next({
|
|
11255
|
-
event,
|
|
11256
|
-
target: plotBand,
|
|
11257
|
-
});
|
|
11258
|
-
};
|
|
11259
|
-
const dragPlotband = d3
|
|
11260
|
-
.drag()
|
|
11261
|
-
.subject(function () {
|
|
11262
|
-
const element = d3.select(this);
|
|
11263
|
-
return { y: element.attr('y') };
|
|
11264
|
-
})
|
|
11265
|
-
.on('start drag end', function (event, d) {
|
|
11266
|
-
var _a, _b;
|
|
11267
|
-
const element = d3.select(this);
|
|
11268
|
-
const height = parseFloat(element.attr('height'));
|
|
11269
|
-
d.to = y.invert(event.y + height);
|
|
11270
|
-
d.from = y.invert(event.y);
|
|
11271
|
-
const minValue = (_a = d.min) !== null && _a !== void 0 ? _a : min;
|
|
11272
|
-
const maxValue = (_b = d.max) !== null && _b !== void 0 ? _b : max;
|
|
11273
|
-
const borderReachedMin = d.from <= minValue;
|
|
11274
|
-
const borderReachedMax = d.to >= maxValue;
|
|
11275
|
-
if (borderReachedMin) {
|
|
11276
|
-
d.to = y.invert(y(minValue) + height);
|
|
11277
|
-
d.from = minValue;
|
|
11278
|
-
}
|
|
11279
|
-
if (borderReachedMax) {
|
|
11280
|
-
d.to = maxValue;
|
|
11281
|
-
d.from = y.invert(y(maxValue) - height);
|
|
11282
|
-
}
|
|
11283
|
-
element.attr('y', y(d.from));
|
|
11284
|
-
const group = element.node().parentElement;
|
|
11285
|
-
d3.select(group)
|
|
11286
|
-
.select(`[data-line-left-id='${d.id}']`)
|
|
11287
|
-
.attr('y1', y(d.from))
|
|
11288
|
-
.attr('y2', y(d.from));
|
|
11289
|
-
d3.select(group)
|
|
11290
|
-
.select(`[data-grab-left-id='${d.id}']`)
|
|
11291
|
-
.attr('y1', y(d.from))
|
|
11292
|
-
.attr('y2', y(d.from));
|
|
11293
|
-
d3.select(group)
|
|
11294
|
-
.select(`[data-line-right-id='${d.id}']`)
|
|
11295
|
-
.attr('y1', y(d.to))
|
|
11296
|
-
.attr('y2', y(d.to));
|
|
11297
|
-
d3.select(group)
|
|
11298
|
-
.select(`[data-grab-right-id='${d.id}']`)
|
|
11299
|
-
.attr('y1', y(d.to))
|
|
11300
|
-
.attr('y2', y(d.to));
|
|
11301
|
-
emit(event, d);
|
|
11302
|
-
});
|
|
11303
|
-
const leftGrabDrag = d3
|
|
11304
|
-
.drag()
|
|
11305
|
-
.on('drag', function (event, d) {
|
|
11306
|
-
var _a;
|
|
11307
|
-
const group = d3.select(this).node().parentElement;
|
|
11308
|
-
const draggedBand = d3
|
|
11309
|
-
.select(group)
|
|
11310
|
-
.select(`[data-plotband-id='${d.id}']`);
|
|
11311
|
-
const draggedLine = d3
|
|
11312
|
-
.select(group)
|
|
11313
|
-
.select(`[data-line-left-id='${d.id}']`);
|
|
11314
|
-
d.from = y.invert(event.y);
|
|
11315
|
-
const minValue = (_a = d.min) !== null && _a !== void 0 ? _a : min;
|
|
11316
|
-
const borderReached = d.from <= minValue;
|
|
11317
|
-
if (borderReached) {
|
|
11318
|
-
d.from = minValue;
|
|
11319
|
-
}
|
|
11320
|
-
if (d.from >= d.to) {
|
|
11321
|
-
d.from = d.to;
|
|
11322
|
-
}
|
|
11323
|
-
d3.select(this).attr('y1', y(d.from)).attr('y2', y(d.from));
|
|
11324
|
-
draggedBand
|
|
11325
|
-
.attr('y', y(d.from))
|
|
11326
|
-
.attr('height', Math.abs(y(d.to) - y(d.from)));
|
|
11327
|
-
draggedLine.attr('y1', y(d.from)).attr('y2', y(d.from));
|
|
11328
|
-
emit(event, d);
|
|
11329
|
-
})
|
|
11330
|
-
.on('end', (event, d) => emit(event, d));
|
|
11331
|
-
const rightGrabDrag = d3
|
|
11332
|
-
.drag()
|
|
11333
|
-
.on('drag', function (event, d) {
|
|
11334
|
-
var _a;
|
|
11335
|
-
const group = d3.select(this).node().parentElement;
|
|
11336
|
-
const draggedBand = d3
|
|
11337
|
-
.select(group)
|
|
11338
|
-
.select(`[data-plotband-id='${d.id}']`);
|
|
11339
|
-
const draggedLine = d3
|
|
11340
|
-
.select(group)
|
|
11341
|
-
.select(`[data-line-right-id='${d.id}']`);
|
|
11342
|
-
d.to = y.invert(event.y);
|
|
11343
|
-
const maxValue = (_a = d.max) !== null && _a !== void 0 ? _a : max;
|
|
11344
|
-
const borderReached = d.to >= maxValue;
|
|
11345
|
-
if (borderReached) {
|
|
11346
|
-
d.to = maxValue;
|
|
11347
|
-
}
|
|
11348
|
-
if (d.to <= d.from) {
|
|
11349
|
-
d.to = d.from;
|
|
11350
|
-
}
|
|
11351
|
-
d3.select(this).attr('y1', y(d.to)).attr('y2', y(d.to));
|
|
11352
|
-
draggedBand
|
|
11353
|
-
.attr('y', y(d.from))
|
|
11354
|
-
.attr('height', Math.abs(y(d.to) - y(d.from)));
|
|
11355
|
-
draggedLine.attr('y1', y(d.to)).attr('y2', y(d.to));
|
|
11356
|
-
emit(event, d);
|
|
11357
|
-
})
|
|
11358
|
-
.on('end', (event, d) => emit(event, d));
|
|
11359
|
-
plotband
|
|
11360
|
-
.selectAll('rect')
|
|
11361
|
-
.data(axis.options.plotBands)
|
|
11362
|
-
.join('rect')
|
|
11363
|
-
.attr('data-plotband-id', (d) => d.id)
|
|
11364
|
-
.attr('x', 0)
|
|
11365
|
-
.attr('y', (d) => y(d.from))
|
|
11366
|
-
.attr('width', (d) => plotBandWidth)
|
|
11367
|
-
.attr('fill', (d) => {
|
|
11368
|
-
if (d.image) {
|
|
11369
|
-
return `url(#${d.image})`;
|
|
11370
|
-
}
|
|
11371
|
-
return d.color;
|
|
11372
|
-
})
|
|
11373
|
-
.style('opacity', (d) => { var _a; return (_a = d.opacity) !== null && _a !== void 0 ? _a : 1; })
|
|
11374
|
-
.attr('height', (d) => Math.abs(y(d.to) - y(d.from)))
|
|
11375
|
-
.attr('cursor', (d) => (d.draggable ? 'move' : 'default'));
|
|
11376
|
-
plotband
|
|
11377
|
-
.selectAll('.line-left')
|
|
11378
|
-
.data(axis.options.plotBands.filter((d) => d.resizable))
|
|
11379
|
-
.join('line')
|
|
11380
|
-
.attr('data-line-left-id', (d) => d.id)
|
|
11381
|
-
.attr('class', 'line-left')
|
|
11382
|
-
.attr('y1', (d) => y(d.from))
|
|
11383
|
-
.attr('y2', (d) => y(d.from))
|
|
11384
|
-
.attr('x1', 0)
|
|
11385
|
-
.attr('x2', plotBandWidth)
|
|
11386
|
-
.style('stroke-width', 1)
|
|
11387
|
-
.style('stroke-dasharray', '8, 8')
|
|
11388
|
-
.style('stroke', 'var(--color-text-90)')
|
|
11389
|
-
.style('opacity', (d) => (d.showGrabbers ? 1 : 0));
|
|
11390
|
-
plotband
|
|
11391
|
-
.selectAll('.drag-left')
|
|
11392
|
-
.data(axis.options.plotBands.filter((d) => d.resizable))
|
|
11393
|
-
.join('line')
|
|
11394
|
-
.attr('data-grab-left-id', (d) => d.id)
|
|
11395
|
-
.attr('y1', (d) => y(d.from))
|
|
11396
|
-
.attr('y2', (d) => y(d.from))
|
|
11397
|
-
.attr('x1', 0)
|
|
11398
|
-
.attr('x2', plotBandWidth)
|
|
11399
|
-
.style('stroke-width', 8)
|
|
11400
|
-
.style('stroke', 'rgba(0, 0, 0, 0)')
|
|
11401
|
-
.style('cursor', (d) => (d.resizable ? 'row-resize' : 'default'));
|
|
11402
|
-
plotband
|
|
11403
|
-
.selectAll('.line-right')
|
|
11404
|
-
.data(axis.options.plotBands.filter((d) => d.resizable))
|
|
11405
|
-
.join('line')
|
|
11406
|
-
.attr('data-line-right-id', (d) => d.id)
|
|
11407
|
-
.attr('class', 'line-right')
|
|
11408
|
-
.attr('y1', (d) => y(d.to))
|
|
11409
|
-
.attr('y2', (d) => y(d.to))
|
|
11410
|
-
.attr('x1', 0)
|
|
11411
|
-
.attr('x2', plotBandWidth)
|
|
11412
|
-
.style('stroke-width', 1)
|
|
11413
|
-
.style('stroke-dasharray', '8, 8')
|
|
11414
|
-
.style('stroke', 'var(--color-text-90)')
|
|
11415
|
-
.style('opacity', (d) => (d.showGrabbers ? 1 : 0));
|
|
11416
|
-
plotband
|
|
11417
|
-
.selectAll('.drag-right')
|
|
11418
|
-
.data(axis.options.plotBands.filter((d) => d.resizable))
|
|
11419
|
-
.join('line')
|
|
11420
|
-
.attr('class', 'drag-right')
|
|
11421
|
-
.attr('data-grab-right-id', (d) => d.id)
|
|
11422
|
-
.attr('y1', (d) => y(d.to))
|
|
11423
|
-
.attr('y2', (d) => y(d.to))
|
|
11424
|
-
.attr('x1', 0)
|
|
11425
|
-
.attr('x2', plotBandWidth)
|
|
11426
|
-
.style('stroke-width', 8)
|
|
11427
|
-
.style('stroke', 'rgba(0, 0, 0, 0)')
|
|
11428
|
-
.style('cursor', (d) => (d.resizable ? 'row-resize' : 'default'));
|
|
11429
|
-
axis.options.plotBands.forEach((_) => {
|
|
11430
|
-
if (_.draggable) {
|
|
11431
|
-
plotband.select(`[data-plotband-id='${_.id}']`).call(dragPlotband);
|
|
11432
|
-
}
|
|
11433
|
-
if (_.resizable) {
|
|
11434
|
-
plotband.select(`[data-grab-left-id='${_.id}']`).call(leftGrabDrag);
|
|
11435
|
-
plotband
|
|
11436
|
-
.select(`[data-grab-right-id='${_.id}']`)
|
|
11437
|
-
.call(rightGrabDrag);
|
|
11438
|
-
}
|
|
11439
|
-
});
|
|
11440
|
-
});
|
|
11441
|
-
}
|
|
11442
|
-
drawChart() {
|
|
11443
|
-
var _a;
|
|
11444
|
-
const series = (_a = this._options.series) === null || _a === void 0 ? void 0 : _a.filter((_) => _.visible);
|
|
11445
|
-
this._chart.selectAll('.series').remove();
|
|
11446
|
-
if (!series || series.length < 1) {
|
|
11447
|
-
d3.select(this._container.nativeElement)
|
|
11448
|
-
.select('canvas')
|
|
11449
|
-
.style('display', 'none');
|
|
11450
|
-
}
|
|
11451
|
-
const group = this._chart
|
|
11452
|
-
.append('g')
|
|
11453
|
-
.attr('class', 'series')
|
|
11454
|
-
.attr('clip-path', `url(#draw-window-${this.uniqId})`);
|
|
11455
|
-
series === null || series === void 0 ? void 0 : series.forEach((seriesItem, index) => {
|
|
11456
|
-
var _a, _b;
|
|
11457
|
-
if (seriesItem.renderTo === 'canvas') {
|
|
11458
|
-
d3.select(this._container.nativeElement)
|
|
11459
|
-
.select('canvas')
|
|
11460
|
-
.style('display', null);
|
|
11461
|
-
d3.select(this._container.nativeElement)
|
|
11462
|
-
.select('svg')
|
|
11463
|
-
.style('position', 'absolute');
|
|
11464
|
-
}
|
|
11465
|
-
else {
|
|
11466
|
-
d3.select(this._container.nativeElement)
|
|
11467
|
-
.select('canvas')
|
|
11468
|
-
.style('display', 'none');
|
|
11469
|
-
}
|
|
11470
|
-
if (!this._xScales.has(seriesItem.xAxisIndex) ||
|
|
11471
|
-
!this._yScales.has(seriesItem.yAxisIndex)) {
|
|
11472
|
-
return;
|
|
11473
|
-
}
|
|
11474
|
-
const foundX = this._xScales.get(seriesItem.xAxisIndex);
|
|
11475
|
-
const foundY = this._yScales.get(seriesItem.yAxisIndex);
|
|
11476
|
-
const drawer = seriesItem.drawer != null
|
|
11477
|
-
? seriesItem.drawer
|
|
11478
|
-
: defaultDrawerMapping.get(seriesItem.type);
|
|
11479
|
-
if (!drawer) {
|
|
11480
|
-
throw new Error(`No drawer for series ${seriesItem.name}, type ${SeriesType[seriesItem.type]}`);
|
|
11481
|
-
}
|
|
11482
|
-
if (seriesItem.renderTo === 'canvas') {
|
|
11483
|
-
const context = this._canvas.node().getContext('2d');
|
|
11484
|
-
context.clearRect(0, 0, this._width, this._height);
|
|
11485
|
-
}
|
|
11486
|
-
let [xMin, xMax] = foundX.domain();
|
|
11487
|
-
let [yMin, yMax] = foundY.domain();
|
|
11488
|
-
xMin = xMin instanceof Date ? xMin.getTime() : xMin;
|
|
11489
|
-
xMax = xMax instanceof Date ? xMax.getTime() : xMax;
|
|
11490
|
-
yMin = yMin instanceof Date ? yMin.getTime() : yMin;
|
|
11491
|
-
yMax = yMax instanceof Date ? yMax.getTime() : yMax;
|
|
11492
|
-
const visiblePoints = (point, idx, arr) => (point.x <= xMax ||
|
|
11493
|
-
point.x1 <= xMax ||
|
|
11494
|
-
(arr[idx - 1] && arr[idx - 1].x <= xMax) ||
|
|
11495
|
-
(arr[idx - 1] && arr[idx - 1].x1 <= xMax)) &&
|
|
11496
|
-
(point.x >= xMin ||
|
|
11497
|
-
point.x1 >= xMin ||
|
|
11498
|
-
(arr[idx + 1] && arr[idx + 1].x >= xMin) ||
|
|
11499
|
-
(arr[idx + 1] && arr[idx + 1].x1 >= xMin)) &&
|
|
11500
|
-
(point.y <= yMax ||
|
|
11501
|
-
point.y1 <= yMax ||
|
|
11502
|
-
(arr[idx - 1] && arr[idx - 1].y <= yMax) ||
|
|
11503
|
-
(arr[idx - 1] && arr[idx - 1].y1 <= yMax)) &&
|
|
11504
|
-
(point.y >= yMin ||
|
|
11505
|
-
point.y1 >= yMin ||
|
|
11506
|
-
(arr[idx + 1] && arr[idx + 1].y >= yMin) ||
|
|
11507
|
-
(arr[idx + 1] && arr[idx + 1].y1 >= yMin));
|
|
11508
|
-
const filteredData = seriesItem.data; //.filter(visiblePoints);
|
|
11509
|
-
const serie = Object.assign(Object.assign({}, seriesItem), { data: filteredData });
|
|
11510
|
-
drawer.draw(serie, seriesItem.renderTo === 'canvas' ? this._canvas : group, foundX, foundY, this._options);
|
|
11511
|
-
const emit = (event) => {
|
|
11512
|
-
this.seriesMove$.next(event);
|
|
11513
|
-
};
|
|
11514
|
-
const emitPoint = (event) => {
|
|
11515
|
-
this.pointMove$.next(event);
|
|
11516
|
-
};
|
|
11517
|
-
(_a = drawer === null || drawer === void 0 ? void 0 : drawer.dispatch) === null || _a === void 0 ? void 0 : _a.on(DispatchType.moveLine, function () {
|
|
11518
|
-
emit(this);
|
|
11519
|
-
});
|
|
11520
|
-
(_b = drawer === null || drawer === void 0 ? void 0 : drawer.dispatch) === null || _b === void 0 ? void 0 : _b.on(DispatchType.movePoint, function () {
|
|
11521
|
-
emitPoint(this);
|
|
11522
|
-
});
|
|
11523
|
-
});
|
|
11524
|
-
}
|
|
11525
|
-
createTooltip() {
|
|
11526
|
-
d3.select(this._container.nativeElement)
|
|
11527
|
-
.append('div')
|
|
11528
|
-
.attr('class', 'tooltip-chart color-text-90 bg-background-50 shadow-2')
|
|
11529
|
-
.style('position', 'fixed')
|
|
11530
|
-
.style('top', 'unset')
|
|
11531
|
-
.style('right', 'unset')
|
|
11532
|
-
.style('bottom', 'unset')
|
|
11533
|
-
.style('left', 'unset')
|
|
11534
|
-
.style('pointer-events', 'none')
|
|
11535
|
-
.style('display', 'none');
|
|
11536
|
-
}
|
|
11537
|
-
handleMouseMove(options) {
|
|
11538
|
-
var _a, _b;
|
|
11539
|
-
const mouse = d3.pointer(options.event);
|
|
11540
|
-
const { top, right, bottom, left } = this.tooltipPosition(options.event);
|
|
11541
|
-
const tooltipsData = [];
|
|
11542
|
-
this._chart
|
|
11543
|
-
.select('.marker-line')
|
|
11544
|
-
.attr('transform', `translate(${0}, ${mouse[1] - 2})`);
|
|
11545
|
-
this._chart
|
|
11546
|
-
.selectAll('.marker')
|
|
11547
|
-
.attr('transform', (d) => {
|
|
11548
|
-
if (!d.data.length) {
|
|
11549
|
-
return;
|
|
11550
|
-
}
|
|
11551
|
-
if (!this._xScales.has(d.xAxisIndex) ||
|
|
11552
|
-
!this._yScales.has(d.yAxisIndex)) {
|
|
11553
|
-
return;
|
|
11554
|
-
}
|
|
11555
|
-
const foundX = this._xScales.get(d.xAxisIndex);
|
|
11556
|
-
const foundY = this._yScales.get(d.yAxisIndex);
|
|
11557
|
-
if (this._options.tooltip.tracking === 'x') {
|
|
11558
|
-
const [min, max] = foundX.domain();
|
|
11559
|
-
const filteredData = d.data.filter((point) => point.x <= max && point.x >= min);
|
|
11560
|
-
const sorted = [...filteredData].sort((a, b) => d3.ascending(a.x, b.x));
|
|
11561
|
-
const bisect = d3.bisector((dd) => dd.x).left;
|
|
11562
|
-
const x0 = foundX.invert(mouse[0]);
|
|
11563
|
-
const index = bisect(sorted, x0);
|
|
11564
|
-
const data = sorted[index] ? sorted[index] : sorted[index - 1];
|
|
11565
|
-
tooltipsData.push({
|
|
11566
|
-
point: data,
|
|
11567
|
-
color: d.color,
|
|
11568
|
-
name: d.name,
|
|
11569
|
-
});
|
|
11570
|
-
return `translate(${!isNaN(data === null || data === void 0 ? void 0 : data.x) && (data === null || data === void 0 ? void 0 : data.x) != null ? foundX(data.x) : -10}, ${!isNaN(data === null || data === void 0 ? void 0 : data.y) && (data === null || data === void 0 ? void 0 : data.y) != null ? foundY(data.y) : -10})`;
|
|
11571
|
-
}
|
|
11572
|
-
if (this._options.tooltip.tracking === 'y') {
|
|
11573
|
-
const sorted = [...d.data].sort((a, b) => d3.ascending(a.y, b.y));
|
|
11574
|
-
const bisect = d3.bisector((dd) => dd.y).left;
|
|
11575
|
-
const y0 = foundY.invert(mouse[1]);
|
|
11576
|
-
const index = bisect(sorted, y0, 0);
|
|
11577
|
-
const data = sorted[index] ? sorted[index] : sorted[index - 1];
|
|
11578
|
-
tooltipsData.push({
|
|
11579
|
-
point: data,
|
|
11580
|
-
color: d.color,
|
|
11581
|
-
name: d.name,
|
|
11582
|
-
});
|
|
11583
|
-
return `translate(${!isNaN(data === null || data === void 0 ? void 0 : data.x) && (data === null || data === void 0 ? void 0 : data.x) != null ? foundX(data.x) : -10}, ${!isNaN(data === null || data === void 0 ? void 0 : data.y) && (data === null || data === void 0 ? void 0 : data.y) != null ? foundY(data.y) : -10})`;
|
|
11584
|
-
}
|
|
11585
|
-
});
|
|
11586
|
-
if ((_a = this._options.tooltip) === null || _a === void 0 ? void 0 : _a.format) {
|
|
11587
|
-
const formatted = (_b = this._options.tooltip) === null || _b === void 0 ? void 0 : _b.format(tooltipsData);
|
|
11588
|
-
d3.select(this._container.nativeElement)
|
|
11589
|
-
.select('.tooltip-chart')
|
|
11590
|
-
.style('top', top)
|
|
11591
|
-
.style('right', right)
|
|
11592
|
-
.style('bottom', bottom)
|
|
11593
|
-
.style('left', left)
|
|
11594
|
-
.html(formatted);
|
|
11595
|
-
}
|
|
11596
|
-
}
|
|
11597
|
-
tooltipPosition(event) {
|
|
11598
|
-
const centerX = this._width / 2;
|
|
11599
|
-
const centerY = this._height / 2;
|
|
11600
|
-
const padding = { x: 10, y: 10 };
|
|
11601
|
-
const scene = {
|
|
11602
|
-
left: event.pageX > centerX ? 'initial' : `${event.pageX + padding.x}px`,
|
|
11603
|
-
top: event.pageY > centerY ? 'initial' : `${event.pageY + padding.y}px`,
|
|
11604
|
-
bottom: event.pageY > centerY
|
|
11605
|
-
? `${window.innerHeight - event.pageY}px`
|
|
11606
|
-
: 'initial',
|
|
11607
|
-
right: event.pageX > centerX
|
|
11608
|
-
? `${window.innerWidth - event.pageX + padding.x}px`
|
|
11609
|
-
: 'initial',
|
|
11610
|
-
};
|
|
11611
|
-
return scene;
|
|
11612
|
-
}
|
|
11613
|
-
createMarkers() {
|
|
11614
|
-
if (this._options.tooltip === undefined) {
|
|
11615
|
-
return;
|
|
11616
|
-
}
|
|
11617
|
-
if (!this._options.tooltip.enable) {
|
|
11618
|
-
return;
|
|
11619
|
-
}
|
|
11620
|
-
this._chart.selectAll('.marker').remove();
|
|
11621
|
-
this._chart.select('.marker-line').remove();
|
|
11622
|
-
this._chart
|
|
11623
|
-
.append('line')
|
|
11624
|
-
.attr('class', 'marker-line')
|
|
11625
|
-
.attr('x1', 35)
|
|
11626
|
-
.attr('x2', this._width)
|
|
11627
|
-
.style('stroke-width', 0.5)
|
|
11628
|
-
.style('stroke', 'var(--color-text-40)')
|
|
11629
|
-
.style('display', 'none');
|
|
11630
|
-
const { series } = this._options;
|
|
11631
|
-
if (!series) {
|
|
11632
|
-
return;
|
|
11633
|
-
}
|
|
11634
|
-
const markers = this._chart
|
|
11635
|
-
.selectAll()
|
|
11636
|
-
.data(series.filter((_) => _.visible));
|
|
11637
|
-
markers
|
|
11638
|
-
.enter()
|
|
11639
|
-
.append('circle')
|
|
11640
|
-
.attr('class', 'marker')
|
|
11641
|
-
.attr('pointer-events', 'none')
|
|
11642
|
-
.attr('r', 3)
|
|
11643
|
-
.attr('fill', (_, i) => _.color)
|
|
11644
|
-
.style('display', 'none');
|
|
11645
|
-
const mouseoutEvent = () => {
|
|
11646
|
-
this._chart.selectAll('.marker').style('display', 'none');
|
|
11647
|
-
this._chart.select('.marker-line').style('display', 'none');
|
|
11648
|
-
d3.select(this._container.nativeElement)
|
|
11649
|
-
.select('.tooltip-chart')
|
|
11650
|
-
.style('display', 'none');
|
|
11651
|
-
};
|
|
11652
|
-
const mouseMoveEvent = (event) => {
|
|
11653
|
-
const options = {
|
|
11654
|
-
event,
|
|
11655
|
-
series,
|
|
11656
|
-
};
|
|
11657
|
-
this.handleMouseMove(options);
|
|
11658
|
-
};
|
|
11659
|
-
const mouseOverEvent = () => {
|
|
11660
|
-
if (this._options.tooltip.showMarkers) {
|
|
11661
|
-
this._chart
|
|
11662
|
-
.selectAll('.marker')
|
|
11663
|
-
.style('display', (d) => {
|
|
11664
|
-
if (d.data.length) {
|
|
11665
|
-
return null;
|
|
11666
|
-
}
|
|
11667
|
-
return 'none';
|
|
11668
|
-
});
|
|
11669
|
-
}
|
|
11670
|
-
if (this._options.tooltip.showLine) {
|
|
11671
|
-
this._chart.select('.marker-line').style('display', null);
|
|
11672
|
-
}
|
|
11673
|
-
d3.select(this._container.nativeElement)
|
|
11674
|
-
.select('.tooltip-chart')
|
|
11675
|
-
.style('display', null);
|
|
11676
|
-
};
|
|
11677
|
-
this._chart
|
|
11678
|
-
.on('mouseover', mouseOverEvent)
|
|
11679
|
-
.on('mousemove', mouseMoveEvent)
|
|
11680
|
-
.on('mouseleave', mouseoutEvent);
|
|
11681
|
-
}
|
|
11682
|
-
drawLegend() {
|
|
11683
|
-
var _a, _b;
|
|
11684
|
-
if (((_a = this._options.legend) === null || _a === void 0 ? void 0 : _a.visible) === false) {
|
|
11685
|
-
return;
|
|
11686
|
-
}
|
|
11687
|
-
this._chart.selectAll('.legend').remove();
|
|
11688
|
-
const drawer = ((_b = this._options.legend) === null || _b === void 0 ? void 0 : _b.type)
|
|
11689
|
-
? defaultLegendDrawerMapping.get(this._options.legend.type)
|
|
11690
|
-
: defaultLegendDrawerMapping.get(LegendType.swatches);
|
|
11691
|
-
const context = this._container.nativeElement;
|
|
11692
|
-
if (!drawer) {
|
|
11693
|
-
throw new Error(`No drawer for legend
|
|
11694
|
-
}`);
|
|
11695
|
-
}
|
|
11696
|
-
drawer.draw({
|
|
11697
|
-
context,
|
|
11698
|
-
series: this._options.series.filter((_) => _.showInLegend),
|
|
11699
|
-
width: this._width,
|
|
11700
|
-
height: this._height,
|
|
11701
|
-
});
|
|
11702
|
-
}
|
|
11703
|
-
caluclateChartWidth() {
|
|
11704
|
-
let width = -this._width;
|
|
11705
|
-
if (this.offsetOpposite > 0) {
|
|
11706
|
-
width = -this._width + this.offsetOpposite + this.offsetNonOpposite;
|
|
11707
|
-
}
|
|
11708
|
-
if (this.offsetNonOpposite > 0) {
|
|
11709
|
-
width =
|
|
11710
|
-
-this._width + this._options.bounds.right + this.offsetNonOpposite;
|
|
11711
|
-
}
|
|
11712
|
-
if (this.offsetOpposite >= Axis.offsetFactor &&
|
|
11713
|
-
this.offsetNonOpposite === 0) {
|
|
11714
|
-
width = -this._width + this.offsetOpposite + this._options.bounds.left;
|
|
11715
|
-
}
|
|
11716
|
-
if (this.offsetOpposite > 0 && this.offsetNonOpposite > 0) {
|
|
11717
|
-
width = -this._width + this.offsetOpposite + this.offsetNonOpposite;
|
|
11718
|
-
}
|
|
11719
|
-
return Math.abs(width);
|
|
11720
|
-
}
|
|
11721
|
-
drawGridLines() {
|
|
11722
|
-
if (this._options.gridLines === false) {
|
|
11723
|
-
return;
|
|
11724
|
-
}
|
|
11725
|
-
const translateX = this.offsetNonOpposite > 0
|
|
11726
|
-
? this.offsetNonOpposite
|
|
11727
|
-
: this._options.bounds.left + this.offsetNonOpposite;
|
|
11728
|
-
this._chart.selectAll('.grid').remove();
|
|
11729
|
-
const yList = this._yAxisList.filter((_) => _.options.visible && !_.options.opposite);
|
|
11730
|
-
const y = (yList === null || yList === void 0 ? void 0 : yList.length) > 0
|
|
11731
|
-
? this._yScales.get(yList[yList.length - 1].index)
|
|
11732
|
-
: this._yScales.get(0);
|
|
11733
|
-
const x = this._xScales.get(0);
|
|
11734
|
-
if (!y || !x) {
|
|
11735
|
-
return;
|
|
11736
|
-
}
|
|
11737
|
-
const TICK_HEIGHT = 40;
|
|
11738
|
-
const TICK_WIDTH = 60;
|
|
11739
|
-
const tickCount = Math.round(this._height / TICK_HEIGHT);
|
|
11740
|
-
const tickCountX = Math.round(this._width / TICK_WIDTH);
|
|
11741
|
-
const gridY = this._chart
|
|
11742
|
-
.append('g')
|
|
11743
|
-
.attr('class', 'grid color-text-10')
|
|
11744
|
-
.style('shape-rendering', 'crispEdges');
|
|
11745
|
-
const gridlinesY = d3
|
|
11746
|
-
.axisLeft(y)
|
|
11747
|
-
.tickFormat('')
|
|
11748
|
-
.tickSize(-this.visibleChartWindowWidth);
|
|
11749
|
-
const hasBarSeriesType = this._options.series.some((_) => _.type === SeriesType.bar);
|
|
11750
|
-
if (!hasBarSeriesType) {
|
|
11751
|
-
const gridX = this._chart
|
|
11752
|
-
.append('g')
|
|
11753
|
-
.attr('class', 'grid color-text-10')
|
|
11754
|
-
.style('shape-rendering', 'crispEdges');
|
|
11755
|
-
const gridlinesX = d3
|
|
11756
|
-
.axisBottom(x)
|
|
11757
|
-
.ticks(tickCountX)
|
|
11758
|
-
.tickFormat('')
|
|
11759
|
-
.tickSize(this._height - this._options.bounds.bottom - this._options.bounds.top);
|
|
11760
|
-
gridX
|
|
11761
|
-
.call(gridlinesX)
|
|
11762
|
-
.attr('transform', `translate(0, ${this._options.bounds.top})`)
|
|
11763
|
-
.lower();
|
|
11764
|
-
}
|
|
11765
|
-
gridY
|
|
11766
|
-
.call(gridlinesY)
|
|
11767
|
-
.attr('transform', `translate(${translateX}, ${0})`)
|
|
11768
|
-
.lower();
|
|
11769
|
-
this._chart.selectAll('.grid path').remove();
|
|
11770
|
-
}
|
|
11771
|
-
createScales() {
|
|
11772
|
-
this._xScales.clear();
|
|
11773
|
-
this._yScales.clear();
|
|
11774
|
-
const defaultScaleMapping = new Map()
|
|
11775
|
-
.set(ScaleType.linear, d3.scaleLinear)
|
|
11776
|
-
.set(ScaleType.log, d3.scaleLog)
|
|
11777
|
-
.set(ScaleType.sqrt, d3.scaleSqrt)
|
|
11778
|
-
.set(ScaleType.pow, d3.scalePow);
|
|
11779
|
-
const xRange = [
|
|
11780
|
-
this.offsetNonOpposite
|
|
11781
|
-
? this.offsetNonOpposite
|
|
11782
|
-
: this._options.bounds.left,
|
|
11783
|
-
this._width -
|
|
11784
|
-
(this.offsetOpposite
|
|
11785
|
-
? this.offsetOpposite
|
|
11786
|
-
: this._options.bounds.right),
|
|
11787
|
-
];
|
|
11788
|
-
const yRange = [
|
|
11789
|
-
this._height - this._options.bounds.bottom,
|
|
11790
|
-
this._options.bounds.top,
|
|
11791
|
-
];
|
|
11792
|
-
this._xAxisList.forEach((axis, index) => {
|
|
11793
|
-
let scale = null;
|
|
11794
|
-
if (axis.options.type === Scale.time) {
|
|
11795
|
-
scale = d3
|
|
11796
|
-
.scaleTime()
|
|
11797
|
-
.domain(axis.extent)
|
|
11798
|
-
.range(axis.options.inverted ? [...xRange].reverse() : xRange);
|
|
11799
|
-
}
|
|
11800
|
-
if (axis.options.type === Scale.number) {
|
|
11801
|
-
scale = defaultScaleMapping
|
|
11802
|
-
.get(axis.options.scaleOptions.type)()
|
|
11803
|
-
.domain(axis.extent)
|
|
11804
|
-
.range(axis.options.inverted ? [...xRange].reverse() : xRange);
|
|
11805
|
-
}
|
|
11806
|
-
if (axis.options.niceTicks) {
|
|
11807
|
-
scale.nice();
|
|
11808
|
-
}
|
|
11809
|
-
if (axis.options.scaleOptions.type === ScaleType.log) {
|
|
11810
|
-
scale.base(axis.options.scaleOptions.base);
|
|
11811
|
-
}
|
|
11812
|
-
if (axis.options.scaleOptions.type === ScaleType.pow) {
|
|
11813
|
-
scale.exponent(axis.options.scaleOptions.base);
|
|
11814
|
-
}
|
|
11815
|
-
this._xScales.set(index, scale);
|
|
11816
|
-
});
|
|
11817
|
-
this._yAxisList.forEach((axis, index) => {
|
|
11818
|
-
let scale = null;
|
|
11819
|
-
if (axis.options.type === Scale.number) {
|
|
11820
|
-
scale = defaultScaleMapping
|
|
11821
|
-
.get(axis.options.scaleOptions.type)()
|
|
11822
|
-
.domain(axis.extent)
|
|
11823
|
-
.range(axis.options.inverted ? [...yRange].reverse() : yRange);
|
|
11824
|
-
}
|
|
11825
|
-
if (axis.options.type === Scale.time) {
|
|
11826
|
-
scale = d3
|
|
11827
|
-
.scaleTime()
|
|
11828
|
-
.domain(axis.extent)
|
|
11829
|
-
.range(axis.options.inverted ? [...yRange].reverse() : yRange);
|
|
11830
|
-
}
|
|
11831
|
-
if (axis.options.niceTicks) {
|
|
11832
|
-
scale.nice();
|
|
11833
|
-
}
|
|
11834
|
-
if (axis.options.scaleOptions.type === ScaleType.log) {
|
|
11835
|
-
scale.base(axis.options.scaleOptions.base);
|
|
11836
|
-
}
|
|
11837
|
-
if (axis.options.scaleOptions.type === ScaleType.pow) {
|
|
11838
|
-
scale.exponent(axis.options.scaleOptions.base);
|
|
11839
|
-
}
|
|
11840
|
-
this._yScales.set(index, scale);
|
|
11841
|
-
});
|
|
11842
|
-
for (const [key, value] of this._yScales) {
|
|
11843
|
-
this._clonedY.set(key, value.copy());
|
|
11844
|
-
}
|
|
11845
|
-
for (const [key, value] of this._xScales) {
|
|
11846
|
-
this._clonedX.set(key, value.copy());
|
|
11847
|
-
}
|
|
11848
|
-
}
|
|
11849
|
-
drawAxis() {
|
|
11850
|
-
const hasVisibleAxis = [...this._xAxisList, ...this._yAxisList].filter((axis) => axis.options.visible);
|
|
11851
|
-
if (!hasVisibleAxis) {
|
|
11852
|
-
return;
|
|
11853
|
-
}
|
|
11854
|
-
const negative = false;
|
|
11855
|
-
this._chart.selectAll('.axes').remove();
|
|
11856
|
-
const axes = this._chart
|
|
11857
|
-
.append('g')
|
|
11858
|
-
.attr('class', 'axes')
|
|
11859
|
-
.style('shape-rendering', 'crispEdges');
|
|
11860
|
-
const TICK_HEIGHT = 40;
|
|
11861
|
-
const TICK_WIDTH = 60;
|
|
11862
|
-
const tickCount = Math.round(this._height / TICK_HEIGHT);
|
|
11863
|
-
const tickCountX = Math.round(this._width / TICK_WIDTH);
|
|
11864
|
-
this._xAxisList.forEach((axis) => {
|
|
11865
|
-
var _a, _b;
|
|
11866
|
-
const options = axis.options;
|
|
11867
|
-
const translate = `translate(${0}, ${this._height - this._options.bounds.bottom})`;
|
|
11868
|
-
const x = this._xScales.get(axis.index);
|
|
11869
|
-
const xAxis = d3.axisBottom(x).ticks(tickCountX);
|
|
11870
|
-
if ((_a = axis.options) === null || _a === void 0 ? void 0 : _a.tickFormat) {
|
|
11871
|
-
xAxis.tickFormat(axis.options.tickFormat);
|
|
11872
|
-
}
|
|
11873
|
-
if (options.visible !== false) {
|
|
11874
|
-
const translateX = this.offsetNonOpposite
|
|
11875
|
-
? this.offsetNonOpposite
|
|
11876
|
-
: this._options.bounds.left + this.offsetNonOpposite;
|
|
11877
|
-
axes
|
|
11878
|
-
.append('g')
|
|
11879
|
-
.attr('class', 'x-axis-label')
|
|
11880
|
-
.append('text')
|
|
11881
|
-
.style('fill', 'var(--color-text-50)')
|
|
11882
|
-
.attr('transform', 'translate(' +
|
|
11883
|
-
this._width / 2 +
|
|
11884
|
-
' ,' +
|
|
11885
|
-
(this._height - this._options.bounds.bottom) +
|
|
11886
|
-
')')
|
|
11887
|
-
.style('text-anchor', 'middle')
|
|
11888
|
-
.attr('dy', '3em')
|
|
11889
|
-
.text((_b = options.title) !== null && _b !== void 0 ? _b : '');
|
|
11890
|
-
axes
|
|
11891
|
-
.append('g')
|
|
11892
|
-
.attr('class', 'x-axis font-caption')
|
|
11893
|
-
.attr('data-x-scale-id', axis.index)
|
|
11894
|
-
.attr('transform', translate)
|
|
11895
|
-
.style('pointer-events', 'none')
|
|
11896
|
-
.call(xAxis)
|
|
11897
|
-
.call((_) => {
|
|
11898
|
-
_.select('.domain').remove();
|
|
11899
|
-
_.selectAll('.tick').attr('class', 'color-text-50');
|
|
11900
|
-
if (negative) {
|
|
11901
|
-
_.append('line')
|
|
11902
|
-
.attr('y1', 0)
|
|
11903
|
-
.attr('y2', this._height)
|
|
11904
|
-
.attr('transform', `translate(${x(0)}, -${this._height})`)
|
|
11905
|
-
.style('stroke-width', 0.5)
|
|
11906
|
-
.style('stroke', 'var(--color-text-50)');
|
|
11907
|
-
}
|
|
11908
|
-
_.append('line')
|
|
11909
|
-
.attr('x1', 0)
|
|
11910
|
-
.attr('x2', this.visibleChartWindowWidth)
|
|
11911
|
-
.attr('transform', `translate(${translateX}, ${0})`)
|
|
11912
|
-
.style('stroke-width', 0.5)
|
|
11913
|
-
.style('stroke', 'var(--color-text-50)');
|
|
11914
|
-
});
|
|
11915
|
-
}
|
|
11916
|
-
});
|
|
11917
|
-
this._yAxisList.forEach((axis) => {
|
|
11918
|
-
var _a;
|
|
11919
|
-
const translate = axis.options.opposite
|
|
11920
|
-
? `translate(${this._width - axis.offset}, ${0})`
|
|
11921
|
-
: `translate(${axis.offset}, ${0})`;
|
|
11922
|
-
const y = this._yScales.get(axis.index);
|
|
11923
|
-
const yAxis = axis.options.opposite ? d3.axisRight(y) : d3.axisLeft(y);
|
|
11924
|
-
if (axis.options.visible !== false) {
|
|
11925
|
-
const labelOffset = axis.options.opposite
|
|
11926
|
-
? this._width - axis.offset + axis.width
|
|
11927
|
-
: axis.offset - axis.width;
|
|
11928
|
-
axes
|
|
11929
|
-
.append('g')
|
|
11930
|
-
.attr('class', 'y-axis-label')
|
|
11931
|
-
.append('text')
|
|
11932
|
-
.style('fill', 'var(--color-text-50)')
|
|
11933
|
-
.attr('transform', 'rotate(-90)')
|
|
11934
|
-
.attr('y', labelOffset)
|
|
11935
|
-
.attr('x', 0 - this._height / 2)
|
|
11936
|
-
.attr('dy', axis.options.opposite ? '12px' : '-3px')
|
|
11937
|
-
.style('text-anchor', 'middle')
|
|
11938
|
-
.text((_a = axis.options.title) !== null && _a !== void 0 ? _a : '');
|
|
11939
|
-
axes
|
|
11940
|
-
.append('g')
|
|
11941
|
-
.attr('class', 'y-axis font-caption')
|
|
11942
|
-
.attr('data-y-scale-id', axis.index)
|
|
11943
|
-
.attr('transform', translate)
|
|
11944
|
-
.call(yAxis)
|
|
11945
|
-
.style('pointer-events', 'none')
|
|
11946
|
-
.call((_) => {
|
|
11947
|
-
_.select('.domain').remove();
|
|
11948
|
-
_.selectAll('.tick').attr('class', 'color-text-50');
|
|
11949
|
-
if (!negative) {
|
|
11950
|
-
_.append('line')
|
|
11951
|
-
.attr('y1', 0)
|
|
11952
|
-
.attr('y2', this._height -
|
|
11953
|
-
this._options.bounds.top -
|
|
11954
|
-
this._options.bounds.bottom)
|
|
11955
|
-
.attr('transform', `translate(${0}, ${this._options.bounds.top})`)
|
|
11956
|
-
.style('stroke-width', 0.5)
|
|
11957
|
-
.style('stroke', 'var(--color-text-50)');
|
|
11958
|
-
}
|
|
11959
|
-
});
|
|
11960
|
-
}
|
|
11961
|
-
});
|
|
11962
|
-
}
|
|
11963
|
-
}
|
|
11964
|
-
|
|
11965
|
-
class ChartComponent {
|
|
11966
|
-
constructor(_zone) {
|
|
11967
|
-
this._zone = _zone;
|
|
11968
|
-
this.plotLinesMove = new EventEmitter();
|
|
11969
|
-
this.plotBandsMove = new EventEmitter();
|
|
11970
|
-
this.seriesMove = new EventEmitter();
|
|
11971
|
-
this.pointMove = new EventEmitter();
|
|
11972
|
-
this.zoomChange = new EventEmitter();
|
|
11973
|
-
this._alive = true;
|
|
11974
|
-
this.size$ = new Subject();
|
|
11975
|
-
}
|
|
11976
|
-
click(event) {
|
|
11977
|
-
var _a, _b, _c, _d;
|
|
11978
|
-
const composedPath = event.composedPath();
|
|
11979
|
-
const triggerToken = 'legend';
|
|
11980
|
-
const isLegend = composedPath.some((_) => { var _a; return (_a = _.classList) === null || _a === void 0 ? void 0 : _a.contains(triggerToken); });
|
|
11981
|
-
if (isLegend) {
|
|
11982
|
-
const clickedElement = (_a = event.target) === null || _a === void 0 ? void 0 : _a.__data__;
|
|
11983
|
-
if (!clickedElement) {
|
|
11984
|
-
return;
|
|
11985
|
-
}
|
|
11986
|
-
const serieIndex = (_c = (_b = this._config) === null || _b === void 0 ? void 0 : _b.series) === null || _c === void 0 ? void 0 : _c.indexOf(clickedElement);
|
|
11987
|
-
if (clickedElement.serieType === SeriesType.bar) {
|
|
11988
|
-
const foundSerie = this._config.series[clickedElement.serieIndex];
|
|
11989
|
-
this._config.series[foundSerie.id].data = this._config.series[foundSerie.id].data.map((_) => {
|
|
11990
|
-
if (clickedElement.id === _.id) {
|
|
11991
|
-
return Object.assign(Object.assign({}, _), { visible: !_.visible });
|
|
11992
|
-
}
|
|
11993
|
-
return _;
|
|
11994
|
-
});
|
|
11995
|
-
this.redraw(this._config);
|
|
11996
|
-
}
|
|
11997
|
-
if (serieIndex !== -1) {
|
|
11998
|
-
const foundSerie = this._config.series[serieIndex];
|
|
11999
|
-
const yAxisIndex = foundSerie === null || foundSerie === void 0 ? void 0 : foundSerie.yAxisIndex;
|
|
12000
|
-
this._config.series[serieIndex].visible = !foundSerie.visible;
|
|
12001
|
-
const attachedYAxes = (_d = this._config.series) === null || _d === void 0 ? void 0 : _d.filter((_) => _.visible).map((_) => _.yAxisIndex);
|
|
12002
|
-
const shouldVisibleYAxis = attachedYAxes === null || attachedYAxes === void 0 ? void 0 : attachedYAxes.includes(yAxisIndex);
|
|
12003
|
-
this._config.yAxis[yAxisIndex].visible = shouldVisibleYAxis;
|
|
12004
|
-
this.redraw(this._config);
|
|
12005
|
-
}
|
|
12006
|
-
}
|
|
12007
|
-
}
|
|
12008
|
-
ngOnChanges(changes) {
|
|
12009
|
-
var _a, _b;
|
|
12010
|
-
if (this.config && changes.hasOwnProperty('config')) {
|
|
12011
|
-
this.setConfig(this.config);
|
|
12012
|
-
if (this.zoom) {
|
|
12013
|
-
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setZoom(this.zoom);
|
|
12014
|
-
}
|
|
12015
|
-
}
|
|
12016
|
-
if (this.zoom && changes.hasOwnProperty('zoom')) {
|
|
12017
|
-
(_b = this._chart) === null || _b === void 0 ? void 0 : _b.setZoom(this.zoom);
|
|
12018
|
-
}
|
|
12019
|
-
}
|
|
12020
|
-
ngOnInit() { }
|
|
12021
|
-
ngAfterViewInit() {
|
|
12022
|
-
this._observer = new ResizeObserver((entries) => {
|
|
12023
|
-
const { contentRect } = entries[0];
|
|
12024
|
-
this.size$.next(contentRect);
|
|
12025
|
-
});
|
|
12026
|
-
this._observer.observe(this.chart.nativeElement);
|
|
12027
|
-
this.size$
|
|
12028
|
-
.pipe(throttleTime(100, undefined, { trailing: true }))
|
|
12029
|
-
.pipe(takeWhile((_) => this._alive), map((_) => {
|
|
12030
|
-
this.resize(_);
|
|
12031
|
-
this.redraw(this._config);
|
|
12032
|
-
}))
|
|
12033
|
-
.subscribe();
|
|
12034
|
-
}
|
|
12035
|
-
get showLegend() {
|
|
12036
|
-
var _a, _b;
|
|
12037
|
-
return (_b = (_a = this._config) === null || _a === void 0 ? void 0 : _a.legend) === null || _b === void 0 ? void 0 : _b.visible;
|
|
12038
|
-
}
|
|
12039
|
-
ngOnDestroy() {
|
|
12040
|
-
var _a;
|
|
12041
|
-
this._alive = false;
|
|
12042
|
-
(_a = this._observer) === null || _a === void 0 ? void 0 : _a.unobserve(this.chart.nativeElement);
|
|
12043
|
-
}
|
|
12044
|
-
redraw(config) {
|
|
12045
|
-
if (config) {
|
|
12046
|
-
this._chart.redraw(config);
|
|
12047
|
-
}
|
|
12048
|
-
}
|
|
12049
|
-
resize(contentRect) {
|
|
12050
|
-
const { width, height } = contentRect;
|
|
12051
|
-
this._chart.setSize({
|
|
12052
|
-
width,
|
|
12053
|
-
height,
|
|
12054
|
-
});
|
|
12055
|
-
}
|
|
12056
|
-
setConfig(config) {
|
|
12057
|
-
var _a, _b, _c, _d;
|
|
12058
|
-
if (config) {
|
|
12059
|
-
this._config = config;
|
|
12060
|
-
this.hasSeriesData = !!((_b = (_a = this._config) === null || _a === void 0 ? void 0 : _a.series) === null || _b === void 0 ? void 0 : _b.some((_) => _.data.length));
|
|
12061
|
-
if (!this._chart) {
|
|
12062
|
-
this._chart = new TetaChart(this._config, this.chart);
|
|
12063
|
-
this._chart.plotLinesMove
|
|
12064
|
-
.pipe(takeWhile((_) => this._alive))
|
|
12065
|
-
.subscribe((_) => this.plotLinesMove.emit(_));
|
|
12066
|
-
this._chart.plotBandsMove
|
|
12067
|
-
.pipe(takeWhile((_) => this._alive))
|
|
12068
|
-
.subscribe((_) => this.plotBandsMove.emit(_));
|
|
12069
|
-
this._chart.seriesMove
|
|
12070
|
-
.pipe(takeWhile((_) => this._alive))
|
|
12071
|
-
.subscribe((_) => this.seriesMove.emit(_));
|
|
12072
|
-
this._chart.pointMove
|
|
12073
|
-
.pipe(takeWhile((_) => this._alive))
|
|
12074
|
-
.subscribe((_) => {
|
|
12075
|
-
this.pointMove.emit(_);
|
|
12076
|
-
});
|
|
12077
|
-
this._chart.zoom
|
|
12078
|
-
.pipe(takeWhile((_) => this._alive), map((_) => {
|
|
12079
|
-
this.zoomChange.emit(_);
|
|
12080
|
-
}))
|
|
12081
|
-
.subscribe();
|
|
12082
|
-
}
|
|
12083
|
-
if (this.chart) {
|
|
12084
|
-
if (this.hasSeriesData) {
|
|
12085
|
-
if (!this._zoom || ((_d = (_c = this._zoom) === null || _c === void 0 ? void 0 : _c.event) === null || _d === void 0 ? void 0 : _d.type) === 'end') {
|
|
12086
|
-
this.redraw(this._config);
|
|
12087
|
-
}
|
|
12088
|
-
}
|
|
12089
|
-
}
|
|
12090
|
-
}
|
|
12091
|
-
}
|
|
12092
|
-
}
|
|
12093
|
-
ChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
12094
|
-
ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: ChartComponent, selector: "teta-chart", inputs: { zoom: "zoom", config: "config" }, outputs: { plotLinesMove: "plotLinesMove", plotBandsMove: "plotBandsMove", seriesMove: "seriesMove", pointMove: "pointMove", zoomChange: "zoomChange" }, host: { listeners: { "click": "click($event)" } }, viewQueries: [{ propertyName: "chart", first: true, predicate: ["chart"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.display]=\"hasSeriesData ? 'contents' : 'none'\">\n <div #chart class=\"chart-container\"></div>\n <div *ngIf=\"showLegend\" class=\"legend-container\"></div>\n</div>\n<div [style.display]=\"!hasSeriesData ? 'block' : 'none'\" class=\"chart-placeholder text-align-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\n\n", styles: [":host{display:flex;width:100%;height:100%;flex-direction:column}.chart-container{position:relative;min-height:0;flex-grow:1;flex-basis:1px}.chart-placeholder{margin:auto;width:100%}.chart-placeholder span{text-overflow:ellipsis;overflow:hidden;display:block}.legend-container{flex-shrink:0;flex-basis:1px}::ng-deep .grid line{stroke-dasharray:1,4}::ng-deep .tooltip-chart{padding:8px 12px;border-radius:2px}::ng-deep .legend{grid-gap:8px;padding-bottom:5px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-evenly}::ng-deep .legend .item{display:flex;align-items:center;cursor:pointer}::ng-deep .legend .item .swatch{width:10px;height:10px}::ng-deep .legend .item .line{width:12px;height:2px}::ng-deep .legend .item .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:5px}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12095
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartComponent, decorators: [{
|
|
12096
|
-
type: Component,
|
|
12097
|
-
args: [{ selector: 'teta-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.display]=\"hasSeriesData ? 'contents' : 'none'\">\n <div #chart class=\"chart-container\"></div>\n <div *ngIf=\"showLegend\" class=\"legend-container\"></div>\n</div>\n<div [style.display]=\"!hasSeriesData ? 'block' : 'none'\" class=\"chart-placeholder text-align-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\n\n", styles: [":host{display:flex;width:100%;height:100%;flex-direction:column}.chart-container{position:relative;min-height:0;flex-grow:1;flex-basis:1px}.chart-placeholder{margin:auto;width:100%}.chart-placeholder span{text-overflow:ellipsis;overflow:hidden;display:block}.legend-container{flex-shrink:0;flex-basis:1px}::ng-deep .grid line{stroke-dasharray:1,4}::ng-deep .tooltip-chart{padding:8px 12px;border-radius:2px}::ng-deep .legend{grid-gap:8px;padding-bottom:5px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-evenly}::ng-deep .legend .item{display:flex;align-items:center;cursor:pointer}::ng-deep .legend .item .swatch{width:10px;height:10px}::ng-deep .legend .item .line{width:12px;height:2px}::ng-deep .legend .item .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:5px}\n"] }]
|
|
12098
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { zoom: [{
|
|
12099
|
-
type: Input
|
|
12100
|
-
}], config: [{
|
|
12101
|
-
type: Input
|
|
12102
|
-
}], plotLinesMove: [{
|
|
12103
|
-
type: Output
|
|
12104
|
-
}], plotBandsMove: [{
|
|
12105
|
-
type: Output
|
|
12106
|
-
}], seriesMove: [{
|
|
12107
|
-
type: Output
|
|
12108
|
-
}], pointMove: [{
|
|
12109
|
-
type: Output
|
|
12110
|
-
}], zoomChange: [{
|
|
12111
|
-
type: Output
|
|
12112
|
-
}], chart: [{
|
|
12113
|
-
type: ViewChild,
|
|
12114
|
-
args: ['chart', {
|
|
12115
|
-
static: true,
|
|
12116
|
-
}]
|
|
12117
|
-
}], click: [{
|
|
12118
|
-
type: HostListener,
|
|
12119
|
-
args: ['click', ['$event']]
|
|
12120
|
-
}] } });
|
|
12121
|
-
|
|
12122
|
-
class ChartModule {
|
|
12123
|
-
}
|
|
12124
|
-
ChartModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12125
|
-
ChartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartModule, declarations: [ChartComponent], imports: [CommonModule], exports: [ChartComponent] });
|
|
12126
|
-
ChartModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartModule, imports: [[CommonModule]] });
|
|
12127
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartModule, decorators: [{
|
|
12128
|
-
type: NgModule,
|
|
12129
|
-
args: [{
|
|
12130
|
-
declarations: [ChartComponent],
|
|
12131
|
-
exports: [ChartComponent],
|
|
12132
|
-
imports: [CommonModule],
|
|
12133
|
-
}]
|
|
12134
|
-
}] });
|
|
12135
|
-
|
|
12136
|
-
class AxisOptions {
|
|
12137
|
-
constructor(options) {
|
|
12138
|
-
var _a, _b;
|
|
12139
|
-
this.niceTicks = true;
|
|
12140
|
-
this.title = options === null || options === void 0 ? void 0 : options.title;
|
|
12141
|
-
this.min = options === null || options === void 0 ? void 0 : options.min;
|
|
12142
|
-
this.max = options === null || options === void 0 ? void 0 : options.max;
|
|
12143
|
-
this.visible = (_a = options === null || options === void 0 ? void 0 : options.visible) !== null && _a !== void 0 ? _a : true;
|
|
12144
|
-
this.tickFormat = options === null || options === void 0 ? void 0 : options.tickFormat;
|
|
12145
|
-
this.transform = options === null || options === void 0 ? void 0 : options.transform;
|
|
12146
|
-
this.zoom = options === null || options === void 0 ? void 0 : options.zoom;
|
|
12147
|
-
this.type = (_b = options === null || options === void 0 ? void 0 : options.type) !== null && _b !== void 0 ? _b : 'number';
|
|
12148
|
-
this.scaleOptions = Object.assign({ type: ScaleType.linear, base: 10 }, options === null || options === void 0 ? void 0 : options.scaleOptions);
|
|
12149
|
-
this.inverted = options === null || options === void 0 ? void 0 : options.inverted;
|
|
12150
|
-
this.negative = options === null || options === void 0 ? void 0 : options.negative;
|
|
12151
|
-
this.opposite = options === null || options === void 0 ? void 0 : options.opposite;
|
|
12152
|
-
this.niceTicks = (options === null || options === void 0 ? void 0 : options.niceTicks) == null ? true : options.niceTicks;
|
|
12153
|
-
this.plotLines = (options === null || options === void 0 ? void 0 : options.plotLines) || [];
|
|
12154
|
-
this.plotBands = (options === null || options === void 0 ? void 0 : options.plotBands) || [];
|
|
12155
|
-
}
|
|
12156
|
-
}
|
|
12157
|
-
|
|
12158
|
-
class Series {
|
|
12159
|
-
constructor(options) {
|
|
12160
|
-
var _a, _b, _c, _d;
|
|
12161
|
-
this.id = options === null || options === void 0 ? void 0 : options.id;
|
|
12162
|
-
this.renderTo = (_a = options === null || options === void 0 ? void 0 : options.renderTo) !== null && _a !== void 0 ? _a : 'svg';
|
|
12163
|
-
this.type = (options === null || options === void 0 ? void 0 : options.type) != null ? options === null || options === void 0 ? void 0 : options.type : SeriesType.line;
|
|
12164
|
-
this.curveType =
|
|
12165
|
-
(options === null || options === void 0 ? void 0 : options.curveType) != null ? options === null || options === void 0 ? void 0 : options.curveType : d3.curveLinear;
|
|
12166
|
-
this.data = (_b = options === null || options === void 0 ? void 0 : options.data) === null || _b === void 0 ? void 0 : _b.filter((_) => !isNaN(_.x) && !isNaN(_.y));
|
|
12167
|
-
this.axisFormat = options === null || options === void 0 ? void 0 : options.axisFormat;
|
|
12168
|
-
this.name = options === null || options === void 0 ? void 0 : options.name;
|
|
12169
|
-
this.xAxisIndex = (options === null || options === void 0 ? void 0 : options.xAxisIndex) != null ? options === null || options === void 0 ? void 0 : options.xAxisIndex : 0;
|
|
12170
|
-
this.yAxisIndex = (options === null || options === void 0 ? void 0 : options.yAxisIndex) != null ? options === null || options === void 0 ? void 0 : options.yAxisIndex : 0;
|
|
12171
|
-
this.drawer = options === null || options === void 0 ? void 0 : options.drawer;
|
|
12172
|
-
this.strokeWidth = options === null || options === void 0 ? void 0 : options.strokeWidth;
|
|
12173
|
-
this.strokeDasharray = (_c = options === null || options === void 0 ? void 0 : options.strokeDasharray) !== null && _c !== void 0 ? _c : null;
|
|
12174
|
-
this.visible = (options === null || options === void 0 ? void 0 : options.visible) || true;
|
|
12175
|
-
this.color = (_d = options === null || options === void 0 ? void 0 : options.color) !== null && _d !== void 0 ? _d : 'cyan';
|
|
12176
|
-
this.colorScale = options === null || options === void 0 ? void 0 : options.colorScale;
|
|
12177
|
-
this.drag = Object.assign({ enable: false, extendLine: false }, options === null || options === void 0 ? void 0 : options.drag);
|
|
12178
|
-
this.showInLegend =
|
|
12179
|
-
(options === null || options === void 0 ? void 0 : options.showInLegend) != null ? options === null || options === void 0 ? void 0 : options.showInLegend : true;
|
|
12180
|
-
this.extend = (options === null || options === void 0 ? void 0 : options.extend) != null ? options === null || options === void 0 ? void 0 : options.extend : false;
|
|
12181
|
-
}
|
|
12182
|
-
}
|
|
12183
|
-
|
|
12184
|
-
class TooltipOptions {
|
|
12185
|
-
constructor(options) {
|
|
12186
|
-
var _a, _b, _c, _d, _e;
|
|
12187
|
-
const defaultFormatter = (tooltips) => {
|
|
12188
|
-
let html = '';
|
|
12189
|
-
tooltips
|
|
12190
|
-
.filter((_) => _.point)
|
|
12191
|
-
.forEach((_) => {
|
|
12192
|
-
var _a, _b, _c, _d, _e;
|
|
12193
|
-
html += `<div>${(_a = _.name) !== null && _a !== void 0 ? _a : 'Без названия'} x: ${(_c = (_b = _.point) === null || _b === void 0 ? void 0 : _b.x) === null || _c === void 0 ? void 0 : _c.toFixed(2)} y: ${(_e = (_d = _.point) === null || _d === void 0 ? void 0 : _d.y) === null || _e === void 0 ? void 0 : _e.toFixed(2)}</div>`;
|
|
12194
|
-
});
|
|
12195
|
-
return html;
|
|
12196
|
-
};
|
|
12197
|
-
this.enable = (_a = options === null || options === void 0 ? void 0 : options.enable) !== null && _a !== void 0 ? _a : true;
|
|
12198
|
-
this.showMarkers = (_b = options === null || options === void 0 ? void 0 : options.showMarkers) !== null && _b !== void 0 ? _b : true;
|
|
12199
|
-
this.showLine = (_c = options === null || options === void 0 ? void 0 : options.showLine) !== null && _c !== void 0 ? _c : false;
|
|
12200
|
-
this.tracking = (_d = options === null || options === void 0 ? void 0 : options.tracking) !== null && _d !== void 0 ? _d : 'x';
|
|
12201
|
-
this.format = (_e = options === null || options === void 0 ? void 0 : options.format) !== null && _e !== void 0 ? _e : defaultFormatter;
|
|
12202
|
-
}
|
|
12203
|
-
}
|
|
12204
|
-
|
|
12205
|
-
class ChartBounds {
|
|
12206
|
-
constructor(options) {
|
|
12207
|
-
this.top = 35;
|
|
12208
|
-
this.right = 50;
|
|
12209
|
-
this.bottom = 50;
|
|
12210
|
-
this.left = 35;
|
|
12211
|
-
this.top = (options === null || options === void 0 ? void 0 : options.top) || this.top;
|
|
12212
|
-
this.right = (options === null || options === void 0 ? void 0 : options.right) || this.right;
|
|
12213
|
-
this.bottom = (options === null || options === void 0 ? void 0 : options.bottom) || this.bottom;
|
|
12214
|
-
this.left = (options === null || options === void 0 ? void 0 : options.left) || this.left;
|
|
12215
|
-
}
|
|
12216
|
-
}
|
|
12217
|
-
|
|
12218
|
-
class ChartOptions {
|
|
12219
|
-
constructor(options) {
|
|
12220
|
-
var _a, _b, _c, _d;
|
|
12221
|
-
this.bounds = new ChartBounds();
|
|
12222
|
-
this.name = options === null || options === void 0 ? void 0 : options.name;
|
|
12223
|
-
this.zoom = Object.assign({ enable: false, zoomType: ZoomType.x }, options === null || options === void 0 ? void 0 : options.zoom);
|
|
12224
|
-
this.series = (_a = options === null || options === void 0 ? void 0 : options.series) === null || _a === void 0 ? void 0 : _a.map((series, idx) => (Object.assign(Object.assign({}, series), { id: idx })));
|
|
12225
|
-
this.zoom = Object.assign({ enable: false, zoomType: ZoomType.x }, options === null || options === void 0 ? void 0 : options.zoom);
|
|
12226
|
-
this.series = (_b = options === null || options === void 0 ? void 0 : options.series) === null || _b === void 0 ? void 0 : _b.map((series, idx) => new Series(series));
|
|
12227
|
-
this.tooltip = new TooltipOptions(Object.assign({}, options === null || options === void 0 ? void 0 : options.tooltip));
|
|
12228
|
-
this.xAxis = (_c = options === null || options === void 0 ? void 0 : options.xAxis) === null || _c === void 0 ? void 0 : _c.map((_) => new AxisOptions(_));
|
|
12229
|
-
this.yAxis = (_d = options === null || options === void 0 ? void 0 : options.yAxis) === null || _d === void 0 ? void 0 : _d.map((_) => new AxisOptions(_));
|
|
12230
|
-
this.gridLines = (options === null || options === void 0 ? void 0 : options.gridLines) == null ? true : options.gridLines;
|
|
12231
|
-
this.width = options === null || options === void 0 ? void 0 : options.width;
|
|
12232
|
-
this.height = options === null || options === void 0 ? void 0 : options.height;
|
|
12233
|
-
this.legend = Object.assign({ visible: true, type: LegendType.swatches }, options === null || options === void 0 ? void 0 : options.legend);
|
|
12234
|
-
this.bounds = Object.assign(Object.assign({}, this.bounds), options === null || options === void 0 ? void 0 : options.bounds);
|
|
12235
|
-
this.annotations = options === null || options === void 0 ? void 0 : options.annotations;
|
|
12236
|
-
}
|
|
12237
|
-
}
|
|
12238
|
-
|
|
12239
|
-
const annotationMap = [
|
|
12240
|
-
annotationBadge,
|
|
12241
|
-
annotationLabel,
|
|
12242
|
-
annotationCallout,
|
|
12243
|
-
annotationCalloutCircle,
|
|
12244
|
-
annotationCalloutCurve,
|
|
12245
|
-
annotationCalloutElbow,
|
|
12246
|
-
annotationCalloutRect,
|
|
12247
|
-
annotationCustomType,
|
|
12248
|
-
annotationXYThreshold,
|
|
12249
|
-
];
|
|
12250
|
-
class Annotation {
|
|
12251
|
-
constructor(options) {
|
|
12252
|
-
this.point = options === null || options === void 0 ? void 0 : options.point;
|
|
12253
|
-
this.yAxisIndex = options === null || options === void 0 ? void 0 : options.yAxisIndex;
|
|
12254
|
-
this.xAxisIndex = options === null || options === void 0 ? void 0 : options.xAxisIndex;
|
|
12255
|
-
this.type = (options === null || options === void 0 ? void 0 : options.type) || annotationLabel;
|
|
12256
|
-
this.enabled = options === null || options === void 0 ? void 0 : options.enabled;
|
|
12257
|
-
this.className = options === null || options === void 0 ? void 0 : options.className;
|
|
12258
|
-
this.fillColor = options === null || options === void 0 ? void 0 : options.fillColor;
|
|
12259
|
-
this.borderColor = options === null || options === void 0 ? void 0 : options.borderColor;
|
|
12260
|
-
this.borderWidth = options === null || options === void 0 ? void 0 : options.borderWidth;
|
|
12261
|
-
this.note = options === null || options === void 0 ? void 0 : options.note;
|
|
12262
|
-
this.connector = options === null || options === void 0 ? void 0 : options.connector;
|
|
12263
|
-
this.dx = options === null || options === void 0 ? void 0 : options.dx;
|
|
12264
|
-
this.dy = options === null || options === void 0 ? void 0 : options.dy;
|
|
12265
|
-
}
|
|
12266
|
-
}
|
|
12267
|
-
|
|
12268
|
-
class PlotLine {
|
|
12269
|
-
constructor(options) {
|
|
12270
|
-
this.id = options === null || options === void 0 ? void 0 : options.id;
|
|
12271
|
-
this.width = (options === null || options === void 0 ? void 0 : options.width) || 1;
|
|
12272
|
-
this.value = options === null || options === void 0 ? void 0 : options.value;
|
|
12273
|
-
this.label = options === null || options === void 0 ? void 0 : options.label;
|
|
12274
|
-
this.dashed = (options === null || options === void 0 ? void 0 : options.dashed) || false;
|
|
12275
|
-
this.color = (options === null || options === void 0 ? void 0 : options.color) || 'var(--color-text-70)';
|
|
12276
|
-
this.min = options === null || options === void 0 ? void 0 : options.min;
|
|
12277
|
-
this.max = options === null || options === void 0 ? void 0 : options.max;
|
|
12278
|
-
}
|
|
12279
|
-
}
|
|
12280
|
-
|
|
12281
|
-
class PlotBand {
|
|
12282
|
-
constructor(options) {
|
|
12283
|
-
this.id = options === null || options === void 0 ? void 0 : options.id;
|
|
12284
|
-
this.from = options === null || options === void 0 ? void 0 : options.from;
|
|
12285
|
-
this.to = options === null || options === void 0 ? void 0 : options.to;
|
|
12286
|
-
this.label = options === null || options === void 0 ? void 0 : options.label;
|
|
12287
|
-
this.color = (options === null || options === void 0 ? void 0 : options.color) || '#59AE501A';
|
|
12288
|
-
this.image = options === null || options === void 0 ? void 0 : options.image;
|
|
12289
|
-
this.showGrabbers =
|
|
12290
|
-
(options === null || options === void 0 ? void 0 : options.showGrabbers) != null ? options.showGrabbers : true;
|
|
12291
|
-
this.draggable = (options === null || options === void 0 ? void 0 : options.draggable) != null ? options === null || options === void 0 ? void 0 : options.draggable : false;
|
|
12292
|
-
this.resizable = (options === null || options === void 0 ? void 0 : options.resizable) != null ? options === null || options === void 0 ? void 0 : options.resizable : true;
|
|
12293
|
-
this.min = options === null || options === void 0 ? void 0 : options.min;
|
|
12294
|
-
this.max = options === null || options === void 0 ? void 0 : options.max;
|
|
12295
|
-
this.opacity = options === null || options === void 0 ? void 0 : options.opacity;
|
|
12296
|
-
}
|
|
12297
|
-
}
|
|
12298
|
-
|
|
12299
10009
|
class Chart3dComponent {
|
|
12300
10010
|
constructor(_elementRef, _themeService) {
|
|
12301
10011
|
this._elementRef = _elementRef;
|
|
@@ -12514,10 +10224,10 @@ class Chart3dComponent {
|
|
|
12514
10224
|
}
|
|
12515
10225
|
}
|
|
12516
10226
|
Chart3dComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: Chart3dComponent, deps: [{ token: i0.ElementRef }, { token: ThemeSwitchService }], target: i0.ɵɵFactoryTarget.Component });
|
|
12517
|
-
Chart3dComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: Chart3dComponent, selector: "teta-chart3d", inputs: { config: "config" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true }], ngImport: i0, template: "<canvas #canvas></canvas>\n", styles: [":host{display:flex;width:100%;height:100%}\n"] });
|
|
10227
|
+
Chart3dComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: Chart3dComponent, selector: "teta-chart3d", inputs: { config: "config" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true }], ngImport: i0, template: "<canvas #canvas></canvas>\n", styles: [":host{display:flex;width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12518
10228
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: Chart3dComponent, decorators: [{
|
|
12519
10229
|
type: Component,
|
|
12520
|
-
args: [{ selector: 'teta-chart3d', template: "<canvas #canvas></canvas>\n", styles: [":host{display:flex;width:100%;height:100%}\n"] }]
|
|
10230
|
+
args: [{ selector: 'teta-chart3d', changeDetection: ChangeDetectionStrategy.OnPush, template: "<canvas #canvas></canvas>\n", styles: [":host{display:flex;width:100%;height:100%}\n"] }]
|
|
12521
10231
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ThemeSwitchService }]; }, propDecorators: { canvasRef: [{
|
|
12522
10232
|
type: ViewChild,
|
|
12523
10233
|
args: ['canvas']
|
|
@@ -13338,5 +11048,5 @@ class StringUtil {
|
|
|
13338
11048
|
* Generated bundle index. Do not edit.
|
|
13339
11049
|
*/
|
|
13340
11050
|
|
|
13341
|
-
export { AccordionComponent, AccordionContentDirective, AccordionHeadComponent, AccordionItemComponent, AccordionModule, AggregationType, Align,
|
|
11051
|
+
export { AccordionComponent, AccordionContentDirective, AccordionHeadComponent, AccordionItemComponent, AccordionModule, AggregationType, Align, ArrayUtil, BooleanCellComponent, BooleanFilter, BooleanFilterComponent, ButtonComponent, ButtonModule, CHECKBOX_CONTROL_VALUE_ACCESSOR, CellComponent, CellComponentBase, CellHostComponent, Chart3dComponent, Chart3dModule, Chart3dOptions, CheckboxComponent, CheckboxModule, ClickOutsideDirective, ClickOutsideModule, ClickService, ColumnReorderEvent, ColumnResizeEvent, ContextMenuDirective, ContextMenuModule, CurrentModal, DATE_PICKER_CONTROL_VALUE_ACCESSOR, DAY_SELECT_CONTROL_VALUE_ACCESSOR, DateCellComponent, DateFilter, DateFilterComponent, DateFilterValue, DatePeriod, DatePickerComponent, DatePickerModule, DateTimeCellComponent, DateUtil, DaySelectComponent, DelimiterComponent, DelimiterModule, DetailComponentBase, DialogComponent, DialogService, DisableControlDirective, DisableControlModule, DomUtil, DragSortContainerDirective, DragSortItemDirective, DragSortModule, DropdownComponent, DropdownContentDirective, DropdownDirective, DropdownHeadDirective, DropdownModule, DynamicComponentModule, DynamicComponentService, DynamicContentBaseDirective, DynamicData, EditEvent, EditType, ExpandPanelComponent, ExpandPanelContentDirective, ExpandPanelHeadDirective, ExpandPanelModule, FileItemComponent, FileUploadAreaComponent, FileUploadModule, FilterBase, FilterComponentBase, FilterHostComponent, FilterItem, FilterModule, FilterPanelComponent, FilterState, FilterType, FormGroupTitleComponent, FormsUtil, GroupRowComponent, HeadCellComponentBase, HeadCellHostComponent, HighlightDirective, HighlightModule, HintDirective, HintModule, IconComponent, IconModule, IconService, IconSpriteDirective, InputComponent, InputModule, ListCellComponent, ListFilter, ListFilterComponent, ListFilterType, LoaderDirective, LoaderModule, MONTH_PICKER_CONTROL_VALUE_ACCESSOR, Message, MessageComponent, MessageHostComponent, MessageModule, MessageService, ModalCloseReason, ModalContainerComponent, ModalInstance, ModalModule, ModalService, MonthPickerComponent, NoAutofillDirective, NoAutofillModule, NumberPipe, NumberPipeModule, NumericCellComponent, NumericFilter, NumericFilterComponent, NumericFilterValue, OnlyNumberDirective, OnlyNumberModule, OverlayContainerService, PagerComponent, PagerModule, PagerState, PagerUtil, PanelComponent, PanelModule, PopupContentComponent, PositionUtil, ProgressBarComponent, ProgressBarModule, PropertyGridComponent, PropertyGridModule, RadioButtonComponent, RadioComponent, RadioModule, ResizeDragDirective, ResizeDragModule, ResizePanelComponent, ResizePanelModule, SLIDER_CONTROL_VALUE_ACCESSOR, SWITCH_CONTROL_VALUE_ACCESSOR, SelectComponent, SelectModule, SelectOptionDirective, SelectType, SelectValueDirective, SidebarComponent, SidebarModule, SidebarPosition, SortEvent, SortParam, StateUtil, StringCellComponent, StringFilter, StringFilterComponent, StringFilterType, StringUtil, SwitchButtonComponent, SwitchComponent, SwitchModule, TOGGLE_CONTROL_VALUE_ACCESSOR, TabComponent, TabContentDirective, TabTitleDirective, TableBodyComponent, TableColumn, TableColumnStore, TableComponent, TableContextMenuConfig, TableHeadComponent, TableModule, TableRow, TableService, TableUtil, TabsComponent, TabsModule, TetaContentRef, TetaSize, TetaTemplateDirective, TetaTemplateModule, TextFieldComponent, ThemeSwitchComponent, ThemeSwitchModule, ThemeSwitchService, ToggleComponent, ToggleModule, ToolbarComponent, ToolbarModule, TooltipDirective, TooltipModule, TreeComponent, TreeItemToggleComponent, TreeModule, TreeService, VerticalAlign, formatNumber, getCellComponent, getPrecision, prependZero };
|
|
13342
11052
|
//# sourceMappingURL=tetacom-ng-components.mjs.map
|