MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getResolvedXScale

Function getResolvedXScale

src/ui-react-dom-charts/common/data.ts:228–245  ·  view source on GitHub ↗
(
  xAxisScale: 'auto' | XScale | undefined,
  {continuousX, xValues}: DomainState,
  hasLinearAxisDefinition: boolean,
)

Source from the content-addressed store, hash-verified

226 : [];
227
228export const getResolvedXScale = (
229 xAxisScale: 'auto' | XScale | undefined,
230 {continuousX, xValues}: DomainState,
231 hasLinearAxisDefinition: boolean,
232): XScale =>
233 xAxisScale == CATEGORY || xAxisScale == LINEAR || xAxisScale == TIME
234 ? xAxisScale
235 : continuousX || (arrayIsEmpty(xValues) && hasLinearAxisDefinition)
236 ? LINEAR
237 : !arrayIsEmpty(xValues) &&
238 arrayEvery(
239 xValues,
240 (xValue) =>
241 isString(xValue) &&
242 isFiniteNumber(normalizeTimeValue(xValue, MILLISECOND)),
243 )
244 ? TIME
245 : CATEGORY;
246
247export const getXScaleDomain = (
248 [xMin, xMax]: Bounds,

Callers 1

CartesianChartFunction · 0.90

Calls 4

arrayIsEmptyFunction · 0.90
arrayEveryFunction · 0.90
isStringFunction · 0.90
normalizeTimeValueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…