/** * Brush config transform: enables ECharts' brush component on the option * object. Module-level constant — identity stable across renders. * * Pairs with `replaceMergeKeys: ['brush']` so the pipeline replaces (not * merges) the brush config on every config-pipeline run. v1 needed a * mousemove re-dispatch hack to keep the brush state across data updates; * v2 keeps brush state continuous via `notMerge: false` + dynamic * replaceMerge in the EchartUI layer (D6) — no hack required. */ export const addBrush = (option: unknown): unknown => { if (option == null || typeof option !== 'object') return option const cfg = option as Record return { ...cfg, brush: { toolbox: ['rect', 'clear'], xAxisIndex: 'all', brushLink: 'all', outOfBrush: { colorAlpha: 0.15 }, }, toolbox: { ...((cfg.toolbox as object | undefined) ?? {}), show: false, feature: { ...((cfg.toolbox as { feature?: object } | undefined)?.feature ?? {}), brush: { type: ['rect', 'clear'] }, }, }, } }