@acorex/charts 22.0.0-next.2 → 22.0.0-next.21
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 +20 -50
- package/fesm2022/acorex-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-chart-legend.mjs +16 -11
- package/fesm2022/acorex-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/acorex-charts-chart-tooltip.mjs +8 -7
- package/fesm2022/acorex-charts-chart-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-charts-donut-chart.mjs +19 -10
- package/fesm2022/acorex-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-funnel-chart.mjs +40 -20
- package/fesm2022/acorex-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-gauge-chart.mjs +13 -14
- package/fesm2022/acorex-charts-gauge-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-heatmap-chart.mjs +36 -20
- package/fesm2022/acorex-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-hierarchy-chart.mjs +25 -64
- package/fesm2022/acorex-charts-hierarchy-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-line-chart.mjs +21 -14
- package/fesm2022/acorex-charts-line-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts.mjs +29 -25
- package/fesm2022/acorex-charts.mjs.map +1 -1
- package/package.json +1 -1
- package/types/acorex-charts-bar-chart.d.ts +4 -4
- package/types/acorex-charts-chart-legend.d.ts +7 -1
- package/types/acorex-charts-donut-chart.d.ts +4 -0
- package/types/acorex-charts-funnel-chart.d.ts +3 -4
- package/types/acorex-charts-gauge-chart.d.ts +1 -0
- package/types/acorex-charts-heatmap-chart.d.ts +3 -2
- package/types/acorex-charts-hierarchy-chart.d.ts +0 -8
- package/types/acorex-charts-line-chart.d.ts +4 -0
- package/types/acorex-charts.d.ts +4 -3
|
@@ -90,6 +90,9 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
90
90
|
_rendered = signal(false, /* @ts-ignore */
|
|
91
91
|
...(ngDevMode ? [{ debugName: "_rendered" }] : /* istanbul ignore next */ []));
|
|
92
92
|
hiddenSeries = new Set();
|
|
93
|
+
_legendStateVersion = signal(0, /* @ts-ignore */
|
|
94
|
+
...(ngDevMode ? [{ debugName: "_legendStateVersion" }] : /* istanbul ignore next */ []));
|
|
95
|
+
legendStateVersion = this._legendStateVersion.asReadonly();
|
|
93
96
|
_fullNormalizedData = [];
|
|
94
97
|
tooltipVisible = this._tooltipVisible.asReadonly();
|
|
95
98
|
tooltipPosition = this._tooltipPosition.asReadonly();
|
|
@@ -416,9 +419,13 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
416
419
|
this.effectiveOptions();
|
|
417
420
|
if (this._rendered()) {
|
|
418
421
|
this.updateChart();
|
|
422
|
+
this.bumpLegendState();
|
|
419
423
|
}
|
|
420
424
|
}, /* @ts-ignore */
|
|
421
425
|
...(ngDevMode ? [{ debugName: "#effect" }] : /* istanbul ignore next */ []));
|
|
426
|
+
bumpLegendState() {
|
|
427
|
+
this._legendStateVersion.update((version) => version + 1);
|
|
428
|
+
}
|
|
422
429
|
ngAfterViewInit() {
|
|
423
430
|
this._initialized.set(true);
|
|
424
431
|
if (this.d3 && this.chartContainerEl()) {
|
|
@@ -427,6 +434,7 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
427
434
|
}
|
|
428
435
|
}
|
|
429
436
|
ngOnDestroy() {
|
|
437
|
+
this.cancelTooltipPosition();
|
|
430
438
|
this.cleanupChart();
|
|
431
439
|
}
|
|
432
440
|
// AXChartLegendCompatible Implementation
|
|
@@ -489,6 +497,7 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
489
497
|
this.hiddenSeries.add(id);
|
|
490
498
|
}
|
|
491
499
|
this.updateChart();
|
|
500
|
+
this.bumpLegendState();
|
|
492
501
|
return !this.hiddenSeries.has(id);
|
|
493
502
|
}
|
|
494
503
|
async loadD3() {
|
|
@@ -541,11 +550,7 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
541
550
|
this.createChart();
|
|
542
551
|
}
|
|
543
552
|
cleanupChart() {
|
|
544
|
-
|
|
545
|
-
cancelAnimationFrame(this._tooltipRafId);
|
|
546
|
-
this._tooltipRafId = null;
|
|
547
|
-
}
|
|
548
|
-
this._pendingTooltipCoords = null;
|
|
553
|
+
this.cancelTooltipPosition();
|
|
549
554
|
if (this.svg) {
|
|
550
555
|
this.d3
|
|
551
556
|
?.select(this.chartContainerEl()?.nativeElement)
|
|
@@ -1197,16 +1202,18 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
1197
1202
|
return;
|
|
1198
1203
|
}
|
|
1199
1204
|
this._tooltipRafId = null;
|
|
1200
|
-
const rect = containerEl.getBoundingClientRect();
|
|
1201
1205
|
const tooltipRect = tooltipEl ? tooltipEl.getBoundingClientRect() : null;
|
|
1202
|
-
const pos = computeTooltipPosition(
|
|
1203
|
-
|
|
1204
|
-
if (prev.x !== pos.x || prev.y !== pos.y) {
|
|
1205
|
-
this._tooltipPosition.set(pos);
|
|
1206
|
-
}
|
|
1206
|
+
const pos = computeTooltipPosition(containerEl, tooltipRect, coords.x, coords.y, this.TOOLTIP_GAP);
|
|
1207
|
+
this._tooltipPosition.set(pos);
|
|
1207
1208
|
});
|
|
1208
1209
|
}
|
|
1209
|
-
|
|
1210
|
+
cancelTooltipPosition() {
|
|
1211
|
+
if (this._tooltipRafId != null) {
|
|
1212
|
+
cancelAnimationFrame(this._tooltipRafId);
|
|
1213
|
+
this._tooltipRafId = null;
|
|
1214
|
+
}
|
|
1215
|
+
this._pendingTooltipCoords = null;
|
|
1216
|
+
}
|
|
1210
1217
|
handlePointClick(event, dataPoint, series) {
|
|
1211
1218
|
this.pointClick.emit({
|
|
1212
1219
|
series: series, // series still refers to the full series data with originalIndex
|
|
@@ -1249,11 +1256,11 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
1249
1256
|
}
|
|
1250
1257
|
}
|
|
1251
1258
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLineChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1252
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", 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: ["@
|
|
1259
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", 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: ["@layer properties;@layer components{.ax-chart-empty{pointer-events:none;position:absolute;inset:calc(var(--spacing, .25rem) * 0);z-index:1;box-sizing:border-box;display:flex;align-items:center;justify-content:center;padding:calc(var(--spacing, .25rem) * 4);color:rgba(var(--ax-sys-color-on-lightest-surface))}.ax-chart-empty__card{box-sizing:border-box;max-width:300px;border-radius:var(--radius-lg, .5rem);padding:calc(var(--spacing, .25rem) * 6);text-align:center;width:80%;border:1px solid rgba(var(--ax-sys-color-border-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));color:rgba(var(--ax-sys-color-on-lightest-surface))}.ax-chart-empty__icon{margin-bottom:calc(var(--spacing, .25rem) * 3);opacity:60%}.ax-chart-empty__title{margin-bottom:calc(var(--spacing, .25rem) * 2);font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);color:rgba(var(--ax-sys-color-on-lightest-surface))}.ax-chart-empty__help{font-size:.8rem;opacity:60%;color:rgba(var(--ax-sys-color-on-lightest-surface))}}@layer components{ax-line-chart{box-sizing:border-box;display:block;height:100%;width:100%;min-height:clamp(220px,38vw,360px);--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{position:relative;box-sizing:border-box;height:100%;min-height:calc(var(--spacing, .25rem) * 0);width:100%;overflow:hidden;border-radius:var(--radius-lg, .5rem);padding:clamp(.25rem,.6vw,.5rem);contain:layout style;color:rgba(var(--ax-comp-line-chart-text-color));background-color:rgba(var(--ax-comp-line-chart-bg-color))}ax-line-chart .ax-line-chart svg{display:block;height:100%;max-height:100%;width:100%;max-width:100%;flex-shrink:0;overflow:hidden}ax-line-chart .ax-line-chart svg g:has(text){font-family:inherit}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXChartTooltipComponent, selector: "ax-chart-tooltip", inputs: ["data", "position", "visible", "showPercentage", "style"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1253
1260
|
}
|
|
1254
1261
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXLineChartComponent, decorators: [{
|
|
1255
1262
|
type: Component,
|
|
1256
|
-
args: [{ selector: 'ax-line-chart', encapsulation: ViewEncapsulation.None, imports: [AXChartTooltipComponent], 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: ["@
|
|
1263
|
+
args: [{ selector: 'ax-line-chart', encapsulation: ViewEncapsulation.None, imports: [AXChartTooltipComponent], 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: ["@layer properties;@layer components{.ax-chart-empty{pointer-events:none;position:absolute;inset:calc(var(--spacing, .25rem) * 0);z-index:1;box-sizing:border-box;display:flex;align-items:center;justify-content:center;padding:calc(var(--spacing, .25rem) * 4);color:rgba(var(--ax-sys-color-on-lightest-surface))}.ax-chart-empty__card{box-sizing:border-box;max-width:300px;border-radius:var(--radius-lg, .5rem);padding:calc(var(--spacing, .25rem) * 6);text-align:center;width:80%;border:1px solid rgba(var(--ax-sys-color-border-surface));background-color:rgba(var(--ax-sys-color-lightest-surface));color:rgba(var(--ax-sys-color-on-lightest-surface))}.ax-chart-empty__icon{margin-bottom:calc(var(--spacing, .25rem) * 3);opacity:60%}.ax-chart-empty__title{margin-bottom:calc(var(--spacing, .25rem) * 2);font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);color:rgba(var(--ax-sys-color-on-lightest-surface))}.ax-chart-empty__help{font-size:.8rem;opacity:60%;color:rgba(var(--ax-sys-color-on-lightest-surface))}}@layer components{ax-line-chart{box-sizing:border-box;display:block;height:100%;width:100%;min-height:clamp(220px,38vw,360px);--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{position:relative;box-sizing:border-box;height:100%;min-height:calc(var(--spacing, .25rem) * 0);width:100%;overflow:hidden;border-radius:var(--radius-lg, .5rem);padding:clamp(.25rem,.6vw,.5rem);contain:layout style;color:rgba(var(--ax-comp-line-chart-text-color));background-color:rgba(var(--ax-comp-line-chart-bg-color))}ax-line-chart .ax-line-chart svg{display:block;height:100%;max-height:100%;width:100%;max-width:100%;flex-shrink:0;overflow:hidden}ax-line-chart .ax-line-chart svg g:has(text){font-family:inherit}}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
1257
1264
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], pointClick: [{ type: i0.Output, args: ["pointClick"] }], chartContainerEl: [{ type: i0.ViewChild, args: ['chartContainer', { isSignal: true }] }] } });
|
|
1258
1265
|
|
|
1259
1266
|
/**
|