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

Function normalizeDomain

src/ChartGPU.ts:347–368  ·  view source on GitHub ↗
(
  minCandidate: number,
  maxCandidate: number
)

Source from the content-addressed store, hash-verified

345};
346
347const normalizeDomain = (
348 minCandidate: number,
349 maxCandidate: number
350): { readonly min: number; readonly max: number } => {
351 let min = minCandidate;
352 let max = maxCandidate;
353
354 if (!Number.isFinite(min) || !Number.isFinite(max)) {
355 min = 0;
356 max = 1;
357 }
358
359 if (min === max) {
360 max = min + 1;
361 } else if (min > max) {
362 const t = min;
363 min = max;
364 max = t;
365 }
366
367 return { min, max };
368};
369
370type CartesianHitTestMatch = Readonly<{
371 kind: 'cartesian';

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected