MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / getDataZoomConfig

Function getDataZoomConfig

examples/candlestick-streaming/main.ts:71–83  ·  view source on GitHub ↗
(candleCount: number)

Source from the content-addressed store, hash-verified

69
70// Get appropriate dataZoom config based on candle count
71function getDataZoomConfig(candleCount: number) {
72 if (candleCount <= 200) {
73 // Few candles: just inside zoom, show all data
74 return [{ type: 'inside' }];
75 } else {
76 // Many candles: add slider and zoom to recent data
77 const showPercent = Math.min(100, Math.max(5, 500 / candleCount * 100));
78 return [
79 { type: 'inside' },
80 { type: 'slider', start: 100 - showPercent, end: 100 },
81 ];
82 }
83}
84
85// Get max candles based on current count (allow some growth for streaming)
86function getMaxCandles(candleCount: number): number {

Callers 2

initFunction · 0.85
switchCandleCountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected