()
| 2674 | }; |
| 2675 | |
| 2676 | const initRuntimeSeriesFromOptions = (): void => { |
| 2677 | const count = currentOptions.series.length; |
| 2678 | runtimeRawDataByIndex = new Array(count).fill(null); |
| 2679 | runtimeRawBoundsByIndex = new Array(count).fill(null); |
| 2680 | pendingAppendByIndex.clear(); |
| 2681 | |
| 2682 | for (let i = 0; i < count; i++) { |
| 2683 | const s = currentOptions.series[i]!; |
| 2684 | if (s.type === 'pie') continue; |
| 2685 | |
| 2686 | if (s.type === 'candlestick') { |
| 2687 | // Store candlestick raw OHLC data (not for streaming append, but for zoom-aware resampling). |
| 2688 | const rawOHLC = (s.rawData ?? s.data) as ReadonlyArray<OHLCDataPoint>; |
| 2689 | const owned = rawOHLC.length === 0 ? [] : rawOHLC.slice(); |
| 2690 | runtimeRawDataByIndex[i] = owned; |
| 2691 | runtimeRawBoundsByIndex[i] = s.rawBounds ?? null; |
| 2692 | continue; |
| 2693 | } |
| 2694 | |
| 2695 | const raw = (s.rawData ?? s.data) as ReadonlyArray<DataPoint>; |
| 2696 | // Coordinator-owned: copy into a mutable array (streaming appends mutate this). |
| 2697 | const owned = raw.length === 0 ? [] : raw.slice(); |
| 2698 | runtimeRawDataByIndex[i] = owned; |
| 2699 | runtimeRawBoundsByIndex[i] = s.rawBounds ?? computeRawBoundsFromData(owned); |
| 2700 | } |
| 2701 | }; |
| 2702 | |
| 2703 | const recomputeRuntimeBaseSeries = (): void => { |
| 2704 | const next: ResolvedChartGPUOptions['series'][number][] = new Array(currentOptions.series.length); |
no test coverage detected