@taiga-ui/addon-charts 4.2.0 → 4.4.0
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/esm2022/components/arc-chart/arc-chart.component.mjs +10 -17
- package/esm2022/components/axes/axes.component.mjs +6 -7
- package/esm2022/components/bar/bar.component.mjs +6 -7
- package/esm2022/components/bar-chart/bar-chart.component.mjs +3 -3
- package/esm2022/components/legend-item/legend-item.component.mjs +8 -13
- package/esm2022/components/line-chart/line-chart-hint.directive.mjs +5 -5
- package/esm2022/components/line-chart/line-chart.component.mjs +13 -14
- package/esm2022/components/line-days-chart/line-days-chart-hint.directive.mjs +4 -3
- package/esm2022/components/line-days-chart/line-days-chart.component.mjs +42 -27
- package/esm2022/components/pie-chart/pie-chart.component.mjs +7 -10
- package/esm2022/components/ring-chart/ring-chart.component.mjs +6 -7
- package/esm2022/utils/control-point.mjs +6 -5
- package/esm2022/utils/describe-sector.mjs +2 -2
- package/esm2022/utils/draw-curve.mjs +3 -2
- package/esm2022/utils/draw.mjs +3 -2
- package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs +9 -16
- package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-axes.mjs +5 -6
- package/fesm2022/taiga-ui-addon-charts-components-axes.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs +2 -2
- package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar.mjs +5 -6
- package/fesm2022/taiga-ui-addon-charts-components-bar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-legend-item.mjs +7 -12
- package/fesm2022/taiga-ui-addon-charts-components-legend-item.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs +16 -17
- package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs +44 -28
- package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs +6 -9
- package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs +5 -6
- package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-utils.mjs +10 -7
- package/fesm2022/taiga-ui-addon-charts-utils.mjs.map +1 -1
- package/package.json +3 -3
- package/utils/control-point.d.ts +1 -1
- package/utils/describe-sector.d.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
2
|
import { NgForOf } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, DestroyRef, NgZone, Directive, ContentChildren, forwardRef, Input, Component, ChangeDetectionStrategy, ViewChildren
|
|
4
|
+
import { inject, DestroyRef, NgZone, Directive, ContentChildren, forwardRef, Input, Component, ChangeDetectionStrategy, ViewChildren } from '@angular/core';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { tuiLineChartDrivers, TUI_LINE_CHART_OPTIONS, TuiLineChartHint, TuiLineChart } from '@taiga-ui/addon-charts/components/line-chart';
|
|
7
7
|
import { EMPTY_QUERY, EMPTY_ARRAY } from '@taiga-ui/cdk/constants';
|
|
@@ -40,12 +40,13 @@ class TuiLineDaysChartHint {
|
|
|
40
40
|
}
|
|
41
41
|
raise(day) {
|
|
42
42
|
const current = this.charts
|
|
43
|
-
.map(({ value }) => find(value, day))
|
|
43
|
+
.map(({ value }) => (day ? find(value, day) : []))
|
|
44
44
|
.filter(([_, value]) => !Number.isNaN(value));
|
|
45
45
|
const sorted = [...current].sort((a, b) => a[1] - b[1]);
|
|
46
46
|
this.charts.forEach((chart, index) => {
|
|
47
|
+
const item = current[index];
|
|
47
48
|
chart.onHovered(day);
|
|
48
|
-
chart.zIndex = Math.max(sorted.indexOf(
|
|
49
|
+
chart.zIndex = Math.max(item ? sorted.indexOf(item) : 0, 0);
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
getMap(...values) {
|
|
@@ -91,19 +92,26 @@ class TuiLineDaysChart {
|
|
|
91
92
|
this.dots = this.options.dots;
|
|
92
93
|
this.zIndex = 0;
|
|
93
94
|
this.value = [];
|
|
94
|
-
this.daysStringify = (index) =>
|
|
95
|
+
this.daysStringify = (index) => {
|
|
96
|
+
const day = this.getDay(index);
|
|
97
|
+
return this.xStringify && day ? this.xStringify(day) : '';
|
|
98
|
+
};
|
|
95
99
|
}
|
|
96
100
|
set valueSetter(value) {
|
|
97
101
|
if (!value.length) {
|
|
98
102
|
this.value = [];
|
|
99
103
|
return;
|
|
100
104
|
}
|
|
101
|
-
const start = value[0][0];
|
|
105
|
+
const start = value[0]?.[0];
|
|
106
|
+
const end = value[value.length - 1];
|
|
102
107
|
const mutable = [...value];
|
|
103
|
-
const length = TuiDay.lengthBetween(start,
|
|
108
|
+
const length = start && end ? TuiDay.lengthBetween(start, end[0]) + 1 : 0;
|
|
104
109
|
this.value = Array.from({ length }, (_, day) => {
|
|
105
|
-
const
|
|
106
|
-
const
|
|
110
|
+
const startMutable = mutable[0]?.[0];
|
|
111
|
+
const currentDay = start?.append({ day });
|
|
112
|
+
const shifted = startMutable && currentDay?.daySame(startMutable)
|
|
113
|
+
? mutable.shift()
|
|
114
|
+
: null;
|
|
107
115
|
const currentValue = shifted ? shifted[1] : NaN;
|
|
108
116
|
return [currentDay, currentValue];
|
|
109
117
|
});
|
|
@@ -120,8 +128,9 @@ class TuiLineDaysChart {
|
|
|
120
128
|
this.charts.forEach((chart) => chart.onHovered(NaN));
|
|
121
129
|
return;
|
|
122
130
|
}
|
|
123
|
-
const
|
|
124
|
-
const
|
|
131
|
+
const start = this.value[0]?.[0];
|
|
132
|
+
const index = start && day ? TuiMonth.lengthBetween(start, day) : 0;
|
|
133
|
+
const x = start && day ? TuiDay.lengthBetween(start, day) + start.day - 1 : 0;
|
|
125
134
|
const current = this.charts.get(index);
|
|
126
135
|
this.charts.forEach((chart) => {
|
|
127
136
|
if (chart === current) {
|
|
@@ -136,23 +145,27 @@ class TuiLineDaysChart {
|
|
|
136
145
|
return this.value.length ? this.breakMonths(this.value) : EMPTY_ARRAY;
|
|
137
146
|
}
|
|
138
147
|
get firstWidth() {
|
|
139
|
-
return this.months.length * this.value[0][0].daysCount;
|
|
148
|
+
return this.months.length * (this.value[0]?.[0].daysCount || 0);
|
|
140
149
|
}
|
|
141
150
|
get hint() {
|
|
142
151
|
return this.hintDirective?.hint ?? this.hintContent;
|
|
143
152
|
}
|
|
144
153
|
getHintContext(x, value) {
|
|
145
|
-
return value[x - value[0][0]
|
|
154
|
+
return value[x - (value[0]?.[0]?.day || 0) + 1];
|
|
146
155
|
}
|
|
147
156
|
getX(index) {
|
|
157
|
+
const start = this.value[0]?.[0];
|
|
148
158
|
const current = this.getDay(index);
|
|
149
|
-
const months = TuiMonth.lengthBetween(
|
|
150
|
-
const offset = months * current
|
|
159
|
+
const months = start && current ? TuiMonth.lengthBetween(start, current) : 0;
|
|
160
|
+
const offset = months * (current?.daysCount || 0);
|
|
151
161
|
return index - offset;
|
|
152
162
|
}
|
|
153
163
|
raise(index, { value }) {
|
|
154
|
-
const x = value[index][0];
|
|
164
|
+
const x = value[index]?.[0] || 0;
|
|
155
165
|
const month = this.getDay(x);
|
|
166
|
+
if (!month) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
156
169
|
if (this.hintDirective) {
|
|
157
170
|
this.hintDirective.raise(month);
|
|
158
171
|
}
|
|
@@ -161,17 +174,20 @@ class TuiLineDaysChart {
|
|
|
161
174
|
}
|
|
162
175
|
}
|
|
163
176
|
getWidth(index) {
|
|
164
|
-
return this.getDay(index)
|
|
177
|
+
return (this.getDay(index)?.daysCount || 0) * this.months.length;
|
|
165
178
|
}
|
|
166
179
|
getContext(index, { value }) {
|
|
167
|
-
const x = value[index][0];
|
|
168
|
-
|
|
169
|
-
|
|
180
|
+
const x = value[index]?.[0] || 0;
|
|
181
|
+
const day = this.getDay(x);
|
|
182
|
+
return this.hintDirective && day
|
|
183
|
+
? this.hintDirective.getContext(day)
|
|
170
184
|
: this.getHintContext(x, this.value);
|
|
171
185
|
}
|
|
172
186
|
breakMonths(value) {
|
|
173
|
-
const offset = value[0][0].day - 1;
|
|
174
|
-
|
|
187
|
+
const offset = (value[0]?.[0].day || 1) - 1;
|
|
188
|
+
const start = value[0]?.[0];
|
|
189
|
+
const end = value[value.length - 1]?.[0];
|
|
190
|
+
return Array.from({ length: start && end ? TuiMonth.lengthBetween(start, end) + 1 : 0 }, (_, i) => i + (start?.month || 0) + (start?.year || 0) * 12)
|
|
175
191
|
.map((absoluteMonth) => value
|
|
176
192
|
.map(([{ month, year }, y], index) => month + year * 12 === absoluteMonth ? [index + offset, y] : null)
|
|
177
193
|
.filter(tuiIsPresent))
|
|
@@ -179,14 +195,15 @@ class TuiLineDaysChart {
|
|
|
179
195
|
? month
|
|
180
196
|
: [
|
|
181
197
|
...month,
|
|
182
|
-
array[index + 1]
|
|
198
|
+
array[index + 1]?.find((day) => !Number.isNaN(day[1])) || DUMMY,
|
|
183
199
|
]);
|
|
184
200
|
}
|
|
185
201
|
getDay(index) {
|
|
186
|
-
|
|
202
|
+
const start = this.value[0]?.[0];
|
|
203
|
+
return this.value[index - (start?.day || 0) + 1]?.[0];
|
|
187
204
|
}
|
|
188
205
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiLineDaysChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
189
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiLineDaysChart, isStandalone: true, selector: "tui-line-days-chart", inputs: { y: "y", height: "height", smoothingFactor: "smoothingFactor", hintContent: "hintContent", xStringify: "xStringify", yStringify: "yStringify", dots: "dots", valueSetter: ["value", "valueSetter"] }, host: { properties: { "style.zIndex": "
|
|
206
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiLineDaysChart, isStandalone: true, selector: "tui-line-days-chart", inputs: { y: "y", height: "height", smoothingFactor: "smoothingFactor", hintContent: "hintContent", xStringify: "xStringify", yStringify: "yStringify", dots: "dots", valueSetter: ["value", "valueSetter"] }, host: { properties: { "style.zIndex": "zIndex" } }, providers: [
|
|
190
207
|
TuiHoveredService,
|
|
191
208
|
{
|
|
192
209
|
provide: TuiLineChartHint,
|
|
@@ -208,7 +225,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
208
225
|
provide: TuiLineChartHint,
|
|
209
226
|
useExisting: TuiLineDaysChart,
|
|
210
227
|
},
|
|
211
|
-
],
|
|
228
|
+
], host: {
|
|
229
|
+
'[style.zIndex]': 'zIndex',
|
|
230
|
+
}, template: "<tui-line-chart\n *ngFor=\"let month of months; let first = first\"\n class=\"t-chart\"\n [dots]=\"dots\"\n [height]=\"height\"\n [smoothingFactor]=\"smoothingFactor\"\n [style.zIndex]=\"zIndex\"\n [tuiHintContent]=\"hintContent ? hint : ''\"\n [value]=\"month\"\n [width]=\"first ? firstWidth : getWidth(month[0][0])\"\n [x]=\"first ? 0 : getX(month[0][0])\"\n [xStringify]=\"xStringify ? daysStringify : null\"\n [y]=\"y\"\n [yStringify]=\"yStringify\"\n/>\n<ng-template\n #hint\n let-point\n>\n <ng-container *polymorpheusOutlet=\"hintContent as text; context: {$implicit: getHintContext(point[0], value)}\">\n {{ text }}\n </ng-container>\n</ng-template>\n", styles: [":host{display:block}.t-chart{position:absolute;top:0;left:0;width:100%;height:100%}\n"] }]
|
|
212
231
|
}], propDecorators: { charts: [{
|
|
213
232
|
type: ViewChildren,
|
|
214
233
|
args: [TuiLineChart]
|
|
@@ -226,9 +245,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
226
245
|
type: Input
|
|
227
246
|
}], dots: [{
|
|
228
247
|
type: Input
|
|
229
|
-
}], zIndex: [{
|
|
230
|
-
type: HostBinding,
|
|
231
|
-
args: ['style.zIndex']
|
|
232
248
|
}], valueSetter: [{
|
|
233
249
|
type: Input,
|
|
234
250
|
args: ['value']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-line-days-chart.mjs","sources":["../../../projects/addon-charts/components/line-days-chart/line-days-chart-hint.directive.ts","../../../projects/addon-charts/components/line-days-chart/line-days-chart.component.ts","../../../projects/addon-charts/components/line-days-chart/line-days-chart.template.html","../../../projects/addon-charts/components/line-days-chart/taiga-ui-addon-charts-components-line-days-chart.ts"],"sourcesContent":["import type {AfterContentInit, QueryList} from '@angular/core';\nimport {\n ContentChildren,\n DestroyRef,\n Directive,\n forwardRef,\n inject,\n Input,\n NgZone,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiLineChartDrivers} from '@taiga-ui/addon-charts/components/line-chart';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport type {TuiDay} from '@taiga-ui/cdk/date-time';\nimport {TuiHoveredService} from '@taiga-ui/cdk/directives/hovered';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport type {TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {TuiPoint} from '@taiga-ui/core/types';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {combineLatest, filter} from 'rxjs';\n\nimport {TuiLineDaysChart} from './line-days-chart.component';\n\nfunction find(value: ReadonlyArray<[TuiDay, number]>, current: TuiDay): [TuiDay, number] {\n return value.find(([day]) => day.daySame(current)) || [current, NaN];\n}\n\n// TODO: Consider extending TuiLineChartHintDirective\n@Directive({\n standalone: true,\n selector: '[tuiLineChartHint]',\n providers: [TuiHoveredService],\n})\nexport class TuiLineDaysChartHint implements AfterContentInit {\n @ContentChildren(forwardRef(() => TuiLineDaysChart))\n private readonly charts: QueryList<TuiLineDaysChart> = EMPTY_QUERY;\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly zone = inject(NgZone);\n private readonly hovered$ = inject(TuiHoveredService);\n\n @Input('tuiLineChartHint')\n public hint: PolymorpheusContent<TuiContext<readonly TuiPoint[]>>;\n\n public ngAfterContentInit(): void {\n combineLatest([\n ...this.charts.map(({charts}) => tuiLineChartDrivers(charts)),\n this.hovered$,\n ])\n .pipe(\n filter((result) => !result.some(Boolean)),\n tuiZonefree(this.zone),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe(() => {\n this.charts.forEach((chart) => chart.onHovered(NaN));\n });\n }\n\n public getContext(day: TuiDay): ReadonlyArray<[TuiDay, number]> {\n return this.getMap(...this.charts.map(({value}) => value)).get(String(day)) || [];\n }\n\n public raise(day: TuiDay): void {\n const current = this.charts\n .map(({value}) => find(value, day))\n .filter(([_, value]) => !Number.isNaN(value));\n const sorted = [...current].sort((a, b) => a[1] - b[1]);\n\n this.charts.forEach((chart, index) => {\n chart.onHovered(day);\n chart.zIndex = Math.max(sorted.indexOf(current[index]), 0);\n });\n }\n\n @tuiPure\n private getMap(\n ...values: Array<ReadonlyArray<[TuiDay, number]>>\n ): Map<string, ReadonlyArray<[TuiDay, number]>> {\n return (values[0] || []).reduce(\n (map, [day]) =>\n map.set(\n String(day),\n values.map((value) => find(value, day)),\n ),\n new Map<string, ReadonlyArray<[TuiDay, number]>>(),\n );\n }\n}\n","import {NgForOf} from '@angular/common';\nimport type {AfterViewInit, QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n HostBinding,\n inject,\n Input,\n NgZone,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {\n TUI_LINE_CHART_OPTIONS,\n TuiLineChart,\n tuiLineChartDrivers,\n TuiLineChartHint,\n} from '@taiga-ui/addon-charts/components/line-chart';\nimport {EMPTY_ARRAY, EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {TuiDay, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiHoveredService} from '@taiga-ui/cdk/directives/hovered';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport type {TuiContext, TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiIsNumber, tuiIsPresent, tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiHint} from '@taiga-ui/core/directives/hint';\nimport type {TuiPoint} from '@taiga-ui/core/types';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {PolymorpheusOutlet, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';\nimport {combineLatest, filter} from 'rxjs';\n\nimport {TuiLineDaysChartHint} from './line-days-chart-hint.directive';\n\nconst DUMMY: TuiPoint = [NaN, NaN];\n\n@Component({\n standalone: true,\n selector: 'tui-line-days-chart',\n imports: [TuiLineChart, NgForOf, TuiHint, PolymorpheusOutlet, PolymorpheusTemplate],\n templateUrl: './line-days-chart.template.html',\n styleUrls: ['./line-days-chart.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n TuiHoveredService,\n {\n provide: TuiLineChartHint,\n useExisting: TuiLineDaysChart,\n },\n ],\n})\nexport class TuiLineDaysChart implements AfterViewInit {\n private readonly destroyRef = inject(DestroyRef);\n private readonly zone = inject(NgZone);\n private readonly hovered$ = inject(TuiHoveredService);\n private readonly options = inject(TUI_LINE_CHART_OPTIONS);\n private readonly hintDirective = inject(TuiLineDaysChartHint, {\n optional: true,\n });\n\n @ViewChildren(TuiLineChart)\n public readonly charts: QueryList<TuiLineChart> = EMPTY_QUERY;\n\n @Input()\n public y = 0;\n\n @Input()\n public height = 0;\n\n @Input()\n public smoothingFactor = this.options.smoothingFactor;\n\n @Input()\n public hintContent: PolymorpheusContent<TuiContext<[TuiDay, number]>>;\n\n @Input()\n public xStringify: TuiStringHandler<TuiDay> | null = null;\n\n @Input()\n public yStringify: TuiStringHandler<number> | null = null;\n\n @Input()\n public dots = this.options.dots;\n\n @HostBinding('style.zIndex')\n public zIndex = 0;\n\n public value: ReadonlyArray<[TuiDay, number]> = [];\n\n @Input('value')\n public set valueSetter(value: ReadonlyArray<[TuiDay, number]>) {\n if (!value.length) {\n this.value = [];\n\n return;\n }\n\n const start = value[0][0];\n const mutable = [...value];\n const length = TuiDay.lengthBetween(start, value[value.length - 1][0]) + 1;\n\n this.value = Array.from({length}, (_, day) => {\n const currentDay = start.append({day});\n const shifted = currentDay.daySame(mutable[0][0]) ? mutable.shift() : null;\n const currentValue = shifted ? shifted[1] : NaN;\n\n return [currentDay, currentValue] as [TuiDay, number];\n });\n }\n\n public ngAfterViewInit(): void {\n combineLatest([tuiLineChartDrivers(this.charts), this.hovered$])\n .pipe(\n filter((result) => !result.some(Boolean)),\n tuiZonefree(this.zone),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe(() => {\n this.onHovered(NaN);\n });\n }\n\n public onHovered(day: TuiDay | number): void {\n if (tuiIsNumber(day)) {\n this.charts.forEach((chart) => chart.onHovered(NaN));\n\n return;\n }\n\n const index = TuiMonth.lengthBetween(this.value[0][0], day);\n const x = TuiDay.lengthBetween(this.value[0][0], day) + this.value[0][0].day - 1;\n const current = this.charts.get(index);\n\n this.charts.forEach((chart) => {\n if (chart === current) {\n current.onHovered(current.value.findIndex((point) => point[0] === x));\n } else {\n chart.onHovered(NaN);\n }\n });\n }\n\n protected get months(): ReadonlyArray<readonly TuiPoint[]> {\n return this.value.length ? this.breakMonths(this.value) : EMPTY_ARRAY;\n }\n\n protected get firstWidth(): number {\n return this.months.length * this.value[0][0].daysCount;\n }\n\n protected get hint():\n | PolymorpheusContent<TuiContext<[TuiDay, number]>>\n | PolymorpheusContent<TuiContext<readonly TuiPoint[]>> {\n return this.hintDirective?.hint ?? this.hintContent;\n }\n\n @tuiPure\n protected getHintContext(\n x: number,\n value: ReadonlyArray<[TuiDay, number]>,\n ): [TuiDay, number] {\n return value[x - value[0][0].day + 1];\n }\n\n protected readonly daysStringify: TuiStringHandler<number> = (index) =>\n this.xStringify ? this.xStringify(this.getDay(index)) : '';\n\n protected getX(index: number): number {\n const current = this.getDay(index);\n const months = TuiMonth.lengthBetween(this.value[0][0], current);\n const offset = months * current.daysCount;\n\n return index - offset;\n }\n\n protected raise(index: number, {value}: TuiLineChart): void {\n const x = value[index][0];\n const month = this.getDay(x);\n\n if (this.hintDirective) {\n this.hintDirective.raise(month);\n } else {\n this.onHovered(month);\n }\n }\n\n protected getWidth(index: number): number {\n return this.getDay(index).daysCount * this.months.length;\n }\n\n protected getContext(index: number, {value}: TuiLineChart): unknown {\n const x = value[index][0];\n\n return this.hintDirective\n ? this.hintDirective.getContext(this.getDay(x))\n : this.getHintContext(x, this.value);\n }\n\n @tuiPure\n private breakMonths(\n value: ReadonlyArray<[TuiDay, number]>,\n ): ReadonlyArray<readonly TuiPoint[]> {\n const offset = value[0][0].day - 1;\n\n return Array.from(\n {length: TuiMonth.lengthBetween(value[0][0], value[value.length - 1][0]) + 1},\n (_, i) => i + value[0][0].month + value[0][0].year * 12,\n )\n .map((absoluteMonth) =>\n value\n .map<TuiPoint | null>(([{month, year}, y], index) =>\n month + year * 12 === absoluteMonth ? [index + offset, y] : null,\n )\n .filter(tuiIsPresent),\n )\n .map((month, index, array) =>\n index === array.length - 1\n ? month\n : [\n ...month,\n array[index + 1].find((day) => !Number.isNaN(day[1])) || DUMMY,\n ],\n );\n }\n\n private getDay(index: number): TuiDay {\n return this.value[index - this.value[0][0].day + 1][0];\n }\n}\n","<tui-line-chart\n *ngFor=\"let month of months; let first = first\"\n class=\"t-chart\"\n [dots]=\"dots\"\n [height]=\"height\"\n [smoothingFactor]=\"smoothingFactor\"\n [style.zIndex]=\"zIndex\"\n [tuiHintContent]=\"hintContent ? hint : ''\"\n [value]=\"month\"\n [width]=\"first ? firstWidth : getWidth(month[0][0])\"\n [x]=\"first ? 0 : getX(month[0][0])\"\n [xStringify]=\"xStringify ? daysStringify : null\"\n [y]=\"y\"\n [yStringify]=\"yStringify\"\n/>\n<ng-template\n #hint\n let-point\n>\n <ng-container *polymorpheusOutlet=\"hintContent as text; context: {$implicit: getHintContext(point[0], value)}\">\n {{ text }}\n </ng-container>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAwBA,SAAS,IAAI,CAAC,KAAsC,EAAE,OAAe,EAAA;IACjE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AACzE,CAAC;AAED;AACA,MAKa,oBAAoB,CAAA;AALjC,IAAA,WAAA,GAAA;QAOqB,IAAM,CAAA,MAAA,GAAgC,WAAW,CAAC;AAElD,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AACtB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAiDzD,KAAA;IA5CU,kBAAkB,GAAA;AACrB,QAAA,aAAa,CAAC;AACV,YAAA,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAC,MAAM,EAAC,KAAK,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC7D,YAAA,IAAI,CAAC,QAAQ;SAChB,CAAC;AACG,aAAA,IAAI,CACD,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EACzC,WAA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,EAAE,kBAAkB,EAAE,oBAAoB,CAAC,mBAGlE,uBAAuB,CAAC,MAAM,EACpC,SAAA,EAAA;wBACP,iBAAiB;AACjB,wBAAA;AACI,4BAAA,OAAO,EAAE,gBAAgB;AACzB,4BAAA,WAAW,EAAkB,gBAAA;AAChC,yBAAA;AACJ,qBAAA,EAAA,QAAA,EAAA,gtBAAA,EAAA,MAAA,EAAA,CAAA,uFAAA,CAAA,EAAA,CAAA;8BAYe,MAAM,EAAA,CAAA;sBADrB,YAAY;uBAAC,YAAY,CAAA;gBAInB,CAAC,EAAA,CAAA;sBADP,KAAK;gBAIC,MAAM,EAAA,CAAA;sBADZ,KAAK;gBAIC,eAAe,EAAA,CAAA;sBADrB,KAAK;gBAIC,WAAW,EAAA,CAAA;sBADjB,KAAK;gBAIC,UAAU,EAAA,CAAA;sBADhB,KAAK;gBAIC,UAAU,EAAA,CAAA;sBADhB,KAAK;gBAIC,IAAI,EAAA,CAAA;sBADV,KAAK;gBAIC,MAAM,EAAA,CAAA;sBADZ,WAAW;uBAAC,cAAc,CAAA;gBAMhB,WAAW,EAAA,CAAA;sBADrB,KAAK;uBAAC,OAAO,CAAA;AAoEJ,aAAA,CAAA,EAAA,cAAc,MA0ChB,WAAW,EAAA,EAAA,EAAA,EAAA,CAAA;;AEtMvB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-line-days-chart.mjs","sources":["../../../projects/addon-charts/components/line-days-chart/line-days-chart-hint.directive.ts","../../../projects/addon-charts/components/line-days-chart/line-days-chart.component.ts","../../../projects/addon-charts/components/line-days-chart/line-days-chart.template.html","../../../projects/addon-charts/components/line-days-chart/taiga-ui-addon-charts-components-line-days-chart.ts"],"sourcesContent":["import type {AfterContentInit, QueryList} from '@angular/core';\nimport {\n ContentChildren,\n DestroyRef,\n Directive,\n forwardRef,\n inject,\n Input,\n NgZone,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiLineChartDrivers} from '@taiga-ui/addon-charts/components/line-chart';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport type {TuiDay} from '@taiga-ui/cdk/date-time';\nimport {TuiHoveredService} from '@taiga-ui/cdk/directives/hovered';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport type {TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {TuiPoint} from '@taiga-ui/core/types';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {combineLatest, filter} from 'rxjs';\n\nimport {TuiLineDaysChart} from './line-days-chart.component';\n\nfunction find(value: ReadonlyArray<[TuiDay, number]>, current: TuiDay): [TuiDay, number] {\n return value.find(([day]) => day.daySame(current)) || [current, NaN];\n}\n\n// TODO: Consider extending TuiLineChartHintDirective\n@Directive({\n standalone: true,\n selector: '[tuiLineChartHint]',\n providers: [TuiHoveredService],\n})\nexport class TuiLineDaysChartHint implements AfterContentInit {\n @ContentChildren(forwardRef(() => TuiLineDaysChart))\n private readonly charts: QueryList<TuiLineDaysChart> = EMPTY_QUERY;\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly zone = inject(NgZone);\n private readonly hovered$ = inject(TuiHoveredService);\n\n @Input('tuiLineChartHint')\n public hint: PolymorpheusContent<TuiContext<readonly TuiPoint[]>>;\n\n public ngAfterContentInit(): void {\n combineLatest([\n ...this.charts.map(({charts}) => tuiLineChartDrivers(charts)),\n this.hovered$,\n ])\n .pipe(\n filter((result) => !result.some(Boolean)),\n tuiZonefree(this.zone),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe(() => {\n this.charts.forEach((chart) => chart.onHovered(NaN));\n });\n }\n\n public getContext(day: TuiDay): ReadonlyArray<[TuiDay, number]> {\n return this.getMap(...this.charts.map(({value}) => value)).get(String(day)) || [];\n }\n\n public raise(day: TuiDay): void {\n const current = this.charts\n .map(({value}) => (day ? find(value, day) : []))\n .filter(([_, value]) => !Number.isNaN(value));\n const sorted = [...current].sort((a, b) => a[1] - b[1]);\n\n this.charts.forEach((chart, index) => {\n const item = current[index];\n\n chart.onHovered(day);\n chart.zIndex = Math.max(item ? sorted.indexOf(item) : 0, 0);\n });\n }\n\n @tuiPure\n private getMap(\n ...values: Array<ReadonlyArray<[TuiDay, number]>>\n ): Map<string, ReadonlyArray<[TuiDay, number]>> {\n return (values[0] || []).reduce(\n (map, [day]) =>\n map.set(\n String(day),\n values.map((value) => find(value, day)),\n ),\n new Map<string, ReadonlyArray<[TuiDay, number]>>(),\n );\n }\n}\n","import {NgForOf} from '@angular/common';\nimport type {AfterViewInit, QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n inject,\n Input,\n NgZone,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {\n TUI_LINE_CHART_OPTIONS,\n TuiLineChart,\n tuiLineChartDrivers,\n TuiLineChartHint,\n} from '@taiga-ui/addon-charts/components/line-chart';\nimport {EMPTY_ARRAY, EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {TuiDay, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiHoveredService} from '@taiga-ui/cdk/directives/hovered';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport type {TuiContext, TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiIsNumber, tuiIsPresent, tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiHint} from '@taiga-ui/core/directives/hint';\nimport type {TuiPoint} from '@taiga-ui/core/types';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {PolymorpheusOutlet, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';\nimport {combineLatest, filter} from 'rxjs';\n\nimport {TuiLineDaysChartHint} from './line-days-chart-hint.directive';\n\nconst DUMMY: TuiPoint = [NaN, NaN];\n\n@Component({\n standalone: true,\n selector: 'tui-line-days-chart',\n imports: [TuiLineChart, NgForOf, TuiHint, PolymorpheusOutlet, PolymorpheusTemplate],\n templateUrl: './line-days-chart.template.html',\n styleUrls: ['./line-days-chart.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n TuiHoveredService,\n {\n provide: TuiLineChartHint,\n useExisting: TuiLineDaysChart,\n },\n ],\n host: {\n '[style.zIndex]': 'zIndex',\n },\n})\nexport class TuiLineDaysChart implements AfterViewInit {\n private readonly destroyRef = inject(DestroyRef);\n private readonly zone = inject(NgZone);\n private readonly hovered$ = inject(TuiHoveredService);\n private readonly options = inject(TUI_LINE_CHART_OPTIONS);\n private readonly hintDirective = inject(TuiLineDaysChartHint, {\n optional: true,\n });\n\n @ViewChildren(TuiLineChart)\n public readonly charts: QueryList<TuiLineChart> = EMPTY_QUERY;\n\n @Input()\n public y = 0;\n\n @Input()\n public height = 0;\n\n @Input()\n public smoothingFactor = this.options.smoothingFactor;\n\n @Input()\n public hintContent: PolymorpheusContent<TuiContext<[TuiDay, number]>>;\n\n @Input()\n public xStringify: TuiStringHandler<TuiDay> | null = null;\n\n @Input()\n public yStringify: TuiStringHandler<number> | null = null;\n\n @Input()\n public dots = this.options.dots;\n\n public zIndex = 0;\n\n public value: ReadonlyArray<[TuiDay, number]> = [];\n\n @Input('value')\n public set valueSetter(value: ReadonlyArray<[TuiDay, number]>) {\n if (!value.length) {\n this.value = [];\n\n return;\n }\n\n const start = value[0]?.[0];\n const end = value[value.length - 1];\n const mutable = [...value];\n const length = start && end ? TuiDay.lengthBetween(start, end[0]) + 1 : 0;\n\n this.value = Array.from({length}, (_, day) => {\n const startMutable = mutable[0]?.[0];\n const currentDay = start?.append({day});\n const shifted =\n startMutable && currentDay?.daySame(startMutable)\n ? mutable.shift()\n : null;\n const currentValue = shifted ? shifted[1] : NaN;\n\n return [currentDay, currentValue] as [TuiDay, number];\n });\n }\n\n public ngAfterViewInit(): void {\n combineLatest([tuiLineChartDrivers(this.charts), this.hovered$])\n .pipe(\n filter((result) => !result.some(Boolean)),\n tuiZonefree(this.zone),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe(() => {\n this.onHovered(NaN);\n });\n }\n\n public onHovered(day: TuiDay | number): void {\n if (tuiIsNumber(day)) {\n this.charts.forEach((chart) => chart.onHovered(NaN));\n\n return;\n }\n\n const start = this.value[0]?.[0];\n const index = start && day ? TuiMonth.lengthBetween(start, day) : 0;\n const x = start && day ? TuiDay.lengthBetween(start, day) + start.day - 1 : 0;\n const current = this.charts.get(index);\n\n this.charts.forEach((chart) => {\n if (chart === current) {\n current.onHovered(current.value.findIndex((point) => point[0] === x));\n } else {\n chart.onHovered(NaN);\n }\n });\n }\n\n protected get months(): ReadonlyArray<readonly TuiPoint[]> {\n return this.value.length ? this.breakMonths(this.value) : EMPTY_ARRAY;\n }\n\n protected get firstWidth(): number {\n return this.months.length * (this.value[0]?.[0].daysCount || 0);\n }\n\n protected get hint():\n | PolymorpheusContent<TuiContext<[TuiDay, number]>>\n | PolymorpheusContent<TuiContext<readonly TuiPoint[]>> {\n return this.hintDirective?.hint ?? this.hintContent;\n }\n\n @tuiPure\n protected getHintContext(\n x: number,\n value: ReadonlyArray<[TuiDay, number]>,\n ): [TuiDay, number] {\n return value[x - (value[0]?.[0]?.day || 0) + 1];\n }\n\n protected readonly daysStringify: TuiStringHandler<number> = (index) => {\n const day = this.getDay(index);\n\n return this.xStringify && day ? this.xStringify(day) : '';\n };\n\n protected getX(index: number): number {\n const start = this.value[0]?.[0];\n const current = this.getDay(index);\n const months = start && current ? TuiMonth.lengthBetween(start, current) : 0;\n const offset = months * (current?.daysCount || 0);\n\n return index - offset;\n }\n\n protected raise(index: number, {value}: TuiLineChart): void {\n const x = value[index]?.[0] || 0;\n const month = this.getDay(x);\n\n if (!month) {\n return;\n }\n\n if (this.hintDirective) {\n this.hintDirective.raise(month);\n } else {\n this.onHovered(month);\n }\n }\n\n protected getWidth(index: number): number {\n return (this.getDay(index)?.daysCount || 0) * this.months.length;\n }\n\n protected getContext(index: number, {value}: TuiLineChart): unknown {\n const x = value[index]?.[0] || 0;\n const day = this.getDay(x);\n\n return this.hintDirective && day\n ? this.hintDirective.getContext(day)\n : this.getHintContext(x, this.value);\n }\n\n @tuiPure\n private breakMonths(\n value: ReadonlyArray<[TuiDay, number]>,\n ): ReadonlyArray<readonly TuiPoint[]> {\n const offset = (value[0]?.[0].day || 1) - 1;\n const start = value[0]?.[0];\n const end = value[value.length - 1]?.[0];\n\n return Array.from(\n {length: start && end ? TuiMonth.lengthBetween(start, end) + 1 : 0},\n (_, i) => i + (start?.month || 0) + (start?.year || 0) * 12,\n )\n .map((absoluteMonth) =>\n value\n .map<TuiPoint | null>(([{month, year}, y], index) =>\n month + year * 12 === absoluteMonth ? [index + offset, y] : null,\n )\n .filter(tuiIsPresent),\n )\n .map((month, index, array) =>\n index === array.length - 1\n ? month\n : [\n ...month,\n array[index + 1]?.find((day) => !Number.isNaN(day[1])) || DUMMY,\n ],\n );\n }\n\n private getDay(index: number): TuiDay | undefined {\n const start = this.value[0]?.[0];\n\n return this.value[index - (start?.day || 0) + 1]?.[0];\n }\n}\n","<tui-line-chart\n *ngFor=\"let month of months; let first = first\"\n class=\"t-chart\"\n [dots]=\"dots\"\n [height]=\"height\"\n [smoothingFactor]=\"smoothingFactor\"\n [style.zIndex]=\"zIndex\"\n [tuiHintContent]=\"hintContent ? hint : ''\"\n [value]=\"month\"\n [width]=\"first ? firstWidth : getWidth(month[0][0])\"\n [x]=\"first ? 0 : getX(month[0][0])\"\n [xStringify]=\"xStringify ? daysStringify : null\"\n [y]=\"y\"\n [yStringify]=\"yStringify\"\n/>\n<ng-template\n #hint\n let-point\n>\n <ng-container *polymorpheusOutlet=\"hintContent as text; context: {$implicit: getHintContext(point[0], value)}\">\n {{ text }}\n </ng-container>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAwBA,SAAS,IAAI,CAAC,KAAsC,EAAE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, Input, EventEmitter, Component, ChangeDetectionStrategy,
|
|
3
|
+
import { inject, NgZone, Directive, Input, EventEmitter, Component, ChangeDetectionStrategy, Output } from '@angular/core';
|
|
4
4
|
import { TuiHovered } from '@taiga-ui/cdk/directives/hovered';
|
|
5
5
|
import { TuiRepeatTimes } from '@taiga-ui/cdk/directives/repeat-times';
|
|
6
6
|
import { TuiIdService } from '@taiga-ui/cdk/services';
|
|
@@ -129,7 +129,7 @@ class TuiPieChart {
|
|
|
129
129
|
this.activeItemIndexChange.next(index);
|
|
130
130
|
}
|
|
131
131
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPieChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
132
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiPieChart, isStandalone: true, selector: "tui-pie-chart", inputs: { value: "value", size: "size", masked: "masked", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "
|
|
132
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiPieChart, isStandalone: true, selector: "tui-pie-chart", inputs: { value: "value", size: "size", masked: "masked", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size", "class._empty": "empty" } }, ngImport: i0, template: "<svg\n focusable=\"false\"\n height=\"100%\"\n viewBox=\"-100 -100 200 200\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n>\n <defs>\n <mask [attr.id]=\"maskId\">\n <rect\n fill=\"white\"\n height=\"400\"\n width=\"400\"\n x=\"-200\"\n y=\"-200\"\n />\n <circle\n cx=\"0\"\n cy=\"0\"\n [attr.r]=\"radius\"\n />\n </mask>\n </defs>\n <g [style.mask]=\"mask\">\n <circle\n cx=\"0\"\n cy=\"0\"\n r=\"100\"\n class=\"t-placeholder\"\n />\n <path\n *tuiRepeatTimes=\"let index of segments.length\"\n automation-id=\"tui-pie-chart__segment\"\n d=\"\"\n fill=\"currentColor\"\n tuiHintPointer\n class=\"t-segment\"\n [attr.transform]=\"getTransform(index)\"\n [style.color]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n [tuiPieChart]=\"segments[index]\"\n (tuiHoveredChange)=\"onHovered($event, index)\"\n />\n </g>\n</svg>\n", styles: [":host{position:relative;display:block;width:var(--t-size);height:var(--t-size)}:host[data-size=xs]{--t-size: 2rem;pointer-events:none}:host[data-size=s]{--t-size: 4rem}:host[data-size=m]{--t-size: 9rem}:host[data-size=l]{--t-size: 11rem}:host[data-size=xl]{--t-size: 16rem}.t-svg{position:relative;overflow:visible;transform:rotate(-90deg)}.t-segment{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}:host._empty .t-segment{display:none}.t-placeholder{fill:var(--tui-background-neutral-1)}\n"], dependencies: [{ kind: "directive", type: i1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { kind: "directive", type: i1.TuiHintPointer, selector: "[tuiHint][tuiHintPointer]" }, { kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }, { kind: "directive", type: TuiHovered, selector: "[tuiHoveredChange]", outputs: ["tuiHoveredChange"] }, { kind: "directive", type: TuiPieChartDirective, selector: "path[tuiPieChart]", inputs: ["tuiPieChart"] }], viewProviders: [tuiHintOptionsProvider({ direction: 'top-right', appearance: 'dark' })], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
133
133
|
}
|
|
134
134
|
__decorate([
|
|
135
135
|
tuiPure
|
|
@@ -139,23 +139,20 @@ __decorate([
|
|
|
139
139
|
], TuiPieChart.prototype, "getSegments", null);
|
|
140
140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPieChart, decorators: [{
|
|
141
141
|
type: Component,
|
|
142
|
-
args: [{ standalone: true, selector: 'tui-pie-chart', imports: [TuiHint, TuiRepeatTimes, TuiHovered, TuiPieChartDirective], changeDetection: ChangeDetectionStrategy.OnPush, viewProviders: [tuiHintOptionsProvider({ direction: 'top-right', appearance: 'dark' })],
|
|
142
|
+
args: [{ standalone: true, selector: 'tui-pie-chart', imports: [TuiHint, TuiRepeatTimes, TuiHovered, TuiPieChartDirective], changeDetection: ChangeDetectionStrategy.OnPush, viewProviders: [tuiHintOptionsProvider({ direction: 'top-right', appearance: 'dark' })], host: {
|
|
143
|
+
'[attr.data-size]': 'size',
|
|
144
|
+
'[class._empty]': 'empty',
|
|
145
|
+
}, template: "<svg\n focusable=\"false\"\n height=\"100%\"\n viewBox=\"-100 -100 200 200\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n>\n <defs>\n <mask [attr.id]=\"maskId\">\n <rect\n fill=\"white\"\n height=\"400\"\n width=\"400\"\n x=\"-200\"\n y=\"-200\"\n />\n <circle\n cx=\"0\"\n cy=\"0\"\n [attr.r]=\"radius\"\n />\n </mask>\n </defs>\n <g [style.mask]=\"mask\">\n <circle\n cx=\"0\"\n cy=\"0\"\n r=\"100\"\n class=\"t-placeholder\"\n />\n <path\n *tuiRepeatTimes=\"let index of segments.length\"\n automation-id=\"tui-pie-chart__segment\"\n d=\"\"\n fill=\"currentColor\"\n tuiHintPointer\n class=\"t-segment\"\n [attr.transform]=\"getTransform(index)\"\n [style.color]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n [tuiPieChart]=\"segments[index]\"\n (tuiHoveredChange)=\"onHovered($event, index)\"\n />\n </g>\n</svg>\n", styles: [":host{position:relative;display:block;width:var(--t-size);height:var(--t-size)}:host[data-size=xs]{--t-size: 2rem;pointer-events:none}:host[data-size=s]{--t-size: 4rem}:host[data-size=m]{--t-size: 9rem}:host[data-size=l]{--t-size: 11rem}:host[data-size=xl]{--t-size: 16rem}.t-svg{position:relative;overflow:visible;transform:rotate(-90deg)}.t-segment{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}:host._empty .t-segment{display:none}.t-placeholder{fill:var(--tui-background-neutral-1)}\n"] }]
|
|
143
146
|
}], ctorParameters: function () { return []; }, propDecorators: { value: [{
|
|
144
147
|
type: Input
|
|
145
148
|
}], size: [{
|
|
146
149
|
type: Input
|
|
147
|
-
}, {
|
|
148
|
-
type: HostBinding,
|
|
149
|
-
args: ['attr.data-size']
|
|
150
150
|
}], masked: [{
|
|
151
151
|
type: Input
|
|
152
152
|
}], activeItemIndex: [{
|
|
153
153
|
type: Input
|
|
154
154
|
}], activeItemIndexChange: [{
|
|
155
155
|
type: Output
|
|
156
|
-
}], empty: [{
|
|
157
|
-
type: HostBinding,
|
|
158
|
-
args: ['class._empty']
|
|
159
156
|
}], getSum: [], getSegments: [] } });
|
|
160
157
|
|
|
161
158
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-pie-chart.mjs","sources":["../../../projects/addon-charts/components/pie-chart/pie-chart.directive.ts","../../../projects/addon-charts/components/pie-chart/pie-chart.component.ts","../../../projects/addon-charts/components/pie-chart/pie-chart.template.html","../../../projects/addon-charts/components/pie-chart/taiga-ui-addon-charts-components-pie-chart.ts"],"sourcesContent":["import {Directive, inject, Input, NgZone} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {WA_ANIMATION_FRAME, WA_PERFORMANCE} from '@ng-web-apis/common';\nimport {tuiDescribeSector} from '@taiga-ui/addon-charts/utils';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {tuiEaseInOutQuad} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens';\nimport {tuiGetDuration} from '@taiga-ui/core/utils/miscellaneous';\nimport {BehaviorSubject, map, pairwise, switchMap, takeWhile} from 'rxjs';\n\n@Directive({\n standalone: true,\n selector: 'path[tuiPieChart]',\n})\nexport class TuiPieChartDirective {\n private readonly sector$ = new BehaviorSubject<readonly [number, number]>([0, 0]);\n\n constructor() {\n const el = tuiInjectElement<SVGPathElement>();\n const performance = inject(WA_PERFORMANCE);\n const animationFrame$ = inject(WA_ANIMATION_FRAME);\n const speed = inject(TUI_ANIMATIONS_SPEED);\n\n this.sector$\n .pipe(\n pairwise(),\n switchMap(([prev, cur]) => {\n const now = performance.now();\n const startDelta = cur[0] - prev[0];\n const endDelta = cur[1] - prev[1];\n\n return animationFrame$.pipe(\n map((timestamp) =>\n tuiEaseInOutQuad(\n tuiClamp((timestamp - now) / tuiGetDuration(speed), 0, 1),\n ),\n ),\n takeWhile((progress) => progress < 1, true),\n map((progress) => [\n prev[0] + startDelta * progress,\n cur[1] > 359 ? cur[1] : prev[1] + endDelta * progress,\n ]),\n );\n }),\n tuiZonefree(inject(NgZone)),\n takeUntilDestroyed(),\n )\n .subscribe(([start, end]) =>\n el.setAttribute('d', tuiDescribeSector(start, end)),\n );\n }\n\n @Input()\n public set tuiPieChart(sector: readonly [number, number]) {\n this.sector$.next(sector);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n inject,\n Input,\n Output,\n} from '@angular/core';\nimport {TuiHovered} from '@taiga-ui/cdk/directives/hovered';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {TuiIdService} from '@taiga-ui/cdk/services';\nimport type {TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiSum} from '@taiga-ui/cdk/utils/math';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiHint,\n TuiHintOptionsDirective,\n tuiHintOptionsProvider,\n} from '@taiga-ui/core/directives/hint';\nimport type {TuiSizeXL, TuiSizeXS} from '@taiga-ui/core/types';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nimport {TuiPieChartDirective} from './pie-chart.directive';\n\nconst RADII = {\n xs: '50',\n s: '50',\n m: '77.8',\n l: '81.9',\n xl: '81.3',\n};\nconst TRANSFORM = {\n xs: 1.15,\n s: 1.25,\n m: 1.11,\n l: 1.09,\n xl: 1.08,\n};\n\n@Component({\n standalone: true,\n selector: 'tui-pie-chart',\n imports: [TuiHint, TuiRepeatTimes, TuiHovered, TuiPieChartDirective],\n templateUrl: './pie-chart.template.html',\n styleUrls: ['./pie-chart.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [tuiHintOptionsProvider({direction: 'top-right', appearance: 'dark'})],\n})\nexport class TuiPieChart {\n private readonly hintOptions = inject(TuiHintOptionsDirective, {optional: true});\n private readonly autoIdString = inject(TuiIdService).generate();\n\n @Input()\n public value: readonly number[] = [];\n\n @Input()\n @HostBinding('attr.data-size')\n public size: TuiSizeXL | TuiSizeXS = 'm';\n\n @Input()\n public masked = false;\n\n @Input()\n public activeItemIndex = NaN;\n\n @Output()\n public readonly activeItemIndexChange = new EventEmitter<number>();\n\n constructor() {\n if (this.hintOptions) {\n this.hintOptions.showDelay = 0;\n this.hintOptions.hideDelay = 0;\n }\n }\n\n @HostBinding('class._empty')\n protected get empty(): boolean {\n return !this.getSum(this.value);\n }\n\n protected get hintContent(): PolymorpheusContent<TuiContext<number>> {\n return this.hintOptions?.content || '';\n }\n\n protected get maskId(): string {\n return `tui-ring-chart-${this.autoIdString}`;\n }\n\n protected get mask(): string | null {\n return this.masked ? `url(#${this.maskId})` : null;\n }\n\n protected get radius(): string {\n return RADII[this.size];\n }\n\n protected get segments(): ReadonlyArray<[number, number]> {\n return this.getSegments(this.value);\n }\n\n protected getTransform(index: number): string | null {\n const transform = this.masked\n ? `scale(${TRANSFORM[this.size]})`\n : `scale(${TRANSFORM.xs})`;\n\n return index === this.activeItemIndex ? transform : null;\n }\n\n protected onHovered(hovered: boolean, index: number): void {\n this.updateActiveItemIndex(hovered ? index : NaN);\n }\n\n @tuiPure\n private getSum(value: readonly number[]): number {\n return tuiSum(...value);\n }\n\n @tuiPure\n private getSegments(value: readonly number[]): ReadonlyArray<[number, number]> {\n return value\n .map((initial, i, array) =>\n array.reduce(\n (sum, current, j) => (j < i ? this.getDeg(current) + sum : sum),\n this.getDeg(initial),\n ),\n )\n .map((angle, index, array) => [\n array[index - 1] || 0,\n Math.min(angle, 359.9999),\n ]);\n }\n\n private getDeg(value: number): number {\n return 360 * (value / this.getSum(this.value)) || 0;\n }\n\n private updateActiveItemIndex(index: number): void {\n if (index === this.activeItemIndex) {\n return;\n }\n\n this.activeItemIndex = index;\n this.activeItemIndexChange.next(index);\n }\n}\n","<svg\n focusable=\"false\"\n height=\"100%\"\n viewBox=\"-100 -100 200 200\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n>\n <defs>\n <mask [attr.id]=\"maskId\">\n <rect\n fill=\"white\"\n height=\"400\"\n width=\"400\"\n x=\"-200\"\n y=\"-200\"\n />\n <circle\n cx=\"0\"\n cy=\"0\"\n [attr.r]=\"radius\"\n />\n </mask>\n </defs>\n <g [style.mask]=\"mask\">\n <circle\n cx=\"0\"\n cy=\"0\"\n r=\"100\"\n class=\"t-placeholder\"\n />\n <path\n *tuiRepeatTimes=\"let index of segments.length\"\n automation-id=\"tui-pie-chart__segment\"\n d=\"\"\n fill=\"currentColor\"\n tuiHintPointer\n class=\"t-segment\"\n [attr.transform]=\"getTransform(index)\"\n [style.color]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n [tuiPieChart]=\"segments[index]\"\n (tuiHoveredChange)=\"onHovered($event, index)\"\n />\n </g>\n</svg>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,MAIa,oBAAoB,CAAA;AAG7B,IAAA,WAAA,GAAA;QAFiB,IAAO,CAAA,OAAA,GAAG,IAAI,eAAe,CAA4B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAG9E,QAAA,MAAM,EAAE,GAAG,gBAAgB,EAAkB,CAAC;AAC9C,QAAA,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAC3C,QAAA,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACnD,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAE3C,QAAA,IAAI,CAAC,OAAO;AACP,aAAA,IAAI,CACD,QAAQ,EAAE,EACV,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,KAAI;AACtB,YAAA,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YAC9B,MAAM,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACpC,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAElC,OAAO,eAAe,CAAC,IAAI,CACvB,GAAG,CAAC,CAAC,SAAS,KACV,gBAAgB,CACZ,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAC5D,CACJ,EACD,SAAS,CAAC,CAAC,QAAQ,KAAK,QAAQ,GAAG,CAAC,EAAE,IAAI,CAAC,EAC3C,GAAG,CAAC,CAAC,QAAQ,KAAK;AACd,gBAAA,IAAI,CAAC,CAAC,CA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AAA,CAAA;sBADZ,KAAK;gBAIC,eAAe,EAAA,CAAA;sBADrB,KAAK;gBAIU,qBAAqB,EAAA,CAAA;sBADpC,MAAM;gBAWO,KAAK,EAAA,CAAA;sBADlB,WAAW;uBAAC,cAAc,CAAA;AAsCnB,aAAA,CAAA,EAAA,MAAM,MAKN,WAAW,EAAA,EAAA,EAAA,EAAA,CAAA;;AEvHvB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-pie-chart.mjs","sources":["../../../projects/addon-charts/components/pie-chart/pie-chart.directive.ts","../../../projects/addon-charts/components/pie-chart/pie-chart.component.ts","../../../projects/addon-charts/components/pie-chart/pie-chart.template.html","../../../projects/addon-charts/components/pie-chart/taiga-ui-addon-charts-components-pie-chart.ts"],"sourcesContent":["import {Directive, inject, Input, NgZone} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {WA_ANIMATION_FRAME, WA_PERFORMANCE} from '@ng-web-apis/common';\nimport {tuiDescribeSector} from '@taiga-ui/addon-charts/utils';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {tuiEaseInOutQuad} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens';\nimport {tuiGetDuration} from '@taiga-ui/core/utils/miscellaneous';\nimport {BehaviorSubject, map, pairwise, switchMap, takeWhile} from 'rxjs';\n\n@Directive({\n standalone: true,\n selector: 'path[tuiPieChart]',\n})\nexport class TuiPieChartDirective {\n private readonly sector$ = new BehaviorSubject<readonly [number, number]>([0, 0]);\n\n constructor() {\n const el = tuiInjectElement<SVGPathElement>();\n const performance = inject(WA_PERFORMANCE);\n const animationFrame$ = inject(WA_ANIMATION_FRAME);\n const speed = inject(TUI_ANIMATIONS_SPEED);\n\n this.sector$\n .pipe(\n pairwise(),\n switchMap(([prev, cur]) => {\n const now = performance.now();\n const startDelta = cur[0] - prev[0];\n const endDelta = cur[1] - prev[1];\n\n return animationFrame$.pipe(\n map((timestamp) =>\n tuiEaseInOutQuad(\n tuiClamp((timestamp - now) / tuiGetDuration(speed), 0, 1),\n ),\n ),\n takeWhile((progress) => progress < 1, true),\n map((progress) => [\n prev[0] + startDelta * progress,\n cur[1] > 359 ? cur[1] : prev[1] + endDelta * progress,\n ]),\n );\n }),\n tuiZonefree(inject(NgZone)),\n takeUntilDestroyed(),\n )\n .subscribe(([start, end]) =>\n el.setAttribute('d', tuiDescribeSector(start, end)),\n );\n }\n\n @Input()\n public set tuiPieChart(sector: readonly [number, number]) {\n this.sector$.next(sector);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n} from '@angular/core';\nimport {TuiHovered} from '@taiga-ui/cdk/directives/hovered';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {TuiIdService} from '@taiga-ui/cdk/services';\nimport type {TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiSum} from '@taiga-ui/cdk/utils/math';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TuiHint,\n TuiHintOptionsDirective,\n tuiHintOptionsProvider,\n} from '@taiga-ui/core/directives/hint';\nimport type {TuiSizeXL, TuiSizeXS} from '@taiga-ui/core/types';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nimport {TuiPieChartDirective} from './pie-chart.directive';\n\nconst RADII = {\n xs: '50',\n s: '50',\n m: '77.8',\n l: '81.9',\n xl: '81.3',\n};\nconst TRANSFORM = {\n xs: 1.15,\n s: 1.25,\n m: 1.11,\n l: 1.09,\n xl: 1.08,\n};\n\n@Component({\n standalone: true,\n selector: 'tui-pie-chart',\n imports: [TuiHint, TuiRepeatTimes, TuiHovered, TuiPieChartDirective],\n templateUrl: './pie-chart.template.html',\n styleUrls: ['./pie-chart.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [tuiHintOptionsProvider({direction: 'top-right', appearance: 'dark'})],\n host: {\n '[attr.data-size]': 'size',\n '[class._empty]': 'empty',\n },\n})\nexport class TuiPieChart {\n private readonly hintOptions = inject(TuiHintOptionsDirective, {optional: true});\n private readonly autoIdString = inject(TuiIdService).generate();\n\n @Input()\n public value: readonly number[] = [];\n\n @Input()\n public size: TuiSizeXL | TuiSizeXS = 'm';\n\n @Input()\n public masked = false;\n\n @Input()\n public activeItemIndex = NaN;\n\n @Output()\n public readonly activeItemIndexChange = new EventEmitter<number>();\n\n constructor() {\n if (this.hintOptions) {\n this.hintOptions.showDelay = 0;\n this.hintOptions.hideDelay = 0;\n }\n }\n\n protected get empty(): boolean {\n return !this.getSum(this.value);\n }\n\n protected get hintContent(): PolymorpheusContent<TuiContext<number>> {\n return this.hintOptions?.content || '';\n }\n\n protected get maskId(): string {\n return `tui-ring-chart-${this.autoIdString}`;\n }\n\n protected get mask(): string | null {\n return this.masked ? `url(#${this.maskId})` : null;\n }\n\n protected get radius(): string {\n return RADII[this.size];\n }\n\n protected get segments(): ReadonlyArray<[number, number]> {\n return this.getSegments(this.value);\n }\n\n protected getTransform(index: number): string | null {\n const transform = this.masked\n ? `scale(${TRANSFORM[this.size]})`\n : `scale(${TRANSFORM.xs})`;\n\n return index === this.activeItemIndex ? transform : null;\n }\n\n protected onHovered(hovered: boolean, index: number): void {\n this.updateActiveItemIndex(hovered ? index : NaN);\n }\n\n @tuiPure\n private getSum(value: readonly number[]): number {\n return tuiSum(...value);\n }\n\n @tuiPure\n private getSegments(value: readonly number[]): ReadonlyArray<[number, number]> {\n return value\n .map((initial, i, array) =>\n array.reduce(\n (sum, current, j) => (j < i ? this.getDeg(current) + sum : sum),\n this.getDeg(initial),\n ),\n )\n .map((angle, index, array) => [\n array[index - 1] || 0,\n Math.min(angle, 359.9999),\n ]);\n }\n\n private getDeg(value: number): number {\n return 360 * (value / this.getSum(this.value)) || 0;\n }\n\n private updateActiveItemIndex(index: number): void {\n if (index === this.activeItemIndex) {\n return;\n }\n\n this.activeItemIndex = index;\n this.activeItemIndexChange.next(index);\n }\n}\n","<svg\n focusable=\"false\"\n height=\"100%\"\n viewBox=\"-100 -100 200 200\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n>\n <defs>\n <mask [attr.id]=\"maskId\">\n <rect\n fill=\"white\"\n height=\"400\"\n width=\"400\"\n x=\"-200\"\n y=\"-200\"\n />\n <circle\n cx=\"0\"\n cy=\"0\"\n [attr.r]=\"radius\"\n />\n </mask>\n </defs>\n <g [style.mask]=\"mask\">\n <circle\n cx=\"0\"\n cy=\"0\"\n r=\"100\"\n class=\"t-placeholder\"\n />\n <path\n *tuiRepeatTimes=\"let index of segments.length\"\n automation-id=\"tui-pie-chart__segment\"\n d=\"\"\n fill=\"currentColor\"\n tuiHintPointer\n class=\"t-segment\"\n [attr.transform]=\"getTransform(index)\"\n [style.color]=\"'var(--tui-chart-categorical-0' + index + ')'\"\n [tuiHint]=\"hintContent\"\n [tuiHintContext]=\"{$implicit: index}\"\n [tuiPieChart]=\"segments[index]\"\n (tuiHoveredChange)=\"onHovered($event, index)\"\n />\n </g>\n</svg>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,MAIa,oBAAoB,CAAA;AAG7B,IAAA,WAAA,GAAA;QAFiB,IAAO,CAAA,OAAA,GAAG,IAAI,eAAe,CAA4B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAG9E,QAAA,MAAM,EAAE,GAAG,gBAAgB,EAAkB,CAAC;AAC9C,QAAA,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAC3C,QAAA,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACnD,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,oBAA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,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA,CAAA;AAGO,UAAA,CAAA;IADP,OAAO;AAaP,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,aAAA,EAAA,IAAA,CAAA,CAAA;4FAhFQ,WAAW,EAAA,UAAA,EAAA,CAAA;kBAbvB,SAAS;AACM,YAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,EACN,QAAA,EAAA,eAAe,EAChB,OAAA,EAAA,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,CAAC,mBAGnD,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,CAAC,sBAAsB,CAAC,EAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAC,CAAC,CAAC,EAC/E,IAAA,EAAA;AACF,wBAAA,kBAAkB,EAAE,MAAM;AAC1B,wBAAA,gBAAgB,EAAE,OAAO;AAC5B,qBAAA,EAAA,QAAA,EAAA,0zCAAA,EAAA,MAAA,EAAA,CAAA,8iBAAA,CAAA,EAAA,CAAA;0EAOM,KAAK,EAAA,CAAA;sBADX,KAAK;gBAIC,IAAI,EAAA,CAAA;sBADV,KAAK;gBAIC,MAAM,EAAA,CAAA;sBADZ,KAAK;gBAIC,eAAe,EAAA,CAAA;sBADrB,KAAK;gBAIU,qBAAqB,EAAA,CAAA;sBADpC,MAAM;AA+CC,aAAA,CAAA,EAAA,MAAM,MAKN,WAAW,EAAA,EAAA,EAAA,EAAA,CAAA;;AExHvB;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, ChangeDetectionStrategy, Input,
|
|
2
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, Input, Output } from '@angular/core';
|
|
3
3
|
import { TuiPieChart } from '@taiga-ui/addon-charts/components/pie-chart';
|
|
4
4
|
|
|
5
5
|
class TuiRingChart {
|
|
@@ -20,18 +20,17 @@ class TuiRingChart {
|
|
|
20
20
|
this.activeItemIndexChange.next(index);
|
|
21
21
|
}
|
|
22
22
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRingChart, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
23
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRingChart, isStandalone: true, selector: "tui-ring-chart", inputs: { value: "value", size: "size", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "
|
|
23
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRingChart, isStandalone: true, selector: "tui-ring-chart", inputs: { value: "value", size: "size", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size" } }, ngImport: i0, template: "<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n\n<tui-pie-chart\n class=\"t-chart\"\n [activeItemIndex]=\"activeItemIndex\"\n [masked]=\"true\"\n [size]=\"size\"\n [value]=\"value\"\n (activeItemIndexChange)=\"onActiveItemIndexChange($event)\"\n/>\n\n<div class=\"t-shield\"></div>\n", styles: [":host{position:relative;display:block;width:var(--t-size);height:var(--t-size);flex-shrink:0}:host[data-size=xs]{--t-size: 3rem}:host[data-size=s]{--t-size: 4rem}:host[data-size=m]{--t-size: 9rem}:host[data-size=l]{--t-size: 11rem}:host[data-size=xl]{--t-size: 16rem}.t-content{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;font:var(--tui-font-text-m);max-height:100%;flex-direction:column;justify-content:center;text-align:center;padding:1.5rem;border-radius:100%;box-sizing:border-box;overflow:hidden;word-break:break-word;white-space:pre-wrap;color:var(--tui-text-secondary)}:host[data-size=m] .t-content{font:var(--tui-font-text-xs)}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-l);font-weight:700}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:700}.t-shield{position:absolute;top:25%;left:25%;right:25%;bottom:25%;border-radius:100%}.t-chart{width:100%;height:100%}\n"], dependencies: [{ kind: "component", type: TuiPieChart, selector: "tui-pie-chart", inputs: ["value", "size", "masked", "activeItemIndex"], outputs: ["activeItemIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
24
24
|
}
|
|
25
25
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRingChart, decorators: [{
|
|
26
26
|
type: Component,
|
|
27
|
-
args: [{ standalone: true, selector: 'tui-ring-chart', imports: [TuiPieChart], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
args: [{ standalone: true, selector: 'tui-ring-chart', imports: [TuiPieChart], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
28
|
+
'[attr.data-size]': 'size',
|
|
29
|
+
}, template: "<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n\n<tui-pie-chart\n class=\"t-chart\"\n [activeItemIndex]=\"activeItemIndex\"\n [masked]=\"true\"\n [size]=\"size\"\n [value]=\"value\"\n (activeItemIndexChange)=\"onActiveItemIndexChange($event)\"\n/>\n\n<div class=\"t-shield\"></div>\n", styles: [":host{position:relative;display:block;width:var(--t-size);height:var(--t-size);flex-shrink:0}:host[data-size=xs]{--t-size: 3rem}:host[data-size=s]{--t-size: 4rem}:host[data-size=m]{--t-size: 9rem}:host[data-size=l]{--t-size: 11rem}:host[data-size=xl]{--t-size: 16rem}.t-content{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;font:var(--tui-font-text-m);max-height:100%;flex-direction:column;justify-content:center;text-align:center;padding:1.5rem;border-radius:100%;box-sizing:border-box;overflow:hidden;word-break:break-word;white-space:pre-wrap;color:var(--tui-text-secondary)}:host[data-size=m] .t-content{font:var(--tui-font-text-xs)}.t-wrapper:first-line{color:var(--tui-text-primary)}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-l);font-weight:700}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:700}.t-shield{position:absolute;top:25%;left:25%;right:25%;bottom:25%;border-radius:100%}.t-chart{width:100%;height:100%}\n"] }]
|
|
28
30
|
}], propDecorators: { value: [{
|
|
29
31
|
type: Input
|
|
30
32
|
}], size: [{
|
|
31
33
|
type: Input
|
|
32
|
-
}, {
|
|
33
|
-
type: HostBinding,
|
|
34
|
-
args: ['attr.data-size']
|
|
35
34
|
}], activeItemIndex: [{
|
|
36
35
|
type: Input
|
|
37
36
|
}], activeItemIndexChange: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-components-ring-chart.mjs","sources":["../../../projects/addon-charts/components/ring-chart/ring-chart.component.ts","../../../projects/addon-charts/components/ring-chart/ring-chart.template.html","../../../projects/addon-charts/components/ring-chart/taiga-ui-addon-charts-components-ring-chart.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-components-ring-chart.mjs","sources":["../../../projects/addon-charts/components/ring-chart/ring-chart.component.ts","../../../projects/addon-charts/components/ring-chart/ring-chart.template.html","../../../projects/addon-charts/components/ring-chart/taiga-ui-addon-charts-components-ring-chart.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\nimport {TuiPieChart} from '@taiga-ui/addon-charts/components/pie-chart';\nimport type {TuiSizeXL, TuiSizeXS} from '@taiga-ui/core/types';\n\n@Component({\n standalone: true,\n selector: 'tui-ring-chart',\n imports: [TuiPieChart],\n templateUrl: './ring-chart.template.html',\n styleUrls: ['./ring-chart.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size',\n },\n})\nexport class TuiRingChart {\n @Input()\n public value: readonly number[] = [];\n\n @Input()\n public size: TuiSizeXL | TuiSizeXS = 'm';\n\n @Input()\n public activeItemIndex = NaN;\n\n @Output()\n public readonly activeItemIndexChange = new EventEmitter<number>();\n\n protected onActiveItemIndexChange(index: number): void {\n this.updateActiveItemIndex(index);\n }\n\n private updateActiveItemIndex(index: number): void {\n if (index === this.activeItemIndex) {\n return;\n }\n\n this.activeItemIndex = index;\n this.activeItemIndexChange.next(index);\n }\n}\n","<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content />\n </div>\n</div>\n\n<tui-pie-chart\n class=\"t-chart\"\n [activeItemIndex]=\"activeItemIndex\"\n [masked]=\"true\"\n [size]=\"size\"\n [value]=\"value\"\n (activeItemIndexChange)=\"onActiveItemIndexChange($event)\"\n/>\n\n<div class=\"t-shield\"></div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAUA,MAWa,YAAY,CAAA;AAXzB,IAAA,WAAA,GAAA;QAaW,IAAK,CAAA,KAAA,GAAsB,EAAE,CAAC;QAG9B,IAAI,CAAA,IAAA,GAA0B,GAAG,CAAC;QAGlC,IAAe,CAAA,eAAA,GAAG,GAAG,CAAC;AAGb,QAAA,IAAA,CAAA,qBAAqB,GAAG,IAAI,YAAY,EAAU,CAAC;AActE,KAAA;AAZa,IAAA,uBAAuB,CAAC,KAAa,EAAA;AAC3C,QAAA,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;KACrC;AAEO,IAAA,qBAAqB,CAAC,KAAa,EAAA;AACvC,QAAA,IAAI,KAAK,KAAK,IAAI,CAAC,eAAe,EAAE;YAChC,OAAO;AACV,SAAA;AAED,QAAA,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;AAC7B,QAAA,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAA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AAqB,EAAA,CAAA;sBADpC,MAAM;;;AE/BX;;AAEG;;;;"}
|
|
@@ -13,12 +13,13 @@ function tuiLineLength(a, b) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function tuiControlPoint(current, previous, next, reverse = false, smoothing = 0.2) {
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const fallback = current || [0, 0];
|
|
17
|
+
const p = previous || current || [0, 0];
|
|
18
|
+
const n = next || current || [0, 0];
|
|
18
19
|
const angle = tuiLineAngle(p, n) + (reverse ? Math.PI : 0);
|
|
19
20
|
const length = tuiLineLength(p, n) * smoothing;
|
|
20
|
-
const x =
|
|
21
|
-
const y =
|
|
21
|
+
const x = fallback[0] + Math.cos(angle) * length;
|
|
22
|
+
const y = fallback[1] + Math.sin(angle) * length;
|
|
22
23
|
return [x, y];
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -32,7 +33,7 @@ const EMPTY = 'M 100 0 A 100 100 0 1 1 100 0 L 0 0';
|
|
|
32
33
|
* @param startAngle starting angle in degrees
|
|
33
34
|
* @param endAngle ending angle in degrees
|
|
34
35
|
*/
|
|
35
|
-
function tuiDescribeSector(startAngle, endAngle) {
|
|
36
|
+
function tuiDescribeSector(startAngle = 0, endAngle = 0) {
|
|
36
37
|
const startRad = tuiToRadians(startAngle);
|
|
37
38
|
const endRad = tuiToRadians(endAngle);
|
|
38
39
|
const startX = Math.cos(startRad) * 100;
|
|
@@ -57,7 +58,8 @@ function tuiDescribeSector(startAngle, endAngle) {
|
|
|
57
58
|
function tuiDrawCurve(array, index, smoothing) {
|
|
58
59
|
const [cpsX, cpsY] = tuiControlPoint(array[index - 1], array[index - 2], array[index], false, smoothing);
|
|
59
60
|
const [cpeX, cpeY] = tuiControlPoint(array[index], array[index - 1], array[index + 1], true, smoothing);
|
|
60
|
-
|
|
61
|
+
const point = array[index] ?? [0, 0];
|
|
62
|
+
return `C ${cpsX},${cpsY} ${cpeX},${cpeY} ${point[0]},${point[1]}`;
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
function tuiDrawLine(point) {
|
|
@@ -66,9 +68,10 @@ function tuiDrawLine(point) {
|
|
|
66
68
|
|
|
67
69
|
const COEFFICIENT = 500;
|
|
68
70
|
function tuiDraw(array, index, smoothing) {
|
|
71
|
+
const point = [...(array[index] ?? [0, 0])];
|
|
69
72
|
return smoothing
|
|
70
73
|
? tuiDrawCurve(array, index, smoothing / COEFFICIENT)
|
|
71
|
-
: tuiDrawLine([
|
|
74
|
+
: tuiDrawLine([point[0], point[1]]);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-charts-utils.mjs","sources":["../../../projects/addon-charts/utils/line-angle.ts","../../../projects/addon-charts/utils/line-length.ts","../../../projects/addon-charts/utils/control-point.ts","../../../projects/addon-charts/utils/describe-sector.ts","../../../projects/addon-charts/utils/draw-curve.ts","../../../projects/addon-charts/utils/draw-line.ts","../../../projects/addon-charts/utils/draw.ts","../../../projects/addon-charts/utils/taiga-ui-addon-charts-utils.ts"],"sourcesContent":["import type {TuiPoint} from '@taiga-ui/core/types';\n\nexport function tuiLineAngle(a: TuiPoint, b: TuiPoint): number {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n\n return Math.atan2(y, x);\n}\n","import type {TuiPoint} from '@taiga-ui/core/types';\n\nexport function tuiLineLength(a: TuiPoint, b: TuiPoint): number {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n\n return Math.sqrt(x ** 2 + y ** 2);\n}\n","import type {TuiPoint} from '@taiga-ui/core/types';\n\nimport {tuiLineAngle} from './line-angle';\nimport {tuiLineLength} from './line-length';\n\nexport function tuiControlPoint(\n current
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-charts-utils.mjs","sources":["../../../projects/addon-charts/utils/line-angle.ts","../../../projects/addon-charts/utils/line-length.ts","../../../projects/addon-charts/utils/control-point.ts","../../../projects/addon-charts/utils/describe-sector.ts","../../../projects/addon-charts/utils/draw-curve.ts","../../../projects/addon-charts/utils/draw-line.ts","../../../projects/addon-charts/utils/draw.ts","../../../projects/addon-charts/utils/taiga-ui-addon-charts-utils.ts"],"sourcesContent":["import type {TuiPoint} from '@taiga-ui/core/types';\n\nexport function tuiLineAngle(a: TuiPoint, b: TuiPoint): number {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n\n return Math.atan2(y, x);\n}\n","import type {TuiPoint} from '@taiga-ui/core/types';\n\nexport function tuiLineLength(a: TuiPoint, b: TuiPoint): number {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n\n return Math.sqrt(x ** 2 + y ** 2);\n}\n","import type {TuiPoint} from '@taiga-ui/core/types';\n\nimport {tuiLineAngle} from './line-angle';\nimport {tuiLineLength} from './line-length';\n\nexport function tuiControlPoint(\n current?: TuiPoint,\n previous?: TuiPoint,\n next?: TuiPoint,\n reverse = false,\n smoothing = 0.2,\n): TuiPoint {\n const fallback = current || ([0, 0] as const);\n const p = previous || current || ([0, 0] as const);\n const n = next || current || ([0, 0] as const);\n const angle = tuiLineAngle(p, n) + (reverse ? Math.PI : 0);\n const length = tuiLineLength(p, n) * smoothing;\n const x = fallback[0] + Math.cos(angle) * length;\n const y = fallback[1] + Math.sin(angle) * length;\n\n return [x, y];\n}\n","import {tuiToInt, tuiToRadians} from '@taiga-ui/cdk/utils/math';\n\nconst EMPTY = 'M 100 0 A 100 100 0 1 1 100 0 L 0 0';\n\n/**\n * Describes a normalized sector by angles. Normalized meaning it supposed to work with\n * SVG with viewBox=\"-1 -1 2 2\" so that 0 coordinates in cartesian and polar match the same spot.\n * Everything is multiplied by 100 (including viewBox of SVG to host this) so IE properly\n * handles hover events.\n *\n * @param startAngle starting angle in degrees\n * @param endAngle ending angle in degrees\n */\nexport function tuiDescribeSector(startAngle = 0, endAngle = 0): string {\n const startRad = tuiToRadians(startAngle);\n const endRad = tuiToRadians(endAngle);\n const startX = Math.cos(startRad) * 100;\n const startY = Math.sin(startRad) * 100;\n const endX = Math.cos(endRad) * 100;\n const endY = Math.sin(endRad) * 100;\n const largeArcFlag = tuiToInt(endAngle - startAngle > 180);\n const result = [\n 'M',\n startX,\n startY,\n 'A 100 100 0',\n largeArcFlag,\n 1,\n endX,\n endY,\n 'L 0 0',\n ];\n\n return Number.isNaN(endX) ? EMPTY : result.join(' ');\n}\n","import type {TuiPoint} from '@taiga-ui/core/types';\n\nimport {tuiControlPoint} from './control-point';\n\nexport function tuiDrawCurve(\n array: readonly TuiPoint[],\n index: number,\n smoothing: number,\n): string {\n const [cpsX, cpsY] = tuiControlPoint(\n array[index - 1],\n array[index - 2],\n array[index],\n false,\n smoothing,\n );\n const [cpeX, cpeY] = tuiControlPoint(\n array[index],\n array[index - 1],\n array[index + 1],\n true,\n smoothing,\n );\n\n const point = array[index] ?? [0, 0];\n\n return `C ${cpsX},${cpsY} ${cpeX},${cpeY} ${point[0]},${point[1]}`;\n}\n","export function tuiDrawLine(point: [number, number]): string {\n return `L ${point}`;\n}\n","import type {TuiPoint} from '@taiga-ui/core/types';\n\nimport {tuiDrawCurve} from './draw-curve';\nimport {tuiDrawLine} from './draw-line';\n\nconst COEFFICIENT = 500;\n\nexport function tuiDraw(\n array: readonly TuiPoint[],\n index: number,\n smoothing: number,\n): string {\n const point: readonly [number, number] = [...(array[index] ?? [0, 0])];\n\n return smoothing\n ? tuiDrawCurve(array, index, smoothing / COEFFICIENT)\n : tuiDrawLine([point[0], point[1]]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEgB,SAAA,YAAY,CAAC,CAAW,EAAE,CAAW,EAAA;IACjD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACtB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtB,OAAO,IAAI,CAAC,KAAK,C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