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

Function useInitialSeriesSummary

src/ui-react-dom-charts/components/summary.ts:21–94  ·  view source on GitHub ↗
(
  kind: Kind,
  {
    descending,
    limit,
    offset,
    queries,
    queryId,
    sortCellId,
    store,
    tableId,
    xCellId,
    yCellId,
  }: AliasProps,
)

Source from the content-addressed store, hash-verified

19 ChartProps;
20
21export const useInitialSeriesSummary = (
22 kind: Kind,
23 {
24 descending,
25 limit,
26 offset,
27 queries,
28 queryId,
29 sortCellId,
30 store,
31 tableId,
32 xCellId,
33 yCellId,
34 }: AliasProps,
35): SeriesSummary | undefined => {
36 const storeObject = useStoreOrStoreById(store);
37 const queriesObject = useQueriesOrQueriesById(queries);
38
39 return useMemo(() => {
40 const points = isNullish(tableId)
41 ? getDataPoints(
42 queriesObject?.getResultSortedRowIds(
43 queryId ?? EMPTY_STRING,
44 sortCellId ?? xCellId,
45 descending,
46 offset,
47 limit,
48 ) ?? [],
49 (rowId) =>
50 getDataPoint(
51 rowId,
52 queriesObject?.getResultCell(
53 queryId ?? EMPTY_STRING,
54 rowId,
55 xCellId,
56 ),
57 queriesObject?.getResultCell(
58 queryId ?? EMPTY_STRING,
59 rowId,
60 yCellId,
61 ),
62 ),
63 )
64 : getDataPoints(
65 storeObject?.getSortedRowIds(
66 tableId,
67 sortCellId ?? xCellId,
68 descending,
69 offset,
70 limit,
71 ) ?? [],
72 (rowId) =>
73 getDataPoint(
74 rowId,
75 storeObject?.getCell(tableId, rowId, xCellId),
76 storeObject?.getCell(tableId, rowId, yCellId),
77 ),
78 );

Callers 2

BarChartFunction · 0.90
LineChartFunction · 0.90

Calls 10

useStoreOrStoreByIdFunction · 0.90
useQueriesOrQueriesByIdFunction · 0.90
isNullishFunction · 0.90
getDataPointsFunction · 0.90
getDataPointFunction · 0.90
getSeriesSummaryFunction · 0.90
getResultSortedRowIdsMethod · 0.65
getResultCellMethod · 0.65
getSortedRowIdsMethod · 0.65
getCellMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…