MCPcopy Create free account
hub / github.com/ChartGPU/ChartGPU / getTrackWidthPx

Function getTrackWidthPx

src/components/createDataZoomSlider.ts:124–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 };
123
124 const getTrackWidthPx = (): number | null => {
125 // getBoundingClientRect() is robust even if the container is scaled.
126 const w = track.getBoundingClientRect().width;
127 return Number.isFinite(w) && w > 0 ? w : null;
128 };
129
130 const pxToPercent = (dxPx: number): number | null => {
131 const w = getTrackWidthPx();

Callers 1

pxToPercentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected