| 3011 | a.min === b.min && a.max === b.max; |
| 3012 | |
| 3013 | const didSeriesDataLikelyChange = ( |
| 3014 | prev: ResolvedChartGPUOptions['series'], |
| 3015 | next: ResolvedChartGPUOptions['series'] |
| 3016 | ): boolean => { |
| 3017 | if (prev.length !== next.length) return true; |
| 3018 | for (let i = 0; i < prev.length; i++) { |
| 3019 | const a = prev[i]!; |
| 3020 | const b = next[i]!; |
| 3021 | if (a.type !== b.type) return true; |
| 3022 | |
| 3023 | // Prefer cheap reference checks (good enough for eligibility gating). |
| 3024 | if (a.type === 'pie') { |
| 3025 | const aPie = a as ResolvedPieSeriesConfig; |
| 3026 | const bPie = b as ResolvedPieSeriesConfig; |
| 3027 | if (aPie.data !== bPie.data) return true; |
| 3028 | if (aPie.data.length !== bPie.data.length) return true; |
| 3029 | } else { |
| 3030 | const aAny = a as unknown as { readonly rawData?: ReadonlyArray<DataPoint>; readonly data: ReadonlyArray<DataPoint> }; |
| 3031 | const bAny = b as unknown as { readonly rawData?: ReadonlyArray<DataPoint>; readonly data: ReadonlyArray<DataPoint> }; |
| 3032 | const aRaw = (aAny.rawData ?? aAny.data) as ReadonlyArray<DataPoint>; |
| 3033 | const bRaw = (bAny.rawData ?? bAny.data) as ReadonlyArray<DataPoint>; |
| 3034 | if (aRaw !== bRaw) return true; |
| 3035 | if (aRaw.length !== bRaw.length) return true; |
| 3036 | } |
| 3037 | } |
| 3038 | return false; |
| 3039 | }; |
| 3040 | |
| 3041 | const setOptions: RenderCoordinator['setOptions'] = (resolvedOptions) => { |
| 3042 | assertNotDisposed(); |