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

Function computeSharedBarLayout

src/interaction/findNearestPoint.ts:260–275  ·  view source on GitHub ↗
(
  seriesConfigs: ReadonlyArray<ResolvedBarSeriesConfig>,
)

Source from the content-addressed store, hash-verified

258}>;
259
260const computeSharedBarLayout = (
261 seriesConfigs: ReadonlyArray<ResolvedBarSeriesConfig>,
262): BarSharedLayout => {
263 let barWidth: number | string | undefined = undefined;
264 let barGap: number | undefined = undefined;
265 let barCategoryGap: number | undefined = undefined;
266
267 for (let i = 0; i < seriesConfigs.length; i++) {
268 const s = seriesConfigs[i];
269 if (barWidth === undefined && s.barWidth !== undefined) barWidth = s.barWidth;
270 if (barGap === undefined && s.barGap !== undefined) barGap = s.barGap;
271 if (barCategoryGap === undefined && s.barCategoryGap !== undefined) barCategoryGap = s.barCategoryGap;
272 }
273
274 return { barWidth, barGap, barCategoryGap };
275};
276
277export type BarLayoutPx = Readonly<{
278 categoryStep: number;

Callers 1

computeBarLayoutPxFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected