MCPcopy
hub / github.com/ChartGPU/ChartGPU / ChartGPUInstance

Interface ChartGPUInstance

src/ChartGPU.ts:44–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42const FRAME_DROP_THRESHOLD_MULTIPLIER = 1.5;
43
44export interface ChartGPUInstance {
45 readonly options: Readonly<ChartGPUOptions>;
46 readonly disposed: boolean;
47 setOption(options: ChartGPUOptions): void;
48 /**
49 * Appends new points to a cartesian series at runtime (streaming).
50 *
51 * For candlestick series, pass `OHLCDataPoint[]`.
52 * For other cartesian series (line, area, bar, scatter), pass `DataPoint[]`.
53 * Pie series are non-cartesian and are not supported by streaming append.
54 */
55 appendData(seriesIndex: number, newPoints: DataPoint[] | OHLCDataPoint[]): void;
56 resize(): void;
57 dispose(): void;
58 on(eventName: 'crosshairMove', callback: ChartGPUCrosshairMoveCallback): void;
59 on(eventName: ChartGPUEventName, callback: ChartGPUEventCallback): void;
60 off(eventName: 'crosshairMove', callback: ChartGPUCrosshairMoveCallback): void;
61 off(eventName: ChartGPUEventName, callback: ChartGPUEventCallback): void;
62 /**
63 * Gets the current “interaction x” in domain units (or `null` when inactive).
64 *
65 * This is derived from pointer movement inside the plot grid and can also be driven
66 * externally via `setInteractionX(...)` (e.g. chart sync).
67 */
68 getInteractionX(): number | null;
69 /**
70 * Drives the chart’s crosshair + tooltip from a domain-space x value.
71 *
72 * Passing `null` clears the interaction (hides crosshair/tooltip).
73 */
74 setInteractionX(x: number | null, source?: unknown): void;
75 /**
76 * Alias for `setInteractionX(...)` for chart sync semantics.
77 */
78 setCrosshairX(x: number | null, source?: unknown): void;
79 /**
80 * Subscribes to interaction x changes (domain units).
81 *
82 * Returns an unsubscribe function.
83 */
84 onInteractionXChange(callback: (x: number | null, source?: unknown) => void): () => void;
85 /**
86 * Returns the current percent-space zoom window (or `null` when zoom is disabled).
87 */
88 getZoomRange(): Readonly<{ start: number; end: number }> | null;
89 /**
90 * Sets the percent-space zoom window.
91 *
92 * No-op when zoom is disabled.
93 */
94 setZoomRange(start: number, end: number): void;
95 /**
96 * Gets the latest performance metrics.
97 * Returns exact FPS and detailed frame statistics.
98 *
99 * @returns Current performance metrics, or null if not available
100 */
101 getPerformanceMetrics(): Readonly<PerformanceMetrics> | null;

Callers 59

applyFunction · 0.65
handleTickFunction · 0.65
toggleAutoScrollFunction · 0.65
switchTimeframeFunction · 0.65
switchCandleCountFunction · 0.65
setupControlsFunction · 0.65
updateChartsFunction · 0.65
appendDataFunction · 0.65
streamFrameFunction · 0.65
mainFunction · 0.65
handleTickFunction · 0.65

Implementers 1

ChartGPUWorkerProxysrc/worker/ChartGPUWorkerProxy.ts

Calls

no outgoing calls

Tested by

no test coverage detected