@praxisui/charts 8.0.0-beta.80 → 8.0.0-beta.81
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Inject, InjectionToken, input, booleanAttribute, output, viewChild, inject, ElementRef, DestroyRef, signal, computed, afterNextRender, effect, ChangeDetectionStrategy, Component, ViewChild, Input, ENVIRONMENT_INITIALIZER } from '@angular/core';
|
|
2
|
+
import { Injectable, Inject, InjectionToken, input, booleanAttribute, output, viewChild, inject, ElementRef, NgZone, DestroyRef, signal, computed, afterNextRender, effect, ChangeDetectionStrategy, Component, ViewChild, Input, ENVIRONMENT_INITIALIZER } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@praxisui/core';
|
|
4
4
|
import { buildApiUrl, API_URL, PraxisI18nService, SETTINGS_PANEL_BRIDGE, providePraxisI18n, SETTINGS_PANEL_DATA, ComponentMetadataRegistry, createDefaultTableConfig, AnalyticsStatsRequestBuilderService, DynamicWidgetPageComponent } from '@praxisui/core';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -801,6 +801,8 @@ use([
|
|
|
801
801
|
class EChartsEngineAdapter {
|
|
802
802
|
optionBuilder;
|
|
803
803
|
chart;
|
|
804
|
+
clickHost;
|
|
805
|
+
domClickHandler;
|
|
804
806
|
zrenderClickHandler;
|
|
805
807
|
lastSeriesClickAt = 0;
|
|
806
808
|
constructor(optionBuilder) {
|
|
@@ -828,6 +830,9 @@ class EChartsEngineAdapter {
|
|
|
828
830
|
if (zrender && this.zrenderClickHandler) {
|
|
829
831
|
zrender.off?.('click', this.zrenderClickHandler);
|
|
830
832
|
}
|
|
833
|
+
if (this.clickHost && this.domClickHandler) {
|
|
834
|
+
this.clickHost.removeEventListener('click', this.domClickHandler, true);
|
|
835
|
+
}
|
|
831
836
|
this.zrenderClickHandler = (event) => {
|
|
832
837
|
window.setTimeout(() => {
|
|
833
838
|
if (Date.now() - this.lastSeriesClickAt < 80) {
|
|
@@ -837,6 +842,22 @@ class EChartsEngineAdapter {
|
|
|
837
842
|
}, 0);
|
|
838
843
|
};
|
|
839
844
|
zrender?.on?.('click', this.zrenderClickHandler);
|
|
845
|
+
this.domClickHandler = (event) => {
|
|
846
|
+
window.setTimeout(() => {
|
|
847
|
+
if (Date.now() - this.lastSeriesClickAt < 80) {
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
const rect = host.getBoundingClientRect();
|
|
851
|
+
const offsetX = Number.isFinite(event.offsetX) ? event.offsetX : event.clientX - rect.left;
|
|
852
|
+
const offsetY = Number.isFinite(event.offsetY) ? event.offsetY : event.clientY - rect.top;
|
|
853
|
+
this.emitCategoryClickFromGrid({
|
|
854
|
+
offsetX,
|
|
855
|
+
offsetY,
|
|
856
|
+
}, payload);
|
|
857
|
+
}, 0);
|
|
858
|
+
};
|
|
859
|
+
host.addEventListener('click', this.domClickHandler, true);
|
|
860
|
+
this.clickHost = host;
|
|
840
861
|
}
|
|
841
862
|
resize() {
|
|
842
863
|
this.chart?.resize();
|
|
@@ -846,6 +867,11 @@ class EChartsEngineAdapter {
|
|
|
846
867
|
if (zrender && this.zrenderClickHandler) {
|
|
847
868
|
zrender.off?.('click', this.zrenderClickHandler);
|
|
848
869
|
}
|
|
870
|
+
if (this.clickHost && this.domClickHandler) {
|
|
871
|
+
this.clickHost.removeEventListener('click', this.domClickHandler, true);
|
|
872
|
+
}
|
|
873
|
+
this.clickHost = undefined;
|
|
874
|
+
this.domClickHandler = undefined;
|
|
849
875
|
this.zrenderClickHandler = undefined;
|
|
850
876
|
this.chart?.dispose();
|
|
851
877
|
this.chart = undefined;
|
|
@@ -2040,6 +2066,7 @@ class PraxisChartComponent {
|
|
|
2040
2066
|
canonicalMapper = inject(PraxisChartCanonicalContractMapperService);
|
|
2041
2067
|
statsApi = inject(PraxisChartStatsApiService);
|
|
2042
2068
|
i18n = inject(PraxisI18nService);
|
|
2069
|
+
ngZone = inject(NgZone);
|
|
2043
2070
|
settingsPanel = inject(SETTINGS_PANEL_BRIDGE, { optional: true });
|
|
2044
2071
|
destroyRef = inject(DestroyRef);
|
|
2045
2072
|
resizeObserver = signal(null, ...(ngDevMode ? [{ debugName: "resizeObserver" }] : /* istanbul ignore next */ []));
|
|
@@ -2323,7 +2350,7 @@ class PraxisChartComponent {
|
|
|
2323
2350
|
this.engine.render(host, {
|
|
2324
2351
|
config: this.renderConfig(),
|
|
2325
2352
|
data: this.resolvedData(),
|
|
2326
|
-
onPointClick: (event) => this.handlePointClick(event),
|
|
2353
|
+
onPointClick: (event) => this.ngZone.run(() => this.handlePointClick(event)),
|
|
2327
2354
|
});
|
|
2328
2355
|
});
|
|
2329
2356
|
this.destroyRef.onDestroy(() => {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/charts",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.81",
|
|
4
4
|
"description": "Metadata-driven charts library for Praxis UI Angular with engine adapters and Apache ECharts as the initial renderer.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
7
7
|
"@angular/core": "^21.0.0",
|
|
8
|
-
"@praxisui/core": "^8.0.0-beta.
|
|
8
|
+
"@praxisui/core": "^8.0.0-beta.81",
|
|
9
9
|
"@angular/forms": "^21.0.0",
|
|
10
10
|
"@angular/material": "^21.0.0",
|
|
11
|
-
"@praxisui/table": "^8.0.0-beta.
|
|
11
|
+
"@praxisui/table": "^8.0.0-beta.81",
|
|
12
12
|
"rxjs": "~7.8.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
@@ -464,6 +464,7 @@ declare class PraxisChartComponent {
|
|
|
464
464
|
private readonly canonicalMapper;
|
|
465
465
|
private readonly statsApi;
|
|
466
466
|
private readonly i18n;
|
|
467
|
+
private readonly ngZone;
|
|
467
468
|
private readonly settingsPanel;
|
|
468
469
|
private readonly destroyRef;
|
|
469
470
|
private readonly resizeObserver;
|