@acorex/charts 21.1.0-next.1 → 22.0.0-next.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/fesm2022/acorex-charts-bar-chart.mjs +33 -19
- package/fesm2022/acorex-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-chart-legend.mjs +21 -13
- package/fesm2022/acorex-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/acorex-charts-chart-tooltip.mjs +17 -11
- package/fesm2022/acorex-charts-chart-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-charts-donut-chart.mjs +41 -21
- package/fesm2022/acorex-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-funnel-chart.mjs +25 -15
- package/fesm2022/acorex-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-gauge-chart.mjs +123 -18
- package/fesm2022/acorex-charts-gauge-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-heatmap-chart.mjs +25 -15
- package/fesm2022/acorex-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-hierarchy-chart.mjs +38 -21
- package/fesm2022/acorex-charts-hierarchy-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-line-chart.mjs +33 -33
- package/fesm2022/acorex-charts-line-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts.mjs +5 -4
- package/fesm2022/acorex-charts.mjs.map +1 -1
- package/package.json +1 -1
- package/types/acorex-charts-gauge-chart.d.ts +23 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AX_CHART_DEFAULT_MESSAGES, AXChartComponent, AX_CHART_COLOR_PALETTE, mergeChartOptions, mergeChartMessages, resolveBarWidthFraction, formatLargeNumber, getEasingFunction, renderChartEmptyMessage, getChartColor } from '@acorex/charts';
|
|
2
2
|
import { AXChartTooltipComponent } from '@acorex/charts/chart-tooltip';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, input, output, viewChild, signal, inject, computed, afterNextRender, effect,
|
|
4
|
+
import { InjectionToken, input, output, viewChild, signal, inject, computed, afterNextRender, effect, ViewEncapsulation, Component } from '@angular/core';
|
|
5
5
|
|
|
6
6
|
const AXBarChartDefaultConfig = {
|
|
7
7
|
showXAxis: true,
|
|
@@ -41,14 +41,17 @@ function barChartConfig(config = {}) {
|
|
|
41
41
|
class AXBarChartComponent extends AXChartComponent {
|
|
42
42
|
// Inputs
|
|
43
43
|
/** Chart data input */
|
|
44
|
-
data = input([],
|
|
44
|
+
data = input([], /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
45
46
|
/** Chart options input */
|
|
46
|
-
options = input({},
|
|
47
|
+
options = input({}, /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
47
49
|
// Outputs
|
|
48
50
|
/** Emitted when a bar is clicked */
|
|
49
51
|
barClick = output();
|
|
50
52
|
// Chart container reference
|
|
51
|
-
chartContainerEl = viewChild.required('chartContainer'
|
|
53
|
+
chartContainerEl = viewChild.required('chartContainer', /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "chartContainerEl" }] : /* istanbul ignore next */ []));
|
|
52
55
|
// D3 reference - loaded asynchronously
|
|
53
56
|
d3;
|
|
54
57
|
// Chart elements - using proper D3 types
|
|
@@ -102,21 +105,27 @@ class AXBarChartComponent extends AXChartComponent {
|
|
|
102
105
|
MANY_ITEMS_THRESHOLD = 20;
|
|
103
106
|
VERY_MANY_ITEMS_THRESHOLD = 50;
|
|
104
107
|
// Animation state
|
|
105
|
-
_initialAnimationComplete = signal(false,
|
|
108
|
+
_initialAnimationComplete = signal(false, /* @ts-ignore */
|
|
109
|
+
...(ngDevMode ? [{ debugName: "_initialAnimationComplete" }] : /* istanbul ignore next */ []));
|
|
106
110
|
// Tooltip state
|
|
107
|
-
_tooltipVisible = signal(false,
|
|
108
|
-
|
|
111
|
+
_tooltipVisible = signal(false, /* @ts-ignore */
|
|
112
|
+
...(ngDevMode ? [{ debugName: "_tooltipVisible" }] : /* istanbul ignore next */ []));
|
|
113
|
+
_tooltipPosition = signal({ x: 0, y: 0 }, /* @ts-ignore */
|
|
114
|
+
...(ngDevMode ? [{ debugName: "_tooltipPosition" }] : /* istanbul ignore next */ []));
|
|
109
115
|
_tooltipData = signal({
|
|
110
116
|
title: '',
|
|
111
117
|
value: '0',
|
|
112
118
|
percentage: '0%',
|
|
113
119
|
color: '',
|
|
114
|
-
},
|
|
120
|
+
}, /* @ts-ignore */
|
|
121
|
+
...(ngDevMode ? [{ debugName: "_tooltipData" }] : /* istanbul ignore next */ []));
|
|
115
122
|
_tooltipRafId = null;
|
|
116
123
|
_pendingTooltipCoords = null;
|
|
117
124
|
// Signals for component state
|
|
118
|
-
_initialized = signal(false,
|
|
119
|
-
|
|
125
|
+
_initialized = signal(false, /* @ts-ignore */
|
|
126
|
+
...(ngDevMode ? [{ debugName: "_initialized" }] : /* istanbul ignore next */ []));
|
|
127
|
+
_rendered = signal(false, /* @ts-ignore */
|
|
128
|
+
...(ngDevMode ? [{ debugName: "_rendered" }] : /* istanbul ignore next */ []));
|
|
120
129
|
// Tooltip accessors
|
|
121
130
|
tooltipVisible = this._tooltipVisible.asReadonly();
|
|
122
131
|
tooltipPosition = this._tooltipPosition.asReadonly();
|
|
@@ -128,9 +137,11 @@ class AXBarChartComponent extends AXChartComponent {
|
|
|
128
137
|
// Inject AXPlatform
|
|
129
138
|
// Removed unused AXPlatform injection
|
|
130
139
|
// Configuration with defaults
|
|
131
|
-
effectiveOptions = computed(() => mergeChartOptions(this.configToken, this.options()),
|
|
140
|
+
effectiveOptions = computed(() => mergeChartOptions(this.configToken, this.options()), /* @ts-ignore */
|
|
141
|
+
...(ngDevMode ? [{ debugName: "effectiveOptions" }] : /* istanbul ignore next */ []));
|
|
132
142
|
// Messages with defaults
|
|
133
|
-
effectiveMessages = computed(() => mergeChartMessages(this.configToken.messages, this.options()?.messages),
|
|
143
|
+
effectiveMessages = computed(() => mergeChartMessages(this.configToken.messages, this.options()?.messages), /* @ts-ignore */
|
|
144
|
+
...(ngDevMode ? [{ debugName: "effectiveMessages" }] : /* istanbul ignore next */ []));
|
|
134
145
|
// Track hidden bars and series
|
|
135
146
|
hiddenBars = new Set();
|
|
136
147
|
hiddenSeries = new Set();
|
|
@@ -138,14 +149,16 @@ class AXBarChartComponent extends AXChartComponent {
|
|
|
138
149
|
isClusteredMode = computed(() => {
|
|
139
150
|
const value = this.data();
|
|
140
151
|
return Array.isArray(value) && value.length > 0 && 'chartData' in value[0];
|
|
141
|
-
},
|
|
152
|
+
}, /* @ts-ignore */
|
|
153
|
+
...(ngDevMode ? [{ debugName: "isClusteredMode" }] : /* istanbul ignore next */ []));
|
|
142
154
|
visibleData = computed(() => {
|
|
143
155
|
const value = this.data() || [];
|
|
144
156
|
if (this.isClusteredMode()) {
|
|
145
157
|
return value;
|
|
146
158
|
}
|
|
147
159
|
return value.filter((d) => !this.hiddenBars.has(d.id));
|
|
148
|
-
},
|
|
160
|
+
}, /* @ts-ignore */
|
|
161
|
+
...(ngDevMode ? [{ debugName: "visibleData" }] : /* istanbul ignore next */ []));
|
|
149
162
|
hasVisibleData = computed(() => {
|
|
150
163
|
const value = this.data();
|
|
151
164
|
if (!Array.isArray(value) || value.length === 0)
|
|
@@ -157,7 +170,8 @@ class AXBarChartComponent extends AXChartComponent {
|
|
|
157
170
|
return groups.some((g) => visibleSeries.some((label) => !!g.chartData.find((item) => item.label === label)));
|
|
158
171
|
}
|
|
159
172
|
return value.some((d) => !this.hiddenBars.has(d.id));
|
|
160
|
-
},
|
|
173
|
+
}, /* @ts-ignore */
|
|
174
|
+
...(ngDevMode ? [{ debugName: "hasVisibleData" }] : /* istanbul ignore next */ []));
|
|
161
175
|
// Type guard helper
|
|
162
176
|
isClusteredData(value) {
|
|
163
177
|
return Array.isArray(value) && value.length > 0 && 'chartData' in value[0];
|
|
@@ -1313,12 +1327,12 @@ class AXBarChartComponent extends AXChartComponent {
|
|
|
1313
1327
|
this.createXAxisTitle(axesGroup, options.xAxisLabel, tickAreaHeight, gapBelowTicks);
|
|
1314
1328
|
}
|
|
1315
1329
|
}
|
|
1316
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1317
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
1330
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXBarChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1331
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: AXBarChartComponent, isStandalone: true, selector: "ax-bar-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: { barClick: "barClick" }, viewQueries: [{ propertyName: "chartContainerEl", first: true, predicate: ["chartContainer"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-bar-chart\" role=\"img\" #chartContainer>\n <!-- Shared tooltip component -->\n <ax-chart-tooltip\n [visible]=\"tooltipVisible()\"\n [position]=\"tooltipPosition()\"\n [data]=\"tooltipData()\"\n [showPercentage]=\"true\"\n ></ax-chart-tooltip>\n</div>\n", styles: ["@reference \"../../../../styles/themes/default.css\";@import \"../../../src/lib/chart-empty-state.css\";@layer components{ax-bar-chart{@apply box-border block h-full w-full;min-height:clamp(220px,38vw,360px);--ax-comp-bar-chart-axis-label-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bar-chart-labels-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bar-chart-data-labels-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bar-chart-grid-lines-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bar-chart-bg-color: 0, 0, 0, 0}ax-bar-chart .ax-bar-chart{@apply relative box-border h-full min-h-0 w-full overflow-hidden;background-color:rgba(var(--ax-comp-bar-chart-bg-color))}ax-bar-chart .ax-bar-chart svg{@apply block h-full max-h-full w-full max-w-full;}ax-bar-chart .ax-bar-chart svg g:has(text){font-family:inherit}ax-bar-chart .ax-bar-chart .ax-bar-chart-data-label{@apply pointer-events-none select-none;}ax-bar-chart .ax-bar-chart .ax-bar-chart-data-label[data-inside-bar=true]{fill:#fff;font-weight:600;text-shadow:0 0 2px rgba(0,0,0,.3)}}\n"], dependencies: [{ kind: "component", type: AXChartTooltipComponent, selector: "ax-chart-tooltip", inputs: ["data", "position", "visible", "showPercentage", "style"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1318
1332
|
}
|
|
1319
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1333
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXBarChartComponent, decorators: [{
|
|
1320
1334
|
type: Component,
|
|
1321
|
-
args: [{ selector: 'ax-bar-chart', encapsulation: ViewEncapsulation.None, imports: [AXChartTooltipComponent],
|
|
1335
|
+
args: [{ selector: 'ax-bar-chart', encapsulation: ViewEncapsulation.None, imports: [AXChartTooltipComponent], template: "<div class=\"ax-bar-chart\" role=\"img\" #chartContainer>\n <!-- Shared tooltip component -->\n <ax-chart-tooltip\n [visible]=\"tooltipVisible()\"\n [position]=\"tooltipPosition()\"\n [data]=\"tooltipData()\"\n [showPercentage]=\"true\"\n ></ax-chart-tooltip>\n</div>\n", styles: ["@reference \"../../../../styles/themes/default.css\";@import \"../../../src/lib/chart-empty-state.css\";@layer components{ax-bar-chart{@apply box-border block h-full w-full;min-height:clamp(220px,38vw,360px);--ax-comp-bar-chart-axis-label-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bar-chart-labels-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bar-chart-data-labels-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bar-chart-grid-lines-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-bar-chart-bg-color: 0, 0, 0, 0}ax-bar-chart .ax-bar-chart{@apply relative box-border h-full min-h-0 w-full overflow-hidden;background-color:rgba(var(--ax-comp-bar-chart-bg-color))}ax-bar-chart .ax-bar-chart svg{@apply block h-full max-h-full w-full max-w-full;}ax-bar-chart .ax-bar-chart svg g:has(text){font-family:inherit}ax-bar-chart .ax-bar-chart .ax-bar-chart-data-label{@apply pointer-events-none select-none;}ax-bar-chart .ax-bar-chart .ax-bar-chart-data-label[data-inside-bar=true]{fill:#fff;font-weight:600;text-shadow:0 0 2px rgba(0,0,0,.3)}}\n"] }]
|
|
1322
1336
|
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], barClick: [{ type: i0.Output, args: ["barClick"] }], chartContainerEl: [{ type: i0.ViewChild, args: ['chartContainer', { isSignal: true }] }] } });
|
|
1323
1337
|
|
|
1324
1338
|
/**
|