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

Function getSeriesSummary

src/ui-react-dom-charts/common/data.ts:304–334  ·  view source on GitHub ↗
(
  kind: Kind,
  points: DataPoint[],
  xCellId?: Id,
  yCellId?: Id,
  yLabel?: string,
)

Source from the content-addressed store, hash-verified

302];
303
304export const getSeriesSummary = (
305 kind: Kind,
306 points: DataPoint[],
307 xCellId?: Id,
308 yCellId?: Id,
309 yLabel?: string,
310): SeriesSummary => {
311 const [xMin, xMax, yMin, yMax] = getBounds(kind, points);
312 const xValues: XValue[] = [];
313 const continuousX =
314 kind == LINE &&
315 arrayIsEmpty(arrayFilter(points, ([, xValue]) => !isNumber(xValue)));
316
317 arrayForEach(points, ([, xValue]) => {
318 if (!arrayHas(xValues, xValue)) {
319 arrayPush(xValues, xValue);
320 }
321 });
322
323 return {
324 continuousX,
325 xCellId,
326 xMin,
327 xMax,
328 yMin,
329 yMax,
330 yCellId,
331 yLabel,
332 xValues,
333 };
334};
335
336export const getDomainState = (summaries: SeriesSummary[]): DomainState => {
337 const xValues: XValue[] = [];

Callers 3

LineSeries.tsxFile · 0.90
BarSeries.tsxFile · 0.90
useInitialSeriesSummaryFunction · 0.90

Calls 7

arrayIsEmptyFunction · 0.90
arrayFilterFunction · 0.90
isNumberFunction · 0.90
arrayForEachFunction · 0.90
arrayHasFunction · 0.90
arrayPushFunction · 0.90
getBoundsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…