@praxisui/charts 10.0.0-rc.63 → 10.0.0-rc.64

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,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-11-25T21:40:24.177Z",
3
+ "generatedAt": "2026-11-25T22:31:29.130Z",
4
4
  "packageName": "@praxisui/charts",
5
- "packageVersion": "10.0.0-rc.63",
5
+ "packageVersion": "10.0.0-rc.64",
6
6
  "sourceRegistry": "praxis-component-registry-ingestion",
7
7
  "sourceRegistryVersion": "1.0.0",
8
8
  "componentCount": 13,
@@ -31148,6 +31148,7 @@ class EChartsMicroSvgEngineService {
31148
31148
  engineId = 'echarts';
31149
31149
  optionBuilder = inject(EChartsMicroOptionBuilderService);
31150
31150
  logger = inject(LoggerService, { optional: true });
31151
+ ngZone = inject(NgZone, { optional: true });
31151
31152
  instancePool = new Map();
31152
31153
  svgCache = new Map();
31153
31154
  supports(kind, _surface) {
@@ -31176,21 +31177,34 @@ class EChartsMicroSvgEngineService {
31176
31177
  else {
31177
31178
  let rawSvg = '';
31178
31179
  let instance = null;
31179
- try {
31180
- instance = this.getOrCreateInstance(width, height);
31181
- instance.setOption(option, { notMerge: true, lazyUpdate: false });
31182
- rawSvg = instance.renderToSVGString();
31183
- }
31184
- catch (error) {
31180
+ let hasRenderError = false;
31181
+ let renderError;
31182
+ this.runOutsideAngular(() => {
31183
+ try {
31184
+ instance = this.getOrCreateInstance(width, height);
31185
+ instance.setOption(option, { notMerge: true, lazyUpdate: false });
31186
+ rawSvg = instance.renderToSVGString();
31187
+ }
31188
+ catch (error) {
31189
+ hasRenderError = true;
31190
+ renderError = error;
31191
+ }
31192
+ finally {
31193
+ this.stopZRenderAnimationLoop(instance);
31194
+ }
31195
+ });
31196
+ if (hasRenderError) {
31185
31197
  const poolKey = `${width}x${height}`;
31186
31198
  if (instance && this.instancePool.get(poolKey) === instance) {
31187
31199
  this.instancePool.delete(poolKey);
31188
- try {
31189
- instance.dispose();
31190
- }
31191
- catch {
31192
- // Ignore secondary disposal failures on a broken instance.
31193
- }
31200
+ this.runOutsideAngular(() => {
31201
+ try {
31202
+ instance?.dispose();
31203
+ }
31204
+ catch {
31205
+ // Ignore secondary disposal failures on a broken instance.
31206
+ }
31207
+ });
31194
31208
  }
31195
31209
  this.logger?.warnOnce(`Apache ECharts micro-SVG render failed for kind "${request.visualization.kind}". Falling back to primitive renderer.`, {
31196
31210
  dedupeKey: `echarts-micro:render-error:${request.visualization.kind}:${request.surface ?? 'default'}`,
@@ -31200,7 +31214,7 @@ class EChartsMicroSvgEngineService {
31200
31214
  surface: request.surface,
31201
31215
  width,
31202
31216
  height,
31203
- error: error instanceof Error ? error.message : String(error),
31217
+ error: renderError instanceof Error ? renderError.message : String(renderError),
31204
31218
  },
31205
31219
  });
31206
31220
  return null;
@@ -31224,12 +31238,33 @@ class EChartsMicroSvgEngineService {
31224
31238
  };
31225
31239
  }
31226
31240
  ngOnDestroy() {
31227
- for (const instance of this.instancePool.values()) {
31228
- instance.dispose();
31229
- }
31241
+ this.runOutsideAngular(() => {
31242
+ for (const instance of this.instancePool.values()) {
31243
+ this.stopZRenderAnimationLoop(instance);
31244
+ try {
31245
+ instance.dispose();
31246
+ }
31247
+ catch {
31248
+ // Ignore secondary disposal failures during teardown.
31249
+ }
31250
+ }
31251
+ });
31230
31252
  this.instancePool.clear();
31231
31253
  this.svgCache.clear();
31232
31254
  }
31255
+ runOutsideAngular(work) {
31256
+ return this.ngZone ? this.ngZone.runOutsideAngular(work) : work();
31257
+ }
31258
+ stopZRenderAnimationLoop(instance) {
31259
+ try {
31260
+ const animation = instance?.getZr?.()?.animation;
31261
+ animation?.clear?.();
31262
+ animation?.stop?.();
31263
+ }
31264
+ catch {
31265
+ // Ignore secondary cleanup failures on headless/disposed ZRender instances.
31266
+ }
31267
+ }
31233
31268
  getOrCreateInstance(width, height) {
31234
31269
  const key = `${width}x${height}`;
31235
31270
  const existing = this.instancePool.get(key);
@@ -31244,6 +31279,7 @@ class EChartsMicroSvgEngineService {
31244
31279
  if (oldestKey !== undefined) {
31245
31280
  const oldestInstance = this.instancePool.get(oldestKey);
31246
31281
  this.instancePool.delete(oldestKey);
31282
+ this.stopZRenderAnimationLoop(oldestInstance ?? null);
31247
31283
  oldestInstance?.dispose();
31248
31284
  }
31249
31285
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@praxisui/charts",
3
- "version": "10.0.0-rc.63",
3
+ "version": "10.0.0-rc.64",
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": "^10.0.0-rc.63",
8
+ "@praxisui/core": "^10.0.0-rc.64",
9
9
  "@angular/forms": "^21.0.0",
10
10
  "@angular/material": "^21.0.0",
11
- "@praxisui/table": "^10.0.0-rc.63",
11
+ "@praxisui/table": "^10.0.0-rc.64",
12
12
  "rxjs": "~7.8.0"
13
13
  },
14
14
  "dependencies": {
@@ -5889,11 +5889,14 @@ declare class EChartsMicroSvgEngineService implements PraxisMicroChartEngine, On
5889
5889
  readonly engineId = "echarts";
5890
5890
  private readonly optionBuilder;
5891
5891
  private readonly logger;
5892
+ private readonly ngZone;
5892
5893
  private readonly instancePool;
5893
5894
  private readonly svgCache;
5894
5895
  supports(kind: PraxisPresentationVisualizationKind, _surface?: PraxisPresentationVisualizationSurface | null): boolean;
5895
5896
  renderSvg(request: PraxisMicroChartRenderRequest): PraxisMicroChartRenderResult | null;
5896
5897
  ngOnDestroy(): void;
5898
+ private runOutsideAngular;
5899
+ private stopZRenderAnimationLoop;
5897
5900
  private getOrCreateInstance;
5898
5901
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EChartsMicroSvgEngineService, never>;
5899
5902
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<EChartsMicroSvgEngineService>;