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

Function getTickLabel

src/ui-react-dom-charts/components/XAxis.tsx:111–124  ·  view source on GitHub ↗
(
  tick: XValue | Date,
  tickFormatter: TickFormatter | undefined,
  xScale: XScale,
  timestampUnit: TimestampUnit,
  ticks: Ticks = [],
)

Source from the content-addressed store, hash-verified

109};
110
111const getTickLabel = (
112 tick: XValue | Date,
113 tickFormatter: TickFormatter | undefined,
114 xScale: XScale,
115 timestampUnit: TimestampUnit,
116 ticks: Ticks = [],
117) => {
118 const timestamp =
119 xScale == TIME ? normalizeTimeValue(tick, timestampUnit) : undefined;
120 return isNumber(timestamp)
121 ? (tickFormatter?.(dateNew(timestamp), timestamp) ??
122 getTimeTickLabel(timestamp, ticks))
123 : (tickFormatter?.(tick, undefined) ?? string(tick));
124};

Callers 1

XAxisFunction · 0.70

Calls 5

normalizeTimeValueFunction · 0.90
isNumberFunction · 0.90
dateNewFunction · 0.90
getTimeTickLabelFunction · 0.90
stringFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…