-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathchart-props.tsx
More file actions
43 lines (37 loc) · 1.31 KB
/
chart-props.tsx
File metadata and controls
43 lines (37 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { EmbedQueryParams } from "@/components/embed-params";
import { ChartConfig, DataSource } from "@/config-types";
import { Dimension, Measure, Observation } from "@/domain/data";
import { DataCubeObservationFilter } from "@/graphql/query-hooks";
export type DimensionsById = Record<string, Dimension>;
export type MeasuresById = Record<string, Measure>;
export type PaginationControls = {
pageIndex: number;
pageSize: number;
canNextPage: boolean;
canPreviousPage: boolean;
totalCount: number;
nextPage: () => void;
previousPage: () => void;
gotoPage: (pageIndex: number) => void;
setPageSize: (pageSize: number) => void;
setSortBy: (sortBy: Array<{ id: string; desc: boolean }>) => void;
};
export type BaseChartProps = {
observations: Observation[];
dimensions: Dimension[];
dimensionsById: DimensionsById;
measures: Measure[];
measuresById: MeasuresById;
embedParams?: EmbedQueryParams;
pagination?: PaginationControls;
};
export type ChartProps<TChartConfig extends ChartConfig> = BaseChartProps & {
chartConfig: TChartConfig;
};
export type VisualizationProps<TChartConfig extends ChartConfig> = {
dataSource: DataSource;
componentIds: string[] | undefined;
chartConfig: TChartConfig;
observationQueryFilters: DataCubeObservationFilter[];
embedParams?: EmbedQueryParams;
};