@tetacom/svg-charts 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chart/base/series-base.component.d.ts +6 -2
- package/chart/chart-container/series/area-series/area-series.component.d.ts +6 -8
- package/chart/chart-container/series/bar/bar-series.component.d.ts +2 -4
- package/chart/chart-container/series/block-area-series/block-area-series.component.d.ts +1 -3
- package/chart/chart-container/series/block-horizontal-series/block-horizontal-series.component.d.ts +2 -4
- package/chart/chart-container/series/block-series/block-series.component.d.ts +2 -4
- package/chart/chart-container/series/line/line-series.component.d.ts +2 -2
- package/chart/chart-container/series/linear-series-base.component.d.ts +9 -11
- package/chart/chart-container/series/scatter-series/scatter-series.component.d.ts +0 -6
- package/fesm2022/tetacom-svg-charts.mjs +126 -138
- package/fesm2022/tetacom-svg-charts.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, ChangeDetectorRef, ElementRef,
|
|
2
|
+
import { Injectable, input, inject, ChangeDetectorRef, ElementRef, computed, Component, ChangeDetectionStrategy, Input, ViewChild, Directive, HostBinding, HostListener, signal, EventEmitter, Output, ViewContainerRef, effect } from '@angular/core';
|
|
3
3
|
import { ReplaySubject, filter, BehaviorSubject, Subject, of, withLatestFrom, map, shareReplay, merge, lastValueFrom, take, combineLatest, tap, takeWhile, observeOn, animationFrameScheduler } from 'rxjs';
|
|
4
4
|
import * as d3 from 'd3';
|
|
5
5
|
import { zoomIdentity } from 'd3';
|
|
6
6
|
import { maxIndex } from 'd3-array';
|
|
7
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
7
8
|
import * as i3 from '@angular/platform-browser';
|
|
8
9
|
import { AsyncPipe, NgTemplateOutlet, KeyValuePipe, NgStyle } from '@angular/common';
|
|
9
10
|
import { Align as Align$1, ButtonComponent, DropdownComponent, DropdownContentDirective, DropdownHeadDirective, IconComponent, AccordionComponent, AccordionHeadComponent, AccordionItemComponent, AccordionContentDirective, CheckboxComponent, ColorInputComponent, SelectComponent, SelectOptionDirective, SelectValueDirective } from '@tetacom/ng-components';
|
|
@@ -314,7 +315,10 @@ class ChartService {
|
|
|
314
315
|
const currentSerieIndex = config.series.findIndex((_) => _.id === serie.id);
|
|
315
316
|
if (currentSerieIndex !== -1) {
|
|
316
317
|
const seriesLinkCount = config.series.filter((_) => _.yAxisIndex === config.series[currentSerieIndex].yAxisIndex && _.visible === true).length;
|
|
317
|
-
config.yAxis[config.series[currentSerieIndex].yAxisIndex]
|
|
318
|
+
const yAxis = config.yAxis[config.series[currentSerieIndex].yAxisIndex];
|
|
319
|
+
if (yAxis) {
|
|
320
|
+
yAxis.visible = seriesLinkCount !== 0;
|
|
321
|
+
}
|
|
318
322
|
}
|
|
319
323
|
return serie;
|
|
320
324
|
});
|
|
@@ -894,14 +898,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
894
898
|
|
|
895
899
|
class SeriesBaseComponent {
|
|
896
900
|
constructor() {
|
|
901
|
+
this.config = input();
|
|
902
|
+
this.series = input();
|
|
897
903
|
this.svc = inject(ChartService);
|
|
898
904
|
this.cdr = inject(ChangeDetectorRef);
|
|
899
905
|
this.scaleService = inject(ScaleService);
|
|
900
906
|
this.zoomService = inject(ZoomService);
|
|
901
907
|
this.element = inject(ElementRef);
|
|
902
908
|
this.id = (Date.now() + Math.random()).toString(36);
|
|
903
|
-
this.
|
|
904
|
-
this.
|
|
909
|
+
this.xScales = toSignal(this.scaleService.scales.pipe(map((_) => _.x)));
|
|
910
|
+
this.yScales = toSignal(this.scaleService.scales.pipe(map((_) => _.y)));
|
|
911
|
+
this.x = computed(() => {
|
|
912
|
+
return this.xScales().get(this.series().xAxisIndex)?.scale;
|
|
913
|
+
});
|
|
914
|
+
this.y = computed(() => {
|
|
915
|
+
return this.yScales().get(this.series().yAxisIndex)?.scale;
|
|
916
|
+
});
|
|
905
917
|
}
|
|
906
918
|
mouseenter(point) {
|
|
907
919
|
this.svc.setTooltip({
|
|
@@ -1675,24 +1687,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1675
1687
|
|
|
1676
1688
|
class LinearSeriesBaseComponent extends SeriesBaseComponent {
|
|
1677
1689
|
constructor() {
|
|
1678
|
-
super(
|
|
1690
|
+
super();
|
|
1691
|
+
this.pointerMove = toSignal(this.svc.pointerMove);
|
|
1692
|
+
this.transform = computed(() => {
|
|
1693
|
+
const event = this.pointerMove();
|
|
1694
|
+
return this.getTransform(event, this.x(), this.y());
|
|
1695
|
+
});
|
|
1679
1696
|
this.defaultClipPointsMapping = new Map();
|
|
1680
1697
|
this.markers = computed(() => {
|
|
1681
1698
|
return this.series().data?.filter((_) => _?.marker && _?.x !== undefined && _?.y !== undefined && _?.x !== null && _?.y !== null);
|
|
1682
1699
|
});
|
|
1683
|
-
this.
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1700
|
+
this.path = computed(() => {
|
|
1701
|
+
this.update();
|
|
1702
|
+
if (!this.x() || !this.y()) {
|
|
1703
|
+
return '';
|
|
1704
|
+
}
|
|
1705
|
+
const filter = this.defaultClipPointsMapping.get(this.series().clipPointsDirection);
|
|
1706
|
+
const line = d3
|
|
1707
|
+
.line()
|
|
1708
|
+
.defined((point) => point.x !== null &&
|
|
1709
|
+
point.y !== null &&
|
|
1710
|
+
point.x !== undefined &&
|
|
1711
|
+
point.y !== undefined &&
|
|
1712
|
+
!isNaN(point.x) &&
|
|
1713
|
+
!isNaN(point.y))
|
|
1714
|
+
.x((point) => this.x()(point.x))
|
|
1715
|
+
.y((point) => this.y()(point.y));
|
|
1716
|
+
let filteredData = this.series().data;
|
|
1717
|
+
if (this.series().clipPointsDirection === ClipPointsDirection.x) {
|
|
1718
|
+
let [min, max] = this.x().domain();
|
|
1719
|
+
min = min instanceof Date ? min.getTime() : min;
|
|
1720
|
+
max = max instanceof Date ? max.getTime() : max;
|
|
1721
|
+
filteredData = filteredData?.filter(filter(min, max));
|
|
1722
|
+
}
|
|
1723
|
+
if (this.series().clipPointsDirection === ClipPointsDirection.y) {
|
|
1724
|
+
let [min, max] = this.y().domain();
|
|
1725
|
+
min = min instanceof Date ? min.getTime() : min;
|
|
1726
|
+
max = max instanceof Date ? max.getTime() : max;
|
|
1727
|
+
filteredData = filteredData?.filter(filter(min, max));
|
|
1728
|
+
}
|
|
1729
|
+
return line(filteredData);
|
|
1730
|
+
});
|
|
1731
|
+
this.update = signal(null);
|
|
1696
1732
|
const filterX = (min, max) => (point, idx, arr) => {
|
|
1697
1733
|
const bigger = min > max ? min : max;
|
|
1698
1734
|
const smaller = min > max ? max : min;
|
|
@@ -1719,43 +1755,6 @@ class LinearSeriesBaseComponent extends SeriesBaseComponent {
|
|
|
1719
1755
|
};
|
|
1720
1756
|
this.defaultClipPointsMapping.set(ClipPointsDirection.x, filterX);
|
|
1721
1757
|
this.defaultClipPointsMapping.set(ClipPointsDirection.y, filterY);
|
|
1722
|
-
this.transform = this.svc.pointerMove.pipe(withLatestFrom(this.scaleService.scales), map((data) => {
|
|
1723
|
-
const [event, { x, y }] = data;
|
|
1724
|
-
return this.getTransform(event, x.get(this.series().xAxisIndex).scale, y.get(this.series().yAxisIndex).scale);
|
|
1725
|
-
}), tap(() => setTimeout(() => this.cdr.detectChanges())));
|
|
1726
|
-
this.path = combineLatest([this.scaleService.scales, this._update]).pipe(map(([data]) => {
|
|
1727
|
-
const { x, y } = data;
|
|
1728
|
-
this.x = x.get(this.series().xAxisIndex)?.scale;
|
|
1729
|
-
this.y = y.get(this.series().yAxisIndex)?.scale;
|
|
1730
|
-
if (!this.x || !this.y) {
|
|
1731
|
-
return '';
|
|
1732
|
-
}
|
|
1733
|
-
const filter = this.defaultClipPointsMapping.get(this.series().clipPointsDirection);
|
|
1734
|
-
const line = d3
|
|
1735
|
-
.line()
|
|
1736
|
-
.defined((point) => point.x !== null &&
|
|
1737
|
-
point.y !== null &&
|
|
1738
|
-
point.x !== undefined &&
|
|
1739
|
-
point.y !== undefined &&
|
|
1740
|
-
!isNaN(point.x) &&
|
|
1741
|
-
!isNaN(point.y))
|
|
1742
|
-
.x((point) => this.x(point.x))
|
|
1743
|
-
.y((point) => this.y(point.y));
|
|
1744
|
-
let filteredData = this.series().data;
|
|
1745
|
-
if (this.series().clipPointsDirection === ClipPointsDirection.x) {
|
|
1746
|
-
let [min, max] = this.x.domain();
|
|
1747
|
-
min = min instanceof Date ? min.getTime() : min;
|
|
1748
|
-
max = max instanceof Date ? max.getTime() : max;
|
|
1749
|
-
filteredData = filteredData?.filter(filter(min, max));
|
|
1750
|
-
}
|
|
1751
|
-
if (this.series().clipPointsDirection === ClipPointsDirection.y) {
|
|
1752
|
-
let [min, max] = this.y.domain();
|
|
1753
|
-
min = min instanceof Date ? min.getTime() : min;
|
|
1754
|
-
max = max instanceof Date ? max.getTime() : max;
|
|
1755
|
-
filteredData = filteredData?.filter(filter(min, max));
|
|
1756
|
-
}
|
|
1757
|
-
return line(filteredData);
|
|
1758
|
-
}));
|
|
1759
1758
|
}
|
|
1760
1759
|
ngOnDestroy() {
|
|
1761
1760
|
this.svc.setTooltip({
|
|
@@ -1764,23 +1763,23 @@ class LinearSeriesBaseComponent extends SeriesBaseComponent {
|
|
|
1764
1763
|
});
|
|
1765
1764
|
}
|
|
1766
1765
|
getTransform(event, scaleX, scaleY) {
|
|
1767
|
-
if (
|
|
1766
|
+
if (!scaleX || !scaleY) {
|
|
1767
|
+
return null;
|
|
1768
|
+
}
|
|
1769
|
+
if (event && event.type === 'mouseleave') {
|
|
1768
1770
|
return null;
|
|
1769
1771
|
}
|
|
1770
1772
|
const mouse = [event?.offsetX, event?.offsetY];
|
|
1771
1773
|
const tooltipTracking = this.config()?.tooltip?.tracking;
|
|
1772
1774
|
const lineIntersection = (p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) => {
|
|
1773
1775
|
const rV = {};
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
s = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-s2_x * s1_y + s1_x * s2_y);
|
|
1781
|
-
t = (s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-s2_x * s1_y + s1_x * s2_y);
|
|
1776
|
+
const s1_x = p1_x - p0_x;
|
|
1777
|
+
const s1_y = p1_y - p0_y;
|
|
1778
|
+
const s2_x = p3_x - p2_x;
|
|
1779
|
+
const s2_y = p3_y - p2_y;
|
|
1780
|
+
const s = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-s2_x * s1_y + s1_x * s2_y);
|
|
1781
|
+
const t = (s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-s2_x * s1_y + s1_x * s2_y);
|
|
1782
1782
|
if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {
|
|
1783
|
-
// Collision detected
|
|
1784
1783
|
rV.x = p0_x + t * s1_x;
|
|
1785
1784
|
rV.y = p0_y + t * s1_y;
|
|
1786
1785
|
}
|
|
@@ -1851,7 +1850,7 @@ class LinearSeriesBaseComponent extends SeriesBaseComponent {
|
|
|
1851
1850
|
}
|
|
1852
1851
|
return null;
|
|
1853
1852
|
}
|
|
1854
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LinearSeriesBaseComponent, deps:
|
|
1853
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LinearSeriesBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1855
1854
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: LinearSeriesBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
1856
1855
|
}
|
|
1857
1856
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LinearSeriesBaseComponent, decorators: [{
|
|
@@ -1860,7 +1859,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1860
1859
|
template: '',
|
|
1861
1860
|
standalone: true,
|
|
1862
1861
|
}]
|
|
1863
|
-
}] });
|
|
1862
|
+
}], ctorParameters: () => [] });
|
|
1864
1863
|
|
|
1865
1864
|
var DragPointType;
|
|
1866
1865
|
(function (DragPointType) {
|
|
@@ -2016,22 +2015,22 @@ class LineSeriesComponent extends LinearSeriesBaseComponent {
|
|
|
2016
2015
|
this.allowDrag = (point) => {
|
|
2017
2016
|
return (newPoint) => {
|
|
2018
2017
|
if (point.marker.minX !== null && point.marker.minX !== undefined) {
|
|
2019
|
-
if (this.x.invert(this.x(this.start.x) + newPoint.deltaX) < point.marker.minX) {
|
|
2018
|
+
if (this.x().invert(this.x()(this.start.x) + newPoint.deltaX) < point.marker.minX) {
|
|
2020
2019
|
return false;
|
|
2021
2020
|
}
|
|
2022
2021
|
}
|
|
2023
2022
|
if (point.marker.maxX !== null && point.marker.maxX !== undefined) {
|
|
2024
|
-
if (this.x.invert(this.x(this.start.x) + newPoint.deltaX) > point.marker.maxX) {
|
|
2023
|
+
if (this.x().invert(this.x()(this.start.x) + newPoint.deltaX) > point.marker.maxX) {
|
|
2025
2024
|
return false;
|
|
2026
2025
|
}
|
|
2027
2026
|
}
|
|
2028
2027
|
if (point.marker.minY !== null && point.marker.minY !== undefined) {
|
|
2029
|
-
if (this.y.invert(this.y(this.start.y) + newPoint.deltaY) < point.marker.minY) {
|
|
2028
|
+
if (this.y().invert(this.y()(this.start.y) + newPoint.deltaY) < point.marker.minY) {
|
|
2030
2029
|
return false;
|
|
2031
2030
|
}
|
|
2032
2031
|
}
|
|
2033
2032
|
if (point.marker.maxY !== null && point.marker.maxY !== undefined) {
|
|
2034
|
-
if (this.y.invert(this.y(this.start.y) + newPoint.deltaY) > point.marker.maxY) {
|
|
2033
|
+
if (this.y().invert(this.y()(this.start.y) + newPoint.deltaY) > point.marker.maxY) {
|
|
2035
2034
|
return false;
|
|
2036
2035
|
}
|
|
2037
2036
|
}
|
|
@@ -2043,9 +2042,9 @@ class LineSeriesComponent extends LinearSeriesBaseComponent {
|
|
|
2043
2042
|
this.start = { x: point.x, y: point.y };
|
|
2044
2043
|
}
|
|
2045
2044
|
moveEnd(event, point) {
|
|
2046
|
-
point.x = this.x.invert(this.x(this.start.x) + event.deltaX);
|
|
2047
|
-
point.y = this.y.invert(this.y(this.start.y) + event.deltaY);
|
|
2048
|
-
this.
|
|
2045
|
+
point.x = this.x().invert(this.x()(this.start.x) + event.deltaX);
|
|
2046
|
+
point.y = this.y().invert(this.y()(this.start.y) + event.deltaY);
|
|
2047
|
+
this.update.set({});
|
|
2049
2048
|
const emitEvent = {
|
|
2050
2049
|
type: 'end',
|
|
2051
2050
|
sourceEvent: event,
|
|
@@ -2059,9 +2058,9 @@ class LineSeriesComponent extends LinearSeriesBaseComponent {
|
|
|
2059
2058
|
});
|
|
2060
2059
|
}
|
|
2061
2060
|
moveProcess(event, point) {
|
|
2062
|
-
point.x = this.x.invert(this.x(this.start.x) + event.deltaX);
|
|
2063
|
-
point.y = this.y.invert(this.y(this.start.y) + event.deltaY);
|
|
2064
|
-
this.
|
|
2061
|
+
point.x = this.x().invert(this.x()(this.start.x) + event.deltaX);
|
|
2062
|
+
point.y = this.y().invert(this.y()(this.start.y) + event.deltaY);
|
|
2063
|
+
this.update.set({});
|
|
2065
2064
|
const emitEvent = {
|
|
2066
2065
|
type: 'drag',
|
|
2067
2066
|
sourceEvent: event,
|
|
@@ -2082,28 +2081,26 @@ class LineSeriesComponent extends LinearSeriesBaseComponent {
|
|
|
2082
2081
|
label.dy = this.labelStart.dy + event.deltaY;
|
|
2083
2082
|
}
|
|
2084
2083
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LineSeriesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2085
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: LineSeriesComponent, isStandalone: true, selector: "svg:svg[teta-line-series]", usesInheritance: true, ngImport: i0, template: "@if (series(); as series) {\n <svg:path\n class=\"line\"\n [attr.d]=\"path
|
|
2084
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: LineSeriesComponent, isStandalone: true, selector: "svg:svg[teta-line-series]", usesInheritance: true, ngImport: i0, template: "@if (series(); as series) {\n <svg:path\n class=\"line\"\n [attr.d]=\"path()\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n fill=\"none\"\n ></svg:path>\n @if (transform(); as t) {\n @if (t?.x !== null && t?.x !== undefined && t?.y !== null && t?.y !== undefined) {\n <svg:circle r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate(' + t.x + ', ' + t.y + ')'\"></svg:circle>\n }\n }\n @if (markers(); as draggablePoints) {\n @if (x() && y()) {\n @for (point of draggablePoints; track point) {\n <svg:g [attr.transform]=\"'translate(' + x()(point.x) + ',' + y()(point.y) + ')'\">\n <svg:g [tetaDraggablePoint]=\"point.marker.draggable\"\n [dragDirection]=\"point.marker.dragType\"\n [allowDrag]=\"allowDrag(point)\"\n #dragPoint=\"tetaDraggablePoint\"\n (moveStart)=\"moveStart($event, point)\"\n (moveEnd)=\"moveEnd($event, point); dragPoint.resetTransform()\"\n (moveProcess)=\"moveProcess($event, point); dragPoint.resetTransform()\"\n [class.draggable-marker]=\"point?.marker?.draggable\">\n <svg:circle class=\"marker\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"0\"\n [attr.cy]=\"0\"></svg:circle>\n @if (point.marker.label?.text) {\n <svg:line [attr.x1]=\"0\"\n [attr.y1]=\"0\"\n [attr.x2]=\"point.marker.label?.dx\"\n [attr.y2]=\"point.marker.label?.dy\"\n [attr.stroke]=\"point.marker.label?.style?.stroke ?? 'var(--color-text-90)'\"\n [attr.stroke-width]=\"point.marker.label?.style?.strokeWidth ?? 1\"\n [attr.stroke-dasharray]=\"point.marker.label?.style?.strokeDasharray ?? null\"></svg:line>\n <svg:foreignObject [tetaDraggablePoint]=\"point.marker.label?.draggable\"\n [dragDirection]=\"point.marker.label.dragType\"\n #labelPoint=\"tetaDraggablePoint\"\n (moveStart)=\"startLabel($event, point.marker.label)\"\n (moveProcess)=\"moveLabel($event, point.marker.label); labelPoint.resetTransform()\"\n (moveEnd)=\"labelPoint.resetTransform()\"\n [attr.width]=\"annotationNode?.offsetWidth ?? 0\"\n [attr.height]=\"annotationNode?.offsetHeight ?? 0\"\n [attr.x]=\"point.marker.label?.dx\"\n [attr.y]=\"point.marker.label?.dy\"\n class=\"position-absolute\">\n <div #annotationNode\n class=\"shadow-2 padding-2\"\n [style.color]=\"'var(--color-text-90)'\"\n [style.background-color]=\"'var(--color-global-bgcard)'\"\n [style.cursor]=\"'move'\"\n style=\"border-radius: 2px; display: inline-block\">\n {{ point.marker.label?.text }}\n </div>\n </svg:foreignObject>\n }\n </svg:g>\n </svg:g>\n }\n }\n }\n}\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"], dependencies: [{ kind: "directive", type: DraggablePointDirective, selector: "[tetaDraggablePoint]", inputs: ["tetaDraggablePoint", "dragDirection", "allowDrag"], outputs: ["moveStart", "moveProcess", "moveEnd"], exportAs: ["tetaDraggablePoint"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2086
2085
|
}
|
|
2087
2086
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LineSeriesComponent, decorators: [{
|
|
2088
2087
|
type: Component,
|
|
2089
|
-
args: [{ selector: 'svg:svg[teta-line-series]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe, DraggablePointDirective], template: "@if (series(); as series) {\n <svg:path\n class=\"line\"\n [attr.d]=\"path
|
|
2088
|
+
args: [{ selector: 'svg:svg[teta-line-series]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe, DraggablePointDirective], template: "@if (series(); as series) {\n <svg:path\n class=\"line\"\n [attr.d]=\"path()\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n fill=\"none\"\n ></svg:path>\n @if (transform(); as t) {\n @if (t?.x !== null && t?.x !== undefined && t?.y !== null && t?.y !== undefined) {\n <svg:circle r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate(' + t.x + ', ' + t.y + ')'\"></svg:circle>\n }\n }\n @if (markers(); as draggablePoints) {\n @if (x() && y()) {\n @for (point of draggablePoints; track point) {\n <svg:g [attr.transform]=\"'translate(' + x()(point.x) + ',' + y()(point.y) + ')'\">\n <svg:g [tetaDraggablePoint]=\"point.marker.draggable\"\n [dragDirection]=\"point.marker.dragType\"\n [allowDrag]=\"allowDrag(point)\"\n #dragPoint=\"tetaDraggablePoint\"\n (moveStart)=\"moveStart($event, point)\"\n (moveEnd)=\"moveEnd($event, point); dragPoint.resetTransform()\"\n (moveProcess)=\"moveProcess($event, point); dragPoint.resetTransform()\"\n [class.draggable-marker]=\"point?.marker?.draggable\">\n <svg:circle class=\"marker\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"0\"\n [attr.cy]=\"0\"></svg:circle>\n @if (point.marker.label?.text) {\n <svg:line [attr.x1]=\"0\"\n [attr.y1]=\"0\"\n [attr.x2]=\"point.marker.label?.dx\"\n [attr.y2]=\"point.marker.label?.dy\"\n [attr.stroke]=\"point.marker.label?.style?.stroke ?? 'var(--color-text-90)'\"\n [attr.stroke-width]=\"point.marker.label?.style?.strokeWidth ?? 1\"\n [attr.stroke-dasharray]=\"point.marker.label?.style?.strokeDasharray ?? null\"></svg:line>\n <svg:foreignObject [tetaDraggablePoint]=\"point.marker.label?.draggable\"\n [dragDirection]=\"point.marker.label.dragType\"\n #labelPoint=\"tetaDraggablePoint\"\n (moveStart)=\"startLabel($event, point.marker.label)\"\n (moveProcess)=\"moveLabel($event, point.marker.label); labelPoint.resetTransform()\"\n (moveEnd)=\"labelPoint.resetTransform()\"\n [attr.width]=\"annotationNode?.offsetWidth ?? 0\"\n [attr.height]=\"annotationNode?.offsetHeight ?? 0\"\n [attr.x]=\"point.marker.label?.dx\"\n [attr.y]=\"point.marker.label?.dy\"\n class=\"position-absolute\">\n <div #annotationNode\n class=\"shadow-2 padding-2\"\n [style.color]=\"'var(--color-text-90)'\"\n [style.background-color]=\"'var(--color-global-bgcard)'\"\n [style.cursor]=\"'move'\"\n style=\"border-radius: 2px; display: inline-block\">\n {{ point.marker.label?.text }}\n </div>\n </svg:foreignObject>\n }\n </svg:g>\n </svg:g>\n }\n }\n }\n}\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"] }]
|
|
2090
2089
|
}] });
|
|
2091
2090
|
|
|
2092
2091
|
class BarSeriesComponent extends SeriesBaseComponent {
|
|
2093
2092
|
constructor() {
|
|
2094
2093
|
super(...arguments);
|
|
2095
|
-
this.
|
|
2096
|
-
|
|
2097
|
-
this.x1 = this.scaleService.scales.pipe(map((_) => {
|
|
2098
|
-
const x = _.x.get(this.series().xAxisIndex)?.scale;
|
|
2094
|
+
this.x1 = computed(() => {
|
|
2095
|
+
const x = this.xScales().get(this.series().xAxisIndex)?.scale;
|
|
2099
2096
|
const range = x.range();
|
|
2100
2097
|
const domain = this.series().data.map((_) => _.x);
|
|
2101
2098
|
return d3.scaleBand().range([0, range[1]]).domain(domain).padding(0.1);
|
|
2102
|
-
})
|
|
2103
|
-
this.barSeriesCount =
|
|
2104
|
-
const count =
|
|
2099
|
+
});
|
|
2100
|
+
this.barSeriesCount = computed(() => {
|
|
2101
|
+
const count = this.config().series.filter((_) => _.type === SeriesType.bar && _.xAxisIndex === this.series().xAxisIndex);
|
|
2105
2102
|
return count.length;
|
|
2106
|
-
})
|
|
2103
|
+
});
|
|
2107
2104
|
this.Math = Math;
|
|
2108
2105
|
this.Number = Number;
|
|
2109
2106
|
}
|
|
@@ -2111,118 +2108,111 @@ class BarSeriesComponent extends SeriesBaseComponent {
|
|
|
2111
2108
|
return typeof value === 'number';
|
|
2112
2109
|
}
|
|
2113
2110
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BarSeriesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2114
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: BarSeriesComponent, isStandalone: true, selector: "svg:svg[teta-bar-series]", usesInheritance: true, ngImport: i0, template: "@if ({ x: x
|
|
2111
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: BarSeriesComponent, isStandalone: true, selector: "svg:svg[teta-bar-series]", usesInheritance: true, ngImport: i0, template: "@if ({ x: x(), x1: x1(), y: y(), barSeriesCount: barSeriesCount() }; as data) {\n @if (data.x && data.y) {\n @if (data.barSeriesCount > 1) {\n @for (point of series().data; track point) {\n <svg:rect\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.x]=\"\n data.x(point.x) + ((isNumber(series().id) ? Number(series().id) : 0) * data.x1.bandwidth()) / data.barSeriesCount\n \"\n [attr.y]=\"point.y > 0 ? data.y(point.y) : data.y(0)\"\n [attr.width]=\"data.x1.bandwidth() / data.barSeriesCount\"\n [attr.height]=\"Math.abs(data.y(point.y) - data.y(0))\"\n [attr.fill]=\"series().color\"\n ></svg:rect>\n }\n }\n @if (data.barSeriesCount === 1) {\n @for (point of series().data; track point) {\n <svg:rect\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.x]=\"data.x(point.x)\"\n [attr.y]=\"point.y > 0 ? data.y(point.y) : data.y(0)\"\n [attr.width]=\"data.x1.bandwidth()\"\n [attr.height]=\"Math.abs(data.y(point.y) - data.y(0))\"\n [attr.fill]=\"point.color ?? series().color\"\n ></svg:rect>\n }\n }\n }\n}\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2115
2112
|
}
|
|
2116
2113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BarSeriesComponent, decorators: [{
|
|
2117
2114
|
type: Component,
|
|
2118
|
-
args: [{ selector: 'svg:svg[teta-bar-series]', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2115
|
+
args: [{ selector: 'svg:svg[teta-bar-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if ({ x: x(), x1: x1(), y: y(), barSeriesCount: barSeriesCount() }; as data) {\n @if (data.x && data.y) {\n @if (data.barSeriesCount > 1) {\n @for (point of series().data; track point) {\n <svg:rect\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.x]=\"\n data.x(point.x) + ((isNumber(series().id) ? Number(series().id) : 0) * data.x1.bandwidth()) / data.barSeriesCount\n \"\n [attr.y]=\"point.y > 0 ? data.y(point.y) : data.y(0)\"\n [attr.width]=\"data.x1.bandwidth() / data.barSeriesCount\"\n [attr.height]=\"Math.abs(data.y(point.y) - data.y(0))\"\n [attr.fill]=\"series().color\"\n ></svg:rect>\n }\n }\n @if (data.barSeriesCount === 1) {\n @for (point of series().data; track point) {\n <svg:rect\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.x]=\"data.x(point.x)\"\n [attr.y]=\"point.y > 0 ? data.y(point.y) : data.y(0)\"\n [attr.width]=\"data.x1.bandwidth()\"\n [attr.height]=\"Math.abs(data.y(point.y) - data.y(0))\"\n [attr.fill]=\"point.color ?? series().color\"\n ></svg:rect>\n }\n }\n }\n}\n" }]
|
|
2119
2116
|
}] });
|
|
2120
2117
|
|
|
2121
2118
|
class ScatterSeriesComponent extends SeriesBaseComponent {
|
|
2122
|
-
constructor() {
|
|
2123
|
-
super(...arguments);
|
|
2124
|
-
this.x = this.scaleService.scales.pipe(map((_) => _.x.get(this.series().xAxisIndex)?.scale));
|
|
2125
|
-
this.y = this.scaleService.scales.pipe(map((_) => _.y.get(this.series().yAxisIndex)?.scale));
|
|
2126
|
-
}
|
|
2127
2119
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScatterSeriesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2128
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScatterSeriesComponent, isStandalone: true, selector: "svg:svg[teta-scatter-series]", usesInheritance: true, ngImport: i0, template: "@if ({ y: y
|
|
2120
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScatterSeriesComponent, isStandalone: true, selector: "svg:svg[teta-scatter-series]", usesInheritance: true, ngImport: i0, template: "@if ({ y: y(), x: x() }; as scales) {\n @if (scales.x && scales.y) {\n @for (point of series().data; track point) {\n <svg:circle\n class=\"line\"\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.cx]=\"scales.x(point.x)\"\n [attr.cy]=\"scales.y(point.y)\"\n [attr.r]=\"series().style?.radius ?? 1\"\n [attr.stroke]=\"point.color ?? series().color\"\n [attr.fill]=\"point.color ?? series().color\"\n [attr.stroke-width]=\"series().style?.strokeWidth\"\n ></svg:circle>\n }\n }\n}\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2129
2121
|
}
|
|
2130
2122
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScatterSeriesComponent, decorators: [{
|
|
2131
2123
|
type: Component,
|
|
2132
|
-
args: [{ selector: 'svg:svg[teta-scatter-series]',
|
|
2124
|
+
args: [{ selector: 'svg:svg[teta-scatter-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if ({ y: y(), x: x() }; as scales) {\n @if (scales.x && scales.y) {\n @for (point of series().data; track point) {\n <svg:circle\n class=\"line\"\n (mouseenter)=\"mouseenter(point)\"\n (mouseleave)=\"mouseleave(point)\"\n [attr.cx]=\"scales.x(point.x)\"\n [attr.cy]=\"scales.y(point.y)\"\n [attr.r]=\"series().style?.radius ?? 1\"\n [attr.stroke]=\"point.color ?? series().color\"\n [attr.fill]=\"point.color ?? series().color\"\n [attr.stroke-width]=\"series().style?.strokeWidth\"\n ></svg:circle>\n }\n }\n}\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"] }]
|
|
2133
2125
|
}] });
|
|
2134
2126
|
|
|
2135
2127
|
class BlockSeriesComponent extends SeriesBaseComponent {
|
|
2136
2128
|
constructor() {
|
|
2137
2129
|
super(...arguments);
|
|
2138
|
-
this.
|
|
2139
|
-
this.y = this.scaleService.scales.pipe(map((_) => _.y.get(this.series().yAxisIndex)?.scale));
|
|
2140
|
-
this.displayPoints = this.y.pipe(filter((y) => y), map((y) => {
|
|
2130
|
+
this.displayPoints = computed(() => {
|
|
2141
2131
|
return this.series().data.filter((point, index, arr) => {
|
|
2142
|
-
const [min, max] = y.domain();
|
|
2132
|
+
const [min, max] = this.y().domain();
|
|
2143
2133
|
return ((point.y >= min || point.y1 >= min || arr[index + 1]?.y >= min || arr[index + 1]?.y1 >= min) &&
|
|
2144
2134
|
(point.y <= max || point.y1 <= max || arr[index - 1]?.y <= max || arr[index - 1]?.y1 <= max));
|
|
2145
2135
|
});
|
|
2146
|
-
})
|
|
2147
|
-
this.fillType = FillType;
|
|
2136
|
+
});
|
|
2148
2137
|
this.Math = Math;
|
|
2138
|
+
this.FillType = FillType;
|
|
2149
2139
|
}
|
|
2150
2140
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BlockSeriesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2151
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: BlockSeriesComponent, isStandalone: true, selector: "svg:svg[teta-block-series]", usesInheritance: true, ngImport: i0, template: "@if ({ y: y
|
|
2141
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: BlockSeriesComponent, isStandalone: true, selector: "svg:svg[teta-block-series]", usesInheritance: true, ngImport: i0, template: "@if ({ y: y(), x: x(), points: displayPoints() }; as data) {\n @if (series()?.fillType === FillType.gradient) {\n <svg:defs>\n <svg:linearGradient\n [id]=\"'gradient-fill-' + id\"\n gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config()?.inverted ? '0%' : '100%'\"\n [attr.x2]=\"config()?.inverted ? '100%' : '0%'\"\n y2=\"0%\"\n >\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.9\"></svg:stop>\n </svg:linearGradient>\n </svg:defs>\n }\n @if (data.x && data.y) {\n @for (point of data.points; track point) {\n <svg:g (mouseenter)=\"mouseenter(point)\" (mouseleave)=\"mouseleave(point)\">\n <svg:rect\n x=\"0\"\n [attr.y]=\"data.y(point.y)\"\n [attr.height]=\"Math.abs(data.y(point.y1) - data.y(point.y))\"\n [attr.fill]=\"\n series().fillType === FillType.gradient\n ? 'url(#gradient-fill-' + id + ')'\n : point.iconId\n ? 'url(#pattern' + point.iconId + ')'\n : (point.color ?? series().style?.fill ?? series().color)\n \"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"\n width=\"100%\"\n ></svg:rect>\n @if (point.text && data.y(point.y1) - data.y(point.y) > 8) {\n <svg:text\n x=\"50%\"\n [attr.y]=\"(data.y(point.y1) + data.y(point.y)) / 2\"\n alignment-baseline=\"middle\"\n text-anchor=\"middle\"\n >\n {{ point.text }}\n </svg:text>\n }\n <svg:line\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"data.y(point.y)\"\n [attr.y2]=\"data.y(point.y)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : (point.color ?? series().style?.stroke ?? series().color)\"\n ></svg:line>\n <svg:line\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"data.y(point.y1)\"\n [attr.y2]=\"data.y(point.y1)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : (point.color ?? series().style?.stroke ?? series().color)\"\n ></svg:line>\n </svg:g>\n }\n }\n}\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2152
2142
|
}
|
|
2153
2143
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BlockSeriesComponent, decorators: [{
|
|
2154
2144
|
type: Component,
|
|
2155
|
-
args: [{ selector: 'svg:svg[teta-block-series]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe], template: "@if ({ y: y
|
|
2145
|
+
args: [{ selector: 'svg:svg[teta-block-series]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe], template: "@if ({ y: y(), x: x(), points: displayPoints() }; as data) {\n @if (series()?.fillType === FillType.gradient) {\n <svg:defs>\n <svg:linearGradient\n [id]=\"'gradient-fill-' + id\"\n gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config()?.inverted ? '0%' : '100%'\"\n [attr.x2]=\"config()?.inverted ? '100%' : '0%'\"\n y2=\"0%\"\n >\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.9\"></svg:stop>\n </svg:linearGradient>\n </svg:defs>\n }\n @if (data.x && data.y) {\n @for (point of data.points; track point) {\n <svg:g (mouseenter)=\"mouseenter(point)\" (mouseleave)=\"mouseleave(point)\">\n <svg:rect\n x=\"0\"\n [attr.y]=\"data.y(point.y)\"\n [attr.height]=\"Math.abs(data.y(point.y1) - data.y(point.y))\"\n [attr.fill]=\"\n series().fillType === FillType.gradient\n ? 'url(#gradient-fill-' + id + ')'\n : point.iconId\n ? 'url(#pattern' + point.iconId + ')'\n : (point.color ?? series().style?.fill ?? series().color)\n \"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"\n width=\"100%\"\n ></svg:rect>\n @if (point.text && data.y(point.y1) - data.y(point.y) > 8) {\n <svg:text\n x=\"50%\"\n [attr.y]=\"(data.y(point.y1) + data.y(point.y)) / 2\"\n alignment-baseline=\"middle\"\n text-anchor=\"middle\"\n >\n {{ point.text }}\n </svg:text>\n }\n <svg:line\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"data.y(point.y)\"\n [attr.y2]=\"data.y(point.y)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : (point.color ?? series().style?.stroke ?? series().color)\"\n ></svg:line>\n <svg:line\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"data.y(point.y1)\"\n [attr.y2]=\"data.y(point.y1)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : (point.color ?? series().style?.stroke ?? series().color)\"\n ></svg:line>\n </svg:g>\n }\n }\n}\n" }]
|
|
2156
2146
|
}] });
|
|
2157
2147
|
|
|
2158
2148
|
class BlockAreaSeriesComponent extends SeriesBaseComponent {
|
|
2159
2149
|
constructor() {
|
|
2160
2150
|
super(...arguments);
|
|
2161
|
-
this.
|
|
2162
|
-
this.y = this.scaleService.scales.pipe(map((_) => _.y.get(this.series().yAxisIndex)?.scale));
|
|
2163
|
-
this.displayPoints = this.y.pipe(filter((y) => y), map((y) => {
|
|
2151
|
+
this.displayPoints = computed(() => {
|
|
2164
2152
|
return this.series().data.filter((point, index, arr) => {
|
|
2165
|
-
const [min, max] = y.domain();
|
|
2153
|
+
const [min, max] = this.y().domain();
|
|
2166
2154
|
return ((point.y >= min || point.y1 >= min || arr[index + 1]?.y >= min || arr[index + 1]?.y1 >= min) &&
|
|
2167
2155
|
(point.y <= max || point.y1 <= max || arr[index - 1]?.y <= max || arr[index - 1]?.y1 <= max));
|
|
2168
2156
|
});
|
|
2169
|
-
})
|
|
2157
|
+
});
|
|
2170
2158
|
this.fillType = FillType;
|
|
2171
2159
|
this.Math = Math;
|
|
2172
2160
|
}
|
|
2173
2161
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BlockAreaSeriesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2174
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: BlockAreaSeriesComponent, isStandalone: true, selector: "svg:svg[teta-block-area-series]", usesInheritance: true, ngImport: i0, template: "@if ({ y: y
|
|
2162
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: BlockAreaSeriesComponent, isStandalone: true, selector: "svg:svg[teta-block-area-series]", usesInheritance: true, ngImport: i0, template: "@if ({ y: y(), x: x(), points: displayPoints() }; as data) {\n @if (series()?.fillType === fillType.gradient) {\n <svg:defs>\n <svg:linearGradient [id]=\"'gradient-fill-' + id\"\n gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config()?.inverted ? '0%' : '100%'\"\n [attr.x2]=\"config()?.inverted ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series().style?.fill ?? series().color\"\n stop-opacity=\"0.9\"></svg:stop>\n </svg:linearGradient>\n </svg:defs>\n }\n @if (data.x && data.y) {\n @for (point of data.points; track point) {\n <svg:g (mouseenter)=\"mouseenter(point)\" (mouseleave)=\"mouseleave(point)\">\n @if (!!config().inverted) {\n <svg:rect [attr.x]=\"data.x(0) < data.x(point.x) ? data.x(0) : data.x(point.x)\"\n [attr.y]=\"data.y(point.y)\"\n [attr.height]=\"Math.abs(data.y(point.y1) - data.y(point.y))\"\n [attr.width]=\"data.x(0) < data.x(point.x) ? data.x(point.x) - data.x(0) : data.x(0) - data.x(point.x)\"\n [attr.stroke]=\"point.iconId ? '' : (point.color ?? series().style?.stroke ?? series().color)\"\n [attr.stroke-dasharray]=\"series().style?.strokeDasharray\"\n [attr.stroke-width]=\"series().style?.strokeWidth\"\n [attr.fill]=\"\n series().fillType === fillType.gradient\n ? 'url(#gradient-fill-' + id + ')'\n : point.iconId\n ? 'url(#pattern' + point.iconId + ')'\n : (point.color ?? series().style?.fill ?? series().color)\n \"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"></svg:rect>\n } @else {\n <svg:rect [attr.x]=\"data.x(point.x)\"\n [attr.y]=\"data.y(0)\"\n [attr.height]=\"Math.abs(data.y(0) - data.y(point.y))\"\n [attr.width]=\"data.x(point.x1) - data.x(point.x)\"\n [attr.stroke]=\"point.iconId ? '' : (point.color ?? series().color)\"\n [attr.stroke-dasharray]=\"series().style?.strokeDasharray\"\n [attr.stroke-width]=\"series().style?.strokeWidth\"\n [attr.fill]=\"\n series().fillType === fillType.gradient\n ? 'url(#gradient-fill-' + id + ')'\n : point.iconId\n ? 'url(#pattern' + point.iconId + ')'\n : (point.color ?? series().color)\n \"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"></svg:rect>\n }\n @if (point.text) {\n <svg:text x=\"50%\"\n fill=\"var(--color-text-50)\"\n [attr.y]=\"(data.y(point.y1) + data.y(point.y)) / 2\"\n alignment-baseline=\"middle\"\n text-anchor=\"middle\">\n {{ point.text }}\n </svg:text>\n }\n </svg:g>\n }\n }\n}\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2175
2163
|
}
|
|
2176
2164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BlockAreaSeriesComponent, decorators: [{
|
|
2177
2165
|
type: Component,
|
|
2178
|
-
args: [{ selector: 'svg:svg[teta-block-area-series]', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2166
|
+
args: [{ selector: 'svg:svg[teta-block-area-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if ({ y: y(), x: x(), points: displayPoints() }; as data) {\n @if (series()?.fillType === fillType.gradient) {\n <svg:defs>\n <svg:linearGradient [id]=\"'gradient-fill-' + id\"\n gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config()?.inverted ? '0%' : '100%'\"\n [attr.x2]=\"config()?.inverted ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series().style?.fill ?? series().color\"\n stop-opacity=\"0.9\"></svg:stop>\n </svg:linearGradient>\n </svg:defs>\n }\n @if (data.x && data.y) {\n @for (point of data.points; track point) {\n <svg:g (mouseenter)=\"mouseenter(point)\" (mouseleave)=\"mouseleave(point)\">\n @if (!!config().inverted) {\n <svg:rect [attr.x]=\"data.x(0) < data.x(point.x) ? data.x(0) : data.x(point.x)\"\n [attr.y]=\"data.y(point.y)\"\n [attr.height]=\"Math.abs(data.y(point.y1) - data.y(point.y))\"\n [attr.width]=\"data.x(0) < data.x(point.x) ? data.x(point.x) - data.x(0) : data.x(0) - data.x(point.x)\"\n [attr.stroke]=\"point.iconId ? '' : (point.color ?? series().style?.stroke ?? series().color)\"\n [attr.stroke-dasharray]=\"series().style?.strokeDasharray\"\n [attr.stroke-width]=\"series().style?.strokeWidth\"\n [attr.fill]=\"\n series().fillType === fillType.gradient\n ? 'url(#gradient-fill-' + id + ')'\n : point.iconId\n ? 'url(#pattern' + point.iconId + ')'\n : (point.color ?? series().style?.fill ?? series().color)\n \"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"></svg:rect>\n } @else {\n <svg:rect [attr.x]=\"data.x(point.x)\"\n [attr.y]=\"data.y(0)\"\n [attr.height]=\"Math.abs(data.y(0) - data.y(point.y))\"\n [attr.width]=\"data.x(point.x1) - data.x(point.x)\"\n [attr.stroke]=\"point.iconId ? '' : (point.color ?? series().color)\"\n [attr.stroke-dasharray]=\"series().style?.strokeDasharray\"\n [attr.stroke-width]=\"series().style?.strokeWidth\"\n [attr.fill]=\"\n series().fillType === fillType.gradient\n ? 'url(#gradient-fill-' + id + ')'\n : point.iconId\n ? 'url(#pattern' + point.iconId + ')'\n : (point.color ?? series().color)\n \"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"></svg:rect>\n }\n @if (point.text) {\n <svg:text x=\"50%\"\n fill=\"var(--color-text-50)\"\n [attr.y]=\"(data.y(point.y1) + data.y(point.y)) / 2\"\n alignment-baseline=\"middle\"\n text-anchor=\"middle\">\n {{ point.text }}\n </svg:text>\n }\n </svg:g>\n }\n }\n}\n" }]
|
|
2179
2167
|
}] });
|
|
2180
2168
|
|
|
2181
2169
|
class AreaSeriesComponent extends LinearSeriesBaseComponent {
|
|
2182
2170
|
constructor() {
|
|
2183
2171
|
super(...arguments);
|
|
2184
|
-
this.
|
|
2185
|
-
|
|
2186
|
-
}
|
|
2187
|
-
ngOnInit() {
|
|
2188
|
-
super.ngOnInit();
|
|
2189
|
-
this.areaPath = this.scaleService.scales.pipe(map((data) => {
|
|
2190
|
-
const { x, y } = data;
|
|
2191
|
-
this.x = x.get(this.series().xAxisIndex)?.scale;
|
|
2192
|
-
this.y = y.get(this.series().yAxisIndex)?.scale;
|
|
2193
|
-
if (!this.x || !this.y) {
|
|
2172
|
+
this.areaPath = computed(() => {
|
|
2173
|
+
if (!this.x() || !this.y()) {
|
|
2194
2174
|
return '';
|
|
2195
2175
|
}
|
|
2196
2176
|
const area = d3
|
|
2197
2177
|
.area()
|
|
2198
2178
|
.defined((point) => point.x !== null && point.y !== null && !isNaN(point.x) && !isNaN(point.y));
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2179
|
+
if (this.config().inverted) {
|
|
2180
|
+
area
|
|
2181
|
+
.x1((_) => (_.x1 !== null && _.x1 !== undefined ? this.x()(_.x1) : this.x()(0)))
|
|
2182
|
+
.x0((_) => this.x()(_.x))
|
|
2183
|
+
.y((_) => this.y()(_.y));
|
|
2184
|
+
}
|
|
2185
|
+
else {
|
|
2186
|
+
area
|
|
2187
|
+
.y1((_) => (_.y1 !== null && _.y1 !== undefined ? this.y()(_.y1) : this.y()(0)))
|
|
2188
|
+
.y0((_) => this.y()(_.y))
|
|
2189
|
+
.x((_) => this.x()(_.x));
|
|
2190
|
+
}
|
|
2203
2191
|
const filter = this.defaultClipPointsMapping.get(this.series().clipPointsDirection);
|
|
2204
2192
|
let filteredData = this.series().data;
|
|
2205
2193
|
if (this.series().clipPointsDirection === ClipPointsDirection.x) {
|
|
2206
|
-
let [min, max] = this.x.domain();
|
|
2194
|
+
let [min, max] = this.x().domain();
|
|
2207
2195
|
min = min instanceof Date ? min.getTime() : min;
|
|
2208
2196
|
max = max instanceof Date ? max.getTime() : max;
|
|
2209
2197
|
filteredData = filteredData?.filter(filter(min, max));
|
|
2210
2198
|
}
|
|
2211
2199
|
if (this.series().clipPointsDirection === ClipPointsDirection.y) {
|
|
2212
|
-
let [min, max] = this.y.domain();
|
|
2200
|
+
let [min, max] = this.y().domain();
|
|
2213
2201
|
min = min instanceof Date ? min.getTime() : min;
|
|
2214
2202
|
max = max instanceof Date ? max.getTime() : max;
|
|
2215
2203
|
filteredData = filteredData?.filter(filter(min, max));
|
|
2216
2204
|
}
|
|
2217
2205
|
return area(filteredData);
|
|
2218
|
-
})
|
|
2206
|
+
});
|
|
2207
|
+
this.FillType = FillType;
|
|
2208
|
+
this.FillDirection = FillDirection;
|
|
2219
2209
|
}
|
|
2220
2210
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AreaSeriesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2221
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: AreaSeriesComponent, isStandalone: true, selector: "svg:svg[teta-area-series]", usesInheritance: true, ngImport: i0, template: "@if (series()?.fillType ===
|
|
2211
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: AreaSeriesComponent, isStandalone: true, selector: "svg:svg[teta-area-series]", usesInheritance: true, ngImport: i0, template: "@if (series()?.fillType === FillType.gradient) {\n <svg:defs>\n <svg:linearGradient [id]=\"'gradient-fill-' + id\"\n gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config()?.inverted || series()?.fillDirection === FillDirection.y ? '0%' : '100%'\"\n [attr.x2]=\"config()?.inverted || series()?.fillDirection === FillDirection.y ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0.8\"></svg:stop>\n </svg:linearGradient>\n </svg:defs>\n}\n<svg:path class=\"area\"\n [attr.d]=\"areaPath()\"\n [attr.stroke-width]=\"0\"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"\n [attr.fill]=\"series().fillType === FillType.gradient ? 'url(#gradient-fill-' + id + ')' : (series().style?.fill ?? series().color)\"></svg:path>\n<svg:path class=\"area\"\n fill=\"none\"\n [attr.d]=\"path()\"\n [attr.stroke]=\"series().color\"\n [attr.stroke-dasharray]=\"series().style?.strokeDasharray\"\n [attr.stroke-width]=\"series().style?.strokeWidth\"></svg:path>\n@if (transform(); as t) {\n @if (t?.x !== null && t?.x !== undefined && t?.y !== null && t?.y !== undefined) {\n <svg:circle r=\"3\"\n [attr.fill]=\"series().color\"\n [attr.transform]=\"'translate(' + t.x + ', ' + t.y + ')'\"></svg:circle>\n }\n}\n@if (markers(); as draggablePoints) {\n @for (point of draggablePoints; track point) {\n <svg:circle class=\"marker\"\n [class.draggable-marker]=\"point?.marker?.draggable\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"x()(point.x)\"\n [attr.cy]=\"y()(point.y)\"\n ></svg:circle>\n }\n}\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2222
2212
|
}
|
|
2223
2213
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AreaSeriesComponent, decorators: [{
|
|
2224
2214
|
type: Component,
|
|
2225
|
-
args: [{ selector: 'svg:svg[teta-area-series]',
|
|
2215
|
+
args: [{ selector: 'svg:svg[teta-area-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (series()?.fillType === FillType.gradient) {\n <svg:defs>\n <svg:linearGradient [id]=\"'gradient-fill-' + id\"\n gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config()?.inverted || series()?.fillDirection === FillDirection.y ? '0%' : '100%'\"\n [attr.x2]=\"config()?.inverted || series()?.fillDirection === FillDirection.y ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series().color\" stop-opacity=\"0.8\"></svg:stop>\n </svg:linearGradient>\n </svg:defs>\n}\n<svg:path class=\"area\"\n [attr.d]=\"areaPath()\"\n [attr.stroke-width]=\"0\"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"\n [attr.fill]=\"series().fillType === FillType.gradient ? 'url(#gradient-fill-' + id + ')' : (series().style?.fill ?? series().color)\"></svg:path>\n<svg:path class=\"area\"\n fill=\"none\"\n [attr.d]=\"path()\"\n [attr.stroke]=\"series().color\"\n [attr.stroke-dasharray]=\"series().style?.strokeDasharray\"\n [attr.stroke-width]=\"series().style?.strokeWidth\"></svg:path>\n@if (transform(); as t) {\n @if (t?.x !== null && t?.x !== undefined && t?.y !== null && t?.y !== undefined) {\n <svg:circle r=\"3\"\n [attr.fill]=\"series().color\"\n [attr.transform]=\"'translate(' + t.x + ', ' + t.y + ')'\"></svg:circle>\n }\n}\n@if (markers(); as draggablePoints) {\n @for (point of draggablePoints; track point) {\n <svg:circle class=\"marker\"\n [class.draggable-marker]=\"point?.marker?.draggable\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"x()(point.x)\"\n [attr.cy]=\"y()(point.y)\"\n ></svg:circle>\n }\n}\n" }]
|
|
2226
2216
|
}] });
|
|
2227
2217
|
|
|
2228
2218
|
const defaultSeriesTypeMapping = new Map()
|
|
@@ -2993,24 +2983,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2993
2983
|
class BlockHorizontalSeriesComponent extends SeriesBaseComponent {
|
|
2994
2984
|
constructor() {
|
|
2995
2985
|
super(...arguments);
|
|
2996
|
-
this.
|
|
2997
|
-
this.y = this.scaleService.scales.pipe(map((_) => _.y.get(this.series().yAxisIndex)?.scale));
|
|
2998
|
-
this.displayPoints = this.x.pipe(filter((y) => y), map((y) => {
|
|
2986
|
+
this.displayPoints = computed(() => {
|
|
2999
2987
|
return this.series().data.filter((point, index, arr) => {
|
|
3000
|
-
const [min, max] =
|
|
2988
|
+
const [min, max] = this.x().domain();
|
|
3001
2989
|
return ((point.x >= min || point.x1 >= min || arr[index + 1]?.x >= min || arr[index + 1]?.x1 >= min) &&
|
|
3002
2990
|
(point.x <= max || point.x1 <= max || arr[index - 1]?.x <= max || arr[index - 1]?.x1 <= max));
|
|
3003
2991
|
});
|
|
3004
|
-
})
|
|
3005
|
-
this.fillType = FillType;
|
|
2992
|
+
});
|
|
3006
2993
|
this.Math = Math;
|
|
2994
|
+
this.FillType = FillType;
|
|
3007
2995
|
}
|
|
3008
2996
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BlockHorizontalSeriesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3009
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: BlockHorizontalSeriesComponent, isStandalone: true, selector: "svg:svg[teta-block-horizontal-series]", usesInheritance: true, ngImport: i0, template: "@if ({ y: y
|
|
2997
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: BlockHorizontalSeriesComponent, isStandalone: true, selector: "svg:svg[teta-block-horizontal-series]", usesInheritance: true, ngImport: i0, template: "@if ({ y: y(), x: x(), points: displayPoints() }; as data) {\n @if (series()?.fillType === FillType.gradient) {\n <svg:defs>\n <svg:linearGradient [id]=\"'gradient-fill-' + id\"\n gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config()?.inverted ? '0%' : '100%'\"\n [attr.x2]=\"config()?.inverted ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series().style?.fill ?? series().color\"\n stop-opacity=\"0.9\"></svg:stop>\n </svg:linearGradient>\n </svg:defs>\n }\n @if (data.x && data.y) {\n @for (point of data.points; track point) {\n <svg:g (mouseenter)=\"mouseenter(point)\" (mouseleave)=\"mouseleave(point)\">\n <svg:rect x=\"0\"\n [attr.x]=\"data.x(point.x)\"\n [attr.width]=\"Math.abs(data.x(point.x1) - data.x(point.x))\"\n [attr.fill]=\"series().fillType === FillType.gradient\n ? 'url(#gradient-fill-' + id + ')'\n : point.iconId\n ? 'url(#pattern' + point.iconId + ')'\n : (point.color ?? series().style?.fill ?? series().color)\"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"\n height=\"100%\"\n ></svg:rect>\n @if (point.text && data.x(point.x1) - data.x(point.x) > 8) {\n <svg:text [attr.transform]=\"'rotate(270)'\"\n [ngStyle]=\"{ 'transform-origin': (data.x(point.x1) + data.x(point.x)) / 2 + 'px 50%' }\"\n y=\"50%\"\n [attr.x]=\"(data.x(point.x1) + data.x(point.x)) / 2\"\n text-anchor=\"middle\"\n alignment-baseline=\"middle\"\n text-anchor=\"middle\">\n {{ point.text }}\n </svg:text>\n }\n <svg:line y1=\"0\"\n y2=\"100%\"\n [attr.x1]=\"data.x(point.x)\"\n [attr.x2]=\"data.x(point.x)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : (point.color ?? series().style?.stroke ?? series().color)\"></svg:line>\n <svg:line y1=\"0\"\n y2=\"100%\"\n [attr.x1]=\"data.x(point.x1)\"\n [attr.x2]=\"data.x(point.x1)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : (point.color ?? series().style?.stroke ?? series().color)\"></svg:line>\n </svg:g>\n }\n }\n}\n", styles: [""], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3010
2998
|
}
|
|
3011
2999
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BlockHorizontalSeriesComponent, decorators: [{
|
|
3012
3000
|
type: Component,
|
|
3013
|
-
args: [{ selector: 'svg:svg[teta-block-horizontal-series]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
3001
|
+
args: [{ selector: 'svg:svg[teta-block-horizontal-series]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgStyle], template: "@if ({ y: y(), x: x(), points: displayPoints() }; as data) {\n @if (series()?.fillType === FillType.gradient) {\n <svg:defs>\n <svg:linearGradient [id]=\"'gradient-fill-' + id\"\n gradientUnits=\"userSpaceOnUse\"\n x1=\"0%\"\n [attr.y1]=\"config()?.inverted ? '0%' : '100%'\"\n [attr.x2]=\"config()?.inverted ? '100%' : '0%'\"\n y2=\"0%\">\n <svg:stop offset=\"0%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0\"></svg:stop>\n <svg:stop offset=\"5%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.1\"></svg:stop>\n <svg:stop offset=\"20%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.2\"></svg:stop>\n <svg:stop offset=\"60%\" [attr.stop-color]=\"series().style?.fill ?? series().color\" stop-opacity=\"0.5\"></svg:stop>\n <svg:stop offset=\"100%\" [attr.stop-color]=\"series().style?.fill ?? series().color\"\n stop-opacity=\"0.9\"></svg:stop>\n </svg:linearGradient>\n </svg:defs>\n }\n @if (data.x && data.y) {\n @for (point of data.points; track point) {\n <svg:g (mouseenter)=\"mouseenter(point)\" (mouseleave)=\"mouseleave(point)\">\n <svg:rect x=\"0\"\n [attr.x]=\"data.x(point.x)\"\n [attr.width]=\"Math.abs(data.x(point.x1) - data.x(point.x))\"\n [attr.fill]=\"series().fillType === FillType.gradient\n ? 'url(#gradient-fill-' + id + ')'\n : point.iconId\n ? 'url(#pattern' + point.iconId + ')'\n : (point.color ?? series().style?.fill ?? series().color)\"\n [attr.fill-opacity]=\"series().style?.fillOpacity\"\n height=\"100%\"\n ></svg:rect>\n @if (point.text && data.x(point.x1) - data.x(point.x) > 8) {\n <svg:text [attr.transform]=\"'rotate(270)'\"\n [ngStyle]=\"{ 'transform-origin': (data.x(point.x1) + data.x(point.x)) / 2 + 'px 50%' }\"\n y=\"50%\"\n [attr.x]=\"(data.x(point.x1) + data.x(point.x)) / 2\"\n text-anchor=\"middle\"\n alignment-baseline=\"middle\"\n text-anchor=\"middle\">\n {{ point.text }}\n </svg:text>\n }\n <svg:line y1=\"0\"\n y2=\"100%\"\n [attr.x1]=\"data.x(point.x)\"\n [attr.x2]=\"data.x(point.x)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : (point.color ?? series().style?.stroke ?? series().color)\"></svg:line>\n <svg:line y1=\"0\"\n y2=\"100%\"\n [attr.x1]=\"data.x(point.x1)\"\n [attr.x2]=\"data.x(point.x1)\"\n [attr.stroke]=\"point.iconId ? 'var(--color-text-10)' : (point.color ?? series().style?.stroke ?? series().color)\"></svg:line>\n </svg:g>\n }\n }\n}\n" }]
|
|
3014
3002
|
}] });
|
|
3015
3003
|
|
|
3016
3004
|
/*
|