@databrainhq/plugin 0.14.57 → 0.14.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,5 +21,7 @@ export type ListProps = {
21
21
  action: string;
22
22
  id: string;
23
23
  }>>;
24
+ isDisableMoreOption?: boolean;
25
+ isEnableHovering?: boolean;
24
26
  };
25
- export declare const List: ({ headers, data, variant, noDataText, loadMoreText, className, initialLimit, isDataLoading, showLogo, isShowOptions, setValue, }: ListProps) => React.JSX.Element;
27
+ export declare const List: ({ headers, data, variant, noDataText, loadMoreText, className, initialLimit, isDataLoading, showLogo, isShowOptions, setValue, isDisableMoreOption, isEnableHovering, }: ListProps) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { TimeSeriesSettingsProps } from '@/types';
3
- declare const TimeSeriesSettings: ({ onChange, settings: { groupBySettings, seriesType }, yAxisList, }: TimeSeriesSettingsProps) => React.JSX.Element;
3
+ declare const TimeSeriesSettings: ({ onChange, settings: { groupBySettings, seriesType }, yAxisList, onChangeTimeseriesFormat, }: TimeSeriesSettingsProps) => React.JSX.Element;
4
4
  export default TimeSeriesSettings;
@@ -98,7 +98,7 @@ export declare const NUMBER_FORMAT: {
98
98
  label: string;
99
99
  value: string;
100
100
  }[];
101
- export declare const ICONS_LIST: readonly ["new-window", "circle", "group-by", "undo", "redo", "maximize", "minimize", "fullscreen", "download", "archive", "format", "company", "profile", "users", "bar-chart", "bar-chart-2", "kebab-menu-horizontal", "kebab-menu-vertical", "paint-brush", "funnel", "funnel-simple", "cross", "columns", "gear", "presentation-chart", "chevron-down", "plus", "info", "arrow-down", "arrow-up", "arrow-left", "arrow-right", "double-arrow-left", "double-arrow-right", "expand-arrows", "eye", "eye-slash", "database", "magnifying-glass", "pencil-simple-line", "pencil-simple", "file-sql", "code", "sign-out", "save", "delete", "align-space-even", "align-bottom", "align-left", "align-right", "align-top", "trend-up", "trend-up-chart", "caret-down-fill", "caret-up-fill", "caret-up-down", "pie-chart", "table-view", "task-done-file", "right-angle", "text-rotation-angle-up", "text-rotation-none", "text-rotation-up", "preview-file", "share", "image", "text", "color-palette", "shuffle", "table", "chart", "calendar", "horizontal-rule", "short-text", "subheader", "copy", "timer", "link", "not-found", "bar-chart-horizontal", "line-chart", "line-chart-trend-up", "globe", "map", "leaderboard", "radar", "scale", "scatter-plot", "tree", "donut-chart", "scatter-chart", "waterfall-chart", "area-chart", "bubble-chart", "candlestick-chart", "string", "boolean", "date", "number", "unknown", "array", "right-join", "left-join", "outer-join", "right-full-join", "left-full-join", "inner-join", "full-join", "version-history", "roles"];
101
+ export declare const ICONS_LIST: readonly ["people", "new-window", "circle", "group-by", "undo", "redo", "maximize", "minimize", "fullscreen", "download", "archive", "format", "company", "profile", "users", "bar-chart", "bar-chart-2", "kebab-menu-horizontal", "kebab-menu-vertical", "paint-brush", "funnel", "funnel-simple", "cross", "columns", "gear", "presentation-chart", "chevron-down", "plus", "info", "arrow-down", "arrow-up", "arrow-left", "arrow-right", "double-arrow-left", "double-arrow-right", "expand-arrows", "eye", "eye-slash", "database", "magnifying-glass", "pencil-simple-line", "pencil-simple", "file-sql", "code", "sign-out", "save", "delete", "align-space-even", "align-bottom", "align-left", "align-right", "align-top", "trend-up", "trend-up-chart", "caret-down-fill", "caret-up-fill", "caret-up-down", "pie-chart", "table-view", "task-done-file", "right-angle", "text-rotation-angle-up", "text-rotation-none", "text-rotation-up", "preview-file", "share", "image", "text", "color-palette", "shuffle", "table", "chart", "calendar", "horizontal-rule", "short-text", "subheader", "copy", "timer", "link", "not-found", "bar-chart-horizontal", "line-chart", "line-chart-trend-up", "globe", "map", "leaderboard", "radar", "scale", "scatter-plot", "tree", "donut-chart", "scatter-chart", "waterfall-chart", "area-chart", "bubble-chart", "candlestick-chart", "string", "boolean", "date", "number", "unknown", "array", "right-join", "left-join", "outer-join", "right-full-join", "left-full-join", "inner-join", "full-join", "version-history", "roles"];
102
102
  export declare const NUMBER = "number";
103
103
  export declare const STRING = "string";
104
104
  export declare const BOOLEAN = "boolean";
@@ -129,6 +129,7 @@ export declare const MONGODB = "mongodb";
129
129
  export declare const DATABRICKS = "databricks";
130
130
  export declare const CLICKHOUSE = "clickhouse";
131
131
  export declare const AWSS3 = "awss3";
132
+ export declare const ELASTICSEARCH = "elasticsearch";
132
133
  export declare const DOWNLOAD_DATA_OPTIONS: {
133
134
  RAW_DATA: string;
134
135
  DOWNLOAD_WITHOUT_FILTERS: string;
@@ -9,3 +9,4 @@ export * from './areArraysEqual';
9
9
  export * from './generateTimeRangeWhereClause';
10
10
  export * from './getColumnType';
11
11
  export * from './createMetric';
12
+ export * from './timeseriesOption';
@@ -0,0 +1,198 @@
1
+ import { BackgroundSettings, ChartSettingsType, CustomSettings, FloatingDropDownOption, LabelSettings, LegendSettings } from '@/types';
2
+ type DataRow = Record<string, any>;
3
+ type AxisSettings = {
4
+ axis?: string | undefined;
5
+ };
6
+ type GetSeriesOptionParams = {
7
+ chartOptions: ChartSettingsType;
8
+ data: DataRow[];
9
+ labelSettings: LabelSettings;
10
+ backGroundColor: BackgroundSettings;
11
+ customSettings: CustomSettings;
12
+ colorOptions: Record<string, any>;
13
+ defaultOptions: Record<string, any>;
14
+ legendSettings: LegendSettings;
15
+ axisSettings: AxisSettings;
16
+ legendPosition: Record<string, any>;
17
+ };
18
+ export declare const getSeriesOption: ({ chartOptions, data, backGroundColor, customSettings, labelSettings, colorOptions, defaultOptions, legendSettings, axisSettings, legendPosition, }: GetSeriesOptionParams) => {
19
+ axisLine: {
20
+ show: boolean | undefined;
21
+ };
22
+ axisLabel: {
23
+ show: boolean | undefined;
24
+ };
25
+ tooltip: {
26
+ trigger: string;
27
+ backgroundColor: string;
28
+ borderRadius: number;
29
+ padding: number;
30
+ axisPointer: {
31
+ type: string;
32
+ };
33
+ className: string;
34
+ enterable: boolean;
35
+ valueFormatter: (value: any) => string;
36
+ formatter: (params: any) => string;
37
+ };
38
+ xAxis: {
39
+ name: string | undefined;
40
+ nameLocation: string;
41
+ nameGap: number;
42
+ nameTextStyle: {
43
+ fontSize: number;
44
+ color: string;
45
+ fontWeight: number;
46
+ };
47
+ type: string;
48
+ axisTick: {
49
+ alignWithLabel: boolean;
50
+ };
51
+ axisLabel: {
52
+ formatter?: ((value: any) => string) | undefined;
53
+ show: boolean;
54
+ color: string;
55
+ fontSize: number;
56
+ fontWeight: number;
57
+ fontFamily: string | undefined;
58
+ interval: number;
59
+ rotate: number | undefined;
60
+ hideOverlap: boolean;
61
+ };
62
+ splitLine: {
63
+ show: boolean;
64
+ };
65
+ axisLine: {
66
+ show: boolean;
67
+ };
68
+ data: string[];
69
+ };
70
+ yAxis: {
71
+ name: string | undefined;
72
+ nameLocation: string;
73
+ nameGap: number;
74
+ nameTextStyle: {
75
+ fontSize: number;
76
+ color: string;
77
+ fontWeight: number;
78
+ };
79
+ type: string;
80
+ position: string | undefined;
81
+ splitLine: {
82
+ show: boolean;
83
+ };
84
+ axisLine: {
85
+ show: boolean;
86
+ };
87
+ axisLabel: {
88
+ show: boolean;
89
+ color: string;
90
+ fontSize: number;
91
+ fontWeight: number;
92
+ fontFamily: string | undefined;
93
+ formatter: (value: any) => string;
94
+ };
95
+ };
96
+ legend: {
97
+ orient: string | undefined;
98
+ icon: string | undefined;
99
+ type: string;
100
+ data: string[];
101
+ formatter(value: any): string;
102
+ tooltip: {
103
+ show: boolean;
104
+ formatter(params: {
105
+ name: any;
106
+ }): any;
107
+ };
108
+ textStyle: {
109
+ rich: {
110
+ a: {
111
+ fontSize: number;
112
+ lineHeight: number;
113
+ };
114
+ };
115
+ };
116
+ top: number | undefined;
117
+ left: number | undefined;
118
+ right: number | undefined;
119
+ bottom: number | undefined;
120
+ show: boolean | undefined;
121
+ } | {
122
+ orient: string | undefined;
123
+ icon: string | undefined;
124
+ type: string;
125
+ data: string[];
126
+ formatter(value: any): string;
127
+ tooltip: {
128
+ show: boolean;
129
+ formatter(params: {
130
+ name: any;
131
+ }): any;
132
+ };
133
+ textStyle: {
134
+ rich: {
135
+ a: {
136
+ fontSize: number;
137
+ lineHeight: number;
138
+ };
139
+ };
140
+ };
141
+ show: boolean | undefined;
142
+ };
143
+ series: ({
144
+ stack?: string | undefined;
145
+ barWidth?: string | undefined;
146
+ showBackground?: boolean | undefined;
147
+ backgroundStyle?: {
148
+ color: string;
149
+ } | undefined;
150
+ itemStyle?: {
151
+ borderRadius: number[] | undefined;
152
+ } | undefined;
153
+ areaStyle: {
154
+ opacity?: undefined;
155
+ };
156
+ data: string[] | number[];
157
+ type: "line" | "bar";
158
+ name: string;
159
+ label: {
160
+ show: boolean | undefined;
161
+ position: string | undefined;
162
+ formatter(d: {
163
+ data: any;
164
+ }): string;
165
+ };
166
+ emphasis: {
167
+ focus: string;
168
+ };
169
+ } | {
170
+ stack?: string | undefined;
171
+ barWidth?: string | undefined;
172
+ showBackground?: boolean | undefined;
173
+ backgroundStyle?: {
174
+ color: string;
175
+ } | undefined;
176
+ itemStyle?: {
177
+ borderRadius: number[] | undefined;
178
+ } | undefined;
179
+ areaStyle: {
180
+ opacity: number;
181
+ };
182
+ data: string[] | number[];
183
+ type: "line" | "bar";
184
+ name: string;
185
+ label: {
186
+ show: boolean | undefined;
187
+ position: string | undefined;
188
+ formatter(d: {
189
+ data: any;
190
+ }): string;
191
+ };
192
+ emphasis: {
193
+ focus: string;
194
+ };
195
+ })[];
196
+ };
197
+ export declare const getFormat: (value: FloatingDropDownOption, dbName: string) => "%b - %Y" | "Mon - yyyy" | "%Y" | "yyyy" | "%Q %Y" | "Q yyyy" | "%Y-%m-%d" | "yyyy-mm-dd" | "%Y-%m-%W" | "yyyy-mm-WW";
198
+ export {};
@@ -82,5 +82,8 @@ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, client
82
82
  pivotHeaderOptions: FloatingDropDownOption[];
83
83
  pivotDrillState: PivotDrillState;
84
84
  onDrillPivotTable: ({ filters, nextLevel, currentValue, }: OnDrillPivotTableParams) => void;
85
+ legendData: any;
86
+ timeseriesDimension: any;
87
+ isPythonMode: boolean;
85
88
  };
86
89
  export {};
@@ -49,6 +49,7 @@ export type TimeSeriesSettingsProps = {
49
49
  settings: TimeSeriesSettingsType;
50
50
  onChange: (timeSeriesSettings: TimeSeriesSettingsType | ((ts: TimeSeriesSettingsType) => TimeSeriesSettingsType)) => void;
51
51
  yAxisList: string[];
52
+ onChangeTimeseriesFormat: (value: FloatingDropDownOption) => void;
52
53
  };
53
54
  export type TimeSeriesChartProps = {
54
55
  dataArray: Record<string, any>[];
@@ -192,7 +193,7 @@ export type CustomSettings = {
192
193
  showStackLabels?: boolean;
193
194
  coloredBars?: boolean;
194
195
  };
195
- export type Colors = 'primary' | 'primary-dark' | 'secondary' | 'secondary-dark' | 'alert' | 'alert-dark' | 'alert-light' | 'success' | 'success-dark' | 'success-light' | 'warning' | 'warning-dark' | 'info' | 'info-light' | 'white' | 'gray' | 'gray-dark' | 'light' | 'dark' | 'infoAlert';
196
+ export type Colors = 'primary' | 'primary-dark' | 'secondary' | 'secondary-dark' | 'alert' | 'alert-dark' | 'alert-light' | 'success' | 'success-dark' | 'success-light' | 'warning' | 'warning-dark' | 'info' | 'info-light' | 'white' | 'gray' | 'gray-dark' | 'light' | 'dark' | 'infoAlert' | 'cta';
196
197
  export type IconType = (typeof ICONS_LIST)[number];
197
198
  export type LogoType = 'redshift' | 'postgres' | 'mysql' | 'mongodb' | 'bigquery' | 'snowflake' | 'microsoft' | 'google' | 'elasticsearch' | 'redis' | 'databricks' | 'clickhouse' | 'mssql' | 'awss3';
198
199
  export type IconSizes = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
@@ -54,6 +54,10 @@ export type UseMetricQueryQueryInputType = {
54
54
  isAllClient?: boolean;
55
55
  disableStringify?: boolean;
56
56
  pivotHeaders?: string[];
57
+ timeseriesSettings?: {
58
+ format: string;
59
+ seriesField: string;
60
+ };
57
61
  };
58
62
  export type UseMetricQueryQueryOutputType = {
59
63
  data?: any | null;
@@ -28,9 +28,10 @@ export type GetChartOptionsParams = {
28
28
  data: Record<string, any>[];
29
29
  colors?: string[];
30
30
  geoJsonData?: any;
31
+ isPythonMode?: boolean;
31
32
  };
32
33
  export declare const getLegendData: ({ chartOptions, data, }: {
33
34
  chartOptions: ChartSettingsType;
34
35
  data: Record<string, any>[];
35
36
  }) => any;
36
- export declare const getChartOptions: ({ chartOptions, data, colors, geoJsonData, }: GetChartOptionsParams) => Record<string, any>;
37
+ export declare const getChartOptions: ({ chartOptions, data, colors, isPythonMode, geoJsonData, }: GetChartOptionsParams) => Record<string, any>;