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

Function generateLinearTicks

src/core/createRenderCoordinator.ts:1092–1100  ·  view source on GitHub ↗
(domainMin: number, domainMax: number, tickCount: number)

Source from the content-addressed store, hash-verified

1090};
1091
1092const generateLinearTicks = (domainMin: number, domainMax: number, tickCount: number): number[] => {
1093 const count = Math.max(1, Math.floor(tickCount));
1094 const ticks: number[] = new Array(count);
1095 for (let i = 0; i < count; i++) {
1096 const t = count === 1 ? 0.5 : i / (count - 1);
1097 ticks[i] = domainMin + t * (domainMax - domainMin);
1098 }
1099 return ticks;
1100};
1101
1102const computeAdaptiveTimeXAxisTicks = (params: {
1103 readonly axisMin: number | null;

Callers 2

renderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected