@acorex/charts 19.13.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/README.md +72 -0
- package/bar-chart/README.md +3 -0
- package/bar-chart/index.d.ts +3 -0
- package/bar-chart/lib/bar-chart.component.d.ts +123 -0
- package/bar-chart/lib/bar-chart.config.d.ts +6 -0
- package/bar-chart/lib/bar-chart.type.d.ts +44 -0
- package/chart-tooltip/README.md +3 -0
- package/chart-tooltip/index.d.ts +2 -0
- package/chart-tooltip/lib/chart-tooltip.component.d.ts +43 -0
- package/chart-tooltip/lib/chart-tooltip.type.d.ts +7 -0
- package/donut-chart/README.md +3 -0
- package/donut-chart/index.d.ts +3 -0
- package/donut-chart/lib/donut-chart.component.d.ts +143 -0
- package/donut-chart/lib/donut-chart.config.d.ts +6 -0
- package/donut-chart/lib/donut-chart.type.d.ts +25 -0
- package/fesm2022/acorex-charts-bar-chart.mjs +563 -0
- package/fesm2022/acorex-charts-bar-chart.mjs.map +1 -0
- package/fesm2022/acorex-charts-chart-tooltip.mjs +75 -0
- package/fesm2022/acorex-charts-chart-tooltip.mjs.map +1 -0
- package/fesm2022/acorex-charts-donut-chart.mjs +616 -0
- package/fesm2022/acorex-charts-donut-chart.mjs.map +1 -0
- package/fesm2022/acorex-charts-gauge-chart.mjs +548 -0
- package/fesm2022/acorex-charts-gauge-chart.mjs.map +1 -0
- package/fesm2022/acorex-charts-hierarchy-chart.mjs +652 -0
- package/fesm2022/acorex-charts-hierarchy-chart.mjs.map +1 -0
- package/fesm2022/acorex-charts-line-chart.mjs +738 -0
- package/fesm2022/acorex-charts-line-chart.mjs.map +1 -0
- package/fesm2022/acorex-charts.mjs +8 -0
- package/fesm2022/acorex-charts.mjs.map +1 -0
- package/gauge-chart/README.md +3 -0
- package/gauge-chart/index.d.ts +3 -0
- package/gauge-chart/lib/gauge-chart.component.d.ts +110 -0
- package/gauge-chart/lib/gauge-chart.config.d.ts +6 -0
- package/gauge-chart/lib/gauge-chart.type.d.ts +37 -0
- package/hierarchy-chart/README.md +61 -0
- package/hierarchy-chart/index.d.ts +3 -0
- package/hierarchy-chart/lib/hierarchy-chart.component.d.ts +99 -0
- package/hierarchy-chart/lib/hierarchy-chart.config.d.ts +6 -0
- package/hierarchy-chart/lib/hierarchy-chart.type.d.ts +227 -0
- package/index.d.ts +1 -0
- package/line-chart/README.md +3 -0
- package/line-chart/index.d.ts +3 -0
- package/line-chart/lib/line-chart.component.d.ts +96 -0
- package/line-chart/lib/line-chart.config.d.ts +6 -0
- package/line-chart/lib/line-chart.type.d.ts +61 -0
- package/package.json +48 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { input, afterNextRender, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
class AXChartTooltipComponent {
|
|
7
|
+
ngZone;
|
|
8
|
+
data = input(null);
|
|
9
|
+
position = input({ x: 0, y: 0 });
|
|
10
|
+
visible = input(false);
|
|
11
|
+
/**
|
|
12
|
+
* Whether to show the tooltip's percentage badge
|
|
13
|
+
*/
|
|
14
|
+
showPercentage = input(true);
|
|
15
|
+
/**
|
|
16
|
+
* Optional custom styling for the tooltip
|
|
17
|
+
*/
|
|
18
|
+
style = input({});
|
|
19
|
+
/**
|
|
20
|
+
* Reference to tooltip container for measuring dimensions
|
|
21
|
+
*/
|
|
22
|
+
tooltipContainer;
|
|
23
|
+
// Tooltip dimensions
|
|
24
|
+
tooltipWidth = 0;
|
|
25
|
+
tooltipHeight = 0;
|
|
26
|
+
constructor(ngZone) {
|
|
27
|
+
this.ngZone = ngZone;
|
|
28
|
+
afterNextRender(() => {
|
|
29
|
+
// Update tooltip dimensions when visible changes
|
|
30
|
+
this.updateTooltipDimensions();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Updates tooltip dimensions after it's rendered
|
|
35
|
+
*/
|
|
36
|
+
updateTooltipDimensions() {
|
|
37
|
+
if (this.visible() && this.tooltipContainer) {
|
|
38
|
+
this.ngZone.runOutsideAngular(() => {
|
|
39
|
+
// Use requestAnimationFrame to ensure dimensions are calculated after render
|
|
40
|
+
requestAnimationFrame(() => {
|
|
41
|
+
if (this.tooltipContainer?.nativeElement) {
|
|
42
|
+
this.tooltipWidth = this.tooltipContainer.nativeElement.offsetWidth;
|
|
43
|
+
this.tooltipHeight = this.tooltipContainer.nativeElement.offsetHeight;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get adjusted tooltip position
|
|
51
|
+
* Exposes properties for parent components to query tooltip dimensions
|
|
52
|
+
*/
|
|
53
|
+
getDimensions() {
|
|
54
|
+
return {
|
|
55
|
+
width: this.tooltipWidth,
|
|
56
|
+
height: this.tooltipHeight,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AXChartTooltipComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
60
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.9", type: AXChartTooltipComponent, isStandalone: true, selector: "ax-chart-tooltip", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, showPercentage: { classPropertyName: "showPercentage", publicName: "showPercentage", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "tooltipContainer", first: true, predicate: ["tooltipContainer"], descendants: true }], ngImport: i0, template: "@if (visible() && data()) {\n <div\n #tooltipContainer\n class=\"chart-tooltip\"\n [style.left.px]=\"position().x\"\n [style.top.px]=\"position().y\"\n [ngStyle]=\"style()\"\n >\n <div class=\"chart-tooltip-title\">{{ data()!.title }}</div>\n <div class=\"chart-tooltip-content\">\n @if (data()!.color) {\n <div class=\"chart-tooltip-color\" [style.background-color]=\"data()!.color\"></div>\n }\n <div class=\"chart-tooltip-value\">{{ data()!.value }}</div>\n @if (showPercentage() && data()!.percentage) {\n <div class=\"chart-tooltip-percentage\">{{ data()!.percentage }}</div>\n }\n </div>\n </div>\n}\n", styles: [".chart-tooltip{position:absolute;pointer-events:none;background-color:#212121e6;color:#fff;padding:.5rem .75rem;border-radius:.375rem;font-size:.8rem;z-index:10;box-shadow:0 4px 12px #00000026;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);border:1px solid rgba(255,255,255,.1);transform:translate(10px,-50%);max-width:200px;font-family:var(--ax-font-family, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);transition:opacity .15s ease,transform .15s ease}.chart-tooltip-title{font-weight:600;padding-bottom:.5rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chart-tooltip-content{display:flex;justify-content:space-between;align-items:center;gap:.5rem}.chart-tooltip-color{width:10px;height:10px;border-radius:2px;flex-shrink:0;box-shadow:0 1px 2px #0003}.chart-tooltip-value{font-weight:500;flex-grow:1}.chart-tooltip-percentage{background-color:#fff3;padding:.125rem .375rem;border-radius:1rem;font-size:.7rem;font-weight:500;flex-shrink:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
61
|
+
}
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AXChartTooltipComponent, decorators: [{
|
|
63
|
+
type: Component,
|
|
64
|
+
args: [{ selector: 'ax-chart-tooltip', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (visible() && data()) {\n <div\n #tooltipContainer\n class=\"chart-tooltip\"\n [style.left.px]=\"position().x\"\n [style.top.px]=\"position().y\"\n [ngStyle]=\"style()\"\n >\n <div class=\"chart-tooltip-title\">{{ data()!.title }}</div>\n <div class=\"chart-tooltip-content\">\n @if (data()!.color) {\n <div class=\"chart-tooltip-color\" [style.background-color]=\"data()!.color\"></div>\n }\n <div class=\"chart-tooltip-value\">{{ data()!.value }}</div>\n @if (showPercentage() && data()!.percentage) {\n <div class=\"chart-tooltip-percentage\">{{ data()!.percentage }}</div>\n }\n </div>\n </div>\n}\n", styles: [".chart-tooltip{position:absolute;pointer-events:none;background-color:#212121e6;color:#fff;padding:.5rem .75rem;border-radius:.375rem;font-size:.8rem;z-index:10;box-shadow:0 4px 12px #00000026;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);border:1px solid rgba(255,255,255,.1);transform:translate(10px,-50%);max-width:200px;font-family:var(--ax-font-family, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);transition:opacity .15s ease,transform .15s ease}.chart-tooltip-title{font-weight:600;padding-bottom:.5rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chart-tooltip-content{display:flex;justify-content:space-between;align-items:center;gap:.5rem}.chart-tooltip-color{width:10px;height:10px;border-radius:2px;flex-shrink:0;box-shadow:0 1px 2px #0003}.chart-tooltip-value{font-weight:500;flex-grow:1}.chart-tooltip-percentage{background-color:#fff3;padding:.125rem .375rem;border-radius:1rem;font-size:.7rem;font-weight:500;flex-shrink:0}\n"] }]
|
|
65
|
+
}], ctorParameters: () => [{ type: i0.NgZone }], propDecorators: { tooltipContainer: [{
|
|
66
|
+
type: ViewChild,
|
|
67
|
+
args: ['tooltipContainer']
|
|
68
|
+
}] } });
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Generated bundle index. Do not edit.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
export { AXChartTooltipComponent };
|
|
75
|
+
//# sourceMappingURL=acorex-charts-chart-tooltip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-charts-chart-tooltip.mjs","sources":["../../../../libs/charts/chart-tooltip/src/lib/chart-tooltip.component.ts","../../../../libs/charts/chart-tooltip/src/lib/chart-tooltip.component.html","../../../../libs/charts/chart-tooltip/src/acorex-charts-chart-tooltip.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n ViewChild,\n afterNextRender,\n input,\n} from '@angular/core';\nimport { AXChartTooltipData } from './chart-tooltip.type';\n\n@Component({\n selector: 'ax-chart-tooltip',\n templateUrl: './chart-tooltip.component.html',\n styleUrls: ['./chart-tooltip.component.scss'],\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXChartTooltipComponent {\n data = input<AXChartTooltipData | null>(null);\n position = input<{ x: number; y: number }>({ x: 0, y: 0 });\n visible = input<boolean>(false);\n\n /**\n * Whether to show the tooltip's percentage badge\n */\n showPercentage = input<boolean>(true);\n\n /**\n * Optional custom styling for the tooltip\n */\n style = input<{ [key: string]: string }>({});\n\n /**\n * Reference to tooltip container for measuring dimensions\n */\n @ViewChild('tooltipContainer') tooltipContainer?: ElementRef<HTMLDivElement>;\n\n // Tooltip dimensions\n protected tooltipWidth = 0;\n protected tooltipHeight = 0;\n\n constructor(private ngZone: NgZone) {\n afterNextRender(() => {\n // Update tooltip dimensions when visible changes\n this.updateTooltipDimensions();\n });\n }\n\n /**\n * Updates tooltip dimensions after it's rendered\n */\n protected updateTooltipDimensions(): void {\n if (this.visible() && this.tooltipContainer) {\n this.ngZone.runOutsideAngular(() => {\n // Use requestAnimationFrame to ensure dimensions are calculated after render\n requestAnimationFrame(() => {\n if (this.tooltipContainer?.nativeElement) {\n this.tooltipWidth = this.tooltipContainer.nativeElement.offsetWidth;\n this.tooltipHeight = this.tooltipContainer.nativeElement.offsetHeight;\n }\n });\n });\n }\n }\n\n /**\n * Get adjusted tooltip position\n * Exposes properties for parent components to query tooltip dimensions\n */\n getDimensions(): { width: number; height: number } {\n return {\n width: this.tooltipWidth,\n height: this.tooltipHeight,\n };\n }\n}\n","@if (visible() && data()) {\n <div\n #tooltipContainer\n class=\"chart-tooltip\"\n [style.left.px]=\"position().x\"\n [style.top.px]=\"position().y\"\n [ngStyle]=\"style()\"\n >\n <div class=\"chart-tooltip-title\">{{ data()!.title }}</div>\n <div class=\"chart-tooltip-content\">\n @if (data()!.color) {\n <div class=\"chart-tooltip-color\" [style.background-color]=\"data()!.color\"></div>\n }\n <div class=\"chart-tooltip-value\">{{ data()!.value }}</div>\n @if (showPercentage() && data()!.percentage) {\n <div class=\"chart-tooltip-percentage\">{{ data()!.percentage }}</div>\n }\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAoBa,uBAAuB,CAAA;AAwBd,IAAA,MAAA;AAvBpB,IAAA,IAAI,GAAG,KAAK,CAA4B,IAAI,CAAC;AAC7C,IAAA,QAAQ,GAAG,KAAK,CAA2B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAC1D,IAAA,OAAO,GAAG,KAAK,CAAU,KAAK,CAAC;AAE/B;;AAEG;AACH,IAAA,cAAc,GAAG,KAAK,CAAU,IAAI,CAAC;AAErC;;AAEG;AACH,IAAA,KAAK,GAAG,KAAK,CAA4B,EAAE,CAAC;AAE5C;;AAEG;AAC4B,IAAA,gBAAgB;;IAGrC,YAAY,GAAG,CAAC;IAChB,aAAa,GAAG,CAAC;AAE3B,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;QACxB,eA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