@acorex/charts 20.2.0-next.21 → 20.2.0-next.22
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/bar-chart/index.d.ts +15 -10
- package/donut-chart/index.d.ts +7 -5
- package/fesm2022/acorex-charts-bar-chart.mjs +169 -309
- package/fesm2022/acorex-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-chart-legend.mjs +4 -4
- package/fesm2022/acorex-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/acorex-charts-chart-tooltip.mjs +4 -4
- package/fesm2022/acorex-charts-chart-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-charts-donut-chart.mjs +107 -153
- package/fesm2022/acorex-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-gauge-chart.mjs +18 -59
- package/fesm2022/acorex-charts-gauge-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-hierarchy-chart.mjs +9 -6
- package/fesm2022/acorex-charts-hierarchy-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-line-chart.mjs +21 -39
- package/fesm2022/acorex-charts-line-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts.mjs +56 -1
- package/fesm2022/acorex-charts.mjs.map +1 -1
- package/gauge-chart/index.d.ts +6 -8
- package/hierarchy-chart/index.d.ts +5 -3
- package/index.d.ts +29 -1
- package/line-chart/index.d.ts +6 -4
- package/package.json +3 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NXComponent } from '@acorex/cdk/common';
|
|
2
|
-
import { AX_CHART_COLOR_PALETTE, getChartColor } from '@acorex/charts';
|
|
2
|
+
import { AX_CHART_COLOR_PALETTE, getChartColor, computeTooltipPosition } from '@acorex/charts';
|
|
3
3
|
import { AXChartTooltipComponent } from '@acorex/charts/chart-tooltip';
|
|
4
4
|
import { AXPlatform } from '@acorex/core/platform';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
@@ -115,6 +115,8 @@ class AXLineChartComponent extends NXComponent {
|
|
|
115
115
|
...this.effectiveOptions().messages,
|
|
116
116
|
};
|
|
117
117
|
}, ...(ngDevMode ? [{ debugName: "effectiveMessages" }] : []));
|
|
118
|
+
// Tooltip gap in pixels for consistent spacing
|
|
119
|
+
TOOLTIP_GAP = 10;
|
|
118
120
|
ngOnInit() {
|
|
119
121
|
this.loadD3();
|
|
120
122
|
}
|
|
@@ -289,13 +291,13 @@ class AXLineChartComponent extends NXComponent {
|
|
|
289
291
|
const svg = this.d3
|
|
290
292
|
.select(containerElement)
|
|
291
293
|
.append('svg')
|
|
292
|
-
.attr('width',
|
|
293
|
-
.attr('height',
|
|
294
|
+
.attr('width', totalWidth)
|
|
295
|
+
.attr('height', totalHeight)
|
|
294
296
|
.attr('viewBox', `0 0 ${totalWidth} ${totalHeight}`)
|
|
295
297
|
.attr('preserveAspectRatio', 'xMidYMid meet')
|
|
296
298
|
.attr('style', `
|
|
297
|
-
width:
|
|
298
|
-
height:
|
|
299
|
+
width: ${totalWidth}px;
|
|
300
|
+
height: ${totalHeight}px;
|
|
299
301
|
max-width: 100%;
|
|
300
302
|
max-height: 100%;
|
|
301
303
|
overflow: visible;
|
|
@@ -879,22 +881,16 @@ class AXLineChartComponent extends NXComponent {
|
|
|
879
881
|
.attr('pointer-events', 'none');
|
|
880
882
|
}
|
|
881
883
|
updateTooltipPosition(event) {
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
if (!tooltipEl) {
|
|
885
|
-
const x = event.clientX - container.left;
|
|
886
|
-
const y = event.clientY - container.top;
|
|
887
|
-
this._tooltipPosition.set({ x, y });
|
|
884
|
+
const containerEl = this.chartContainerEl()?.nativeElement;
|
|
885
|
+
if (!containerEl)
|
|
888
886
|
return;
|
|
889
|
-
|
|
890
|
-
const
|
|
891
|
-
|
|
892
|
-
const
|
|
893
|
-
|
|
894
|
-
x = x - tooltipRect.width - 15;
|
|
895
|
-
}
|
|
896
|
-
this._tooltipPosition.set({ x, y });
|
|
887
|
+
const rect = containerEl.getBoundingClientRect();
|
|
888
|
+
const tooltipEl = containerEl.querySelector('.chart-tooltip');
|
|
889
|
+
const tooltipRect = tooltipEl ? tooltipEl.getBoundingClientRect() : null;
|
|
890
|
+
const pos = computeTooltipPosition(rect, tooltipRect, event.clientX, event.clientY, this.TOOLTIP_GAP);
|
|
891
|
+
this._tooltipPosition.set(pos);
|
|
897
892
|
}
|
|
893
|
+
// computeTooltipPosition moved to shared chart utils
|
|
898
894
|
handlePointClick(event, dataPoint, series) {
|
|
899
895
|
this.pointClick.emit({
|
|
900
896
|
series: series, // series still refers to the full series data with originalIndex
|
|
@@ -918,14 +914,7 @@ class AXLineChartComponent extends NXComponent {
|
|
|
918
914
|
.style('position', 'absolute')
|
|
919
915
|
.style('left', '50%')
|
|
920
916
|
.style('top', '50%')
|
|
921
|
-
.style('transform', 'translate(-50%, -50%)')
|
|
922
|
-
.style('text-align', 'center')
|
|
923
|
-
.style('background-color', 'rgb(var(--ax-comp-line-chart-bg-color))')
|
|
924
|
-
.style('padding', '1.5rem')
|
|
925
|
-
.style('border-radius', '0.5rem')
|
|
926
|
-
.style('box-shadow', '0 2px 12px rgba(0, 0, 0, 0.08)')
|
|
927
|
-
.style('width', '80%')
|
|
928
|
-
.style('max-width', '300px');
|
|
917
|
+
.style('transform', 'translate(-50%, -50%)');
|
|
929
918
|
messageContainer
|
|
930
919
|
.append('div')
|
|
931
920
|
.attr('class', 'ax-line-chart-no-data-icon')
|
|
@@ -959,14 +948,7 @@ class AXLineChartComponent extends NXComponent {
|
|
|
959
948
|
.style('position', 'absolute')
|
|
960
949
|
.style('left', '50%')
|
|
961
950
|
.style('top', '50%')
|
|
962
|
-
.style('transform', 'translate(-50%, -50%)')
|
|
963
|
-
.style('text-align', 'center')
|
|
964
|
-
.style('background-color', 'rgb(var(--ax-comp-line-chart-bg-color))')
|
|
965
|
-
.style('padding', '1.5rem')
|
|
966
|
-
.style('border-radius', '0.5rem')
|
|
967
|
-
.style('box-shadow', '0 2px 12px rgba(0, 0, 0, 0.08)')
|
|
968
|
-
.style('width', '80%')
|
|
969
|
-
.style('max-width', '350px'); // Slightly wider for longer text
|
|
951
|
+
.style('transform', 'translate(-50%, -50%)');
|
|
970
952
|
messageContainer
|
|
971
953
|
.append('div')
|
|
972
954
|
.attr('class', 'ax-line-chart-all-hidden-icon')
|
|
@@ -1026,12 +1008,12 @@ class AXLineChartComponent extends NXComponent {
|
|
|
1026
1008
|
return this.d3.easeCubicOut;
|
|
1027
1009
|
}
|
|
1028
1010
|
}
|
|
1029
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1030
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.
|
|
1011
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXLineChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1012
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.3", type: AXLineChartComponent, isStandalone: true, selector: "ax-line-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClick: "pointClick" }, viewQueries: [{ propertyName: "chartContainerEl", first: true, predicate: ["chartContainer"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-line-chart\" #chartContainer>\n <!-- Shared tooltip component -->\n <ax-chart-tooltip\n [visible]=\"tooltipVisible()\"\n [position]=\"tooltipPosition()\"\n [data]=\"tooltipData()\"\n [showPercentage]=\"false\"\n ></ax-chart-tooltip>\n</div>\n", styles: ["ax-line-chart{display:block;width:100%;height:100%;min-height:200px;--ax-comp-line-chart-labels-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-line-chart-axis-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-line-chart-grid-lines-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-line-chart-bg-color: 0, 0, 0, 0;--ax-comp-line-chart-text-color: var(--ax-sys-color-on-lightest-surface)}ax-line-chart .ax-line-chart{width:100%;height:100%;position:relative;display:flex;align-items:center;justify-content:center;border-radius:.5rem;overflow:hidden;color:rgba(var(--ax-comp-line-chart-text-color));background-color:rgb(var(--ax-comp-line-chart-bg-color))}ax-line-chart .ax-line-chart svg{width:100%;height:100%;max-width:100%;max-height:100%;overflow:visible}ax-line-chart .ax-line-chart svg g:has(text){font-family:inherit}ax-line-chart .ax-line-chart-no-data-message{text-align:center;background-color:rgb(var(--ax-comp-line-chart-bg-color));padding:1.5rem;border-radius:.5rem;border:1px solid rgba(var(--ax-sys-color-surface));width:80%;max-width:300px}ax-line-chart .ax-line-chart-no-data-message .ax-line-chart-no-data-icon{opacity:.6;margin-bottom:.75rem}ax-line-chart .ax-line-chart-no-data-message .ax-line-chart-no-data-text{font-size:1rem;font-weight:600;margin-bottom:.5rem}ax-line-chart .ax-line-chart-no-data-message .ax-line-chart-no-data-help{font-size:.8rem;opacity:.6}\n"], dependencies: [{ kind: "component", type: AXChartTooltipComponent, selector: "ax-chart-tooltip", inputs: ["data", "position", "visible", "showPercentage", "style"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1031
1013
|
}
|
|
1032
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1014
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXLineChartComponent, decorators: [{
|
|
1033
1015
|
type: Component,
|
|
1034
|
-
args: [{ selector: 'ax-line-chart', standalone: true, encapsulation: ViewEncapsulation.None, imports: [AXChartTooltipComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ax-line-chart\" #chartContainer>\n <!-- Shared tooltip component -->\n <ax-chart-tooltip\n [visible]=\"tooltipVisible()\"\n [position]=\"tooltipPosition()\"\n [data]=\"tooltipData()\"\n [showPercentage]=\"false\"\n ></ax-chart-tooltip>\n</div>\n", styles: ["ax-line-chart{display:block;width:100%;height:100%;min-height:200px;--ax-comp-line-chart-labels-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-line-chart-axis-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-line-chart-grid-lines-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-line-chart-bg-color:
|
|
1016
|
+
args: [{ selector: 'ax-line-chart', standalone: true, encapsulation: ViewEncapsulation.None, imports: [AXChartTooltipComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ax-line-chart\" #chartContainer>\n <!-- Shared tooltip component -->\n <ax-chart-tooltip\n [visible]=\"tooltipVisible()\"\n [position]=\"tooltipPosition()\"\n [data]=\"tooltipData()\"\n [showPercentage]=\"false\"\n ></ax-chart-tooltip>\n</div>\n", styles: ["ax-line-chart{display:block;width:100%;height:100%;min-height:200px;--ax-comp-line-chart-labels-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-line-chart-axis-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-line-chart-grid-lines-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-line-chart-bg-color: 0, 0, 0, 0;--ax-comp-line-chart-text-color: var(--ax-sys-color-on-lightest-surface)}ax-line-chart .ax-line-chart{width:100%;height:100%;position:relative;display:flex;align-items:center;justify-content:center;border-radius:.5rem;overflow:hidden;color:rgba(var(--ax-comp-line-chart-text-color));background-color:rgb(var(--ax-comp-line-chart-bg-color))}ax-line-chart .ax-line-chart svg{width:100%;height:100%;max-width:100%;max-height:100%;overflow:visible}ax-line-chart .ax-line-chart svg g:has(text){font-family:inherit}ax-line-chart .ax-line-chart-no-data-message{text-align:center;background-color:rgb(var(--ax-comp-line-chart-bg-color));padding:1.5rem;border-radius:.5rem;border:1px solid rgba(var(--ax-sys-color-surface));width:80%;max-width:300px}ax-line-chart .ax-line-chart-no-data-message .ax-line-chart-no-data-icon{opacity:.6;margin-bottom:.75rem}ax-line-chart .ax-line-chart-no-data-message .ax-line-chart-no-data-text{font-size:1rem;font-weight:600;margin-bottom:.5rem}ax-line-chart .ax-line-chart-no-data-message .ax-line-chart-no-data-help{font-size:.8rem;opacity:.6}\n"] }]
|
|
1035
1017
|
}] });
|
|
1036
1018
|
|
|
1037
1019
|
/**
|