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

Function normalizeDomain

src/core/createRenderCoordinator.ts:487–508  ·  view source on GitHub ↗
(
  minCandidate: number,
  maxCandidate: number
)

Source from the content-addressed store, hash-verified

485};
486
487const normalizeDomain = (
488 minCandidate: number,
489 maxCandidate: number
490): { readonly min: number; readonly max: number } => {
491 let min = minCandidate;
492 let max = maxCandidate;
493
494 if (!Number.isFinite(min) || !Number.isFinite(max)) {
495 min = 0;
496 max = 1;
497 }
498
499 if (min === max) {
500 max = min + 1;
501 } else if (min > max) {
502 const t = min;
503 min = max;
504 max = t;
505 }
506
507 return { min, max };
508};
509
510const computeGridArea = (gpuContext: GPUContextLike, options: ResolvedChartGPUOptions): GridArea => {
511 const canvas = gpuContext.canvas;

Callers 4

lerpDomainFunction · 0.70
computeBaseXDomainFunction · 0.70
computeBaseYDomainFunction · 0.70
computeVisibleXDomainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected