chartgpu-angular 19.0.0 → 21.0.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.
@@ -5,11 +5,11 @@ import { ChartGPU, connectCharts, createPipelineCache } from 'chartgpu';
5
5
 
6
6
  class ChartGpuAngularComponent {
7
7
  destroyRef;
8
- options = input.required();
9
- gpuContext = input(null);
10
- theme = input(undefined);
11
- className = input();
12
- style = input();
8
+ options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
9
+ gpuContext = input(null, ...(ngDevMode ? [{ debugName: "gpuContext" }] : /* istanbul ignore next */ []));
10
+ theme = input(undefined, ...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
11
+ className = input(...(ngDevMode ? [undefined, { debugName: "className" }] : /* istanbul ignore next */ []));
12
+ style = input(...(ngDevMode ? [undefined, { debugName: "style" }] : /* istanbul ignore next */ []));
13
13
  ready = output();
14
14
  chartReady = output();
15
15
  chartDispose = output();
@@ -24,10 +24,10 @@ class ChartGpuAngularComponent {
24
24
  zoomRangeChange = output();
25
25
  deviceLost = output();
26
26
  chartError = output();
27
- host = viewChild('host');
28
- canvasHost = viewChild('canvasHost');
29
- chartInstance = signal(null);
30
- initializationError = signal(null);
27
+ host = viewChild('host', ...(ngDevMode ? [{ debugName: "host" }] : /* istanbul ignore next */ []));
28
+ canvasHost = viewChild('canvasHost', ...(ngDevMode ? [{ debugName: "canvasHost" }] : /* istanbul ignore next */ []));
29
+ chartInstance = signal(null, ...(ngDevMode ? [{ debugName: "chartInstance" }] : /* istanbul ignore next */ []));
30
+ initializationError = signal(null, ...(ngDevMode ? [{ debugName: "initializationError" }] : /* istanbul ignore next */ []));
31
31
  chartContainer;
32
32
  createdWithOptions;
33
33
  resizeTimeout;
@@ -253,8 +253,8 @@ class ChartGpuAngularComponent {
253
253
  this.chartContainer = undefined;
254
254
  this.createdWithOptions = undefined;
255
255
  }
256
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChartGpuAngularComponent, deps: [{ token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
257
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: ChartGpuAngularComponent, isStandalone: true, selector: "lib-chartgpu-angular", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, gpuContext: { classPropertyName: "gpuContext", publicName: "gpuContext", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ready: "ready", chartReady: "chartReady", chartDispose: "chartDispose", resize: "resize", click: "click", chartClick: "chartClick", mouseOver: "mouseOver", mouseOut: "mouseOut", crosshairMove: "crosshairMove", dataAppend: "dataAppend", zoomChange: "zoomChange", zoomRangeChange: "zoomRangeChange", deviceLost: "deviceLost", chartError: "chartError" }, host: { classAttribute: "chartgpu-angular" }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, isSignal: true }, { propertyName: "canvasHost", first: true, predicate: ["canvasHost"], descendants: true, isSignal: true }], ngImport: i0, template: `
256
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: ChartGpuAngularComponent, deps: [{ token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
257
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: ChartGpuAngularComponent, isStandalone: true, selector: "lib-chartgpu-angular", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, gpuContext: { classPropertyName: "gpuContext", publicName: "gpuContext", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ready: "ready", chartReady: "chartReady", chartDispose: "chartDispose", resize: "resize", click: "click", chartClick: "chartClick", mouseOver: "mouseOver", mouseOut: "mouseOut", crosshairMove: "crosshairMove", dataAppend: "dataAppend", zoomChange: "zoomChange", zoomRangeChange: "zoomRangeChange", deviceLost: "deviceLost", chartError: "chartError" }, host: { classAttribute: "chartgpu-angular" }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, isSignal: true }, { propertyName: "canvasHost", first: true, predicate: ["canvasHost"], descendants: true, isSignal: true }], ngImport: i0, template: `
258
258
  <div
259
259
  #host
260
260
  class="chartgpu-host"
@@ -269,7 +269,7 @@ class ChartGpuAngularComponent {
269
269
  </div>
270
270
  `, isInline: true, styles: [":host{display:block;width:100%;height:100%}.chartgpu-host{position:relative;width:100%;height:100%}.chartgpu-canvas-host{position:absolute;inset:0}.chartgpu-error{position:absolute;inset:0;display:grid;place-items:center;padding:1rem;text-align:center}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
271
271
  }
272
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChartGpuAngularComponent, decorators: [{
272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: ChartGpuAngularComponent, decorators: [{
273
273
  type: Component,
274
274
  args: [{ selector: 'lib-chartgpu-angular', standalone: true, imports: [NgStyle], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'chartgpu-angular' }, template: `
275
275
  <div
@@ -285,13 +285,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
285
285
  }
286
286
  </div>
287
287
  `, styles: [":host{display:block;width:100%;height:100%}.chartgpu-host{position:relative;width:100%;height:100%}.chartgpu-canvas-host{position:absolute;inset:0}.chartgpu-error{position:absolute;inset:0;display:grid;place-items:center;padding:1rem;text-align:center}\n"] }]
288
- }], ctorParameters: () => [{ type: i0.DestroyRef }] });
288
+ }], ctorParameters: () => [{ type: i0.DestroyRef }], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], gpuContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "gpuContext", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], ready: [{ type: i0.Output, args: ["ready"] }], chartReady: [{ type: i0.Output, args: ["chartReady"] }], chartDispose: [{ type: i0.Output, args: ["chartDispose"] }], resize: [{ type: i0.Output, args: ["resize"] }], click: [{ type: i0.Output, args: ["click"] }], chartClick: [{ type: i0.Output, args: ["chartClick"] }], mouseOver: [{ type: i0.Output, args: ["mouseOver"] }], mouseOut: [{ type: i0.Output, args: ["mouseOut"] }], crosshairMove: [{ type: i0.Output, args: ["crosshairMove"] }], dataAppend: [{ type: i0.Output, args: ["dataAppend"] }], zoomChange: [{ type: i0.Output, args: ["zoomChange"] }], zoomRangeChange: [{ type: i0.Output, args: ["zoomRangeChange"] }], deviceLost: [{ type: i0.Output, args: ["deviceLost"] }], chartError: [{ type: i0.Output, args: ["chartError"] }], host: [{ type: i0.ViewChild, args: ['host', { isSignal: true }] }], canvasHost: [{ type: i0.ViewChild, args: ['canvasHost', { isSignal: true }] }] } });
289
289
 
290
290
  class ChartgpuConnectChartsDirective {
291
- charts = input([], {
292
- alias: 'libChartgpuConnectCharts',
293
- });
294
- syncOptions = input();
291
+ charts = input([], { ...(ngDevMode ? { debugName: "charts" } : /* istanbul ignore next */ {}), alias: 'libChartgpuConnectCharts' });
292
+ syncOptions = input(...(ngDevMode ? [undefined, { debugName: "syncOptions" }] : /* istanbul ignore next */ []));
295
293
  connectionError = output();
296
294
  ids = new WeakMap();
297
295
  nextId = 1;
@@ -337,16 +335,16 @@ class ChartgpuConnectChartsDirective {
337
335
  }
338
336
  });
339
337
  }
340
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChartgpuConnectChartsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
341
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.25", type: ChartgpuConnectChartsDirective, isStandalone: true, selector: "[libChartgpuConnectCharts]", inputs: { charts: { classPropertyName: "charts", publicName: "libChartgpuConnectCharts", isSignal: true, isRequired: false, transformFunction: null }, syncOptions: { classPropertyName: "syncOptions", publicName: "syncOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { connectionError: "connectionError" }, ngImport: i0 });
338
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: ChartgpuConnectChartsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
339
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: ChartgpuConnectChartsDirective, isStandalone: true, selector: "[libChartgpuConnectCharts]", inputs: { charts: { classPropertyName: "charts", publicName: "libChartgpuConnectCharts", isSignal: true, isRequired: false, transformFunction: null }, syncOptions: { classPropertyName: "syncOptions", publicName: "syncOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { connectionError: "connectionError" }, ngImport: i0 });
342
340
  }
343
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChartgpuConnectChartsDirective, decorators: [{
341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: ChartgpuConnectChartsDirective, decorators: [{
344
342
  type: Directive,
345
343
  args: [{
346
344
  selector: '[libChartgpuConnectCharts]',
347
345
  standalone: true,
348
346
  }]
349
- }], ctorParameters: () => [] });
347
+ }], ctorParameters: () => [], propDecorators: { charts: [{ type: i0.Input, args: [{ isSignal: true, alias: "libChartgpuConnectCharts", required: false }] }], syncOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "syncOptions", required: false }] }], connectionError: [{ type: i0.Output, args: ["connectionError"] }] } });
350
348
 
351
349
  const INITIAL_STATE = {
352
350
  adapter: null,
@@ -361,7 +359,7 @@ const INITIAL_STATE = {
361
359
  * for the lifetime of the application.
362
360
  */
363
361
  class ChartgpuGPUContextService {
364
- state = signal(INITIAL_STATE);
362
+ state = signal(INITIAL_STATE, ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
365
363
  context = computed(() => {
366
364
  const state = this.state();
367
365
  if (!state.adapter || !state.device || !state.pipelineCache) {
@@ -372,7 +370,7 @@ class ChartgpuGPUContextService {
372
370
  device: state.device,
373
371
  pipelineCache: state.pipelineCache,
374
372
  };
375
- });
373
+ }, ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
376
374
  initialization;
377
375
  initialize() {
378
376
  if (!this.initialization) {
@@ -415,10 +413,10 @@ class ChartgpuGPUContextService {
415
413
  return state;
416
414
  }
417
415
  }
418
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChartgpuGPUContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
419
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChartgpuGPUContextService, providedIn: 'root' });
416
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: ChartgpuGPUContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
417
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: ChartgpuGPUContextService, providedIn: 'root' });
420
418
  }
421
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChartgpuGPUContextService, decorators: [{
419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: ChartgpuGPUContextService, decorators: [{
422
420
  type: Injectable,
423
421
  args: [{ providedIn: 'root' }]
424
422
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"chartgpu-angular.mjs","sources":["../../../projects/chartgpu-angular/src/lib/chartgpu-angular.component.ts","../../../projects/chartgpu-angular/src/lib/connect-charts.directive.ts","../../../projects/chartgpu-angular/src/lib/gpu-context.service.ts","../../../projects/chartgpu-angular/src/lib/gpu-context.provider.ts","../../../projects/chartgpu-angular/src/chartgpu-angular.ts"],"sourcesContent":["import { NgStyle } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n OnDestroy,\n afterNextRender,\n effect,\n input,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport {\n ChartGPU,\n type ChartGPUCrosshairMovePayload,\n type ChartGPUDeviceLostPayload,\n type ChartGPUEventPayload,\n type ChartGPUInstance,\n type ChartGPUZoomRangeChangePayload,\n type OHLCDataPoint,\n} from 'chartgpu';\nimport type {\n ChartgpuAppendDataOptions,\n ChartgpuCartesianSeriesData,\n ChartgpuChartHandle,\n ChartgpuClickEvent,\n ChartgpuDataAppendEvent,\n ChartgpuGPUContext,\n ChartgpuOptions,\n ChartgpuReadyEvent,\n ChartgpuResizeEvent,\n ChartgpuStyle,\n ChartgpuZoomChangeEvent,\n ChartgpuZoomRangeChangeEvent,\n} from './chartgpu-angular.types';\n\n@Component({\n selector: 'lib-chartgpu-angular',\n standalone: true,\n imports: [NgStyle],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'chartgpu-angular' },\n template: `\n <div\n #host\n class=\"chartgpu-host\"\n [class]=\"className() ?? ''\"\n [ngStyle]=\"style()\"\n (click)=\"emitClick($event)\"\n >\n <div #canvasHost class=\"chartgpu-canvas-host\"></div>\n @if (initializationError(); as error) {\n <div class=\"chartgpu-error\" role=\"alert\">{{ error.message }}</div>\n }\n </div>\n `,\n styles: [`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n .chartgpu-host {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .chartgpu-canvas-host {\n position: absolute;\n inset: 0;\n }\n\n .chartgpu-error {\n position: absolute;\n inset: 0;\n display: grid;\n place-items: center;\n padding: 1rem;\n text-align: center;\n }\n `],\n})\nexport class ChartGpuAngularComponent implements ChartgpuChartHandle, OnDestroy {\n readonly options = input.required<ChartgpuOptions>();\n readonly gpuContext = input<ChartgpuGPUContext | null>(null);\n readonly theme = input<ChartgpuOptions['theme'] | undefined>(undefined);\n readonly className = input<string | undefined>();\n readonly style = input<ChartgpuStyle | undefined>();\n\n readonly ready = output<ChartgpuReadyEvent>();\n readonly chartReady = output<ChartGPUInstance>();\n readonly chartDispose = output<void>();\n readonly resize = output<ChartgpuResizeEvent>();\n readonly click = output<ChartgpuClickEvent>();\n readonly chartClick = output<ChartGPUEventPayload>();\n readonly mouseOver = output<ChartGPUEventPayload>();\n readonly mouseOut = output<ChartGPUEventPayload>();\n readonly crosshairMove = output<ChartGPUCrosshairMovePayload>();\n readonly dataAppend = output<ChartgpuDataAppendEvent>();\n readonly zoomChange = output<ChartgpuZoomChangeEvent>();\n readonly zoomRangeChange = output<ChartgpuZoomRangeChangeEvent>();\n readonly deviceLost = output<ChartGPUDeviceLostPayload>();\n readonly chartError = output<Error>();\n\n readonly host = viewChild<ElementRef<HTMLDivElement>>('host');\n readonly canvasHost = viewChild<ElementRef<HTMLDivElement>>('canvasHost');\n\n private readonly chartInstance = signal<ChartGPUInstance | null>(null);\n readonly initializationError = signal<Error | null>(null);\n private chartContainer?: HTMLDivElement;\n private createdWithOptions?: {\n options: ChartgpuOptions;\n theme: ChartgpuOptions['theme'] | undefined;\n };\n private resizeTimeout?: ReturnType<typeof setTimeout>;\n private resizeObserver?: ResizeObserver;\n private removeChartListeners?: () => void;\n private destroying = false;\n\n constructor(private readonly destroyRef: DestroyRef) {\n this.destroyRef.onDestroy(() => {\n this.resizeObserver?.disconnect();\n if (this.resizeTimeout !== undefined) {\n clearTimeout(this.resizeTimeout);\n }\n this.disposeChart();\n });\n\n afterNextRender(() => {\n const container = this.host()?.nativeElement;\n if (container) {\n this.observeResize(container);\n }\n });\n\n effect(onCleanup => {\n const container = this.canvasHost()?.nativeElement;\n const options = this.options();\n const gpuContext = this.gpuContext();\n const theme = this.theme();\n\n this.initializationError.set(null);\n if (!container) {\n this.disposeChart();\n return;\n }\n if (typeof navigator === 'undefined' || !('gpu' in navigator)) {\n this.reportError(new Error('WebGPU not supported in this browser'));\n return;\n }\n\n if (untracked(() => this.chartInstance()) && this.chartContainer === container) {\n return;\n }\n\n let cancelled = false;\n let createdInstance: ChartGPUInstance | undefined;\n const initialOptions = this.getEffectiveOptions(options, theme);\n\n void (gpuContext\n ? ChartGPU.create(container, initialOptions, gpuContext)\n : ChartGPU.create(container, initialOptions)\n ).then(instance => {\n createdInstance = instance;\n if (cancelled) {\n instance.dispose();\n return;\n }\n\n try {\n const latest = untracked(() => ({\n options: this.options(),\n theme: this.theme(),\n }));\n if (latest.options !== options || latest.theme !== theme) {\n instance.setOption(this.getEffectiveOptions(latest.options, latest.theme));\n }\n\n this.createdWithOptions = latest;\n this.chartContainer = container;\n this.chartInstance.set(instance);\n this.removeChartListeners = this.listenToChart(instance);\n this.ready.emit({ container });\n this.chartReady.emit(instance);\n\n const range = instance.getZoomRange();\n if (range) {\n this.emitZoomRange(range);\n }\n } catch (cause: unknown) {\n instance.dispose();\n throw cause;\n }\n }).catch((cause: unknown) => {\n if (cancelled) {\n return;\n }\n if (createdInstance && this.chartInstance() !== createdInstance && !createdInstance.disposed) {\n createdInstance.dispose();\n }\n this.reportError(cause);\n });\n\n onCleanup(() => {\n cancelled = true;\n if (this.chartContainer === container) {\n this.disposeChart();\n }\n });\n }, { allowSignalWrites: true });\n\n effect(() => {\n const options = this.options();\n const theme = this.theme();\n const instance = this.chartInstance();\n if (!instance || instance.disposed) {\n return;\n }\n\n if (this.createdWithOptions?.options === options && this.createdWithOptions.theme === theme) {\n this.createdWithOptions = undefined;\n return;\n }\n\n try {\n instance.setOption(this.getEffectiveOptions(options, theme));\n } catch (cause: unknown) {\n this.reportError(cause);\n }\n }, { allowSignalWrites: true });\n }\n\n protected emitClick(event: MouseEvent): void {\n this.click.emit({ x: event.offsetX, y: event.offsetY });\n }\n\n ngOnDestroy(): void {\n this.destroying = true;\n }\n\n getChart(): ChartGPUInstance | null {\n const instance = this.chartInstance();\n return instance && !instance.disposed ? instance : null;\n }\n\n getContainer(): HTMLDivElement | null {\n return this.canvasHost()?.nativeElement ?? null;\n }\n\n appendData(\n seriesIndex: number,\n newPoints: ChartgpuCartesianSeriesData | OHLCDataPoint[],\n options?: ChartgpuAppendDataOptions,\n ): void {\n this.getChart()?.appendData(seriesIndex, newPoints, options);\n }\n\n renderFrame(): boolean {\n return this.getChart()?.renderFrame() ?? false;\n }\n\n needsRender(): boolean {\n return this.getChart()?.needsRender() ?? false;\n }\n\n getRenderMode(): 'auto' | 'external' {\n return this.getChart()?.getRenderMode() ?? 'auto';\n }\n\n setRenderMode(mode: 'auto' | 'external'): void {\n this.getChart()?.setRenderMode(mode);\n }\n\n setOption(options: ChartgpuOptions): void {\n this.getChart()?.setOption(options);\n }\n\n setZoomRange(start: number, end: number, source?: unknown): void {\n this.getChart()?.setZoomRange(start, end, source);\n }\n\n setInteractionX(x: number | null, source?: unknown): void {\n this.getChart()?.setInteractionX(x, source);\n }\n\n getInteractionX(): number | null {\n return this.getChart()?.getInteractionX() ?? null;\n }\n\n hitTest(event: PointerEvent | MouseEvent) {\n return this.getChart()?.hitTest(event) ?? null;\n }\n\n private getEffectiveOptions(\n options: ChartgpuOptions,\n theme: ChartgpuOptions['theme'] | undefined,\n ): ChartgpuOptions {\n return theme !== undefined ? { ...options, theme } : options;\n }\n\n private listenToChart(instance: ChartGPUInstance): () => void {\n const click = (payload: ChartGPUEventPayload) => this.chartClick.emit(payload);\n const mouseOver = (payload: ChartGPUEventPayload) => this.mouseOver.emit(payload);\n const mouseOut = (payload: ChartGPUEventPayload) => this.mouseOut.emit(payload);\n const crosshairMove = (payload: ChartGPUCrosshairMovePayload) => this.crosshairMove.emit(payload);\n const dataAppend = (payload: ChartgpuDataAppendEvent) => this.dataAppend.emit(payload);\n const zoomChange = (payload: ChartGPUZoomRangeChangePayload) => this.emitZoomRange(payload);\n const deviceLost = (payload: ChartGPUDeviceLostPayload) => this.deviceLost.emit(payload);\n\n instance.on('click', click);\n instance.on('mouseover', mouseOver);\n instance.on('mouseout', mouseOut);\n instance.on('crosshairMove', crosshairMove);\n instance.on('dataAppend', dataAppend);\n instance.on('zoomRangeChange', zoomChange);\n instance.on('deviceLost', deviceLost);\n\n return () => {\n if (instance.disposed) {\n return;\n }\n instance.off('click', click);\n instance.off('mouseover', mouseOver);\n instance.off('mouseout', mouseOut);\n instance.off('crosshairMove', crosshairMove);\n instance.off('dataAppend', dataAppend);\n instance.off('zoomRangeChange', zoomChange);\n instance.off('deviceLost', deviceLost);\n };\n }\n\n private emitZoomRange(range: { start: number; end: number }): void {\n this.zoomChange.emit({ range: { start: range.start, end: range.end } });\n this.zoomRangeChange.emit({ start: range.start, end: range.end });\n }\n\n private observeResize(container: HTMLDivElement): void {\n if (typeof ResizeObserver === 'undefined') {\n return;\n }\n\n this.resizeObserver = new ResizeObserver(entries => {\n const entry = entries[0];\n if (!entry) {\n return;\n }\n const { width, height } = entry.contentRect;\n this.resize.emit({ width, height, container });\n if (this.resizeTimeout !== undefined) {\n clearTimeout(this.resizeTimeout);\n }\n this.resizeTimeout = setTimeout(() => {\n this.chartInstance()?.resize();\n this.resizeTimeout = undefined;\n }, 100);\n });\n this.resizeObserver.observe(container);\n }\n\n private reportError(cause: unknown): void {\n const error = cause instanceof Error ? cause : new Error(String(cause));\n this.initializationError.set(error);\n this.chartError.emit(error);\n }\n\n private disposeChart(): void {\n const instance = this.chartInstance();\n this.removeChartListeners?.();\n this.removeChartListeners = undefined;\n if (instance && !instance.disposed) {\n instance.dispose();\n if (!this.destroying) {\n this.chartDispose.emit();\n }\n }\n this.chartInstance.set(null);\n this.chartContainer = undefined;\n this.createdWithOptions = undefined;\n }\n}\n","import { Directive, effect, input, output } from '@angular/core';\nimport { connectCharts } from 'chartgpu';\nimport type { ChartGPUInstance, ChartSyncOptions } from 'chartgpu';\n\n@Directive({\n selector: '[libChartgpuConnectCharts]',\n standalone: true,\n})\nexport class ChartgpuConnectChartsDirective {\n readonly charts = input<ReadonlyArray<ChartGPUInstance | null | undefined>>([], {\n alias: 'libChartgpuConnectCharts',\n });\n readonly syncOptions = input<ChartSyncOptions | undefined>();\n readonly connectionError = output<Error>();\n\n private readonly ids = new WeakMap<object, number>();\n private nextId = 1;\n private signature: string | undefined;\n\n constructor() {\n effect(onCleanup => {\n const charts = this.charts();\n const options = this.syncOptions();\n const optionsSignature = options\n ? `crosshair=${options.syncCrosshair ?? ''},zoom=${options.syncZoom ?? ''}`\n : '';\n const signature = `${charts.map(chart => {\n if (!chart) {\n return 'null';\n }\n\n let id = this.ids.get(chart);\n if (id === undefined) {\n id = this.nextId++;\n this.ids.set(chart, id);\n }\n return `${id}:${chart.disposed ? 1 : 0}`;\n }).join('|')}|${optionsSignature}`;\n\n if (signature === this.signature) {\n return;\n }\n this.signature = signature;\n\n if (charts.length === 0 || charts.some(chart => !chart || chart.disposed)) {\n return;\n }\n\n const resolved: ChartGPUInstance[] = [];\n for (const chart of charts) {\n if (!chart || chart.disposed) {\n return;\n }\n resolved.push(chart);\n }\n\n try {\n const disconnect = connectCharts(resolved, options);\n onCleanup(disconnect);\n } catch (cause: unknown) {\n this.connectionError.emit(cause instanceof Error ? cause : new Error(String(cause)));\n }\n });\n }\n}\n","import { Injectable, computed, signal } from '@angular/core';\nimport { createPipelineCache } from 'chartgpu';\nimport type { ChartGPUCreateContext } from 'chartgpu';\nimport type { ChartgpuGPUContextState } from './chartgpu-angular.types';\n\nconst INITIAL_STATE: ChartgpuGPUContextState = {\n adapter: null,\n device: null,\n pipelineCache: null,\n error: null,\n isReady: false,\n};\n\n/**\n * Creates one shared WebGPU context and pipeline cache for charts in a dashboard.\n * The device is intentionally not destroyed with the service so charts can share it\n * for the lifetime of the application.\n */\n@Injectable({ providedIn: 'root' })\nexport class ChartgpuGPUContextService {\n readonly state = signal<ChartgpuGPUContextState>(INITIAL_STATE);\n readonly context = computed<ChartGPUCreateContext | null>(() => {\n const state = this.state();\n if (!state.adapter || !state.device || !state.pipelineCache) {\n return null;\n }\n\n return {\n adapter: state.adapter,\n device: state.device,\n pipelineCache: state.pipelineCache,\n };\n });\n\n private initialization?: Promise<ChartgpuGPUContextState>;\n\n initialize(): Promise<ChartgpuGPUContextState> {\n if (!this.initialization) {\n this.initialization = this.createContext();\n }\n return this.initialization;\n }\n\n private async createContext(): Promise<ChartgpuGPUContextState> {\n try {\n if (typeof navigator === 'undefined' || !('gpu' in navigator)) {\n throw new Error('WebGPU not supported in this browser');\n }\n\n const gpu = (navigator as Navigator & {\n gpu?: {\n requestAdapter(options: {\n powerPreference: 'high-performance';\n }): Promise<ChartGPUCreateContext['adapter'] | null>;\n };\n }).gpu;\n if (!gpu) {\n throw new Error('WebGPU not supported in this browser');\n }\n\n const adapter = await gpu.requestAdapter({ powerPreference: 'high-performance' });\n if (!adapter) {\n const error = new Error('WebGPU is not available. No compatible GPUAdapter was found.');\n const state: ChartgpuGPUContextState = { ...INITIAL_STATE, error };\n this.state.set(state);\n return state;\n }\n\n const device = await adapter.requestDevice();\n const pipelineCache = createPipelineCache(device);\n const state: ChartgpuGPUContextState = {\n adapter,\n device,\n pipelineCache,\n error: null,\n isReady: true,\n };\n this.state.set(state);\n return state;\n } catch (cause: unknown) {\n const error = cause instanceof Error ? cause : new Error(String(cause));\n const state: ChartgpuGPUContextState = { ...INITIAL_STATE, error };\n this.state.set(state);\n return state;\n }\n }\n}\n","import { makeEnvironmentProviders } from '@angular/core';\nimport { ChartgpuGPUContextService } from './gpu-context.service';\n\nexport function provideChartGpuContext() {\n return makeEnvironmentProviders([ChartgpuGPUContextService]);\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAuFa,wBAAwB,CAAA;AAqCN,IAAA,UAAA;AApCpB,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAmB;AAC3C,IAAA,UAAU,GAAG,KAAK,CAA4B,IAAI,CAAC;AACnD,IAAA,KAAK,GAAG,KAAK,CAAuC,SAAS,CAAC;IAC9D,SAAS,GAAG,KAAK,EAAsB;IACvC,KAAK,GAAG,KAAK,EAA6B;IAE1C,KAAK,GAAG,MAAM,EAAsB;IACpC,UAAU,GAAG,MAAM,EAAoB;IACvC,YAAY,GAAG,MAAM,EAAQ;IAC7B,MAAM,GAAG,MAAM,EAAuB;IACtC,KAAK,GAAG,MAAM,EAAsB;IACpC,UAAU,GAAG,MAAM,EAAwB;IAC3C,SAAS,GAAG,MAAM,EAAwB;IAC1C,QAAQ,GAAG,MAAM,EAAwB;IACzC,aAAa,GAAG,MAAM,EAAgC;IACtD,UAAU,GAAG,MAAM,EAA2B;IAC9C,UAAU,GAAG,MAAM,EAA2B;IAC9C,eAAe,GAAG,MAAM,EAAgC;IACxD,UAAU,GAAG,MAAM,EAA6B;IAChD,UAAU,GAAG,MAAM,EAAS;AAE5B,IAAA,IAAI,GAAG,SAAS,CAA6B,MAAM,CAAC;AACpD,IAAA,UAAU,GAAG,SAAS,CAA6B,YAAY,CAAC;AAExD,IAAA,aAAa,GAAG,MAAM,CAA0B,IAAI,CAAC;AAC7D,IAAA,mBAAmB,GAAG,MAAM,CAAe,IAAI,CAAC;AACjD,IAAA,cAAc;AACd,IAAA,kBAAkB;AAIlB,IAAA,a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AAM,OAAO,CAAC,aAAa,EAAE;AAC5C,YAAA,MAAM,aAAa,GAAG,mBAAmB,CAAC,MAAM,CAAC;AACjD,YAAA,MAAM,KAAK,GAA4B;gBACrC,OAAO;gBACP,MAAM;gBACN,aAAa;AACb,gBAAA,KAAK,EAAE,IAAI;AACX,gBAAA,OAAO,EAAE,IAAI;aACd;AACD,YAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;AACrB,YAAA,OAAO,KAAK;QACd;QAAE,OAAO,KAAc,EAAE;YACvB,MAAM,KAAK,GAAG,KAAK,YAAY,KAAK,GAAG,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,MAAM,KAAK,GAA4B,EAAE,GAAG,aAAa,EAAE,KAAK,EAAE;AAClE,YAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;AACrB,YAAA,OAAO,KAAK;QACd;IACF;wGAlEW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA;;4FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;SCflB,sBAAsB,GAAA;AACpC,IAAA,OAAO,wBAAwB,CAAC,CAAC,yBAAyB,CAAC,CAAC;AAC9D;;ACLA;;AAEG;;;;"}
1
+ {"version":3,"file":"chartgpu-angular.mjs","sources":["../../../projects/chartgpu-angular/src/lib/chartgpu-angular.component.ts","../../../projects/chartgpu-angular/src/lib/connect-charts.directive.ts","../../../projects/chartgpu-angular/src/lib/gpu-context.service.ts","../../../projects/chartgpu-angular/src/lib/gpu-context.provider.ts","../../../projects/chartgpu-angular/src/chartgpu-angular.ts"],"sourcesContent":["import { NgStyle } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n OnDestroy,\n afterNextRender,\n effect,\n input,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport {\n ChartGPU,\n type ChartGPUCrosshairMovePayload,\n type ChartGPUDeviceLostPayload,\n type ChartGPUEventPayload,\n type ChartGPUInstance,\n type ChartGPUZoomRangeChangePayload,\n type OHLCDataPoint,\n} from 'chartgpu';\nimport type {\n ChartgpuAppendDataOptions,\n ChartgpuCartesianSeriesData,\n ChartgpuChartHandle,\n ChartgpuClickEvent,\n ChartgpuDataAppendEvent,\n ChartgpuGPUContext,\n ChartgpuOptions,\n ChartgpuReadyEvent,\n ChartgpuResizeEvent,\n ChartgpuStyle,\n ChartgpuZoomChangeEvent,\n ChartgpuZoomRangeChangeEvent,\n} from './chartgpu-angular.types';\n\n@Component({\n selector: 'lib-chartgpu-angular',\n standalone: true,\n imports: [NgStyle],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'chartgpu-angular' },\n template: `\n <div\n #host\n class=\"chartgpu-host\"\n [class]=\"className() ?? ''\"\n [ngStyle]=\"style()\"\n (click)=\"emitClick($event)\"\n >\n <div #canvasHost class=\"chartgpu-canvas-host\"></div>\n @if (initializationError(); as error) {\n <div class=\"chartgpu-error\" role=\"alert\">{{ error.message }}</div>\n }\n </div>\n `,\n styles: [`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n .chartgpu-host {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .chartgpu-canvas-host {\n position: absolute;\n inset: 0;\n }\n\n .chartgpu-error {\n position: absolute;\n inset: 0;\n display: grid;\n place-items: center;\n padding: 1rem;\n text-align: center;\n }\n `],\n})\nexport class ChartGpuAngularComponent implements ChartgpuChartHandle, OnDestroy {\n readonly options = input.required<ChartgpuOptions>();\n readonly gpuContext = input<ChartgpuGPUContext | null>(null);\n readonly theme = input<ChartgpuOptions['theme'] | undefined>(undefined);\n readonly className = input<string | undefined>();\n readonly style = input<ChartgpuStyle | undefined>();\n\n readonly ready = output<ChartgpuReadyEvent>();\n readonly chartReady = output<ChartGPUInstance>();\n readonly chartDispose = output<void>();\n readonly resize = output<ChartgpuResizeEvent>();\n readonly click = output<ChartgpuClickEvent>();\n readonly chartClick = output<ChartGPUEventPayload>();\n readonly mouseOver = output<ChartGPUEventPayload>();\n readonly mouseOut = output<ChartGPUEventPayload>();\n readonly crosshairMove = output<ChartGPUCrosshairMovePayload>();\n readonly dataAppend = output<ChartgpuDataAppendEvent>();\n readonly zoomChange = output<ChartgpuZoomChangeEvent>();\n readonly zoomRangeChange = output<ChartgpuZoomRangeChangeEvent>();\n readonly deviceLost = output<ChartGPUDeviceLostPayload>();\n readonly chartError = output<Error>();\n\n readonly host = viewChild<ElementRef<HTMLDivElement>>('host');\n readonly canvasHost = viewChild<ElementRef<HTMLDivElement>>('canvasHost');\n\n private readonly chartInstance = signal<ChartGPUInstance | null>(null);\n readonly initializationError = signal<Error | null>(null);\n private chartContainer?: HTMLDivElement;\n private createdWithOptions?: {\n options: ChartgpuOptions;\n theme: ChartgpuOptions['theme'] | undefined;\n };\n private resizeTimeout?: ReturnType<typeof setTimeout>;\n private resizeObserver?: ResizeObserver;\n private removeChartListeners?: () => void;\n private destroying = false;\n\n constructor(private readonly destroyRef: DestroyRef) {\n this.destroyRef.onDestroy(() => {\n this.resizeObserver?.disconnect();\n if (this.resizeTimeout !== undefined) {\n clearTimeout(this.resizeTimeout);\n }\n this.disposeChart();\n });\n\n afterNextRender(() => {\n const container = this.host()?.nativeElement;\n if (container) {\n this.observeResize(container);\n }\n });\n\n effect(onCleanup => {\n const container = this.canvasHost()?.nativeElement;\n const options = this.options();\n const gpuContext = this.gpuContext();\n const theme = this.theme();\n\n this.initializationError.set(null);\n if (!container) {\n this.disposeChart();\n return;\n }\n if (typeof navigator === 'undefined' || !('gpu' in navigator)) {\n this.reportError(new Error('WebGPU not supported in this browser'));\n return;\n }\n\n if (untracked(() => this.chartInstance()) && this.chartContainer === container) {\n return;\n }\n\n let cancelled = false;\n let createdInstance: ChartGPUInstance | undefined;\n const initialOptions = this.getEffectiveOptions(options, theme);\n\n void (gpuContext\n ? ChartGPU.create(container, initialOptions, gpuContext)\n : ChartGPU.create(container, initialOptions)\n ).then(instance => {\n createdInstance = instance;\n if (cancelled) {\n instance.dispose();\n return;\n }\n\n try {\n const latest = untracked(() => ({\n options: this.options(),\n theme: this.theme(),\n }));\n if (latest.options !== options || latest.theme !== theme) {\n instance.setOption(this.getEffectiveOptions(latest.options, latest.theme));\n }\n\n this.createdWithOptions = latest;\n this.chartContainer = container;\n this.chartInstance.set(instance);\n this.removeChartListeners = this.listenToChart(instance);\n this.ready.emit({ container });\n this.chartReady.emit(instance);\n\n const range = instance.getZoomRange();\n if (range) {\n this.emitZoomRange(range);\n }\n } catch (cause: unknown) {\n instance.dispose();\n throw cause;\n }\n }).catch((cause: unknown) => {\n if (cancelled) {\n return;\n }\n if (createdInstance && this.chartInstance() !== createdInstance && !createdInstance.disposed) {\n createdInstance.dispose();\n }\n this.reportError(cause);\n });\n\n onCleanup(() => {\n cancelled = true;\n if (this.chartContainer === container) {\n this.disposeChart();\n }\n });\n }, { allowSignalWrites: true });\n\n effect(() => {\n const options = this.options();\n const theme = this.theme();\n const instance = this.chartInstance();\n if (!instance || instance.disposed) {\n return;\n }\n\n if (this.createdWithOptions?.options === options && this.createdWithOptions.theme === theme) {\n this.createdWithOptions = undefined;\n return;\n }\n\n try {\n instance.setOption(this.getEffectiveOptions(options, theme));\n } catch (cause: unknown) {\n this.reportError(cause);\n }\n }, { allowSignalWrites: true });\n }\n\n protected emitClick(event: MouseEvent): void {\n this.click.emit({ x: event.offsetX, y: event.offsetY });\n }\n\n ngOnDestroy(): void {\n this.destroying = true;\n }\n\n getChart(): ChartGPUInstance | null {\n const instance = this.chartInstance();\n return instance && !instance.disposed ? instance : null;\n }\n\n getContainer(): HTMLDivElement | null {\n return this.canvasHost()?.nativeElement ?? null;\n }\n\n appendData(\n seriesIndex: number,\n newPoints: ChartgpuCartesianSeriesData | OHLCDataPoint[],\n options?: ChartgpuAppendDataOptions,\n ): void {\n this.getChart()?.appendData(seriesIndex, newPoints, options);\n }\n\n renderFrame(): boolean {\n return this.getChart()?.renderFrame() ?? false;\n }\n\n needsRender(): boolean {\n return this.getChart()?.needsRender() ?? false;\n }\n\n getRenderMode(): 'auto' | 'external' {\n return this.getChart()?.getRenderMode() ?? 'auto';\n }\n\n setRenderMode(mode: 'auto' | 'external'): void {\n this.getChart()?.setRenderMode(mode);\n }\n\n setOption(options: ChartgpuOptions): void {\n this.getChart()?.setOption(options);\n }\n\n setZoomRange(start: number, end: number, source?: unknown): void {\n this.getChart()?.setZoomRange(start, end, source);\n }\n\n setInteractionX(x: number | null, source?: unknown): void {\n this.getChart()?.setInteractionX(x, source);\n }\n\n getInteractionX(): number | null {\n return this.getChart()?.getInteractionX() ?? null;\n }\n\n hitTest(event: PointerEvent | MouseEvent) {\n return this.getChart()?.hitTest(event) ?? null;\n }\n\n private getEffectiveOptions(\n options: ChartgpuOptions,\n theme: ChartgpuOptions['theme'] | undefined,\n ): ChartgpuOptions {\n return theme !== undefined ? { ...options, theme } : options;\n }\n\n private listenToChart(instance: ChartGPUInstance): () => void {\n const click = (payload: ChartGPUEventPayload) => this.chartClick.emit(payload);\n const mouseOver = (payload: ChartGPUEventPayload) => this.mouseOver.emit(payload);\n const mouseOut = (payload: ChartGPUEventPayload) => this.mouseOut.emit(payload);\n const crosshairMove = (payload: ChartGPUCrosshairMovePayload) => this.crosshairMove.emit(payload);\n const dataAppend = (payload: ChartgpuDataAppendEvent) => this.dataAppend.emit(payload);\n const zoomChange = (payload: ChartGPUZoomRangeChangePayload) => this.emitZoomRange(payload);\n const deviceLost = (payload: ChartGPUDeviceLostPayload) => this.deviceLost.emit(payload);\n\n instance.on('click', click);\n instance.on('mouseover', mouseOver);\n instance.on('mouseout', mouseOut);\n instance.on('crosshairMove', crosshairMove);\n instance.on('dataAppend', dataAppend);\n instance.on('zoomRangeChange', zoomChange);\n instance.on('deviceLost', deviceLost);\n\n return () => {\n if (instance.disposed) {\n return;\n }\n instance.off('click', click);\n instance.off('mouseover', mouseOver);\n instance.off('mouseout', mouseOut);\n instance.off('crosshairMove', crosshairMove);\n instance.off('dataAppend', dataAppend);\n instance.off('zoomRangeChange', zoomChange);\n instance.off('deviceLost', deviceLost);\n };\n }\n\n private emitZoomRange(range: { start: number; end: number }): void {\n this.zoomChange.emit({ range: { start: range.start, end: range.end } });\n this.zoomRangeChange.emit({ start: range.start, end: range.end });\n }\n\n private observeResize(container: HTMLDivElement): void {\n if (typeof ResizeObserver === 'undefined') {\n return;\n }\n\n this.resizeObserver = new ResizeObserver(entries => {\n const entry = entries[0];\n if (!entry) {\n return;\n }\n const { width, height } = entry.contentRect;\n this.resize.emit({ width, height, container });\n if (this.resizeTimeout !== undefined) {\n clearTimeout(this.resizeTimeout);\n }\n this.resizeTimeout = setTimeout(() => {\n this.chartInstance()?.resize();\n this.resizeTimeout = undefined;\n }, 100);\n });\n this.resizeObserver.observe(container);\n }\n\n private reportError(cause: unknown): void {\n const error = cause instanceof Error ? cause : new Error(String(cause));\n this.initializationError.set(error);\n this.chartError.emit(error);\n }\n\n private disposeChart(): void {\n const instance = this.chartInstance();\n this.removeChartListeners?.();\n this.removeChartListeners = undefined;\n if (instance && !instance.disposed) {\n instance.dispose();\n if (!this.destroying) {\n this.chartDispose.emit();\n }\n }\n this.chartInstance.set(null);\n this.chartContainer = undefined;\n this.createdWithOptions = undefined;\n }\n}\n","import { Directive, effect, input, output } from '@angular/core';\nimport { connectCharts } from 'chartgpu';\nimport type { ChartGPUInstance, ChartSyncOptions } from 'chartgpu';\n\n@Directive({\n selector: '[libChartgpuConnectCharts]',\n standalone: true,\n})\nexport class ChartgpuConnectChartsDirective {\n readonly charts = input<ReadonlyArray<ChartGPUInstance | null | undefined>>([], {\n alias: 'libChartgpuConnectCharts',\n });\n readonly syncOptions = input<ChartSyncOptions | undefined>();\n readonly connectionError = output<Error>();\n\n private readonly ids = new WeakMap<object, number>();\n private nextId = 1;\n private signature: string | undefined;\n\n constructor() {\n effect(onCleanup => {\n const charts = this.charts();\n const options = this.syncOptions();\n const optionsSignature = options\n ? `crosshair=${options.syncCrosshair ?? ''},zoom=${options.syncZoom ?? ''}`\n : '';\n const signature = `${charts.map(chart => {\n if (!chart) {\n return 'null';\n }\n\n let id = this.ids.get(chart);\n if (id === undefined) {\n id = this.nextId++;\n this.ids.set(chart, id);\n }\n return `${id}:${chart.disposed ? 1 : 0}`;\n }).join('|')}|${optionsSignature}`;\n\n if (signature === this.signature) {\n return;\n }\n this.signature = signature;\n\n if (charts.length === 0 || charts.some(chart => !chart || chart.disposed)) {\n return;\n }\n\n const resolved: ChartGPUInstance[] = [];\n for (const chart of charts) {\n if (!chart || chart.disposed) {\n return;\n }\n resolved.push(chart);\n }\n\n try {\n const disconnect = connectCharts(resolved, options);\n onCleanup(disconnect);\n } catch (cause: unknown) {\n this.connectionError.emit(cause instanceof Error ? cause : new Error(String(cause)));\n }\n });\n }\n}\n","import { Injectable, computed, signal } from '@angular/core';\nimport { createPipelineCache } from 'chartgpu';\nimport type { ChartGPUCreateContext } from 'chartgpu';\nimport type { ChartgpuGPUContextState } from './chartgpu-angular.types';\n\nconst INITIAL_STATE: ChartgpuGPUContextState = {\n adapter: null,\n device: null,\n pipelineCache: null,\n error: null,\n isReady: false,\n};\n\n/**\n * Creates one shared WebGPU context and pipeline cache for charts in a dashboard.\n * The device is intentionally not destroyed with the service so charts can share it\n * for the lifetime of the application.\n */\n@Injectable({ providedIn: 'root' })\nexport class ChartgpuGPUContextService {\n readonly state = signal<ChartgpuGPUContextState>(INITIAL_STATE);\n readonly context = computed<ChartGPUCreateContext | null>(() => {\n const state = this.state();\n if (!state.adapter || !state.device || !state.pipelineCache) {\n return null;\n }\n\n return {\n adapter: state.adapter,\n device: state.device,\n pipelineCache: state.pipelineCache,\n };\n });\n\n private initialization?: Promise<ChartgpuGPUContextState>;\n\n initialize(): Promise<ChartgpuGPUContextState> {\n if (!this.initialization) {\n this.initialization = this.createContext();\n }\n return this.initialization;\n }\n\n private async createContext(): Promise<ChartgpuGPUContextState> {\n try {\n if (typeof navigator === 'undefined' || !('gpu' in navigator)) {\n throw new Error('WebGPU not supported in this browser');\n }\n\n const gpu = (navigator as Navigator & {\n gpu?: {\n requestAdapter(options: {\n powerPreference: 'high-performance';\n }): Promise<ChartGPUCreateContext['adapter'] | null>;\n };\n }).gpu;\n if (!gpu) {\n throw new Error('WebGPU not supported in this browser');\n }\n\n const adapter = await gpu.requestAdapter({ powerPreference: 'high-performance' });\n if (!adapter) {\n const error = new Error('WebGPU is not available. No compatible GPUAdapter was found.');\n const state: ChartgpuGPUContextState = { ...INITIAL_STATE, error };\n this.state.set(state);\n return state;\n }\n\n const device = await adapter.requestDevice();\n const pipelineCache = createPipelineCache(device);\n const state: ChartgpuGPUContextState = {\n adapter,\n device,\n pipelineCache,\n error: null,\n isReady: true,\n };\n this.state.set(state);\n return state;\n } catch (cause: unknown) {\n const error = cause instanceof Error ? cause : new Error(String(cause));\n const state: ChartgpuGPUContextState = { ...INITIAL_STATE, error };\n this.state.set(state);\n return state;\n }\n }\n}\n","import { makeEnvironmentProviders } from '@angular/core';\nimport { ChartgpuGPUContextService } from './gpu-context.service';\n\nexport function provideChartGpuContext() {\n return makeEnvironmentProviders([ChartgpuGPUContextService]);\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAuFa,wBAAwB,CAAA;AAqCN,IAAA,UAAA;AApCpB,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAmB;AAC3C,IAAA,UAAU,GAAG,KAAK,CAA4B,IAAI,iFAAC;AACnD,IAAA,KAAK,GAAG,KAAK,CAA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"version": "21.0.0",
4
4
  "description": "Unnofficial Angular bindings for ChartGPU — WebGPU-powered high-performance charts",
5
5
  "keywords": [
6
6
  "angular",
@@ -23,22 +23,23 @@
23
23
  "license": "MIT",
24
24
  "author": "Naren",
25
25
  "peerDependencies": {
26
- "@angular/common": "^19.0.0",
27
- "@angular/core": "^19.0.0",
26
+ "@angular/common": "^21.0.0",
27
+ "@angular/core": "^21.0.0",
28
28
  "chartgpu": "^0.4.0"
29
29
  },
30
30
  "module": "fesm2022/chartgpu-angular.mjs",
31
- "typings": "index.d.ts",
31
+ "typings": "types/chartgpu-angular.d.ts",
32
32
  "exports": {
33
33
  "./package.json": {
34
34
  "default": "./package.json"
35
35
  },
36
36
  ".": {
37
- "types": "./index.d.ts",
37
+ "types": "./types/chartgpu-angular.d.ts",
38
38
  "default": "./fesm2022/chartgpu-angular.mjs"
39
39
  }
40
40
  },
41
41
  "sideEffects": false,
42
+ "type": "module",
42
43
  "dependencies": {
43
44
  "tslib": "^2.3.0"
44
45
  }
@@ -0,0 +1,222 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnDestroy, ElementRef, DestroyRef } from '@angular/core';
3
+ import * as chartgpu from 'chartgpu';
4
+ import { ChartGPUInstance, DataPoint, OHLCDataPoint, RenderMode, ChartGPUOptions, ChartGPUHitTestResult, AnimationConfig, AnnotationConfig, AxisConfig, ChartGPUEventPayload, ChartGPUCrosshairMovePayload, ChartGPUCreateContext, PipelineCache, SeriesConfig, SeriesType, ChartSyncOptions, ThemeConfig, TooltipConfig, DataZoomConfig } from 'chartgpu';
5
+ export { ChartGPUCreateContext, ChartGPUCrosshairMovePayload, ChartGPUDeviceLostPayload, ChartGPUEventPayload, ChartGPUHitTestResult, ChartGPUInstance, ChartSyncOptions, DataPoint, OHLCDataPoint, PipelineCache, RenderMode } from 'chartgpu';
6
+
7
+ type ChartgpuOptions = ChartGPUOptions;
8
+ type ChartgpuSeriesType = SeriesType;
9
+ type ChartgpuSeriesData = Extract<SeriesConfig, {
10
+ type: 'line';
11
+ }>['data'];
12
+ type ChartgpuSeriesOptions = SeriesConfig;
13
+ type ChartgpuAxisOptions = AxisConfig;
14
+ type ChartgpuZoomOptions = DataZoomConfig;
15
+ type ChartgpuTooltipOptions = TooltipConfig;
16
+ type ChartgpuAnimationOptions = AnimationConfig | boolean;
17
+ type ChartgpuThemeOptions = ThemeConfig | 'light' | 'dark';
18
+ type ChartgpuAnnotationOptions = AnnotationConfig;
19
+ type ChartgpuThreeDOptions = Pick<ChartGPUOptions, 'coordinateSystem' | 'camera' | 'interaction3d' | 'axes3d'>;
20
+ type ChartgpuStreamingOptions = Pick<ChartGPUOptions, 'autoScroll'>;
21
+ type ChartgpuInteractionOptions = Pick<ChartGPUOptions, 'dataZoom' | 'tooltip'>;
22
+ type ChartgpuChartInstance = ChartGPUInstance;
23
+ type ChartgpuGPUContext = ChartGPUCreateContext;
24
+ type ChartgpuStyle = Record<string, string | number | null | undefined>;
25
+ type ChartgpuZoomRange = NonNullable<ReturnType<ChartGPUInstance['getZoomRange']>>;
26
+ type ChartgpuClickParams = ChartGPUEventPayload;
27
+ type ChartgpuMouseOverParams = ChartGPUEventPayload;
28
+ type ChartgpuCrosshairMoveParams = ChartGPUCrosshairMovePayload;
29
+ type ChartgpuHitTestResult = ChartGPUHitTestResult;
30
+ type ChartgpuRenderMode = RenderMode;
31
+ type ChartgpuSyncOptions = ChartSyncOptions;
32
+ type ChartgpuXYArraysData = Readonly<{
33
+ x: ArrayLike<number>;
34
+ y: ArrayLike<number>;
35
+ size?: ArrayLike<number>;
36
+ }>;
37
+ type ChartgpuInterleavedXYData = ArrayBufferView;
38
+ type ChartgpuCartesianSeriesData = ReadonlyArray<DataPoint | null> | ChartgpuXYArraysData | ChartgpuInterleavedXYData;
39
+ type ChartgpuAppendDataOptions = Readonly<{
40
+ maxPoints?: number;
41
+ }>;
42
+ interface ChartgpuDataAppendEvent {
43
+ seriesIndex: number;
44
+ count: number;
45
+ xExtent: {
46
+ min: number;
47
+ max: number;
48
+ };
49
+ }
50
+ interface ChartgpuReadyEvent {
51
+ container: HTMLDivElement;
52
+ }
53
+ interface ChartgpuResizeEvent {
54
+ width: number;
55
+ height: number;
56
+ container: HTMLDivElement;
57
+ }
58
+ interface ChartgpuClickEvent {
59
+ x: number;
60
+ y: number;
61
+ }
62
+ interface ChartgpuZoomChangeEvent {
63
+ range: {
64
+ start: number;
65
+ end: number;
66
+ };
67
+ }
68
+ interface ChartgpuZoomRangeChangeEvent {
69
+ start: number;
70
+ end: number;
71
+ }
72
+ interface ChartgpuGPUContextState {
73
+ adapter: ChartGPUCreateContext['adapter'] | null;
74
+ device: ChartGPUCreateContext['device'] | null;
75
+ pipelineCache: PipelineCache | null;
76
+ error: Error | null;
77
+ isReady: boolean;
78
+ }
79
+ interface ChartgpuChartHandle {
80
+ getChart(): ChartGPUInstance | null;
81
+ getContainer(): HTMLDivElement | null;
82
+ appendData(seriesIndex: number, newPoints: ChartgpuCartesianSeriesData | OHLCDataPoint[], options?: ChartgpuAppendDataOptions): void;
83
+ renderFrame(): boolean;
84
+ needsRender(): boolean;
85
+ getRenderMode(): RenderMode;
86
+ setRenderMode(mode: RenderMode): void;
87
+ setOption(options: ChartgpuOptions): void;
88
+ setZoomRange(start: number, end: number, source?: unknown): void;
89
+ setInteractionX(x: number | null, source?: unknown): void;
90
+ getInteractionX(): number | null;
91
+ hitTest(event: PointerEvent | MouseEvent): ChartGPUHitTestResult | null;
92
+ }
93
+
94
+ declare class ChartGpuAngularComponent implements ChartgpuChartHandle, OnDestroy {
95
+ private readonly destroyRef;
96
+ readonly options: _angular_core.InputSignal<chartgpu.ChartGPUOptions>;
97
+ readonly gpuContext: _angular_core.InputSignal<Readonly<{
98
+ readonly device: GPUDevice;
99
+ readonly adapter: GPUAdapter;
100
+ readonly pipelineCache?: chartgpu.PipelineCache;
101
+ }>>;
102
+ readonly theme: _angular_core.InputSignal<chartgpu.ThemeConfig | "light" | "dark">;
103
+ readonly className: _angular_core.InputSignal<string>;
104
+ readonly style: _angular_core.InputSignal<ChartgpuStyle>;
105
+ readonly ready: _angular_core.OutputEmitterRef<ChartgpuReadyEvent>;
106
+ readonly chartReady: _angular_core.OutputEmitterRef<ChartGPUInstance>;
107
+ readonly chartDispose: _angular_core.OutputEmitterRef<void>;
108
+ readonly resize: _angular_core.OutputEmitterRef<ChartgpuResizeEvent>;
109
+ readonly click: _angular_core.OutputEmitterRef<ChartgpuClickEvent>;
110
+ readonly chartClick: _angular_core.OutputEmitterRef<Readonly<{
111
+ readonly seriesIndex: number | null;
112
+ readonly dataIndex: number | null;
113
+ readonly value: readonly [number, number] | null;
114
+ readonly seriesName: string | null;
115
+ readonly event: PointerEvent;
116
+ }>>;
117
+ readonly mouseOver: _angular_core.OutputEmitterRef<Readonly<{
118
+ readonly seriesIndex: number | null;
119
+ readonly dataIndex: number | null;
120
+ readonly value: readonly [number, number] | null;
121
+ readonly seriesName: string | null;
122
+ readonly event: PointerEvent;
123
+ }>>;
124
+ readonly mouseOut: _angular_core.OutputEmitterRef<Readonly<{
125
+ readonly seriesIndex: number | null;
126
+ readonly dataIndex: number | null;
127
+ readonly value: readonly [number, number] | null;
128
+ readonly seriesName: string | null;
129
+ readonly event: PointerEvent;
130
+ }>>;
131
+ readonly crosshairMove: _angular_core.OutputEmitterRef<Readonly<{
132
+ readonly x: number | null;
133
+ readonly source?: unknown;
134
+ }>>;
135
+ readonly dataAppend: _angular_core.OutputEmitterRef<ChartgpuDataAppendEvent>;
136
+ readonly zoomChange: _angular_core.OutputEmitterRef<ChartgpuZoomChangeEvent>;
137
+ readonly zoomRangeChange: _angular_core.OutputEmitterRef<ChartgpuZoomRangeChangeEvent>;
138
+ readonly deviceLost: _angular_core.OutputEmitterRef<Readonly<{
139
+ readonly reason: GPUDeviceLostReason;
140
+ readonly message: string;
141
+ }>>;
142
+ readonly chartError: _angular_core.OutputEmitterRef<Error>;
143
+ readonly host: _angular_core.Signal<ElementRef<HTMLDivElement>>;
144
+ readonly canvasHost: _angular_core.Signal<ElementRef<HTMLDivElement>>;
145
+ private readonly chartInstance;
146
+ readonly initializationError: _angular_core.WritableSignal<Error>;
147
+ private chartContainer?;
148
+ private createdWithOptions?;
149
+ private resizeTimeout?;
150
+ private resizeObserver?;
151
+ private removeChartListeners?;
152
+ private destroying;
153
+ constructor(destroyRef: DestroyRef);
154
+ protected emitClick(event: MouseEvent): void;
155
+ ngOnDestroy(): void;
156
+ getChart(): ChartGPUInstance | null;
157
+ getContainer(): HTMLDivElement | null;
158
+ appendData(seriesIndex: number, newPoints: ChartgpuCartesianSeriesData | OHLCDataPoint[], options?: ChartgpuAppendDataOptions): void;
159
+ renderFrame(): boolean;
160
+ needsRender(): boolean;
161
+ getRenderMode(): 'auto' | 'external';
162
+ setRenderMode(mode: 'auto' | 'external'): void;
163
+ setOption(options: ChartgpuOptions): void;
164
+ setZoomRange(start: number, end: number, source?: unknown): void;
165
+ setInteractionX(x: number | null, source?: unknown): void;
166
+ getInteractionX(): number | null;
167
+ hitTest(event: PointerEvent | MouseEvent): Readonly<{
168
+ readonly isInGrid: boolean;
169
+ readonly canvasX: number;
170
+ readonly canvasY: number;
171
+ readonly gridX: number;
172
+ readonly gridY: number;
173
+ readonly match: chartgpu.ChartGPUHitTestMatch | null;
174
+ }>;
175
+ private getEffectiveOptions;
176
+ private listenToChart;
177
+ private emitZoomRange;
178
+ private observeResize;
179
+ private reportError;
180
+ private disposeChart;
181
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartGpuAngularComponent, never>;
182
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartGpuAngularComponent, "lib-chartgpu-angular", never, { "options": { "alias": "options"; "required": true; "isSignal": true; }; "gpuContext": { "alias": "gpuContext"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "ready": "ready"; "chartReady": "chartReady"; "chartDispose": "chartDispose"; "resize": "resize"; "click": "click"; "chartClick": "chartClick"; "mouseOver": "mouseOver"; "mouseOut": "mouseOut"; "crosshairMove": "crosshairMove"; "dataAppend": "dataAppend"; "zoomChange": "zoomChange"; "zoomRangeChange": "zoomRangeChange"; "deviceLost": "deviceLost"; "chartError": "chartError"; }, never, never, true, never>;
183
+ }
184
+
185
+ declare class ChartgpuConnectChartsDirective {
186
+ readonly charts: _angular_core.InputSignal<readonly ChartGPUInstance[]>;
187
+ readonly syncOptions: _angular_core.InputSignal<Readonly<{
188
+ readonly syncCrosshair?: boolean;
189
+ readonly syncZoom?: boolean;
190
+ }>>;
191
+ readonly connectionError: _angular_core.OutputEmitterRef<Error>;
192
+ private readonly ids;
193
+ private nextId;
194
+ private signature;
195
+ constructor();
196
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartgpuConnectChartsDirective, never>;
197
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ChartgpuConnectChartsDirective, "[libChartgpuConnectCharts]", never, { "charts": { "alias": "libChartgpuConnectCharts"; "required": false; "isSignal": true; }; "syncOptions": { "alias": "syncOptions"; "required": false; "isSignal": true; }; }, { "connectionError": "connectionError"; }, never, never, true, never>;
198
+ }
199
+
200
+ declare function provideChartGpuContext(): _angular_core.EnvironmentProviders;
201
+
202
+ /**
203
+ * Creates one shared WebGPU context and pipeline cache for charts in a dashboard.
204
+ * The device is intentionally not destroyed with the service so charts can share it
205
+ * for the lifetime of the application.
206
+ */
207
+ declare class ChartgpuGPUContextService {
208
+ readonly state: _angular_core.WritableSignal<ChartgpuGPUContextState>;
209
+ readonly context: _angular_core.Signal<Readonly<{
210
+ readonly device: GPUDevice;
211
+ readonly adapter: GPUAdapter;
212
+ readonly pipelineCache?: chartgpu.PipelineCache;
213
+ }>>;
214
+ private initialization?;
215
+ initialize(): Promise<ChartgpuGPUContextState>;
216
+ private createContext;
217
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartgpuGPUContextService, never>;
218
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<ChartgpuGPUContextService>;
219
+ }
220
+
221
+ export { ChartGpuAngularComponent, ChartgpuConnectChartsDirective, ChartgpuGPUContextService, provideChartGpuContext };
222
+ export type { ChartgpuAnimationOptions, ChartgpuAnnotationOptions, ChartgpuAppendDataOptions, ChartgpuAxisOptions, ChartgpuCartesianSeriesData, ChartgpuChartHandle, ChartgpuChartInstance, ChartgpuClickEvent, ChartgpuClickParams, ChartgpuCrosshairMoveParams, ChartgpuDataAppendEvent, ChartgpuGPUContext, ChartgpuGPUContextState, ChartgpuHitTestResult, ChartgpuInteractionOptions, ChartgpuInterleavedXYData, ChartgpuMouseOverParams, ChartgpuOptions, ChartgpuReadyEvent, ChartgpuRenderMode, ChartgpuResizeEvent, ChartgpuSeriesData, ChartgpuSeriesOptions, ChartgpuSeriesType, ChartgpuStreamingOptions, ChartgpuStyle, ChartgpuSyncOptions, ChartgpuThemeOptions, ChartgpuThreeDOptions, ChartgpuTooltipOptions, ChartgpuXYArraysData, ChartgpuZoomChangeEvent, ChartgpuZoomOptions, ChartgpuZoomRange, ChartgpuZoomRangeChangeEvent };
package/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="chartgpu-angular" />
5
- export * from './public-api';
@@ -1,94 +0,0 @@
1
- import { DestroyRef, ElementRef, OnDestroy } from '@angular/core';
2
- import { type ChartGPUInstance, type OHLCDataPoint } from 'chartgpu';
3
- import type { ChartgpuAppendDataOptions, ChartgpuCartesianSeriesData, ChartgpuChartHandle, ChartgpuClickEvent, ChartgpuDataAppendEvent, ChartgpuOptions, ChartgpuReadyEvent, ChartgpuResizeEvent, ChartgpuStyle, ChartgpuZoomChangeEvent, ChartgpuZoomRangeChangeEvent } from './chartgpu-angular.types';
4
- import * as i0 from "@angular/core";
5
- export declare class ChartGpuAngularComponent implements ChartgpuChartHandle, OnDestroy {
6
- private readonly destroyRef;
7
- readonly options: import("@angular/core").InputSignal<import("chartgpu").ChartGPUOptions>;
8
- readonly gpuContext: import("@angular/core").InputSignal<Readonly<{
9
- readonly device: GPUDevice;
10
- readonly adapter: GPUAdapter;
11
- readonly pipelineCache?: import("chartgpu").PipelineCache;
12
- }>>;
13
- readonly theme: import("@angular/core").InputSignal<import("chartgpu").ThemeConfig | "light" | "dark">;
14
- readonly className: import("@angular/core").InputSignal<string>;
15
- readonly style: import("@angular/core").InputSignal<ChartgpuStyle>;
16
- readonly ready: import("@angular/core").OutputEmitterRef<ChartgpuReadyEvent>;
17
- readonly chartReady: import("@angular/core").OutputEmitterRef<ChartGPUInstance>;
18
- readonly chartDispose: import("@angular/core").OutputEmitterRef<void>;
19
- readonly resize: import("@angular/core").OutputEmitterRef<ChartgpuResizeEvent>;
20
- readonly click: import("@angular/core").OutputEmitterRef<ChartgpuClickEvent>;
21
- readonly chartClick: import("@angular/core").OutputEmitterRef<Readonly<{
22
- readonly seriesIndex: number | null;
23
- readonly dataIndex: number | null;
24
- readonly value: readonly [number, number] | null;
25
- readonly seriesName: string | null;
26
- readonly event: PointerEvent;
27
- }>>;
28
- readonly mouseOver: import("@angular/core").OutputEmitterRef<Readonly<{
29
- readonly seriesIndex: number | null;
30
- readonly dataIndex: number | null;
31
- readonly value: readonly [number, number] | null;
32
- readonly seriesName: string | null;
33
- readonly event: PointerEvent;
34
- }>>;
35
- readonly mouseOut: import("@angular/core").OutputEmitterRef<Readonly<{
36
- readonly seriesIndex: number | null;
37
- readonly dataIndex: number | null;
38
- readonly value: readonly [number, number] | null;
39
- readonly seriesName: string | null;
40
- readonly event: PointerEvent;
41
- }>>;
42
- readonly crosshairMove: import("@angular/core").OutputEmitterRef<Readonly<{
43
- readonly x: number | null;
44
- readonly source?: unknown;
45
- }>>;
46
- readonly dataAppend: import("@angular/core").OutputEmitterRef<ChartgpuDataAppendEvent>;
47
- readonly zoomChange: import("@angular/core").OutputEmitterRef<ChartgpuZoomChangeEvent>;
48
- readonly zoomRangeChange: import("@angular/core").OutputEmitterRef<ChartgpuZoomRangeChangeEvent>;
49
- readonly deviceLost: import("@angular/core").OutputEmitterRef<Readonly<{
50
- readonly reason: GPUDeviceLostReason;
51
- readonly message: string;
52
- }>>;
53
- readonly chartError: import("@angular/core").OutputEmitterRef<Error>;
54
- readonly host: import("@angular/core").Signal<ElementRef<HTMLDivElement>>;
55
- readonly canvasHost: import("@angular/core").Signal<ElementRef<HTMLDivElement>>;
56
- private readonly chartInstance;
57
- readonly initializationError: import("@angular/core").WritableSignal<Error>;
58
- private chartContainer?;
59
- private createdWithOptions?;
60
- private resizeTimeout?;
61
- private resizeObserver?;
62
- private removeChartListeners?;
63
- private destroying;
64
- constructor(destroyRef: DestroyRef);
65
- protected emitClick(event: MouseEvent): void;
66
- ngOnDestroy(): void;
67
- getChart(): ChartGPUInstance | null;
68
- getContainer(): HTMLDivElement | null;
69
- appendData(seriesIndex: number, newPoints: ChartgpuCartesianSeriesData | OHLCDataPoint[], options?: ChartgpuAppendDataOptions): void;
70
- renderFrame(): boolean;
71
- needsRender(): boolean;
72
- getRenderMode(): 'auto' | 'external';
73
- setRenderMode(mode: 'auto' | 'external'): void;
74
- setOption(options: ChartgpuOptions): void;
75
- setZoomRange(start: number, end: number, source?: unknown): void;
76
- setInteractionX(x: number | null, source?: unknown): void;
77
- getInteractionX(): number | null;
78
- hitTest(event: PointerEvent | MouseEvent): Readonly<{
79
- readonly isInGrid: boolean;
80
- readonly canvasX: number;
81
- readonly canvasY: number;
82
- readonly gridX: number;
83
- readonly gridY: number;
84
- readonly match: import("chartgpu").ChartGPUHitTestMatch | null;
85
- }>;
86
- private getEffectiveOptions;
87
- private listenToChart;
88
- private emitZoomRange;
89
- private observeResize;
90
- private reportError;
91
- private disposeChart;
92
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartGpuAngularComponent, never>;
93
- static ɵcmp: i0.ɵɵComponentDeclaration<ChartGpuAngularComponent, "lib-chartgpu-angular", never, { "options": { "alias": "options"; "required": true; "isSignal": true; }; "gpuContext": { "alias": "gpuContext"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "ready": "ready"; "chartReady": "chartReady"; "chartDispose": "chartDispose"; "resize": "resize"; "click": "click"; "chartClick": "chartClick"; "mouseOver": "mouseOver"; "mouseOut": "mouseOut"; "crosshairMove": "crosshairMove"; "dataAppend": "dataAppend"; "zoomChange": "zoomChange"; "zoomRangeChange": "zoomRangeChange"; "deviceLost": "deviceLost"; "chartError": "chartError"; }, never, never, true, never>;
94
- }
@@ -1,89 +0,0 @@
1
- import type { ChartGPUOptions } from 'chartgpu';
2
- import type { AnimationConfig, AnnotationConfig, AxisConfig, ChartGPUCreateContext, ChartGPUCrosshairMovePayload, ChartGPUEventPayload, ChartGPUHitTestResult, ChartGPUInstance, ChartGPUDeviceLostPayload, ChartSyncOptions, DataZoomConfig, DataPoint, OHLCDataPoint, PipelineCache, RenderMode, SeriesConfig, SeriesType, ThemeConfig, TooltipConfig } from 'chartgpu';
3
- export type ChartgpuOptions = ChartGPUOptions;
4
- export type ChartgpuSeriesType = SeriesType;
5
- export type ChartgpuSeriesData = Extract<SeriesConfig, {
6
- type: 'line';
7
- }>['data'];
8
- export type ChartgpuSeriesOptions = SeriesConfig;
9
- export type ChartgpuAxisOptions = AxisConfig;
10
- export type ChartgpuZoomOptions = DataZoomConfig;
11
- export type ChartgpuTooltipOptions = TooltipConfig;
12
- export type ChartgpuAnimationOptions = AnimationConfig | boolean;
13
- export type ChartgpuThemeOptions = ThemeConfig | 'light' | 'dark';
14
- export type ChartgpuAnnotationOptions = AnnotationConfig;
15
- export type ChartgpuThreeDOptions = Pick<ChartGPUOptions, 'coordinateSystem' | 'camera' | 'interaction3d' | 'axes3d'>;
16
- export type ChartgpuStreamingOptions = Pick<ChartGPUOptions, 'autoScroll'>;
17
- export type ChartgpuInteractionOptions = Pick<ChartGPUOptions, 'dataZoom' | 'tooltip'>;
18
- export type ChartgpuChartInstance = ChartGPUInstance;
19
- export type ChartgpuGPUContext = ChartGPUCreateContext;
20
- export type ChartgpuStyle = Record<string, string | number | null | undefined>;
21
- export type ChartgpuZoomRange = NonNullable<ReturnType<ChartGPUInstance['getZoomRange']>>;
22
- export type ChartgpuClickParams = ChartGPUEventPayload;
23
- export type ChartgpuMouseOverParams = ChartGPUEventPayload;
24
- export type ChartgpuCrosshairMoveParams = ChartGPUCrosshairMovePayload;
25
- export type ChartgpuHitTestResult = ChartGPUHitTestResult;
26
- export type ChartgpuRenderMode = RenderMode;
27
- export type ChartgpuSyncOptions = ChartSyncOptions;
28
- export type ChartgpuXYArraysData = Readonly<{
29
- x: ArrayLike<number>;
30
- y: ArrayLike<number>;
31
- size?: ArrayLike<number>;
32
- }>;
33
- export type ChartgpuInterleavedXYData = ArrayBufferView;
34
- export type ChartgpuCartesianSeriesData = ReadonlyArray<DataPoint | null> | ChartgpuXYArraysData | ChartgpuInterleavedXYData;
35
- export type ChartgpuAppendDataOptions = Readonly<{
36
- maxPoints?: number;
37
- }>;
38
- export interface ChartgpuDataAppendEvent {
39
- seriesIndex: number;
40
- count: number;
41
- xExtent: {
42
- min: number;
43
- max: number;
44
- };
45
- }
46
- export interface ChartgpuReadyEvent {
47
- container: HTMLDivElement;
48
- }
49
- export interface ChartgpuResizeEvent {
50
- width: number;
51
- height: number;
52
- container: HTMLDivElement;
53
- }
54
- export interface ChartgpuClickEvent {
55
- x: number;
56
- y: number;
57
- }
58
- export interface ChartgpuZoomChangeEvent {
59
- range: {
60
- start: number;
61
- end: number;
62
- };
63
- }
64
- export interface ChartgpuZoomRangeChangeEvent {
65
- start: number;
66
- end: number;
67
- }
68
- export interface ChartgpuGPUContextState {
69
- adapter: ChartGPUCreateContext['adapter'] | null;
70
- device: ChartGPUCreateContext['device'] | null;
71
- pipelineCache: PipelineCache | null;
72
- error: Error | null;
73
- isReady: boolean;
74
- }
75
- export interface ChartgpuChartHandle {
76
- getChart(): ChartGPUInstance | null;
77
- getContainer(): HTMLDivElement | null;
78
- appendData(seriesIndex: number, newPoints: ChartgpuCartesianSeriesData | OHLCDataPoint[], options?: ChartgpuAppendDataOptions): void;
79
- renderFrame(): boolean;
80
- needsRender(): boolean;
81
- getRenderMode(): RenderMode;
82
- setRenderMode(mode: RenderMode): void;
83
- setOption(options: ChartgpuOptions): void;
84
- setZoomRange(start: number, end: number, source?: unknown): void;
85
- setInteractionX(x: number | null, source?: unknown): void;
86
- getInteractionX(): number | null;
87
- hitTest(event: PointerEvent | MouseEvent): ChartGPUHitTestResult | null;
88
- }
89
- export type { ChartGPUCreateContext, ChartGPUCrosshairMovePayload, ChartGPUDeviceLostPayload, ChartGPUEventPayload, ChartGPUHitTestResult, ChartGPUInstance, ChartSyncOptions, DataPoint, OHLCDataPoint, PipelineCache, RenderMode, };
@@ -1,16 +0,0 @@
1
- import type { ChartGPUInstance } from 'chartgpu';
2
- import * as i0 from "@angular/core";
3
- export declare class ChartgpuConnectChartsDirective {
4
- readonly charts: import("@angular/core").InputSignal<readonly ChartGPUInstance[]>;
5
- readonly syncOptions: import("@angular/core").InputSignal<Readonly<{
6
- readonly syncCrosshair?: boolean;
7
- readonly syncZoom?: boolean;
8
- }>>;
9
- readonly connectionError: import("@angular/core").OutputEmitterRef<Error>;
10
- private readonly ids;
11
- private nextId;
12
- private signature;
13
- constructor();
14
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartgpuConnectChartsDirective, never>;
15
- static ɵdir: i0.ɵɵDirectiveDeclaration<ChartgpuConnectChartsDirective, "[libChartgpuConnectCharts]", never, { "charts": { "alias": "libChartgpuConnectCharts"; "required": false; "isSignal": true; }; "syncOptions": { "alias": "syncOptions"; "required": false; "isSignal": true; }; }, { "connectionError": "connectionError"; }, never, never, true, never>;
16
- }
@@ -1 +0,0 @@
1
- export declare function provideChartGpuContext(): import("@angular/core").EnvironmentProviders;
@@ -1,20 +0,0 @@
1
- import type { ChartgpuGPUContextState } from './chartgpu-angular.types';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * Creates one shared WebGPU context and pipeline cache for charts in a dashboard.
5
- * The device is intentionally not destroyed with the service so charts can share it
6
- * for the lifetime of the application.
7
- */
8
- export declare class ChartgpuGPUContextService {
9
- readonly state: import("@angular/core").WritableSignal<ChartgpuGPUContextState>;
10
- readonly context: import("@angular/core").Signal<Readonly<{
11
- readonly device: GPUDevice;
12
- readonly adapter: GPUAdapter;
13
- readonly pipelineCache?: import("chartgpu").PipelineCache;
14
- }>>;
15
- private initialization?;
16
- initialize(): Promise<ChartgpuGPUContextState>;
17
- private createContext;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<ChartgpuGPUContextService, never>;
19
- static ɵprov: i0.ɵɵInjectableDeclaration<ChartgpuGPUContextService>;
20
- }
package/public-api.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './lib/chartgpu-angular.component';
2
- export * from './lib/chartgpu-angular.types';
3
- export * from './lib/connect-charts.directive';
4
- export * from './lib/gpu-context.provider';
5
- export * from './lib/gpu-context.service';