@taiga-ui/addon-charts 4.52.0-canary.ece97e9 → 4.52.0-canary.efbd0d4
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/README.md +2 -2
- package/components/arc-chart/arc-chart.component.d.ts +15 -14
- package/components/axes/axes.component.d.ts +23 -19
- package/components/line-chart/line-chart-hint.directive.d.ts +3 -3
- package/components/line-chart/line-chart.component.d.ts +4 -3
- package/components/line-chart/line-chart.options.d.ts +1 -3
- package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs +34 -51
- package/fesm2022/taiga-ui-addon-charts-components-arc-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-axes.mjs +38 -64
- package/fesm2022/taiga-ui-addon-charts-components-axes.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs +7 -8
- package/fesm2022/taiga-ui-addon-charts-components-bar-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-bar-set.mjs +4 -4
- package/fesm2022/taiga-ui-addon-charts-components-bar.mjs +3 -3
- package/fesm2022/taiga-ui-addon-charts-components-legend-item.mjs +4 -4
- package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs +26 -31
- package/fesm2022/taiga-ui-addon-charts-components-line-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs +13 -14
- package/fesm2022/taiga-ui-addon-charts-components-line-days-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs +12 -15
- package/fesm2022/taiga-ui-addon-charts-components-pie-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs +4 -4
- package/fesm2022/taiga-ui-addon-charts-components-ring-chart.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-charts-utils.mjs +6 -3
- package/fesm2022/taiga-ui-addon-charts-utils.mjs.map +1 -1
- package/package.json +5 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { tuiToInt } from '@taiga-ui/cdk/utils/math';
|
|
2
2
|
|
|
3
3
|
function tuiLineAngle(a, b) {
|
|
4
4
|
const x = b[0] - a[0];
|
|
@@ -24,6 +24,9 @@ function tuiControlPoint(current, previous, next, reverse = false, smoothing = 0
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const EMPTY = 'M 100 0 A 100 100 0 1 1 100 0 L 0 0';
|
|
27
|
+
function toRadians(deg) {
|
|
28
|
+
return (deg * Math.PI) / 180;
|
|
29
|
+
}
|
|
27
30
|
/**
|
|
28
31
|
* Describes a normalized sector by angles. Normalized meaning it supposed to work with
|
|
29
32
|
* SVG with viewBox="-1 -1 2 2" so that 0 coordinates in cartesian and polar match the same spot.
|
|
@@ -34,8 +37,8 @@ const EMPTY = 'M 100 0 A 100 100 0 1 1 100 0 L 0 0';
|
|
|
34
37
|
* @param endAngle ending angle in degrees
|
|
35
38
|
*/
|
|
36
39
|
function tuiDescribeSector(startAngle = 0, endAngle = 0) {
|
|
37
|
-
const startRad =
|
|
38
|
-
const endRad =
|
|
40
|
+
const startRad = toRadians(startAngle);
|
|
41
|
+
const endRad = toRadians(endAngle);
|
|
39
42
|
const startX = Math.cos(startRad) * 100;
|
|
40
43
|
const startY = Math.sin(startRad) * 100;
|
|
41
44
|
const endX = Math.cos(endRad) * 100;
|
|
@@ -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?: 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
|
|
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} from '@taiga-ui/cdk/utils/math';\n\nconst EMPTY = 'M 100 0 A 100 100 0 1 1 100 0 L 0 0';\n\nfunction toRadians(deg: number): number {\n return (deg * Math.PI) / 180;\n}\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 = toRadians(startAngle);\n const endRad = toRadians(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;IACrB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAErB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAC3B;;ACLgB,SAAA,aAAa,CAAC,CAAW,EAAE,CAAW,EAAA;IAClD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAErB,IAAA,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACrC;;ACFgB,SAAA,eAAe,CAC3B,OAAkB,EAClB,QAAmB,EACnB,IAAe,EACf,OAAO,GAAG,KAAK,EACf,SAAS,G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O,CAAA,EAAA,EAAK,KAAK,CAAA,CAAE;AACvB;;ACGA,MAAM,WAAW,GAAG,GAAG;SAEP,OAAO,CACnB,KAA0B,EAC1B,KAAa,EACb,SAAiB,EAAA;AAEjB,IAAA,MAAM,KAAK,GAA8B,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEtE,IAAA,OAAO;UACD,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,GAAG,WAAW;AACpD,UAAE,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C;;ACjBA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/addon-charts",
|
|
3
|
-
"version": "4.52.0-canary.
|
|
3
|
+
"version": "4.52.0-canary.efbd0d4",
|
|
4
4
|
"description": "Extension package for Taiga UI that adds various charts, graphs and related components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
"diagram"
|
|
12
12
|
],
|
|
13
13
|
"homepage": "https://github.com/taiga-family/taiga-ui",
|
|
14
|
-
"repository":
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/taiga-family/taiga-ui"
|
|
17
|
+
},
|
|
15
18
|
"license": "Apache-2.0",
|
|
16
19
|
"peerDependencies": {
|
|
17
20
|
"@angular/common": ">=19.0.0",
|