@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.
Files changed (119) hide show
  1. package/component/filter/filter.module.d.ts +2 -1
  2. package/component/public-api.d.ts +0 -1
  3. package/component/table/table-body/table-body.component.d.ts +0 -4
  4. package/component/table/table.module.d.ts +5 -6
  5. package/directive/click-outside/click-outside.directive.d.ts +3 -2
  6. package/directive/hint/hint.directive.d.ts +1 -0
  7. package/esm2020/component/chart-3d/chart3d/chart3d.component.mjs +4 -4
  8. package/esm2020/component/file-upload/file-item/file-item.component.mjs +4 -4
  9. package/esm2020/component/filter/filter.module.mjs +6 -2
  10. package/esm2020/component/filter/numeric-filter/numeric-filter.component.mjs +4 -3
  11. package/esm2020/component/message/message.service.mjs +3 -3
  12. package/esm2020/component/public-api.mjs +1 -3
  13. package/esm2020/component/table/default/numeric-cell/numeric-cell.component.mjs +2 -1
  14. package/esm2020/component/table/default/string-cell/string-cell.component.mjs +3 -2
  15. package/esm2020/component/table/table-body/table-body.component.mjs +1 -31
  16. package/esm2020/component/table/table.module.mjs +1 -5
  17. package/esm2020/directive/click-outside/click-outside.directive.mjs +10 -5
  18. package/esm2020/directive/hint/hint.directive.mjs +4 -1
  19. package/esm2020/directive/only-number/only-number.directive.mjs +3 -2
  20. package/esm2020/pipe/public-api.mjs +2 -1
  21. package/esm2020/util/date-util.mjs +8 -5
  22. package/fesm2015/tetacom-ng-components.mjs +63 -2353
  23. package/fesm2015/tetacom-ng-components.mjs.map +1 -1
  24. package/fesm2020/tetacom-ng-components.mjs +61 -2343
  25. package/fesm2020/tetacom-ng-components.mjs.map +1 -1
  26. package/package.json +1 -1
  27. package/pipe/public-api.d.ts +1 -0
  28. package/component/chart/chart/chart.component.d.ts +0 -39
  29. package/component/chart/chart.module.d.ts +0 -8
  30. package/component/chart/core/axis-creator.d.ts +0 -29
  31. package/component/chart/core/chart.d.ts +0 -70
  32. package/component/chart/core/public-api.d.ts +0 -2
  33. package/component/chart/drawer/area-drawer.d.ts +0 -7
  34. package/component/chart/drawer/bar-drawer.d.ts +0 -8
  35. package/component/chart/drawer/contour-drawer.d.ts +0 -7
  36. package/component/chart/drawer/default-drawer-mapping.d.ts +0 -4
  37. package/component/chart/drawer/line-drawer.d.ts +0 -11
  38. package/component/chart/drawer/pie-drawer.d.ts +0 -7
  39. package/component/chart/drawer/public-api.d.ts +0 -6
  40. package/component/chart/drawer/scatter-drawer.d.ts +0 -15
  41. package/component/chart/drawer/spline-drawer.d.ts +0 -7
  42. package/component/chart/legend-drawer/default-drawer-legend-mapping.d.ts +0 -3
  43. package/component/chart/legend-drawer/gradient-drawer.d.ts +0 -5
  44. package/component/chart/legend-drawer/swatch-drawer.d.ts +0 -6
  45. package/component/chart/model/annotation.d.ts +0 -59
  46. package/component/chart/model/axis-options.d.ts +0 -43
  47. package/component/chart/model/chart-bounds.d.ts +0 -12
  48. package/component/chart/model/chart-options.d.ts +0 -51
  49. package/component/chart/model/enum/axis-type.d.ts +0 -4
  50. package/component/chart/model/enum/dispatch-type.d.ts +0 -4
  51. package/component/chart/model/enum/drag-point-type.d.ts +0 -5
  52. package/component/chart/model/enum/legend-type.d.ts +0 -4
  53. package/component/chart/model/enum/public-api.d.ts +0 -7
  54. package/component/chart/model/enum/scale-type.d.ts +0 -7
  55. package/component/chart/model/enum/scale.d.ts +0 -5
  56. package/component/chart/model/enum/series-type.d.ts +0 -10
  57. package/component/chart/model/enum/zoom-type.d.ts +0 -5
  58. package/component/chart/model/i-drag-event.d.ts +0 -5
  59. package/component/chart/model/i-drawer-legend.d.ts +0 -12
  60. package/component/chart/model/i-drawer.d.ts +0 -9
  61. package/component/chart/model/i-zoom-event.d.ts +0 -8
  62. package/component/chart/model/plot-band.d.ts +0 -28
  63. package/component/chart/model/plot-line.d.ts +0 -20
  64. package/component/chart/model/point/bar-point.d.ts +0 -6
  65. package/component/chart/model/point/base-point.d.ts +0 -9
  66. package/component/chart/model/point/contour-point.d.ts +0 -4
  67. package/component/chart/model/point/marker-options.d.ts +0 -11
  68. package/component/chart/model/point/public-api.d.ts +0 -3
  69. package/component/chart/model/point/scatter-point.d.ts +0 -5
  70. package/component/chart/model/public-api.d.ts +0 -15
  71. package/component/chart/model/series.d.ts +0 -62
  72. package/component/chart/model/tooltip-options.d.ts +0 -14
  73. package/component/chart/public-api.d.ts +0 -5
  74. package/esm2020/component/chart/chart/chart.component.mjs +0 -164
  75. package/esm2020/component/chart/chart.module.mjs +0 -18
  76. package/esm2020/component/chart/core/axis-creator.mjs +0 -82
  77. package/esm2020/component/chart/core/chart.mjs +0 -1339
  78. package/esm2020/component/chart/core/public-api.mjs +0 -3
  79. package/esm2020/component/chart/drawer/area-drawer.mjs +0 -20
  80. package/esm2020/component/chart/drawer/bar-drawer.mjs +0 -23
  81. package/esm2020/component/chart/drawer/contour-drawer.mjs +0 -29
  82. package/esm2020/component/chart/drawer/default-drawer-mapping.mjs +0 -17
  83. package/esm2020/component/chart/drawer/line-drawer.mjs +0 -152
  84. package/esm2020/component/chart/drawer/pie-drawer.mjs +0 -4
  85. package/esm2020/component/chart/drawer/public-api.mjs +0 -7
  86. package/esm2020/component/chart/drawer/scatter-drawer.mjs +0 -93
  87. package/esm2020/component/chart/drawer/spline-drawer.mjs +0 -23
  88. package/esm2020/component/chart/legend-drawer/default-drawer-legend-mapping.mjs +0 -7
  89. package/esm2020/component/chart/legend-drawer/gradient-drawer.mjs +0 -45
  90. package/esm2020/component/chart/legend-drawer/swatch-drawer.mjs +0 -62
  91. package/esm2020/component/chart/model/annotation.mjs +0 -30
  92. package/esm2020/component/chart/model/axis-options.mjs +0 -26
  93. package/esm2020/component/chart/model/chart-bounds.mjs +0 -13
  94. package/esm2020/component/chart/model/chart-options.mjs +0 -37
  95. package/esm2020/component/chart/model/enum/axis-type.mjs +0 -6
  96. package/esm2020/component/chart/model/enum/dispatch-type.mjs +0 -6
  97. package/esm2020/component/chart/model/enum/drag-point-type.mjs +0 -7
  98. package/esm2020/component/chart/model/enum/legend-type.mjs +0 -6
  99. package/esm2020/component/chart/model/enum/public-api.mjs +0 -8
  100. package/esm2020/component/chart/model/enum/scale-type.mjs +0 -9
  101. package/esm2020/component/chart/model/enum/scale.mjs +0 -7
  102. package/esm2020/component/chart/model/enum/series-type.mjs +0 -12
  103. package/esm2020/component/chart/model/enum/zoom-type.mjs +0 -7
  104. package/esm2020/component/chart/model/i-drag-event.mjs +0 -2
  105. package/esm2020/component/chart/model/i-drawer-legend.mjs +0 -2
  106. package/esm2020/component/chart/model/i-drawer.mjs +0 -2
  107. package/esm2020/component/chart/model/i-zoom-event.mjs +0 -2
  108. package/esm2020/component/chart/model/plot-band.mjs +0 -18
  109. package/esm2020/component/chart/model/plot-line.mjs +0 -13
  110. package/esm2020/component/chart/model/point/bar-point.mjs +0 -2
  111. package/esm2020/component/chart/model/point/base-point.mjs +0 -2
  112. package/esm2020/component/chart/model/point/contour-point.mjs +0 -2
  113. package/esm2020/component/chart/model/point/marker-options.mjs +0 -2
  114. package/esm2020/component/chart/model/point/public-api.mjs +0 -4
  115. package/esm2020/component/chart/model/point/scatter-point.mjs +0 -2
  116. package/esm2020/component/chart/model/public-api.mjs +0 -16
  117. package/esm2020/component/chart/model/series.mjs +0 -27
  118. package/esm2020/component/chart/model/tooltip-options.mjs +0 -19
  119. package/esm2020/component/chart/public-api.mjs +0 -6
@@ -15,14 +15,9 @@ import * as i1$1 from '@ngneat/transloco';
15
15
  import { TranslocoModule, TRANSLOCO_SCOPE } from '@ngneat/transloco';
16
16
  import * as hash from 'object-hash';
17
17
  import hash__default from 'object-hash';
18
- import { SizeStrategy, Datasource, UiScrollModule } from 'ngx-ui-scroll';
19
- import * as d3 from 'd3';
20
- import { zoomIdentity } from 'd3';
21
- import * as d3annotation from 'd3-svg-annotation';
22
- import { annotationBadge, annotationLabel, annotationCallout, annotationCalloutCircle, annotationCalloutCurve, annotationCalloutElbow, annotationCalloutRect, annotationCustomType, annotationXYThreshold } from 'd3-svg-annotation';
23
- import { tricontour } from 'd3-tricontour';
24
18
  import * as THREE from 'three';
25
19
  import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
20
+ import * as d3 from 'd3';
26
21
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
27
22
 
28
23
  class AccordionComponent {
@@ -530,6 +525,31 @@ var DatePickerMode;
530
525
  DatePickerMode[DatePickerMode["year"] = 2] = "year";
531
526
  })(DatePickerMode || (DatePickerMode = {}));
532
527
 
528
+ const getPrecision = (a) => {
529
+ if (!isFinite(a)) {
530
+ return 0;
531
+ }
532
+ let e = 1;
533
+ let p = 0;
534
+ while (Math.round(a * e) / e !== a) {
535
+ e *= 10;
536
+ p++;
537
+ }
538
+ return p;
539
+ };
540
+ const formatNumber = (value, decimalLength, chunkDelimiter, decimalDelimiter, chunkLength) => {
541
+ const abs = Math.abs(value);
542
+ if (0 < abs && 1 > abs) {
543
+ const firstDigitIndex = Math.floor(Math.abs(Math.log10(abs)));
544
+ decimalLength += firstDigitIndex;
545
+ }
546
+ const precision = Math.min(getPrecision(value), Math.floor(decimalLength));
547
+ const result = '\\d(?=(\\d{' + chunkLength + '})+' + (precision > 0 ? '\\D' : '$') + ')';
548
+ const num = value.toFixed(precision);
549
+ return (decimalDelimiter ? num.replace('.', decimalDelimiter) : num).replace(new RegExp(result, 'g'), '$&' + chunkDelimiter);
550
+ };
551
+ const prependZero = (input, length) => ('0'.repeat(length) + input).slice(-length);
552
+
533
553
  class DateUtil {
534
554
  /**
535
555
  * Вычесть n-дней
@@ -577,10 +597,12 @@ class DateUtil {
577
597
  return '';
578
598
  }
579
599
  const month = dat.getMonth() + 1;
580
- const monthString = month < 10 ? '0' + month.toString() : month.toString();
581
- return `${dat.getDate().toString()}.${monthString}.${dat
582
- .getFullYear()
583
- .toString()} ${dat.getHours()}:${dat.getMinutes()}:${dat.getSeconds()}`;
600
+ return `${prependZero(dat.getDate(), 2)}.
601
+ ${prependZero(month, 2)}.
602
+ ${dat.getFullYear()}
603
+ ${prependZero(dat.getHours(), 2)}:
604
+ ${prependZero(dat.getMinutes(), 2)}:
605
+ ${prependZero(dat.getSeconds(), 2)}`;
584
606
  }
585
607
  /**
586
608
  * Подготовка даты к отправке на сервер, чтобы небыло смещения часов
@@ -1510,31 +1532,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
1510
1532
  type: Output
1511
1533
  }] } });
1512
1534
 
1513
- const getPrecision = (a) => {
1514
- if (!isFinite(a)) {
1515
- return 0;
1516
- }
1517
- let e = 1;
1518
- let p = 0;
1519
- while (Math.round(a * e) / e !== a) {
1520
- e *= 10;
1521
- p++;
1522
- }
1523
- return p;
1524
- };
1525
- const formatNumber = (value, decimalLength, chunkDelimiter, decimalDelimiter, chunkLength) => {
1526
- const abs = Math.abs(value);
1527
- if (0 < abs && 1 > abs) {
1528
- const firstDigitIndex = Math.floor(Math.abs(Math.log10(abs)));
1529
- decimalLength += firstDigitIndex;
1530
- }
1531
- const precision = Math.min(getPrecision(value), Math.floor(decimalLength));
1532
- const result = '\\d(?=(\\d{' + chunkLength + '})+' + (precision > 0 ? '\\D' : '$') + ')';
1533
- const num = value.toFixed(precision);
1534
- return (decimalDelimiter ? num.replace('.', decimalDelimiter) : num).replace(new RegExp(result, 'g'), '$&' + chunkDelimiter);
1535
- };
1536
- const prependZero = (input, length) => ('0'.repeat(length) + input).slice(-length);
1537
-
1538
1535
  class PrependZeroPipe {
1539
1536
  transform(value, length) {
1540
1537
  if (value === null || value === undefined) {
@@ -2479,8 +2476,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
2479
2476
  }] });
2480
2477
 
2481
2478
  class ClickOutsideDirective {
2482
- constructor(_elementRef) {
2479
+ constructor(_elementRef, _ngZone) {
2483
2480
  this._elementRef = _elementRef;
2481
+ this._ngZone = _ngZone;
2484
2482
  this.clickOutside = new EventEmitter();
2485
2483
  this.rightClick = false;
2486
2484
  this._handleEvents = false;
@@ -2497,7 +2495,11 @@ class ClickOutsideDirective {
2497
2495
  set tetaClickOutside(val) {
2498
2496
  this._handleEvents = val;
2499
2497
  if (this._handleEvents) {
2500
- this.addListener(this.rightClick);
2498
+ this._ngZone.runOutsideAngular(() => {
2499
+ setTimeout(() => {
2500
+ this.addListener(this.rightClick);
2501
+ });
2502
+ });
2501
2503
  }
2502
2504
  else {
2503
2505
  this.removeListener();
@@ -2520,14 +2522,14 @@ class ClickOutsideDirective {
2520
2522
  window.removeEventListener('contextmenu', this.listener);
2521
2523
  }
2522
2524
  }
2523
- ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
2525
+ 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 });
2524
2526
  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 });
2525
2527
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ClickOutsideDirective, decorators: [{
2526
2528
  type: Directive,
2527
2529
  args: [{
2528
2530
  selector: '[tetaClickOutside]',
2529
2531
  }]
2530
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { clickOutside: [{
2532
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { clickOutside: [{
2531
2533
  type: Output
2532
2534
  }], rightClick: [{
2533
2535
  type: Input
@@ -2646,7 +2648,8 @@ class OnlyNumberDirective {
2646
2648
  }
2647
2649
  else {
2648
2650
  if (e.key === ',' && originalValue.indexOf('.') < 0) {
2649
- this._elementRef.nativeElement.value = originalValue + '.';
2651
+ this._elementRef.nativeElement.value =
2652
+ `${originalValue.slice(0, cursorPosition)}.${originalValue.slice(cursorPosition)}`;
2650
2653
  }
2651
2654
  e.preventDefault();
2652
2655
  }
@@ -3329,10 +3332,10 @@ class FileItemComponent {
3329
3332
  ngOnInit() { }
3330
3333
  }
3331
3334
  FileItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: FileItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3332
- 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: [""] });
3335
+ 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 });
3333
3336
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: FileItemComponent, decorators: [{
3334
3337
  type: Component,
3335
- args: [{ selector: 'teta-file-item', template: "<p>file-item works!</p>\n", styles: [""] }]
3338
+ args: [{ selector: 'teta-file-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p>file-item works!</p>\n", styles: [""] }]
3336
3339
  }], ctorParameters: function () { return []; } });
3337
3340
 
3338
3341
  class FileUploadModule {
@@ -3452,10 +3455,10 @@ class NumericFilterComponent extends FilterComponentBase {
3452
3455
  }
3453
3456
  }
3454
3457
  NumericFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: NumericFilterComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3455
- 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 });
3458
+ 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 });
3456
3459
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: NumericFilterComponent, decorators: [{
3457
3460
  type: Component,
3458
- 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: [""] }]
3461
+ 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: [""] }]
3459
3462
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { column: [{
3460
3463
  type: Input
3461
3464
  }], filterOptions: [{
@@ -4662,7 +4665,8 @@ FilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
4662
4665
  DatePickerModule,
4663
4666
  RadioModule,
4664
4667
  InputModule,
4665
- CheckboxModule], exports: [FilterPanelComponent,
4668
+ CheckboxModule,
4669
+ OnlyNumberModule], exports: [FilterPanelComponent,
4666
4670
  NumericFilterComponent,
4667
4671
  StringFilterComponent,
4668
4672
  ListFilterComponent,
@@ -4677,6 +4681,7 @@ FilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
4677
4681
  RadioModule,
4678
4682
  InputModule,
4679
4683
  CheckboxModule,
4684
+ OnlyNumberModule,
4680
4685
  ]] });
4681
4686
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: FilterModule, decorators: [{
4682
4687
  type: NgModule,
@@ -4707,6 +4712,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
4707
4712
  RadioModule,
4708
4713
  InputModule,
4709
4714
  CheckboxModule,
4715
+ OnlyNumberModule,
4710
4716
  ],
4711
4717
  }]
4712
4718
  }] });
@@ -4893,7 +4899,7 @@ class FilterState {
4893
4899
 
4894
4900
  class MessageService {
4895
4901
  constructor() {
4896
- this._message = new Subject();
4902
+ this._message = new ReplaySubject(1);
4897
4903
  this._clear = new Subject();
4898
4904
  this.message = this._message.asObservable();
4899
4905
  this.clear = this._clear.asObservable();
@@ -6131,6 +6137,9 @@ class HintDirective extends DynamicContentBaseDirective {
6131
6137
  'hint',
6132
6138
  ];
6133
6139
  }
6140
+ ngOnDestroy() {
6141
+ super.ngOnDestroy();
6142
+ }
6134
6143
  }
6135
6144
  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 });
6136
6145
  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 });
@@ -8702,6 +8711,7 @@ class NumericCellComponent extends CellComponentBase {
8702
8711
  if (initiator?.column.name === this.column.name) {
8703
8712
  setTimeout(() => {
8704
8713
  this.input?.nativeElement.focus();
8714
+ this.input?.nativeElement.select();
8705
8715
  this.cdr.markForCheck();
8706
8716
  }, 0);
8707
8717
  }
@@ -8838,7 +8848,8 @@ class StringCellComponent extends CellComponentBase {
8838
8848
  if (initiator?.column.name === this.column.name) {
8839
8849
  this.cdr.markForCheck();
8840
8850
  setTimeout(() => {
8841
- this.input.nativeElement.focus();
8851
+ this.input.nativeElement?.focus();
8852
+ this.input.nativeElement?.select();
8842
8853
  }, 0);
8843
8854
  }
8844
8855
  }
@@ -9047,10 +9058,6 @@ class TableBodyComponent {
9047
9058
  }
9048
9059
  set data(data) {
9049
9060
  this._data = data;
9050
- if (!this.dataSource) {
9051
- this.createAdapter();
9052
- }
9053
- this.resetAdapter();
9054
9061
  }
9055
9062
  get data() {
9056
9063
  return this._data;
@@ -9146,31 +9153,6 @@ class TableBodyComponent {
9146
9153
  ? accum
9147
9154
  : current.data[columnName], null);
9148
9155
  }
9149
- async resetAdapter() {
9150
- await this.dataSource.adapter.relax();
9151
- await this.dataSource.adapter.reset({
9152
- get: this.getData,
9153
- settings: {
9154
- minIndex: 0,
9155
- maxIndex: this._data?.length ? this._data.length - 1 : 0,
9156
- startIndex: 0,
9157
- itemSize: 24,
9158
- sizeStrategy: SizeStrategy.Constant,
9159
- },
9160
- });
9161
- await this.dataSource.adapter.check();
9162
- }
9163
- createAdapter() {
9164
- this.dataSource = new Datasource({
9165
- get: this.getData,
9166
- settings: {
9167
- startIndex: 0,
9168
- bufferSize: 2,
9169
- sizeStrategy: SizeStrategy.Constant,
9170
- itemSize: 24,
9171
- },
9172
- });
9173
- }
9174
9156
  }
9175
9157
  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 });
9176
9158
  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 });
@@ -9765,7 +9747,6 @@ TableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "1
9765
9747
  HintModule,
9766
9748
  TreeModule,
9767
9749
  OnlyNumberModule,
9768
- UiScrollModule,
9769
9750
  ToolbarModule,
9770
9751
  ClickOutsideModule,
9771
9752
  ResizeDragModule,
@@ -9797,7 +9778,6 @@ TableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "1
9797
9778
  HintModule,
9798
9779
  TreeModule,
9799
9780
  OnlyNumberModule,
9800
- UiScrollModule,
9801
9781
  ToolbarModule,
9802
9782
  ClickOutsideModule,
9803
9783
  ResizeDragModule,
@@ -9857,7 +9837,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
9857
9837
  HintModule,
9858
9838
  TreeModule,
9859
9839
  OnlyNumberModule,
9860
- UiScrollModule,
9861
9840
  ToolbarModule,
9862
9841
  ClickOutsideModule,
9863
9842
  ResizeDragModule,
@@ -9947,2267 +9926,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
9947
9926
  }]
9948
9927
  }] });
9949
9928
 
9950
- var Scale;
9951
- (function (Scale) {
9952
- Scale["time"] = "time";
9953
- Scale["number"] = "number";
9954
- Scale["category"] = "category";
9955
- })(Scale || (Scale = {}));
9956
-
9957
- var SeriesType;
9958
- (function (SeriesType) {
9959
- SeriesType[SeriesType["area"] = 0] = "area";
9960
- SeriesType[SeriesType["bar"] = 1] = "bar";
9961
- SeriesType[SeriesType["line"] = 2] = "line";
9962
- SeriesType[SeriesType["pie"] = 3] = "pie";
9963
- SeriesType[SeriesType["scatter"] = 4] = "scatter";
9964
- SeriesType[SeriesType["spline"] = 5] = "spline";
9965
- SeriesType[SeriesType["contour"] = 6] = "contour";
9966
- SeriesType[SeriesType["custom"] = 7] = "custom";
9967
- })(SeriesType || (SeriesType = {}));
9968
-
9969
- class AreaDrawer {
9970
- draw(series, context, scaleX, scaleY) {
9971
- const points = series.data;
9972
- const path = d3
9973
- .area()
9974
- .x1((d) => (d.x1 != null ? scaleX(d.x1) : scaleX(0)))
9975
- .x0((d) => scaleX(d.x))
9976
- .y((d) => scaleY(d.y));
9977
- context
9978
- .append('path')
9979
- .attr('transform', `translate(${0}, 0)`)
9980
- .attr('fill', series.color)
9981
- .attr('stroke', series.color)
9982
- .attr('stroke-width', series.strokeWidth ? series.strokeWidth : 1)
9983
- .datum(points)
9984
- .attr('d', path);
9985
- }
9986
- }
9987
-
9988
- class BarDrawer {
9989
- draw(series, context, scaleX, scaleY) {
9990
- const points = series.data.filter((_) => _.visible);
9991
- const barScale = d3
9992
- .scaleBand()
9993
- .domain(d3.range(points.length))
9994
- .range(scaleX.range())
9995
- .paddingInner(0.2)
9996
- .paddingOuter(0.2);
9997
- const u = context.selectAll('rect').data(points);
9998
- u.enter()
9999
- .append('rect')
10000
- .merge(u)
10001
- .attr('x', (d, i) => barScale(i))
10002
- .attr('y', (d) => scaleY(d.y))
10003
- .attr('width', barScale.bandwidth())
10004
- .attr('height', (d) => Math.abs(scaleY(0) - scaleY(d.y)))
10005
- .attr('fill', (d) => d.color);
10006
- u.exit().remove();
10007
- }
10008
- }
10009
-
10010
- var DispatchType;
10011
- (function (DispatchType) {
10012
- DispatchType["moveLine"] = "moveLine";
10013
- DispatchType["movePoint"] = "movePoint";
10014
- })(DispatchType || (DispatchType = {}));
10015
-
10016
- var DragPointType;
10017
- (function (DragPointType) {
10018
- DragPointType[DragPointType["x"] = 0] = "x";
10019
- DragPointType[DragPointType["y"] = 1] = "y";
10020
- DragPointType[DragPointType["xy"] = 2] = "xy";
10021
- })(DragPointType || (DragPointType = {}));
10022
-
10023
- class LineDrawer {
10024
- constructor() {
10025
- this.dispatch = d3.dispatch(DispatchType.moveLine, DispatchType.movePoint);
10026
- }
10027
- draw(series, context, scaleX, scaleY, options) {
10028
- const points = series.data;
10029
- const markerPoints = points.filter((_) => _.marker);
10030
- const path = d3
10031
- .line()
10032
- .curve(series.curveType)
10033
- .defined((d) => d.x != null && d.y != null)
10034
- .x((d) => scaleX(d.x))
10035
- .y((d) => scaleY(d.y));
10036
- const seriesIndex = options.series.findIndex((_) => _.id === series.id);
10037
- context
10038
- .append('path')
10039
- .attr('class', (d) => series?.drag.enable ? 'draggable' : `series-${seriesIndex}`)
10040
- .attr('data-draggable-id', seriesIndex)
10041
- .attr('fill', 'none')
10042
- .attr('stroke', series.color)
10043
- .attr('stroke-dasharray', series?.strokeDasharray)
10044
- .attr('stroke-width', series.strokeWidth ? series.strokeWidth : 1)
10045
- .style('cursor', series?.drag?.enable ? 'move' : 'default')
10046
- .datum(points)
10047
- .attr('d', path);
10048
- const u = context.append('g').attr('class', 'grabbers');
10049
- const emit = (event, target) => {
10050
- this.dispatch.apply(DispatchType.moveLine, {
10051
- target,
10052
- event,
10053
- });
10054
- };
10055
- if (series.drag.enable) {
10056
- u.selectAll('circle')
10057
- .data(points)
10058
- .enter()
10059
- .append('circle')
10060
- .attr('data-grabber-id', seriesIndex)
10061
- .attr('stroke', series?.drag?.grabbers?.stroke ?? series?.color)
10062
- .attr('stroke-width', series?.drag?.grabbers?.strokeWidth ?? 1)
10063
- .attr('fill', series?.drag?.grabbers?.fill ?? series?.color)
10064
- .attr('r', series?.drag?.grabbers?.radius ?? 4)
10065
- .attr('cx', function (d) {
10066
- return scaleX(d.x);
10067
- })
10068
- .attr('cy', function (d) {
10069
- return scaleY(d.y);
10070
- })
10071
- .style('cursor', 'move')
10072
- .call(d3.drag().on('start drag end', function (event, d) {
10073
- d.x = scaleX.invert(event.sourceEvent?.offsetX);
10074
- d.y = scaleY.invert(event.sourceEvent?.offsetY);
10075
- d3.select(this).attr('cx', scaleX(d.x)).attr('cy', scaleY(d.y));
10076
- context
10077
- .select(`[data-draggable-id='${seriesIndex}']`)
10078
- .attr('d', path);
10079
- emit(event, series);
10080
- if (series?.drag?.extendLine) {
10081
- drawExtendedLine();
10082
- }
10083
- }));
10084
- u.exit().remove();
10085
- }
10086
- const drawExtendedLine = () => {
10087
- context.selectAll(`[data-extended-id='${seriesIndex}']`).remove();
10088
- const p1 = points[0];
10089
- const p2 = points[points.length - 1];
10090
- const distance = Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p2.y, 2));
10091
- if (distance <= 0) {
10092
- return;
10093
- }
10094
- const extendLength = 50;
10095
- const extendedEndX = p2.x + ((p2.x - p1.x) / distance) * extendLength;
10096
- const extendedEndY = p2.y + ((p2.y - p1.y) / distance) * extendLength;
10097
- const extendedStartX = p1.x - ((p2.x - p1.x) / distance) * extendLength;
10098
- const extendedStartY = p1.y - ((p2.y - p1.y) / distance) * extendLength;
10099
- context
10100
- .append('line')
10101
- .attr('class', 'extendedLine')
10102
- .attr('data-extended-id', seriesIndex)
10103
- .attr('stroke', series?.color)
10104
- .attr('stroke-width', series?.strokeWidth)
10105
- .attr('stroke-dasharray', series?.strokeDasharray)
10106
- .attr('x1', scaleX(p1.x))
10107
- .attr('y1', scaleY(p1.y))
10108
- .attr('x2', scaleX(extendedStartX))
10109
- .attr('y2', scaleY(extendedStartY));
10110
- context
10111
- .append('line')
10112
- .attr('class', 'extendedLine')
10113
- .attr('data-extended-id', seriesIndex)
10114
- .attr('stroke', series?.color)
10115
- .attr('stroke-width', series?.strokeWidth)
10116
- .attr('stroke-dasharray', series?.strokeDasharray)
10117
- .attr('x1', scaleX(p2.x))
10118
- .attr('y1', scaleY(p2.y))
10119
- .attr('x2', scaleX(extendedEndX))
10120
- .attr('y2', scaleY(extendedEndY));
10121
- };
10122
- if (series?.drag?.extendLine && points?.length) {
10123
- drawExtendedLine();
10124
- }
10125
- if (markerPoints?.length) {
10126
- const emit = (event, target) => {
10127
- this.dispatch.apply(DispatchType.movePoint, {
10128
- target: series,
10129
- point: {
10130
- ...target,
10131
- },
10132
- event,
10133
- });
10134
- };
10135
- context
10136
- .selectAll(`draggable-marker-${seriesIndex}`)
10137
- .data(markerPoints)
10138
- .enter()
10139
- .append('circle')
10140
- .attr('class', `draggable-marker-${seriesIndex}`)
10141
- .attr('r', (d) => d.marker?.style?.radius || 5)
10142
- .attr('cx', function (d) {
10143
- return scaleX(d.x);
10144
- })
10145
- .attr('cy', function (d) {
10146
- return scaleY(d.y);
10147
- })
10148
- .style('cursor', 'pointer')
10149
- .style('fill', (d) => d.marker?.style?.color || 'none')
10150
- .attr('stroke', (d) => d.marker?.style?.stroke || 'none')
10151
- .attr('stroke-width', (d) => d.marker?.style?.strokeWidth || 0);
10152
- context.selectAll(`.draggable-marker-${seriesIndex}`).call(d3.drag().on('drag start end', function dragged(event, d) {
10153
- const node = d3.select(this);
10154
- if (event.type === 'start') {
10155
- node.raise().classed('active', true);
10156
- }
10157
- if (d.marker?.dragType === DragPointType.x) {
10158
- d.x = scaleX.invert(event.sourceEvent?.offsetX);
10159
- node.attr('cx', scaleX(d.x));
10160
- }
10161
- if (d.marker?.dragType === DragPointType.y) {
10162
- d.y = scaleY.invert(event.sourceEvent?.offsetY);
10163
- node.attr('cy', scaleY(d.y));
10164
- }
10165
- context.select(`.series-${seriesIndex}`).attr('d', path);
10166
- emit(event, d);
10167
- }));
10168
- }
10169
- }
10170
- }
10171
-
10172
- class PieDrawer {
10173
- draw(series, context, scaleX, scaleY) { }
10174
- }
10175
-
10176
- class SplineDrawer {
10177
- draw(series, context, scaleX, scaleY) {
10178
- const points = series.data;
10179
- const path = d3
10180
- .line()
10181
- .curve(d3.curveCatmullRom)
10182
- .defined((d) => d.x != null && d.y != null)
10183
- .x((d) => scaleX(d.x))
10184
- .y((d) => scaleY(d.y));
10185
- context
10186
- .append('path')
10187
- .attr('transform', `translate(${0}, 0)`)
10188
- .attr('fill', 'none')
10189
- .attr('stroke', series.color)
10190
- .attr('stroke-width', series.strokeWidth ? series.strokeWidth : 1)
10191
- .datum(points)
10192
- .attr('d', path)
10193
- .transition()
10194
- .duration(750);
10195
- }
10196
- }
10197
-
10198
- class ScatterDrawer {
10199
- constructor() {
10200
- this._colorToData = {};
10201
- }
10202
- draw(series, context, scaleX, scaleY, options) {
10203
- this._options = options;
10204
- d3.select(context.node().parentNode).select('.virtual-canvas').remove();
10205
- if (series.renderTo === 'canvas') {
10206
- this._context = context;
10207
- const height = context.node().clientHeight;
10208
- const width = context.node().clientWidth;
10209
- const points = series.data;
10210
- const context2D = context.node().getContext('2d');
10211
- this._virtualCanvas = d3
10212
- .select(context.node().parentNode)
10213
- .append('canvas')
10214
- .attr('class', 'virtual-canvas')
10215
- .style('display', 'none');
10216
- this._virtualCanvas.attr('width', width).attr('height', height);
10217
- const virtualContext = this._virtualCanvas.node().getContext('2d');
10218
- context.on('mouseout', () => {
10219
- d3.select(this._context.node().parentNode)
10220
- .select('.tooltip-chart')
10221
- .style('display', 'none');
10222
- context.on('mousemove', null);
10223
- });
10224
- context.on('mouseenter', () => {
10225
- d3.select(this._context.node().parentNode)
10226
- .select('.tooltip-chart')
10227
- .style('display', null);
10228
- context.on('mousemove', (e) => this.handleMouseMove(e));
10229
- });
10230
- points.forEach((d, idx) => {
10231
- const color = this.getColor(idx);
10232
- this._colorToData[color] = d;
10233
- virtualContext.fillStyle = color;
10234
- context2D.fillStyle = d.color;
10235
- const cx = scaleX(d.x);
10236
- const cy = scaleY(d.y);
10237
- context2D.beginPath();
10238
- context2D.arc(cx, cy, d.radius, 0, 2 * Math.PI);
10239
- context2D.closePath();
10240
- context2D.fill();
10241
- virtualContext.beginPath();
10242
- virtualContext.arc(cx, cy, d.radius, 0, 2 * Math.PI);
10243
- virtualContext.closePath();
10244
- virtualContext.fill();
10245
- });
10246
- }
10247
- }
10248
- getColor(index) {
10249
- return d3
10250
- .rgb(Math.floor(index / 256 / 256) % 256, Math.floor(index / 256) % 256, index % 256)
10251
- .toString();
10252
- }
10253
- tooltipPosition(event) {
10254
- const centerX = this._context.node().clientWidth / 2;
10255
- const centerY = this._context.node().clientHeight / 2;
10256
- const padding = { x: 10, y: 10 };
10257
- const scene = {
10258
- left: event.pageX > centerX ? 'initial' : `${event.pageX + padding.x}px`,
10259
- top: event.pageY > centerY ? 'initial' : `${event.pageY + padding.y}px`,
10260
- bottom: event.pageY > centerY
10261
- ? `${window.innerHeight - event.pageY}px`
10262
- : 'initial',
10263
- right: event.pageX > centerX
10264
- ? `${window.innerWidth - event.pageX + padding.x}px`
10265
- : 'initial',
10266
- };
10267
- return scene;
10268
- }
10269
- handleMouseMove(event) {
10270
- const mouse = d3.pointer(event);
10271
- const virtualContext = this._virtualCanvas.node().getContext('2d');
10272
- const image = virtualContext.getImageData(mouse[0], mouse[1], 1, 1);
10273
- const color = d3.rgb.apply(null, image.data).toString();
10274
- const possibleDatum = this._colorToData[color];
10275
- const { top, right, bottom, left } = this.tooltipPosition(event);
10276
- if (possibleDatum) {
10277
- const formatted = this._options.tooltip?.format([possibleDatum]);
10278
- d3.select(this._context.node().parentNode)
10279
- .select('.tooltip-chart')
10280
- .style('z-index', 3)
10281
- .style('top', top)
10282
- .style('right', right)
10283
- .style('bottom', bottom)
10284
- .style('left', left)
10285
- .html(formatted);
10286
- }
10287
- }
10288
- }
10289
-
10290
- class ContourDrawer {
10291
- draw(series, context, scaleX, scaleY) {
10292
- const points = series.data;
10293
- const tricontourFn = tricontour()
10294
- .x((d) => scaleX(d.x))
10295
- .y((d) => scaleY(d.y))
10296
- .value((d) => d.value)
10297
- .thresholds(30);
10298
- let contours = tricontourFn(points);
10299
- const geoFn = d3.geoPath();
10300
- const color = series?.colorScale.domain(d3.extent(contours, (d) => d.value));
10301
- contours = contours.map((_) => ({
10302
- ..._,
10303
- color: color(_.value),
10304
- }));
10305
- const u = context.selectAll('path').data(contours);
10306
- u.enter()
10307
- .append('path')
10308
- .merge(u)
10309
- .attr('d', (_) => geoFn(_))
10310
- .attr('stroke', 'rgba(255, 255,255,0.5)')
10311
- .attr('stroke-width', 0.5)
10312
- .attr('fill', (_) => _.color);
10313
- u.exit().remove();
10314
- }
10315
- }
10316
-
10317
- const defaultDrawerMapping = new Map()
10318
- .set(SeriesType.area, new AreaDrawer())
10319
- .set(SeriesType.bar, new BarDrawer())
10320
- .set(SeriesType.line, new LineDrawer())
10321
- .set(SeriesType.pie, new PieDrawer())
10322
- .set(SeriesType.scatter, new ScatterDrawer())
10323
- .set(SeriesType.spline, new SplineDrawer())
10324
- .set(SeriesType.contour, new ContourDrawer());
10325
-
10326
- var LegendType;
10327
- (function (LegendType) {
10328
- LegendType[LegendType["swatches"] = 0] = "swatches";
10329
- LegendType[LegendType["gradient"] = 1] = "gradient";
10330
- })(LegendType || (LegendType = {}));
10331
-
10332
- const classTypeLegendMapping = new Map()
10333
- .set(SeriesType.line, 'line')
10334
- .set(SeriesType.spline, 'line');
10335
- class SwatchDrawer {
10336
- draw(options) {
10337
- d3.select(options.context.parentElement)
10338
- .select('.legend-container')
10339
- .selectAll('.legend')
10340
- .remove();
10341
- const defaultData = options.series?.filter((serie) => serie.type !== SeriesType.bar);
10342
- const barData = options?.series
10343
- ?.filter((serie) => serie.type === SeriesType.bar)
10344
- .reduce((acc, serie) => {
10345
- const data = serie.data.map((_) => ({
10346
- ..._,
10347
- serieType: serie.type,
10348
- serieIndex: serie.id,
10349
- }));
10350
- return acc.concat(data);
10351
- }, []);
10352
- const legendContainer = d3
10353
- .select(options.context.parentElement)
10354
- .select('.legend-container')
10355
- .append('div')
10356
- .attr('class', 'legend padding-bottom-4');
10357
- const defaultLegend = legendContainer
10358
- .selectAll('div')
10359
- .data(defaultData)
10360
- .enter()
10361
- .append('div')
10362
- .attr('class', 'item')
10363
- .style('user-select', 'none');
10364
- const barLegend = legendContainer
10365
- .selectAll('.bar')
10366
- .data(barData)
10367
- .enter()
10368
- .append('div')
10369
- .attr('class', 'item bar')
10370
- .style('user-select', 'none');
10371
- defaultLegend
10372
- .append('div')
10373
- .attr('class', (_) => classTypeLegendMapping.get(_.type) || 'swatch')
10374
- .style('background', (_) => _.visible ? _.color ?? 'black' : 'var(--color-text-10)');
10375
- defaultLegend
10376
- .append('div')
10377
- .attr('class', 'label')
10378
- .text((_) => _.name ?? 'Без названия')
10379
- .style('text-decoration', (_) => (_.visible ? 'unset' : 'line-through'));
10380
- barLegend
10381
- .append('div')
10382
- .attr('class', 'swatch')
10383
- .style('background', (_) => _.visible ? _.color ?? 'black' : 'var(--color-text-10)');
10384
- barLegend
10385
- .append('div')
10386
- .attr('class', 'label')
10387
- .text((_) => _.label ?? 'Без названия')
10388
- .style('text-decoration', (_) => (_.visible ? 'unset' : 'line-through'));
10389
- }
10390
- }
10391
-
10392
- class GradientDrawer {
10393
- draw(options) {
10394
- const container = d3
10395
- .select(options.context.parentElement)
10396
- .select('.legend-container');
10397
- container.selectAll('.gradient-legend').remove();
10398
- const svg = container
10399
- .append('svg')
10400
- .attr('class', 'gradient-legend')
10401
- .attr('width', options.width)
10402
- .attr('height', 32);
10403
- svg.selectAll('.legend-defs').remove();
10404
- const extent = d3.extent(options.series[0]?.data, (d) => d.value);
10405
- const defs = svg.append('defs').attr('class', 'legend-defs');
10406
- const linearGradient = defs
10407
- .append('linearGradient')
10408
- .attr('id', 'legend-gradient');
10409
- linearGradient
10410
- .selectAll('stop')
10411
- .data([...options.series[0]?.data].reverse())
10412
- .enter()
10413
- .append('stop')
10414
- .attr('offset', (d) => ((d.value - extent[0]) / (extent[1] - extent[0])) * 100 + '%')
10415
- .attr('stop-color', (d) => d.color);
10416
- const g = svg.append('g').attr('class', 'gradient-legend');
10417
- g.append('rect')
10418
- .attr('width', options.width - 80)
10419
- .attr('transform', 'translate(40, 0)')
10420
- .attr('height', 4)
10421
- .style('fill', 'url(#legend-gradient)');
10422
- const xScale = d3
10423
- .scaleLinear()
10424
- .range([80, options.width - 80])
10425
- .domain(extent)
10426
- .nice();
10427
- const tickCount = options.width / 80;
10428
- const xAxis = d3.axisBottom(xScale).tickSize(8).ticks(tickCount);
10429
- g.call(xAxis).call((node) => {
10430
- node.select('.domain').remove();
10431
- node.selectAll('line').remove();
10432
- });
10433
- }
10434
- }
10435
-
10436
- const defaultLegendDrawerMapping = new Map()
10437
- .set(LegendType.swatches, new SwatchDrawer())
10438
- .set(LegendType.gradient, new GradientDrawer());
10439
-
10440
- var AxisType;
10441
- (function (AxisType) {
10442
- AxisType[AxisType["abscissa"] = 0] = "abscissa";
10443
- AxisType[AxisType["ordinatus"] = 1] = "ordinatus";
10444
- })(AxisType || (AxisType = {}));
10445
-
10446
- class Axis {
10447
- constructor(options) {
10448
- this._extents = [0, 0];
10449
- this._type = options?.type;
10450
- this._index = options?.index || 0;
10451
- this._chartOptions = options?.chartOptions;
10452
- this._height = options?.height;
10453
- if (this._chartOptions == null) {
10454
- throw new Error(`No chartOptions for axis ${AxisType[this._type]}`);
10455
- }
10456
- this.createExtents();
10457
- this.width = this.calculateAxisWidth();
10458
- }
10459
- get index() {
10460
- return this._index;
10461
- }
10462
- get options() {
10463
- return this._type === AxisType.abscissa
10464
- ? this._chartOptions.xAxis[this.index]
10465
- : this._chartOptions.yAxis[this.index];
10466
- }
10467
- get extent() {
10468
- return this._extents;
10469
- }
10470
- get type() {
10471
- return this._type;
10472
- }
10473
- get offset() {
10474
- return this._offset;
10475
- }
10476
- get ticks() {
10477
- return this._ticks;
10478
- }
10479
- setOffset(offset) {
10480
- this._offset = offset;
10481
- }
10482
- calculateAxisWidth() {
10483
- if (this.type === AxisType.abscissa) {
10484
- return 0;
10485
- }
10486
- const y = d3
10487
- .scaleLinear()
10488
- .domain([this.extent[0], this.extent[1]])
10489
- .range([0, this._height])
10490
- .nice();
10491
- const body = d3
10492
- .select('body')
10493
- .append('svg')
10494
- .attr('class', 'calculate-offset')
10495
- .style('position', 'absolute')
10496
- .style('left', '-9999px');
10497
- const axis = d3.axisRight(y).tickValues(this.ticks);
10498
- const element = body.append('g').attr('class', 'font-caption').call(axis);
10499
- const bBox = element.node().getBBox();
10500
- d3.selectAll('.calculate-offset').remove();
10501
- return bBox.width;
10502
- }
10503
- createExtents() {
10504
- const hasMin = this.options?.min != null;
10505
- const hasMax = this.options?.max != null;
10506
- if (!hasMin || !hasMax) {
10507
- const filtered = this._chartOptions?.series?.filter((serie) => this._index ===
10508
- serie[this._type === AxisType.abscissa ? 'xAxisIndex' : 'yAxisIndex']);
10509
- const raw = filtered.map((series) => d3.extent(series?.data, (point) => this._type === AxisType.abscissa ? point.x : point.y));
10510
- const merged = [].concat(...(raw ?? []));
10511
- const abs = (num) => Math.abs(num);
10512
- this._extents = this.options.negative
10513
- ? [-Math.abs(d3.max(merged.map(abs))), d3.max(merged.map(abs))]
10514
- : [d3.min(merged), d3.max(merged)];
10515
- }
10516
- if (hasMin) {
10517
- this._extents[0] = this.options?.min;
10518
- }
10519
- if (hasMax) {
10520
- this._extents[1] = this.options?.max;
10521
- }
10522
- }
10523
- }
10524
- Axis.offsetFactor = 22;
10525
-
10526
- var ScaleType;
10527
- (function (ScaleType) {
10528
- ScaleType[ScaleType["linear"] = 0] = "linear";
10529
- ScaleType[ScaleType["log"] = 1] = "log";
10530
- ScaleType[ScaleType["pow"] = 2] = "pow";
10531
- ScaleType[ScaleType["sqrt"] = 3] = "sqrt";
10532
- ScaleType[ScaleType["time"] = 4] = "time";
10533
- })(ScaleType || (ScaleType = {}));
10534
-
10535
- var ZoomType;
10536
- (function (ZoomType) {
10537
- ZoomType[ZoomType["x"] = 0] = "x";
10538
- ZoomType[ZoomType["y"] = 1] = "y";
10539
- ZoomType[ZoomType["xy"] = 2] = "xy";
10540
- })(ZoomType || (ZoomType = {}));
10541
-
10542
- class TetaChart {
10543
- constructor(options, element) {
10544
- this.plotLinesMove$ = new Subject();
10545
- this.plotBandsMove$ = new Subject();
10546
- this.seriesMove$ = new Subject();
10547
- this.pointMove$ = new Subject();
10548
- this.zoom$ = new Subject();
10549
- this._container = null;
10550
- this._width = 0;
10551
- this._height = 0;
10552
- this._zoomYCache = new Map();
10553
- this._zoomXCache = new Map();
10554
- this._zoom = d3.zoom();
10555
- this.visibleChartWindowWidth = 0;
10556
- this._xScales = new Map();
10557
- this._yScales = new Map();
10558
- this._clonedX = new Map();
10559
- this._clonedY = new Map();
10560
- this.offsetOpposite = 0;
10561
- this.offsetNonOpposite = 0;
10562
- this._zoomAdded = false;
10563
- this._options = options;
10564
- this.selectNode(element);
10565
- this.createTooltip();
10566
- this.plotLinesMove = this.plotLinesMove$.asObservable();
10567
- this.plotBandsMove = this.plotBandsMove$.asObservable();
10568
- this.seriesMove = this.seriesMove$.asObservable();
10569
- this.pointMove = this.pointMove$.asObservable();
10570
- this.zoom = this.zoom$.asObservable();
10571
- }
10572
- redraw(options) {
10573
- if (options) {
10574
- this._options = options;
10575
- }
10576
- this.createAxis();
10577
- this.createScales();
10578
- this.createMarkers();
10579
- this.createVisibleWindow();
10580
- this._redraw();
10581
- this.drawLegend();
10582
- if (this._commonZoomTransform) {
10583
- this._chart.call(this._zoom.transform, this._commonZoomTransform);
10584
- }
10585
- if (!this._zoomAdded) {
10586
- this.addZoom();
10587
- this._zoomAdded = true;
10588
- }
10589
- this.addAxesZoom();
10590
- }
10591
- setZoom(zoom) {
10592
- if (!this._zoom) {
10593
- return;
10594
- }
10595
- this._chart.call(this._zoom.transform, zoom?.zoomTransform ?? zoomIdentity);
10596
- }
10597
- setSize(size = { width: 0, height: 0 }) {
10598
- this._height = size.height;
10599
- this._width = size.width;
10600
- this._chart.attr('width', this._width).attr('height', this._height);
10601
- this._canvas.attr('width', this._width).attr('height', this._height);
10602
- const extent = [
10603
- [
10604
- this.offsetNonOpposite
10605
- ? this.offsetNonOpposite
10606
- : this._options.bounds.left,
10607
- this._options.bounds.top,
10608
- ],
10609
- [
10610
- this._width -
10611
- (this.offsetOpposite
10612
- ? this.offsetOpposite
10613
- : this._options.bounds.right),
10614
- this._height - this._options.bounds.bottom,
10615
- ],
10616
- ];
10617
- this._zoom
10618
- .scaleExtent([1, Infinity])
10619
- .translateExtent(extent)
10620
- .extent(extent);
10621
- }
10622
- createVisibleWindow() {
10623
- this.uniqId = (Date.now() + Math.random()).toString(36);
10624
- this._chart.selectAll('defs').remove();
10625
- this._chart
10626
- .append('defs')
10627
- .append('clipPath')
10628
- .attr('id', `draw-window-${this.uniqId}`)
10629
- .append('rect')
10630
- .attr('x', this.offsetNonOpposite === 0
10631
- ? this._options.bounds.left
10632
- : this.offsetNonOpposite)
10633
- .attr('y', this._options.bounds.top)
10634
- .attr('width', this.visibleChartWindowWidth + 1)
10635
- .attr('height', this._height -
10636
- this._options.bounds.bottom -
10637
- this._options.bounds.top +
10638
- 1 >
10639
- 0
10640
- ? this._height -
10641
- this._options.bounds.bottom -
10642
- this._options.bounds.top +
10643
- 1
10644
- : 0);
10645
- }
10646
- createAxis() {
10647
- this._xAxisList = this._options.xAxis.map((_, index) => new Axis({
10648
- type: AxisType.abscissa,
10649
- index,
10650
- chartOptions: this._options,
10651
- }));
10652
- this._yAxisList = this._options.yAxis.map((_, index) => {
10653
- const axis = new Axis({
10654
- type: AxisType.ordinatus,
10655
- index,
10656
- chartOptions: this._options,
10657
- height: this._height,
10658
- });
10659
- return axis;
10660
- });
10661
- const nonTitleOffset = 6;
10662
- this.offsetNonOpposite = d3.reduce(this._yAxisList.filter((_) => _.options?.opposite !== true && _.options?.visible), (sum, axis) => {
10663
- const offset = sum +
10664
- axis.width +
10665
- (axis?.options?.title ? Axis.offsetFactor : nonTitleOffset);
10666
- axis.setOffset(offset);
10667
- return offset;
10668
- }, 0);
10669
- this.offsetOpposite = d3.reduce(this._yAxisList.filter((_) => _.options?.opposite === true && _.options?.visible), (sum, axis) => {
10670
- const offset = sum +
10671
- axis.width +
10672
- (axis?.options?.title ? Axis.offsetFactor : nonTitleOffset);
10673
- axis.setOffset(offset);
10674
- return offset;
10675
- }, 0);
10676
- this.visibleChartWindowWidth = this.caluclateChartWidth();
10677
- }
10678
- _redraw() {
10679
- this.drawPlotBands();
10680
- this.drawPlotLines();
10681
- this.drawChart();
10682
- this.drawAxis();
10683
- this.drawGridLines();
10684
- this.drawAnnotations();
10685
- }
10686
- addZoom() {
10687
- if (this._options?.zoom?.enable) {
10688
- const hasXZoom = [ZoomType.x, ZoomType.xy].includes(this._options.zoom.zoomType);
10689
- const hasYZoom = [ZoomType.y, ZoomType.xy].includes(this._options.zoom.zoomType);
10690
- this._chart.call(this._zoom.on('start end zoom', (event) => {
10691
- if (hasXZoom) {
10692
- for (const [key, value] of this._clonedX.entries()) {
10693
- const rescaled = event.transform.rescaleX(value);
10694
- this._xScales.set(key, rescaled);
10695
- if (event.sourceEvent) {
10696
- this.zoom$.next({
10697
- domain: rescaled.domain(),
10698
- zoomTransform: event.transform,
10699
- zoomType: ZoomType.x,
10700
- event,
10701
- });
10702
- }
10703
- }
10704
- }
10705
- if (hasYZoom) {
10706
- for (const [key, value] of this._clonedY.entries()) {
10707
- const rescaled = event.transform.rescaleY(value);
10708
- this._yScales.set(key, rescaled);
10709
- if (event.type === 'zoom') {
10710
- if (event.sourceEvent) {
10711
- this.zoom$.next({
10712
- domain: rescaled.domain(),
10713
- zoomTransform: event.transform,
10714
- zoomType: ZoomType.y,
10715
- event,
10716
- });
10717
- }
10718
- }
10719
- }
10720
- }
10721
- if (event.type === 'end') {
10722
- this._commonZoomTransform = event.transform;
10723
- }
10724
- this._redraw();
10725
- }));
10726
- }
10727
- }
10728
- addAxesZoom() {
10729
- this._chart.selectAll('.zoom-behavior').remove();
10730
- [...this._yAxisList, ...this._xAxisList]
10731
- .filter((axis) => axis.options.visible && axis.options.zoom)
10732
- .forEach((axis) => {
10733
- const foundNode = this._chart
10734
- .select(`[data-${axis.type === AxisType.abscissa ? 'x' : 'y'}-scale-id='${axis.index}']`)
10735
- .node();
10736
- if (!foundNode) {
10737
- return;
10738
- }
10739
- const bBox = foundNode.getBBox();
10740
- const translateX = axis.type === AxisType.abscissa
10741
- ? this.offsetNonOpposite
10742
- ? this.offsetNonOpposite
10743
- : this._options.bounds.left + this.offsetNonOpposite
10744
- : axis.options.opposite
10745
- ? this._width - axis.offset
10746
- : axis.offset - bBox.width;
10747
- const zoom = d3
10748
- .zoom()
10749
- .scaleExtent([1, Infinity])
10750
- .on('zoom end', (event) => {
10751
- if (axis.type === AxisType.abscissa) {
10752
- const scale = this._clonedX.get(axis.index);
10753
- this._xScales.set(axis.index, event.transform.rescaleX(scale));
10754
- }
10755
- else {
10756
- const scale = this._clonedY.get(axis.index);
10757
- this._yScales.set(axis.index, event.transform.rescaleY(scale));
10758
- }
10759
- if (event.type === 'end') {
10760
- if (axis.type === AxisType.ordinatus) {
10761
- this._zoomYCache.set(axis.index, event.transform);
10762
- }
10763
- if (axis.type === AxisType.abscissa) {
10764
- this._zoomXCache.set(axis.index, event.transform);
10765
- this._chart.call(this._zoom.transform, event.transform);
10766
- }
10767
- }
10768
- this._redraw();
10769
- });
10770
- const restoredTransform = axis.type === AxisType.ordinatus
10771
- ? this._zoomYCache.get(axis.index)
10772
- : this._zoomXCache.get(axis.index);
10773
- this._chart
10774
- .append('rect')
10775
- .attr('class', 'zoom-behavior')
10776
- .attr('height', bBox.height)
10777
- .attr('width', bBox.width)
10778
- .attr('transform', `translate(${translateX}, ${axis.type === AxisType.abscissa
10779
- ? this._height - this._options.bounds.bottom
10780
- : this._options.bounds.top})`)
10781
- .style('opacity', '0')
10782
- .style('pointer-events', 'all')
10783
- .call(zoom.transform, restoredTransform ?? d3.zoomIdentity)
10784
- .call(zoom);
10785
- });
10786
- }
10787
- selectNode(element) {
10788
- this._container = element;
10789
- d3.select(element.nativeElement).selectAll('.tooltip-chart').remove();
10790
- d3.select(element.nativeElement).selectAll('svg').remove();
10791
- d3.select(element.nativeElement).selectAll('canvas').remove();
10792
- this._chart = d3
10793
- .select(element.nativeElement)
10794
- .append('svg')
10795
- .attr('position', 'relative')
10796
- .style('z-index', 0);
10797
- this._canvas = d3
10798
- .select(element.nativeElement)
10799
- .append('canvas')
10800
- .attr('class', 'main-canvas')
10801
- .style('transform', 'translate(35, 0)')
10802
- .style('position', 'absolute')
10803
- .style('z-index', 1);
10804
- }
10805
- drawAnnotations() {
10806
- this._chart.selectAll('.annotations').remove();
10807
- const annotations = this._options.annotations?.map((annotation) => {
10808
- const x = this._xScales.get(annotation.xAxisIndex);
10809
- const y = this._yScales.get(annotation.yAxisIndex);
10810
- return {
10811
- note: annotation.note,
10812
- connector: annotation.connector,
10813
- x: x(annotation.point?.x),
10814
- y: y(annotation.point?.y),
10815
- dx: annotation.dx,
10816
- dy: annotation.dy,
10817
- type: annotation.type,
10818
- className: annotation.className,
10819
- };
10820
- });
10821
- const makeAnnotations = d3annotation
10822
- .annotation()
10823
- .annotations(annotations ?? []);
10824
- this._chart
10825
- .append('g')
10826
- .attr('class', 'annotations')
10827
- .attr('clip-path', `url(#draw-window-${this.uniqId})`)
10828
- .call(makeAnnotations)
10829
- .lower();
10830
- }
10831
- drawPlotLines() {
10832
- this._chart.selectAll('.plotlines').remove();
10833
- const plotlineGroup = this._chart
10834
- .append('g')
10835
- .attr('class', 'plotlines')
10836
- .style('shape-rendering', 'crispEdges')
10837
- .attr('clip-path', `url(#draw-window-${this.uniqId})`);
10838
- this._xAxisList
10839
- .filter((_) => _.options.plotLines.length > 0)
10840
- .forEach((axis) => {
10841
- const [min, max] = axis.extent;
10842
- const x = this._xScales.get(axis.index);
10843
- const plotlinesPoints = axis.options.plotLines;
10844
- const getTextCenterPointPx = (d, idx) => x((d?.value +
10845
- (plotlinesPoints[idx - 1]
10846
- ? plotlinesPoints[idx - 1]?.value
10847
- : 0)) /
10848
- 2);
10849
- const opacity = (d, idx) => {
10850
- const displayWidth = 20;
10851
- const width = x(d?.value) -
10852
- x(plotlinesPoints[idx - 1] ? plotlinesPoints[idx - 1]?.value : 0);
10853
- return width <= displayWidth ? 0 : 1;
10854
- };
10855
- plotlineGroup
10856
- .selectAll('.label')
10857
- .data(plotlinesPoints)
10858
- .join('text')
10859
- .attr('class', 'label font-body-3 fill-text-70')
10860
- .attr('x', getTextCenterPointPx)
10861
- .attr('y', (d) => this._height / 2)
10862
- .attr('text-anchor', 'middle')
10863
- .attr('dominant-baseline', 'central')
10864
- .attr('transform', (d, idx) => `rotate(-90, ${getTextCenterPointPx(d, idx)}, ${this._height / 2})`)
10865
- .text((d) => d?.label ?? '')
10866
- .style('opacity', opacity);
10867
- plotlineGroup
10868
- .selectAll('.plotline')
10869
- .data(plotlinesPoints)
10870
- .join('line')
10871
- .attr('class', 'plotline')
10872
- .attr('data-plotline-id', (d) => d.id)
10873
- .attr('x1', (d) => x(d.value))
10874
- .attr('x2', (d) => x(d.value))
10875
- .attr('y1', 0)
10876
- .attr('y2', this._height -
10877
- this._options.bounds.top -
10878
- this._options.bounds.bottom)
10879
- .attr('transform', `translate(0, ${this._options.bounds.top})`)
10880
- .style('stroke-width', (d) => d.width)
10881
- .style('stroke', (d) => d.color)
10882
- .style('stroke-dasharray', (d) => (d.dashed ? '8, 8' : '0, 0'));
10883
- const emit = (event, plotLine) => {
10884
- this.plotLinesMove$.next({ event, target: plotLine });
10885
- };
10886
- plotlineGroup
10887
- .selectAll('.drag-plotline')
10888
- .data(plotlinesPoints)
10889
- .join('line')
10890
- .attr('class', 'drag-plotline')
10891
- .attr('x1', (d) => x(d.value))
10892
- .attr('x2', (d) => x(d.value))
10893
- .attr('y1', 0)
10894
- .attr('y2', this._height -
10895
- this._options.bounds.top -
10896
- this._options.bounds.bottom)
10897
- .attr('transform', `translate(0, ${this._options.bounds.top})`)
10898
- .style('stroke-width', 8)
10899
- .style('stroke', 'rgba(0, 0, 0, 0)')
10900
- .style('cursor', 'col-resize')
10901
- .call(d3
10902
- .drag()
10903
- .on('drag', function (event, d) {
10904
- const group = d3.select(this).node().parentElement;
10905
- const draggedPlotLine = d3
10906
- .select(group)
10907
- .select(`[data-plotline-id='${d.id}']`);
10908
- d.value = x.invert(event.x);
10909
- const minValue = d.min ?? min;
10910
- const maxValue = d.max ?? max;
10911
- const borderLeftReached = d.value <= minValue;
10912
- const borderRightReached = d.value >= maxValue;
10913
- if (borderLeftReached) {
10914
- d.value = minValue;
10915
- }
10916
- if (borderRightReached) {
10917
- d.value = maxValue;
10918
- }
10919
- d3.select(this).attr('x1', x(d.value)).attr('x2', x(d.value));
10920
- draggedPlotLine.attr('x1', x(d.value)).attr('x2', x(d.value));
10921
- emit(event, d);
10922
- })
10923
- .on('end', (event, d) => {
10924
- emit(event, d);
10925
- }));
10926
- });
10927
- this._yAxisList
10928
- .filter((_) => _.options.plotLines.length > 0)
10929
- .forEach((axis) => {
10930
- const [min, max] = axis.extent;
10931
- const y = this._yScales.get(axis.index);
10932
- const plotlinesPoints = axis.options.plotLines;
10933
- plotlineGroup
10934
- .selectAll('.plotline')
10935
- .data(plotlinesPoints)
10936
- .join('line')
10937
- .attr('class', 'plotline')
10938
- .attr('data-plotline-id', (d) => d.id)
10939
- .attr('y1', (d) => y(d.value))
10940
- .attr('y2', (d) => y(d.value))
10941
- .attr('x1', 0)
10942
- .attr('x2', this._width - this._options.bounds.left - this._options.bounds.right)
10943
- .attr('transform', `translate(${this._options.bounds.left}, 0)`)
10944
- .style('stroke-width', (d) => d.width)
10945
- .style('stroke', (d) => d.color)
10946
- .style('stroke-dasharray', (d) => (d.dashed ? '8, 8' : '0, 0'));
10947
- const emit = (event, plotLine) => {
10948
- this.plotLinesMove$.next({ event, target: plotLine });
10949
- };
10950
- plotlineGroup
10951
- .selectAll('.drag-plotline')
10952
- .data(plotlinesPoints)
10953
- .join('line')
10954
- .attr('class', 'drag-plotline')
10955
- .attr('y1', (d) => y(d.value))
10956
- .attr('y2', (d) => y(d.value))
10957
- .attr('x1', 0)
10958
- .attr('x2', this._width - this._options.bounds.left - this._options.bounds.right)
10959
- .attr('transform', `translate(${this._options.bounds.left}, 0)`)
10960
- .style('stroke-width', 8)
10961
- .style('stroke', 'rgba(0, 0, 0, 0)')
10962
- .style('cursor', 'row-resize')
10963
- .call(d3
10964
- .drag()
10965
- .on('drag', function (event, d) {
10966
- const group = d3.select(this).node().parentElement;
10967
- const draggedPlotLine = d3
10968
- .select(group)
10969
- .select(`[data-plotline-id='${d.id}']`);
10970
- d.value = y.invert(event.y);
10971
- const minValue = d.min ?? min;
10972
- const maxValue = d.max ?? max;
10973
- const borderTopReached = d.value <= minValue;
10974
- const borderBottomReached = d.value >= maxValue;
10975
- if (borderTopReached) {
10976
- d.value = minValue;
10977
- }
10978
- if (borderBottomReached) {
10979
- d.value = maxValue;
10980
- }
10981
- d3.select(this).attr('y1', y(d.value)).attr('y2', y(d.value));
10982
- draggedPlotLine.attr('y1', y(d.value)).attr('y2', y(d.value));
10983
- emit(event, d);
10984
- })
10985
- .on('end', (event, d) => {
10986
- emit(event, d);
10987
- }));
10988
- });
10989
- }
10990
- drawPlotBands() {
10991
- this._chart.selectAll('.plotbands').remove();
10992
- const plotBandGroup = this._chart
10993
- .append('g')
10994
- .attr('class', 'plotbands')
10995
- .attr('clip-path', `url(#draw-window-${this.uniqId})`);
10996
- this._xAxisList
10997
- .filter((_) => _.options.plotBands.length > 0)
10998
- .forEach((axis) => {
10999
- const x = this._xScales.get(axis.index);
11000
- const [min, max] = axis.extent;
11001
- const plotband = plotBandGroup
11002
- .append('g')
11003
- .style('shape-rendering', 'crispEdges');
11004
- const plotBandHeight = this._height - this._options.bounds.top - this._options.bounds.bottom;
11005
- const emit = (event, plotBand) => {
11006
- this.plotBandsMove$.next({
11007
- event,
11008
- target: plotBand,
11009
- });
11010
- };
11011
- plotband
11012
- .selectAll('rect')
11013
- .data(axis.options.plotBands)
11014
- .on('start', (_) => {
11015
- this._chart.selectAll('.marker').style('display', 'none');
11016
- d3.select(this._container.nativeElement)
11017
- .select('.tooltip-chart')
11018
- .style('display', 'none');
11019
- })
11020
- .join('rect')
11021
- .attr('data-plotband-id', (d) => d.id)
11022
- .attr('x', (d) => x(d.from))
11023
- .attr('y', 0)
11024
- .attr('width', (d) => Math.abs(x(d.to) - x(d.from)))
11025
- .attr('fill', (d) => {
11026
- if (d.image) {
11027
- return `url(#${d.image})`;
11028
- }
11029
- return d.color;
11030
- })
11031
- .style('opacity', (d) => d.opacity ?? 1)
11032
- .attr('height', plotBandHeight > 0 ? plotBandHeight : 0)
11033
- .attr('transform', `translate(0, ${this._options.bounds.top})`);
11034
- plotband
11035
- .selectAll('.line-left')
11036
- .data(axis.options.plotBands)
11037
- .join('line')
11038
- .attr('data-line-left-id', (d) => d.id)
11039
- .attr('class', 'line-left')
11040
- .attr('x1', (d) => x(d.from))
11041
- .attr('x2', (d) => x(d.from))
11042
- .attr('y1', 0)
11043
- .attr('y2', this._height -
11044
- this._options.bounds.top -
11045
- this._options.bounds.bottom)
11046
- .attr('transform', `translate(0, ${this._options.bounds.top})`)
11047
- .style('stroke-width', 1)
11048
- .style('stroke-dasharray', '8, 8')
11049
- .style('stroke', 'var(--color-text-90)')
11050
- .style('opacity', (d) => (d.showGrabbers ? 1 : 0));
11051
- plotband
11052
- .selectAll('.drag-left')
11053
- .data(axis.options.plotBands)
11054
- .join('line')
11055
- .attr('x1', (d) => x(d.from))
11056
- .attr('x2', (d) => x(d.from))
11057
- .attr('y1', 0)
11058
- .attr('y2', this._height -
11059
- this._options.bounds.top -
11060
- this._options.bounds.bottom)
11061
- .style('display', (d) => (d?.resizable ? 'unset' : 'none'))
11062
- .attr('transform', `translate(0, ${this._options.bounds.top})`)
11063
- .style('stroke-width', 8)
11064
- .style('stroke', 'rgba(0, 0, 0, 0)')
11065
- .style('cursor', 'col-resize')
11066
- .call(d3
11067
- .drag()
11068
- .on('drag', function (event, d) {
11069
- const group = d3.select(this).node().parentElement;
11070
- const draggedBand = d3
11071
- .select(group)
11072
- .select(`[data-plotband-id='${d.id}']`);
11073
- const draggedLine = d3
11074
- .select(group)
11075
- .select(`[data-line-left-id='${d.id}']`);
11076
- d.from = x.invert(event.x);
11077
- const minValue = d.min ?? min;
11078
- const borderReached = d.from <= minValue;
11079
- if (borderReached) {
11080
- d.from = minValue;
11081
- }
11082
- if (d.from >= d.to) {
11083
- d.from = d.to;
11084
- }
11085
- d3.select(this).attr('x1', x(d.from)).attr('x2', x(d.from));
11086
- draggedBand
11087
- .attr('x', x(d.from))
11088
- .attr('width', x(d.to) - x(d.from));
11089
- draggedLine.attr('x1', x(d.from)).attr('x2', x(d.from));
11090
- emit(event, d);
11091
- })
11092
- .on('end', (event, d) => emit(event, d)));
11093
- plotband
11094
- .selectAll('.line-right')
11095
- .data(axis.options.plotBands)
11096
- .join('line')
11097
- .attr('data-line-right-id', (d) => d.id)
11098
- .attr('class', 'line-right')
11099
- .attr('x1', (d) => x(d.to))
11100
- .attr('x2', (d) => x(d.to))
11101
- .attr('y1', 0)
11102
- .attr('y2', this._height -
11103
- this._options.bounds.top -
11104
- this._options.bounds.bottom)
11105
- .attr('transform', `translate(0, ${this._options.bounds.top})`)
11106
- .style('stroke-width', 1)
11107
- .style('stroke-dasharray', '8, 8')
11108
- .style('stroke', 'var(--color-text-90)')
11109
- .style('opacity', (d) => (d.showGrabbers ? 1 : 0));
11110
- plotband
11111
- .selectAll('.drag-right')
11112
- .data(axis.options.plotBands)
11113
- .join('line')
11114
- .attr('class', 'drag-right')
11115
- .style('display', (d) => (d?.resizable ? 'unset' : 'none'))
11116
- .attr('x1', (d) => x(d.to))
11117
- .attr('x2', (d) => x(d.to))
11118
- .attr('y1', 0)
11119
- .attr('y2', this._height -
11120
- this._options.bounds.top -
11121
- this._options.bounds.bottom)
11122
- .attr('transform', `translate(0, ${this._options.bounds.top})`)
11123
- .style('stroke-width', 8)
11124
- .style('stroke', 'rgba(0, 0, 0, 0)')
11125
- .style('cursor', 'col-resize')
11126
- .call(d3
11127
- .drag()
11128
- .on('drag', function (event, d) {
11129
- const group = d3.select(this).node().parentElement;
11130
- const draggedBand = d3
11131
- .select(group)
11132
- .select(`[data-plotband-id='${d.id}']`);
11133
- const draggedLine = d3
11134
- .select(group)
11135
- .select(`[data-line-right-id='${d.id}']`);
11136
- d.to = x.invert(event.x);
11137
- const maxValue = d.max ?? max;
11138
- const borderReached = d.to >= maxValue;
11139
- if (borderReached) {
11140
- d.to = maxValue;
11141
- }
11142
- if (d.to <= d.from) {
11143
- d.to = d.from;
11144
- }
11145
- d3.select(this).attr('x1', x(d.to)).attr('x2', x(d.to));
11146
- draggedBand.attr('width', x(d.to) - x(d.from));
11147
- draggedLine.attr('x1', x(d.to)).attr('x2', x(d.to));
11148
- emit(event, d);
11149
- })
11150
- .on('end', (event, d) => emit(event, d)));
11151
- });
11152
- this._yAxisList
11153
- .filter((_) => _.options.plotBands.length > 0)
11154
- .forEach((axis) => {
11155
- const y = this._yScales.get(axis.index);
11156
- const [min, max] = axis.extent;
11157
- const plotband = plotBandGroup
11158
- .append('g')
11159
- .style('shape-rendering', 'crispEdges');
11160
- const plotBandWidth = this._width - this._options.bounds.left - this._options.bounds.right; // TODO add multiaxis support width
11161
- const emit = (event, plotBand) => {
11162
- this.plotBandsMove$.next({
11163
- event,
11164
- target: plotBand,
11165
- });
11166
- };
11167
- const dragPlotband = d3
11168
- .drag()
11169
- .subject(function () {
11170
- const element = d3.select(this);
11171
- return { y: element.attr('y') };
11172
- })
11173
- .on('start drag end', function (event, d) {
11174
- const element = d3.select(this);
11175
- const height = parseFloat(element.attr('height'));
11176
- d.to = y.invert(event.y + height);
11177
- d.from = y.invert(event.y);
11178
- const minValue = d.min ?? min;
11179
- const maxValue = d.max ?? max;
11180
- const borderReachedMin = d.from <= minValue;
11181
- const borderReachedMax = d.to >= maxValue;
11182
- if (borderReachedMin) {
11183
- d.to = y.invert(y(minValue) + height);
11184
- d.from = minValue;
11185
- }
11186
- if (borderReachedMax) {
11187
- d.to = maxValue;
11188
- d.from = y.invert(y(maxValue) - height);
11189
- }
11190
- element.attr('y', y(d.from));
11191
- const group = element.node().parentElement;
11192
- d3.select(group)
11193
- .select(`[data-line-left-id='${d.id}']`)
11194
- .attr('y1', y(d.from))
11195
- .attr('y2', y(d.from));
11196
- d3.select(group)
11197
- .select(`[data-grab-left-id='${d.id}']`)
11198
- .attr('y1', y(d.from))
11199
- .attr('y2', y(d.from));
11200
- d3.select(group)
11201
- .select(`[data-line-right-id='${d.id}']`)
11202
- .attr('y1', y(d.to))
11203
- .attr('y2', y(d.to));
11204
- d3.select(group)
11205
- .select(`[data-grab-right-id='${d.id}']`)
11206
- .attr('y1', y(d.to))
11207
- .attr('y2', y(d.to));
11208
- emit(event, d);
11209
- });
11210
- const leftGrabDrag = d3
11211
- .drag()
11212
- .on('drag', function (event, d) {
11213
- const group = d3.select(this).node().parentElement;
11214
- const draggedBand = d3
11215
- .select(group)
11216
- .select(`[data-plotband-id='${d.id}']`);
11217
- const draggedLine = d3
11218
- .select(group)
11219
- .select(`[data-line-left-id='${d.id}']`);
11220
- d.from = y.invert(event.y);
11221
- const minValue = d.min ?? min;
11222
- const borderReached = d.from <= minValue;
11223
- if (borderReached) {
11224
- d.from = minValue;
11225
- }
11226
- if (d.from >= d.to) {
11227
- d.from = d.to;
11228
- }
11229
- d3.select(this).attr('y1', y(d.from)).attr('y2', y(d.from));
11230
- draggedBand
11231
- .attr('y', y(d.from))
11232
- .attr('height', Math.abs(y(d.to) - y(d.from)));
11233
- draggedLine.attr('y1', y(d.from)).attr('y2', y(d.from));
11234
- emit(event, d);
11235
- })
11236
- .on('end', (event, d) => emit(event, d));
11237
- const rightGrabDrag = d3
11238
- .drag()
11239
- .on('drag', function (event, d) {
11240
- const group = d3.select(this).node().parentElement;
11241
- const draggedBand = d3
11242
- .select(group)
11243
- .select(`[data-plotband-id='${d.id}']`);
11244
- const draggedLine = d3
11245
- .select(group)
11246
- .select(`[data-line-right-id='${d.id}']`);
11247
- d.to = y.invert(event.y);
11248
- const maxValue = d.max ?? max;
11249
- const borderReached = d.to >= maxValue;
11250
- if (borderReached) {
11251
- d.to = maxValue;
11252
- }
11253
- if (d.to <= d.from) {
11254
- d.to = d.from;
11255
- }
11256
- d3.select(this).attr('y1', y(d.to)).attr('y2', y(d.to));
11257
- draggedBand
11258
- .attr('y', y(d.from))
11259
- .attr('height', Math.abs(y(d.to) - y(d.from)));
11260
- draggedLine.attr('y1', y(d.to)).attr('y2', y(d.to));
11261
- emit(event, d);
11262
- })
11263
- .on('end', (event, d) => emit(event, d));
11264
- plotband
11265
- .selectAll('rect')
11266
- .data(axis.options.plotBands)
11267
- .join('rect')
11268
- .attr('data-plotband-id', (d) => d.id)
11269
- .attr('x', 0)
11270
- .attr('y', (d) => y(d.from))
11271
- .attr('width', (d) => plotBandWidth)
11272
- .attr('fill', (d) => {
11273
- if (d.image) {
11274
- return `url(#${d.image})`;
11275
- }
11276
- return d.color;
11277
- })
11278
- .style('opacity', (d) => d.opacity ?? 1)
11279
- .attr('height', (d) => Math.abs(y(d.to) - y(d.from)))
11280
- .attr('cursor', (d) => (d.draggable ? 'move' : 'default'));
11281
- plotband
11282
- .selectAll('.line-left')
11283
- .data(axis.options.plotBands.filter((d) => d.resizable))
11284
- .join('line')
11285
- .attr('data-line-left-id', (d) => d.id)
11286
- .attr('class', 'line-left')
11287
- .attr('y1', (d) => y(d.from))
11288
- .attr('y2', (d) => y(d.from))
11289
- .attr('x1', 0)
11290
- .attr('x2', plotBandWidth)
11291
- .style('stroke-width', 1)
11292
- .style('stroke-dasharray', '8, 8')
11293
- .style('stroke', 'var(--color-text-90)')
11294
- .style('opacity', (d) => (d.showGrabbers ? 1 : 0));
11295
- plotband
11296
- .selectAll('.drag-left')
11297
- .data(axis.options.plotBands.filter((d) => d.resizable))
11298
- .join('line')
11299
- .attr('data-grab-left-id', (d) => d.id)
11300
- .attr('y1', (d) => y(d.from))
11301
- .attr('y2', (d) => y(d.from))
11302
- .attr('x1', 0)
11303
- .attr('x2', plotBandWidth)
11304
- .style('stroke-width', 8)
11305
- .style('stroke', 'rgba(0, 0, 0, 0)')
11306
- .style('cursor', (d) => (d.resizable ? 'row-resize' : 'default'));
11307
- plotband
11308
- .selectAll('.line-right')
11309
- .data(axis.options.plotBands.filter((d) => d.resizable))
11310
- .join('line')
11311
- .attr('data-line-right-id', (d) => d.id)
11312
- .attr('class', 'line-right')
11313
- .attr('y1', (d) => y(d.to))
11314
- .attr('y2', (d) => y(d.to))
11315
- .attr('x1', 0)
11316
- .attr('x2', plotBandWidth)
11317
- .style('stroke-width', 1)
11318
- .style('stroke-dasharray', '8, 8')
11319
- .style('stroke', 'var(--color-text-90)')
11320
- .style('opacity', (d) => (d.showGrabbers ? 1 : 0));
11321
- plotband
11322
- .selectAll('.drag-right')
11323
- .data(axis.options.plotBands.filter((d) => d.resizable))
11324
- .join('line')
11325
- .attr('class', 'drag-right')
11326
- .attr('data-grab-right-id', (d) => d.id)
11327
- .attr('y1', (d) => y(d.to))
11328
- .attr('y2', (d) => y(d.to))
11329
- .attr('x1', 0)
11330
- .attr('x2', plotBandWidth)
11331
- .style('stroke-width', 8)
11332
- .style('stroke', 'rgba(0, 0, 0, 0)')
11333
- .style('cursor', (d) => (d.resizable ? 'row-resize' : 'default'));
11334
- axis.options.plotBands.forEach((_) => {
11335
- if (_.draggable) {
11336
- plotband.select(`[data-plotband-id='${_.id}']`).call(dragPlotband);
11337
- }
11338
- if (_.resizable) {
11339
- plotband.select(`[data-grab-left-id='${_.id}']`).call(leftGrabDrag);
11340
- plotband
11341
- .select(`[data-grab-right-id='${_.id}']`)
11342
- .call(rightGrabDrag);
11343
- }
11344
- });
11345
- });
11346
- }
11347
- drawChart() {
11348
- const series = this._options.series?.filter((_) => _.visible);
11349
- this._chart.selectAll('.series').remove();
11350
- if (!series || series.length < 1) {
11351
- d3.select(this._container.nativeElement)
11352
- .select('canvas')
11353
- .style('display', 'none');
11354
- }
11355
- const group = this._chart
11356
- .append('g')
11357
- .attr('class', 'series')
11358
- .attr('clip-path', `url(#draw-window-${this.uniqId})`);
11359
- series?.forEach((seriesItem, index) => {
11360
- if (seriesItem.renderTo === 'canvas') {
11361
- d3.select(this._container.nativeElement)
11362
- .select('canvas')
11363
- .style('display', null);
11364
- d3.select(this._container.nativeElement)
11365
- .select('svg')
11366
- .style('position', 'absolute');
11367
- }
11368
- else {
11369
- d3.select(this._container.nativeElement)
11370
- .select('canvas')
11371
- .style('display', 'none');
11372
- }
11373
- if (!this._xScales.has(seriesItem.xAxisIndex) ||
11374
- !this._yScales.has(seriesItem.yAxisIndex)) {
11375
- return;
11376
- }
11377
- const foundX = this._xScales.get(seriesItem.xAxisIndex);
11378
- const foundY = this._yScales.get(seriesItem.yAxisIndex);
11379
- const drawer = seriesItem.drawer != null
11380
- ? seriesItem.drawer
11381
- : defaultDrawerMapping.get(seriesItem.type);
11382
- if (!drawer) {
11383
- throw new Error(`No drawer for series ${seriesItem.name}, type ${SeriesType[seriesItem.type]}`);
11384
- }
11385
- if (seriesItem.renderTo === 'canvas') {
11386
- const context = this._canvas.node().getContext('2d');
11387
- context.clearRect(0, 0, this._width, this._height);
11388
- }
11389
- let [xMin, xMax] = foundX.domain();
11390
- let [yMin, yMax] = foundY.domain();
11391
- xMin = xMin instanceof Date ? xMin.getTime() : xMin;
11392
- xMax = xMax instanceof Date ? xMax.getTime() : xMax;
11393
- yMin = yMin instanceof Date ? yMin.getTime() : yMin;
11394
- yMax = yMax instanceof Date ? yMax.getTime() : yMax;
11395
- const visiblePoints = (point, idx, arr) => (point.x <= xMax ||
11396
- point.x1 <= xMax ||
11397
- (arr[idx - 1] && arr[idx - 1].x <= xMax) ||
11398
- (arr[idx - 1] && arr[idx - 1].x1 <= xMax)) &&
11399
- (point.x >= xMin ||
11400
- point.x1 >= xMin ||
11401
- (arr[idx + 1] && arr[idx + 1].x >= xMin) ||
11402
- (arr[idx + 1] && arr[idx + 1].x1 >= xMin)) &&
11403
- (point.y <= yMax ||
11404
- point.y1 <= yMax ||
11405
- (arr[idx - 1] && arr[idx - 1].y <= yMax) ||
11406
- (arr[idx - 1] && arr[idx - 1].y1 <= yMax)) &&
11407
- (point.y >= yMin ||
11408
- point.y1 >= yMin ||
11409
- (arr[idx + 1] && arr[idx + 1].y >= yMin) ||
11410
- (arr[idx + 1] && arr[idx + 1].y1 >= yMin));
11411
- const filteredData = seriesItem.data; //.filter(visiblePoints);
11412
- const serie = {
11413
- ...seriesItem,
11414
- data: filteredData,
11415
- };
11416
- drawer.draw(serie, seriesItem.renderTo === 'canvas' ? this._canvas : group, foundX, foundY, this._options);
11417
- const emit = (event) => {
11418
- this.seriesMove$.next(event);
11419
- };
11420
- const emitPoint = (event) => {
11421
- this.pointMove$.next(event);
11422
- };
11423
- drawer?.dispatch?.on(DispatchType.moveLine, function () {
11424
- emit(this);
11425
- });
11426
- drawer?.dispatch?.on(DispatchType.movePoint, function () {
11427
- emitPoint(this);
11428
- });
11429
- });
11430
- }
11431
- createTooltip() {
11432
- d3.select(this._container.nativeElement)
11433
- .append('div')
11434
- .attr('class', 'tooltip-chart color-text-90 bg-background-50 shadow-2')
11435
- .style('position', 'fixed')
11436
- .style('top', 'unset')
11437
- .style('right', 'unset')
11438
- .style('bottom', 'unset')
11439
- .style('left', 'unset')
11440
- .style('pointer-events', 'none')
11441
- .style('display', 'none');
11442
- }
11443
- handleMouseMove(options) {
11444
- const mouse = d3.pointer(options.event);
11445
- const { top, right, bottom, left } = this.tooltipPosition(options.event);
11446
- const tooltipsData = [];
11447
- this._chart
11448
- .select('.marker-line')
11449
- .attr('transform', `translate(${0}, ${mouse[1] - 2})`);
11450
- this._chart
11451
- .selectAll('.marker')
11452
- .attr('transform', (d) => {
11453
- if (!d.data.length) {
11454
- return;
11455
- }
11456
- if (!this._xScales.has(d.xAxisIndex) ||
11457
- !this._yScales.has(d.yAxisIndex)) {
11458
- return;
11459
- }
11460
- const foundX = this._xScales.get(d.xAxisIndex);
11461
- const foundY = this._yScales.get(d.yAxisIndex);
11462
- if (this._options.tooltip.tracking === 'x') {
11463
- const [min, max] = foundX.domain();
11464
- const filteredData = d.data.filter((point) => point.x <= max && point.x >= min);
11465
- const sorted = [...filteredData].sort((a, b) => d3.ascending(a.x, b.x));
11466
- const bisect = d3.bisector((dd) => dd.x).left;
11467
- const x0 = foundX.invert(mouse[0]);
11468
- const index = bisect(sorted, x0);
11469
- const data = sorted[index] ? sorted[index] : sorted[index - 1];
11470
- tooltipsData.push({
11471
- point: data,
11472
- color: d.color,
11473
- name: d.name,
11474
- });
11475
- return `translate(${!isNaN(data?.x) && data?.x != null ? foundX(data.x) : -10}, ${!isNaN(data?.y) && data?.y != null ? foundY(data.y) : -10})`;
11476
- }
11477
- if (this._options.tooltip.tracking === 'y') {
11478
- const sorted = [...d.data].sort((a, b) => d3.ascending(a.y, b.y));
11479
- const bisect = d3.bisector((dd) => dd.y).left;
11480
- const y0 = foundY.invert(mouse[1]);
11481
- const index = bisect(sorted, y0, 0);
11482
- const data = sorted[index] ? sorted[index] : sorted[index - 1];
11483
- tooltipsData.push({
11484
- point: data,
11485
- color: d.color,
11486
- name: d.name,
11487
- });
11488
- return `translate(${!isNaN(data?.x) && data?.x != null ? foundX(data.x) : -10}, ${!isNaN(data?.y) && data?.y != null ? foundY(data.y) : -10})`;
11489
- }
11490
- });
11491
- if (this._options.tooltip?.format) {
11492
- const formatted = this._options.tooltip?.format(tooltipsData);
11493
- d3.select(this._container.nativeElement)
11494
- .select('.tooltip-chart')
11495
- .style('top', top)
11496
- .style('right', right)
11497
- .style('bottom', bottom)
11498
- .style('left', left)
11499
- .html(formatted);
11500
- }
11501
- }
11502
- tooltipPosition(event) {
11503
- const centerX = this._width / 2;
11504
- const centerY = this._height / 2;
11505
- const padding = { x: 10, y: 10 };
11506
- const scene = {
11507
- left: event.pageX > centerX ? 'initial' : `${event.pageX + padding.x}px`,
11508
- top: event.pageY > centerY ? 'initial' : `${event.pageY + padding.y}px`,
11509
- bottom: event.pageY > centerY
11510
- ? `${window.innerHeight - event.pageY}px`
11511
- : 'initial',
11512
- right: event.pageX > centerX
11513
- ? `${window.innerWidth - event.pageX + padding.x}px`
11514
- : 'initial',
11515
- };
11516
- return scene;
11517
- }
11518
- createMarkers() {
11519
- if (this._options.tooltip === undefined) {
11520
- return;
11521
- }
11522
- if (!this._options.tooltip.enable) {
11523
- return;
11524
- }
11525
- this._chart.selectAll('.marker').remove();
11526
- this._chart.select('.marker-line').remove();
11527
- this._chart
11528
- .append('line')
11529
- .attr('class', 'marker-line')
11530
- .attr('x1', 35)
11531
- .attr('x2', this._width)
11532
- .style('stroke-width', 0.5)
11533
- .style('stroke', 'var(--color-text-40)')
11534
- .style('display', 'none');
11535
- const { series } = this._options;
11536
- if (!series) {
11537
- return;
11538
- }
11539
- const markers = this._chart
11540
- .selectAll()
11541
- .data(series.filter((_) => _.visible));
11542
- markers
11543
- .enter()
11544
- .append('circle')
11545
- .attr('class', 'marker')
11546
- .attr('pointer-events', 'none')
11547
- .attr('r', 3)
11548
- .attr('fill', (_, i) => _.color)
11549
- .style('display', 'none');
11550
- const mouseoutEvent = () => {
11551
- this._chart.selectAll('.marker').style('display', 'none');
11552
- this._chart.select('.marker-line').style('display', 'none');
11553
- d3.select(this._container.nativeElement)
11554
- .select('.tooltip-chart')
11555
- .style('display', 'none');
11556
- };
11557
- const mouseMoveEvent = (event) => {
11558
- const options = {
11559
- event,
11560
- series,
11561
- };
11562
- this.handleMouseMove(options);
11563
- };
11564
- const mouseOverEvent = () => {
11565
- if (this._options.tooltip.showMarkers) {
11566
- this._chart
11567
- .selectAll('.marker')
11568
- .style('display', (d) => {
11569
- if (d.data.length) {
11570
- return null;
11571
- }
11572
- return 'none';
11573
- });
11574
- }
11575
- if (this._options.tooltip.showLine) {
11576
- this._chart.select('.marker-line').style('display', null);
11577
- }
11578
- d3.select(this._container.nativeElement)
11579
- .select('.tooltip-chart')
11580
- .style('display', null);
11581
- };
11582
- this._chart
11583
- .on('mouseover', mouseOverEvent)
11584
- .on('mousemove', mouseMoveEvent)
11585
- .on('mouseleave', mouseoutEvent);
11586
- }
11587
- drawLegend() {
11588
- if (this._options.legend?.visible === false) {
11589
- return;
11590
- }
11591
- this._chart.selectAll('.legend').remove();
11592
- const drawer = this._options.legend?.type
11593
- ? defaultLegendDrawerMapping.get(this._options.legend.type)
11594
- : defaultLegendDrawerMapping.get(LegendType.swatches);
11595
- const context = this._container.nativeElement;
11596
- if (!drawer) {
11597
- throw new Error(`No drawer for legend
11598
- }`);
11599
- }
11600
- drawer.draw({
11601
- context,
11602
- series: this._options.series.filter((_) => _.showInLegend),
11603
- width: this._width,
11604
- height: this._height,
11605
- });
11606
- }
11607
- caluclateChartWidth() {
11608
- let width = -this._width;
11609
- if (this.offsetOpposite > 0) {
11610
- width = -this._width + this.offsetOpposite + this.offsetNonOpposite;
11611
- }
11612
- if (this.offsetNonOpposite > 0) {
11613
- width =
11614
- -this._width + this._options.bounds.right + this.offsetNonOpposite;
11615
- }
11616
- if (this.offsetOpposite >= Axis.offsetFactor &&
11617
- this.offsetNonOpposite === 0) {
11618
- width = -this._width + this.offsetOpposite + this._options.bounds.left;
11619
- }
11620
- if (this.offsetOpposite > 0 && this.offsetNonOpposite > 0) {
11621
- width = -this._width + this.offsetOpposite + this.offsetNonOpposite;
11622
- }
11623
- return Math.abs(width);
11624
- }
11625
- drawGridLines() {
11626
- if (this._options.gridLines === false) {
11627
- return;
11628
- }
11629
- const translateX = this.offsetNonOpposite > 0
11630
- ? this.offsetNonOpposite
11631
- : this._options.bounds.left + this.offsetNonOpposite;
11632
- this._chart.selectAll('.grid').remove();
11633
- const yList = this._yAxisList.filter((_) => _.options.visible && !_.options.opposite);
11634
- const y = yList?.length > 0
11635
- ? this._yScales.get(yList[yList.length - 1].index)
11636
- : this._yScales.get(0);
11637
- const x = this._xScales.get(0);
11638
- if (!y || !x) {
11639
- return;
11640
- }
11641
- const TICK_HEIGHT = 40;
11642
- const TICK_WIDTH = 60;
11643
- const tickCount = Math.round(this._height / TICK_HEIGHT);
11644
- const tickCountX = Math.round(this._width / TICK_WIDTH);
11645
- const gridY = this._chart
11646
- .append('g')
11647
- .attr('class', 'grid color-text-10')
11648
- .style('shape-rendering', 'crispEdges');
11649
- const gridlinesY = d3
11650
- .axisLeft(y)
11651
- .tickFormat('')
11652
- .tickSize(-this.visibleChartWindowWidth);
11653
- const hasBarSeriesType = this._options.series.some((_) => _.type === SeriesType.bar);
11654
- if (!hasBarSeriesType) {
11655
- const gridX = this._chart
11656
- .append('g')
11657
- .attr('class', 'grid color-text-10')
11658
- .style('shape-rendering', 'crispEdges');
11659
- const gridlinesX = d3
11660
- .axisBottom(x)
11661
- .ticks(tickCountX)
11662
- .tickFormat('')
11663
- .tickSize(this._height - this._options.bounds.bottom - this._options.bounds.top);
11664
- gridX
11665
- .call(gridlinesX)
11666
- .attr('transform', `translate(0, ${this._options.bounds.top})`)
11667
- .lower();
11668
- }
11669
- gridY
11670
- .call(gridlinesY)
11671
- .attr('transform', `translate(${translateX}, ${0})`)
11672
- .lower();
11673
- this._chart.selectAll('.grid path').remove();
11674
- }
11675
- createScales() {
11676
- this._xScales.clear();
11677
- this._yScales.clear();
11678
- const defaultScaleMapping = new Map()
11679
- .set(ScaleType.linear, d3.scaleLinear)
11680
- .set(ScaleType.log, d3.scaleLog)
11681
- .set(ScaleType.sqrt, d3.scaleSqrt)
11682
- .set(ScaleType.pow, d3.scalePow);
11683
- const xRange = [
11684
- this.offsetNonOpposite
11685
- ? this.offsetNonOpposite
11686
- : this._options.bounds.left,
11687
- this._width -
11688
- (this.offsetOpposite
11689
- ? this.offsetOpposite
11690
- : this._options.bounds.right),
11691
- ];
11692
- const yRange = [
11693
- this._height - this._options.bounds.bottom,
11694
- this._options.bounds.top,
11695
- ];
11696
- this._xAxisList.forEach((axis, index) => {
11697
- let scale = null;
11698
- if (axis.options.type === Scale.time) {
11699
- scale = d3
11700
- .scaleTime()
11701
- .domain(axis.extent)
11702
- .range(axis.options.inverted ? [...xRange].reverse() : xRange);
11703
- }
11704
- if (axis.options.type === Scale.number) {
11705
- scale = defaultScaleMapping
11706
- .get(axis.options.scaleOptions.type)()
11707
- .domain(axis.extent)
11708
- .range(axis.options.inverted ? [...xRange].reverse() : xRange);
11709
- }
11710
- if (axis.options.niceTicks) {
11711
- scale.nice();
11712
- }
11713
- if (axis.options.scaleOptions.type === ScaleType.log) {
11714
- scale.base(axis.options.scaleOptions.base);
11715
- }
11716
- if (axis.options.scaleOptions.type === ScaleType.pow) {
11717
- scale.exponent(axis.options.scaleOptions.base);
11718
- }
11719
- this._xScales.set(index, scale);
11720
- });
11721
- this._yAxisList.forEach((axis, index) => {
11722
- let scale = null;
11723
- if (axis.options.type === Scale.number) {
11724
- scale = defaultScaleMapping
11725
- .get(axis.options.scaleOptions.type)()
11726
- .domain(axis.extent)
11727
- .range(axis.options.inverted ? [...yRange].reverse() : yRange);
11728
- }
11729
- if (axis.options.type === Scale.time) {
11730
- scale = d3
11731
- .scaleTime()
11732
- .domain(axis.extent)
11733
- .range(axis.options.inverted ? [...yRange].reverse() : yRange);
11734
- }
11735
- if (axis.options.niceTicks) {
11736
- scale.nice();
11737
- }
11738
- if (axis.options.scaleOptions.type === ScaleType.log) {
11739
- scale.base(axis.options.scaleOptions.base);
11740
- }
11741
- if (axis.options.scaleOptions.type === ScaleType.pow) {
11742
- scale.exponent(axis.options.scaleOptions.base);
11743
- }
11744
- this._yScales.set(index, scale);
11745
- });
11746
- for (const [key, value] of this._yScales) {
11747
- this._clonedY.set(key, value.copy());
11748
- }
11749
- for (const [key, value] of this._xScales) {
11750
- this._clonedX.set(key, value.copy());
11751
- }
11752
- }
11753
- drawAxis() {
11754
- const hasVisibleAxis = [...this._xAxisList, ...this._yAxisList].filter((axis) => axis.options.visible);
11755
- if (!hasVisibleAxis) {
11756
- return;
11757
- }
11758
- const negative = false;
11759
- this._chart.selectAll('.axes').remove();
11760
- const axes = this._chart
11761
- .append('g')
11762
- .attr('class', 'axes')
11763
- .style('shape-rendering', 'crispEdges');
11764
- const TICK_HEIGHT = 40;
11765
- const TICK_WIDTH = 60;
11766
- const tickCount = Math.round(this._height / TICK_HEIGHT);
11767
- const tickCountX = Math.round(this._width / TICK_WIDTH);
11768
- this._xAxisList.forEach((axis) => {
11769
- const options = axis.options;
11770
- const translate = `translate(${0}, ${this._height - this._options.bounds.bottom})`;
11771
- const x = this._xScales.get(axis.index);
11772
- const xAxis = d3.axisBottom(x).ticks(tickCountX);
11773
- if (axis.options?.tickFormat) {
11774
- xAxis.tickFormat(axis.options.tickFormat);
11775
- }
11776
- if (options.visible !== false) {
11777
- const translateX = this.offsetNonOpposite
11778
- ? this.offsetNonOpposite
11779
- : this._options.bounds.left + this.offsetNonOpposite;
11780
- axes
11781
- .append('g')
11782
- .attr('class', 'x-axis-label')
11783
- .append('text')
11784
- .style('fill', 'var(--color-text-50)')
11785
- .attr('transform', 'translate(' +
11786
- this._width / 2 +
11787
- ' ,' +
11788
- (this._height - this._options.bounds.bottom) +
11789
- ')')
11790
- .style('text-anchor', 'middle')
11791
- .attr('dy', '3em')
11792
- .text(options.title ?? '');
11793
- axes
11794
- .append('g')
11795
- .attr('class', 'x-axis font-caption')
11796
- .attr('data-x-scale-id', axis.index)
11797
- .attr('transform', translate)
11798
- .style('pointer-events', 'none')
11799
- .call(xAxis)
11800
- .call((_) => {
11801
- _.select('.domain').remove();
11802
- _.selectAll('.tick').attr('class', 'color-text-50');
11803
- if (negative) {
11804
- _.append('line')
11805
- .attr('y1', 0)
11806
- .attr('y2', this._height)
11807
- .attr('transform', `translate(${x(0)}, -${this._height})`)
11808
- .style('stroke-width', 0.5)
11809
- .style('stroke', 'var(--color-text-50)');
11810
- }
11811
- _.append('line')
11812
- .attr('x1', 0)
11813
- .attr('x2', this.visibleChartWindowWidth)
11814
- .attr('transform', `translate(${translateX}, ${0})`)
11815
- .style('stroke-width', 0.5)
11816
- .style('stroke', 'var(--color-text-50)');
11817
- });
11818
- }
11819
- });
11820
- this._yAxisList.forEach((axis) => {
11821
- const translate = axis.options.opposite
11822
- ? `translate(${this._width - axis.offset}, ${0})`
11823
- : `translate(${axis.offset}, ${0})`;
11824
- const y = this._yScales.get(axis.index);
11825
- const yAxis = axis.options.opposite ? d3.axisRight(y) : d3.axisLeft(y);
11826
- if (axis.options.visible !== false) {
11827
- const labelOffset = axis.options.opposite
11828
- ? this._width - axis.offset + axis.width
11829
- : axis.offset - axis.width;
11830
- axes
11831
- .append('g')
11832
- .attr('class', 'y-axis-label')
11833
- .append('text')
11834
- .style('fill', 'var(--color-text-50)')
11835
- .attr('transform', 'rotate(-90)')
11836
- .attr('y', labelOffset)
11837
- .attr('x', 0 - this._height / 2)
11838
- .attr('dy', axis.options.opposite ? '12px' : '-3px')
11839
- .style('text-anchor', 'middle')
11840
- .text(axis.options.title ?? '');
11841
- axes
11842
- .append('g')
11843
- .attr('class', 'y-axis font-caption')
11844
- .attr('data-y-scale-id', axis.index)
11845
- .attr('transform', translate)
11846
- .call(yAxis)
11847
- .style('pointer-events', 'none')
11848
- .call((_) => {
11849
- _.select('.domain').remove();
11850
- _.selectAll('.tick').attr('class', 'color-text-50');
11851
- if (!negative) {
11852
- _.append('line')
11853
- .attr('y1', 0)
11854
- .attr('y2', this._height -
11855
- this._options.bounds.top -
11856
- this._options.bounds.bottom)
11857
- .attr('transform', `translate(${0}, ${this._options.bounds.top})`)
11858
- .style('stroke-width', 0.5)
11859
- .style('stroke', 'var(--color-text-50)');
11860
- }
11861
- });
11862
- }
11863
- });
11864
- }
11865
- }
11866
-
11867
- class ChartComponent {
11868
- constructor(_zone) {
11869
- this._zone = _zone;
11870
- this.plotLinesMove = new EventEmitter();
11871
- this.plotBandsMove = new EventEmitter();
11872
- this.seriesMove = new EventEmitter();
11873
- this.pointMove = new EventEmitter();
11874
- this.zoomChange = new EventEmitter();
11875
- this._alive = true;
11876
- this.size$ = new Subject();
11877
- }
11878
- click(event) {
11879
- const composedPath = event.composedPath();
11880
- const triggerToken = 'legend';
11881
- const isLegend = composedPath.some((_) => _.classList?.contains(triggerToken));
11882
- if (isLegend) {
11883
- const clickedElement = event.target?.__data__;
11884
- if (!clickedElement) {
11885
- return;
11886
- }
11887
- const serieIndex = this._config?.series?.indexOf(clickedElement);
11888
- if (clickedElement.serieType === SeriesType.bar) {
11889
- const foundSerie = this._config.series[clickedElement.serieIndex];
11890
- this._config.series[foundSerie.id].data = this._config.series[foundSerie.id].data.map((_) => {
11891
- if (clickedElement.id === _.id) {
11892
- return {
11893
- ..._,
11894
- visible: !_.visible,
11895
- };
11896
- }
11897
- return _;
11898
- });
11899
- this.redraw(this._config);
11900
- }
11901
- if (serieIndex !== -1) {
11902
- const foundSerie = this._config.series[serieIndex];
11903
- const yAxisIndex = foundSerie?.yAxisIndex;
11904
- this._config.series[serieIndex].visible = !foundSerie.visible;
11905
- const attachedYAxes = this._config.series
11906
- ?.filter((_) => _.visible)
11907
- .map((_) => _.yAxisIndex);
11908
- const shouldVisibleYAxis = attachedYAxes?.includes(yAxisIndex);
11909
- this._config.yAxis[yAxisIndex].visible = shouldVisibleYAxis;
11910
- this.redraw(this._config);
11911
- }
11912
- }
11913
- }
11914
- ngOnChanges(changes) {
11915
- if (this.config && changes.hasOwnProperty('config')) {
11916
- this.setConfig(this.config);
11917
- if (this.zoom) {
11918
- this._chart?.setZoom(this.zoom);
11919
- }
11920
- }
11921
- if (this.zoom && changes.hasOwnProperty('zoom')) {
11922
- this._chart?.setZoom(this.zoom);
11923
- }
11924
- }
11925
- ngOnInit() { }
11926
- ngAfterViewInit() {
11927
- this._observer = new ResizeObserver((entries) => {
11928
- const { contentRect } = entries[0];
11929
- this.size$.next(contentRect);
11930
- });
11931
- this._observer.observe(this.chart.nativeElement);
11932
- this.size$
11933
- .pipe(throttleTime(100, undefined, { trailing: true }))
11934
- .pipe(takeWhile((_) => this._alive), map((_) => {
11935
- this.resize(_);
11936
- this.redraw(this._config);
11937
- }))
11938
- .subscribe();
11939
- }
11940
- get showLegend() {
11941
- return this._config?.legend?.visible;
11942
- }
11943
- ngOnDestroy() {
11944
- this._alive = false;
11945
- this._observer?.unobserve(this.chart.nativeElement);
11946
- }
11947
- redraw(config) {
11948
- if (config) {
11949
- this._chart.redraw(config);
11950
- }
11951
- }
11952
- resize(contentRect) {
11953
- const { width, height } = contentRect;
11954
- this._chart.setSize({
11955
- width,
11956
- height,
11957
- });
11958
- }
11959
- setConfig(config) {
11960
- if (config) {
11961
- this._config = config;
11962
- this.hasSeriesData = !!this._config?.series?.some((_) => _.data.length);
11963
- if (!this._chart) {
11964
- this._chart = new TetaChart(this._config, this.chart);
11965
- this._chart.plotLinesMove
11966
- .pipe(takeWhile((_) => this._alive))
11967
- .subscribe((_) => this.plotLinesMove.emit(_));
11968
- this._chart.plotBandsMove
11969
- .pipe(takeWhile((_) => this._alive))
11970
- .subscribe((_) => this.plotBandsMove.emit(_));
11971
- this._chart.seriesMove
11972
- .pipe(takeWhile((_) => this._alive))
11973
- .subscribe((_) => this.seriesMove.emit(_));
11974
- this._chart.pointMove
11975
- .pipe(takeWhile((_) => this._alive))
11976
- .subscribe((_) => {
11977
- this.pointMove.emit(_);
11978
- });
11979
- this._chart.zoom
11980
- .pipe(takeWhile((_) => this._alive), map((_) => {
11981
- this.zoomChange.emit(_);
11982
- }))
11983
- .subscribe();
11984
- }
11985
- if (this.chart) {
11986
- if (this.hasSeriesData) {
11987
- if (!this._zoom || this._zoom?.event?.type === 'end') {
11988
- this.redraw(this._config);
11989
- }
11990
- }
11991
- }
11992
- }
11993
- }
11994
- }
11995
- ChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
11996
- 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 });
11997
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartComponent, decorators: [{
11998
- type: Component,
11999
- 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"] }]
12000
- }], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { zoom: [{
12001
- type: Input
12002
- }], config: [{
12003
- type: Input
12004
- }], plotLinesMove: [{
12005
- type: Output
12006
- }], plotBandsMove: [{
12007
- type: Output
12008
- }], seriesMove: [{
12009
- type: Output
12010
- }], pointMove: [{
12011
- type: Output
12012
- }], zoomChange: [{
12013
- type: Output
12014
- }], chart: [{
12015
- type: ViewChild,
12016
- args: ['chart', {
12017
- static: true,
12018
- }]
12019
- }], click: [{
12020
- type: HostListener,
12021
- args: ['click', ['$event']]
12022
- }] } });
12023
-
12024
- class ChartModule {
12025
- }
12026
- ChartModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12027
- ChartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartModule, declarations: [ChartComponent], imports: [CommonModule], exports: [ChartComponent] });
12028
- ChartModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartModule, imports: [[CommonModule]] });
12029
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: ChartModule, decorators: [{
12030
- type: NgModule,
12031
- args: [{
12032
- declarations: [ChartComponent],
12033
- exports: [ChartComponent],
12034
- imports: [CommonModule],
12035
- }]
12036
- }] });
12037
-
12038
- class AxisOptions {
12039
- constructor(options) {
12040
- this.niceTicks = true;
12041
- this.title = options?.title;
12042
- this.min = options?.min;
12043
- this.max = options?.max;
12044
- this.visible = options?.visible ?? true;
12045
- this.tickFormat = options?.tickFormat;
12046
- this.transform = options?.transform;
12047
- this.zoom = options?.zoom;
12048
- this.type = options?.type ?? 'number';
12049
- this.scaleOptions = {
12050
- type: ScaleType.linear,
12051
- base: 10,
12052
- ...options?.scaleOptions,
12053
- };
12054
- this.inverted = options?.inverted;
12055
- this.negative = options?.negative;
12056
- this.opposite = options?.opposite;
12057
- this.niceTicks = options?.niceTicks == null ? true : options.niceTicks;
12058
- this.plotLines = options?.plotLines || [];
12059
- this.plotBands = options?.plotBands || [];
12060
- }
12061
- }
12062
-
12063
- class Series {
12064
- constructor(options) {
12065
- this.id = options?.id;
12066
- this.renderTo = options?.renderTo ?? 'svg';
12067
- this.type = options?.type != null ? options?.type : SeriesType.line;
12068
- this.curveType =
12069
- options?.curveType != null ? options?.curveType : d3.curveLinear;
12070
- this.data = options?.data?.filter((_) => !isNaN(_.x) && !isNaN(_.y));
12071
- this.axisFormat = options?.axisFormat;
12072
- this.name = options?.name;
12073
- this.xAxisIndex = options?.xAxisIndex != null ? options?.xAxisIndex : 0;
12074
- this.yAxisIndex = options?.yAxisIndex != null ? options?.yAxisIndex : 0;
12075
- this.drawer = options?.drawer;
12076
- this.strokeWidth = options?.strokeWidth;
12077
- this.strokeDasharray = options?.strokeDasharray ?? null;
12078
- this.visible = options?.visible || true;
12079
- this.color = options?.color ?? 'cyan';
12080
- this.colorScale = options?.colorScale;
12081
- this.drag = { enable: false, extendLine: false, ...options?.drag };
12082
- this.showInLegend =
12083
- options?.showInLegend != null ? options?.showInLegend : true;
12084
- this.extend = options?.extend != null ? options?.extend : false;
12085
- }
12086
- }
12087
-
12088
- class TooltipOptions {
12089
- constructor(options) {
12090
- const defaultFormatter = (tooltips) => {
12091
- let html = '';
12092
- tooltips
12093
- .filter((_) => _.point)
12094
- .forEach((_) => {
12095
- html += `<div>${_.name ?? 'Без названия'} x: ${_.point?.x?.toFixed(2)} y: ${_.point?.y?.toFixed(2)}</div>`;
12096
- });
12097
- return html;
12098
- };
12099
- this.enable = options?.enable ?? true;
12100
- this.showMarkers = options?.showMarkers ?? true;
12101
- this.showLine = options?.showLine ?? false;
12102
- this.tracking = options?.tracking ?? 'x';
12103
- this.format = options?.format ?? defaultFormatter;
12104
- }
12105
- }
12106
-
12107
- class ChartBounds {
12108
- constructor(options) {
12109
- this.top = 35;
12110
- this.right = 50;
12111
- this.bottom = 50;
12112
- this.left = 35;
12113
- this.top = options?.top || this.top;
12114
- this.right = options?.right || this.right;
12115
- this.bottom = options?.bottom || this.bottom;
12116
- this.left = options?.left || this.left;
12117
- }
12118
- }
12119
-
12120
- class ChartOptions {
12121
- constructor(options) {
12122
- this.bounds = new ChartBounds();
12123
- this.name = options?.name;
12124
- this.zoom = {
12125
- enable: false,
12126
- zoomType: ZoomType.x,
12127
- ...options?.zoom,
12128
- };
12129
- this.series = options?.series?.map((series, idx) => ({
12130
- ...series,
12131
- id: idx,
12132
- }));
12133
- this.zoom = { enable: false, zoomType: ZoomType.x, ...options?.zoom };
12134
- this.series = options?.series?.map((series, idx) => new Series(series));
12135
- this.tooltip = new TooltipOptions({ ...options?.tooltip });
12136
- this.xAxis = options?.xAxis?.map((_) => new AxisOptions(_));
12137
- this.yAxis = options?.yAxis?.map((_) => new AxisOptions(_));
12138
- this.gridLines = options?.gridLines == null ? true : options.gridLines;
12139
- this.width = options?.width;
12140
- this.height = options?.height;
12141
- this.legend = {
12142
- visible: true,
12143
- type: LegendType.swatches,
12144
- ...options?.legend,
12145
- };
12146
- this.bounds = { ...this.bounds, ...options?.bounds };
12147
- this.annotations = options?.annotations;
12148
- }
12149
- }
12150
-
12151
- const annotationMap = [
12152
- annotationBadge,
12153
- annotationLabel,
12154
- annotationCallout,
12155
- annotationCalloutCircle,
12156
- annotationCalloutCurve,
12157
- annotationCalloutElbow,
12158
- annotationCalloutRect,
12159
- annotationCustomType,
12160
- annotationXYThreshold,
12161
- ];
12162
- class Annotation {
12163
- constructor(options) {
12164
- this.point = options?.point;
12165
- this.yAxisIndex = options?.yAxisIndex;
12166
- this.xAxisIndex = options?.xAxisIndex;
12167
- this.type = options?.type || annotationLabel;
12168
- this.enabled = options?.enabled;
12169
- this.className = options?.className;
12170
- this.fillColor = options?.fillColor;
12171
- this.borderColor = options?.borderColor;
12172
- this.borderWidth = options?.borderWidth;
12173
- this.note = options?.note;
12174
- this.connector = options?.connector;
12175
- this.dx = options?.dx;
12176
- this.dy = options?.dy;
12177
- }
12178
- }
12179
-
12180
- class PlotLine {
12181
- constructor(options) {
12182
- this.id = options?.id;
12183
- this.width = options?.width || 1;
12184
- this.value = options?.value;
12185
- this.label = options?.label;
12186
- this.dashed = options?.dashed || false;
12187
- this.color = options?.color || 'var(--color-text-70)';
12188
- this.min = options?.min;
12189
- this.max = options?.max;
12190
- }
12191
- }
12192
-
12193
- class PlotBand {
12194
- constructor(options) {
12195
- this.id = options?.id;
12196
- this.from = options?.from;
12197
- this.to = options?.to;
12198
- this.label = options?.label;
12199
- this.color = options?.color || '#59AE501A';
12200
- this.image = options?.image;
12201
- this.showGrabbers =
12202
- options?.showGrabbers != null ? options.showGrabbers : true;
12203
- this.draggable = options?.draggable != null ? options?.draggable : false;
12204
- this.resizable = options?.resizable != null ? options?.resizable : true;
12205
- this.min = options?.min;
12206
- this.max = options?.max;
12207
- this.opacity = options?.opacity;
12208
- }
12209
- }
12210
-
12211
9929
  class Chart3dComponent {
12212
9930
  constructor(_elementRef, _themeService) {
12213
9931
  this._elementRef = _elementRef;
@@ -12422,10 +10140,10 @@ class Chart3dComponent {
12422
10140
  }
12423
10141
  }
12424
10142
  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 });
12425
- 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"] });
10143
+ 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 });
12426
10144
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: Chart3dComponent, decorators: [{
12427
10145
  type: Component,
12428
- args: [{ selector: 'teta-chart3d', template: "<canvas #canvas></canvas>\n", styles: [":host{display:flex;width:100%;height:100%}\n"] }]
10146
+ args: [{ selector: 'teta-chart3d', changeDetection: ChangeDetectionStrategy.OnPush, template: "<canvas #canvas></canvas>\n", styles: [":host{display:flex;width:100%;height:100%}\n"] }]
12429
10147
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ThemeSwitchService }]; }, propDecorators: { canvasRef: [{
12430
10148
  type: ViewChild,
12431
10149
  args: ['canvas']
@@ -13230,5 +10948,5 @@ class StringUtil {
13230
10948
  * Generated bundle index. Do not edit.
13231
10949
  */
13232
10950
 
13233
- export { AccordionComponent, AccordionContentDirective, AccordionHeadComponent, AccordionItemComponent, AccordionModule, AggregationType, Align, Annotation, AreaDrawer, ArrayUtil, Axis, AxisOptions, AxisType, BarDrawer, BooleanCellComponent, BooleanFilter, BooleanFilterComponent, ButtonComponent, ButtonModule, CHECKBOX_CONTROL_VALUE_ACCESSOR, CellComponent, CellComponentBase, CellHostComponent, Chart3dComponent, Chart3dModule, Chart3dOptions, ChartBounds, ChartComponent, ChartModule, ChartOptions, 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, DragPointType, 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, LegendType, LineDrawer, 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, PieDrawer, PlotBand, PlotLine, PopupContentComponent, PositionUtil, ProgressBarComponent, ProgressBarModule, PropertyGridComponent, PropertyGridModule, RadioButtonComponent, RadioComponent, RadioModule, ResizeDragDirective, ResizeDragModule, ResizePanelComponent, ResizePanelModule, SLIDER_CONTROL_VALUE_ACCESSOR, SWITCH_CONTROL_VALUE_ACCESSOR, Scale, ScaleType, ScatterDrawer, SelectComponent, SelectModule, SelectOptionDirective, SelectType, SelectValueDirective, Series, SeriesType, SidebarComponent, SidebarModule, SidebarPosition, SortEvent, SortParam, SplineDrawer, 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, TetaChart, TetaContentRef, TetaSize, TetaTemplateDirective, TetaTemplateModule, TextFieldComponent, ThemeSwitchComponent, ThemeSwitchModule, ThemeSwitchService, ToggleComponent, ToggleModule, ToolbarComponent, ToolbarModule, TooltipDirective, TooltipModule, TooltipOptions, TreeComponent, TreeItemToggleComponent, TreeModule, TreeService, VerticalAlign, ZoomType, getCellComponent };
10951
+ 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 };
13234
10952
  //# sourceMappingURL=tetacom-ng-components.mjs.map