@databrainhq/plugin 0.10.23 → 0.10.151
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.
- package/README.md +159 -8
- package/dist/components/Chart/SingleValueChart.d.ts +4 -1
- package/dist/components/ChartPopup/components/UnderlyingData/index.d.ts +3 -2
- package/dist/components/ChartPopup/index.d.ts +4 -3
- package/dist/components/DrillBreadCrumb/index.d.ts +2 -1
- package/dist/components/GlobalFilters/NumberFilterField.d.ts +4 -4
- package/dist/components/InternetFailure/index.d.ts +2 -0
- package/dist/components/MetricFilterDropDown/index.d.ts +1 -1
- package/dist/components/MetricList/components/FullScreenView/AddMetricFilter.d.ts +8 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/consts/app.d.ts +4 -0
- package/dist/containers/Dashboard/Dashboard.d.ts +14 -4
- package/dist/containers/Dashboard/EmbededDashboard.d.ts +0 -1
- package/dist/containers/Metric/EmbeddedMetric.d.ts +3 -1
- package/dist/containers/Metric/index.d.ts +20 -3
- package/dist/hooks/useDashboardContext.d.ts +2 -0
- package/dist/hooks/useEmbeddedDashboard.d.ts +1 -0
- package/dist/hooks/useMetricCard.d.ts +4 -3
- package/dist/hooks/useUnderlyingData.d.ts +4 -3
- package/dist/index.es.js +25289 -24611
- package/dist/index.umd.js +168 -164
- package/dist/style.css +1 -1
- package/dist/types/app.d.ts +8 -3
- package/dist/utils/checkIsOnline.d.ts +2 -0
- package/dist/utils/generated/graphql.d.ts +7 -6
- package/dist/webcomponents.d.ts +16 -0
- package/dist/webcomponents.es.js +93086 -0
- package/dist/webcomponents.umd.js +1861 -0
- package/package.json +29 -15
- package/src/index.ts +7 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @databrainhq/plugin
|
|
2
2
|
|
|
3
|
-
> Databrain app ui plugin.
|
|
3
|
+
> Databrain app ui web component plugin.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@databrainhq/plugin) [](https://standardjs.com)
|
|
6
6
|
|
|
@@ -12,15 +12,20 @@ npm install @databrainhq/plugin
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
React/Solidjs
|
|
16
16
|
|
|
17
|
+
Import in main/index/App
|
|
17
18
|
```tsx
|
|
18
|
-
import
|
|
19
|
-
|
|
19
|
+
import '@databrainhq/plugin/web';
|
|
20
|
+
```
|
|
21
|
+
Then use it anywhere in your app
|
|
22
|
+
|
|
23
|
+
Integrating Dashboard
|
|
20
24
|
|
|
25
|
+
```tsx
|
|
21
26
|
const Example = () => {
|
|
22
27
|
return (
|
|
23
|
-
<
|
|
28
|
+
<dbn-dashboard
|
|
24
29
|
token="Your Guest Token"
|
|
25
30
|
dashboardId="Your Dashboard Id"
|
|
26
31
|
options={{
|
|
@@ -49,9 +54,6 @@ const Example = () => {
|
|
|
49
54
|
Integrating Metric
|
|
50
55
|
|
|
51
56
|
```tsx
|
|
52
|
-
import { Metric } from '@databrainhq/plugin';
|
|
53
|
-
import '@databrainhq/plugin/dist/style.css';
|
|
54
|
-
|
|
55
57
|
const Example = () => {
|
|
56
58
|
return (
|
|
57
59
|
<Metric
|
|
@@ -77,6 +79,155 @@ const Example = () => {
|
|
|
77
79
|
};
|
|
78
80
|
```
|
|
79
81
|
|
|
82
|
+
Vue
|
|
83
|
+
|
|
84
|
+
Import in main/index/App
|
|
85
|
+
```vue
|
|
86
|
+
<script setup lang="ts">
|
|
87
|
+
import '@databrainhq/plugin/web';
|
|
88
|
+
</script>
|
|
89
|
+
```
|
|
90
|
+
Then use it anywhere in your app
|
|
91
|
+
|
|
92
|
+
Integrating Dashboard
|
|
93
|
+
|
|
94
|
+
```vue
|
|
95
|
+
<script setup lang="ts">
|
|
96
|
+
// your component logic
|
|
97
|
+
</script>
|
|
98
|
+
<template>
|
|
99
|
+
<dbn-dashboard
|
|
100
|
+
:token="/*YOUR GUEST TOKEN*/"
|
|
101
|
+
:options="/*YOUR ACCESS PERMISSION OPTIONS*/"
|
|
102
|
+
:theme="/*YOUR THEME*/"
|
|
103
|
+
:dashboardId="/*YOUR DASHBORD ID*/"
|
|
104
|
+
></dbn-dashboard>
|
|
105
|
+
</template>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Integrating Metric
|
|
109
|
+
|
|
110
|
+
```vue
|
|
111
|
+
<script setup lang="ts">
|
|
112
|
+
// your component logic
|
|
113
|
+
</script>
|
|
114
|
+
<template>
|
|
115
|
+
<dbn-metric
|
|
116
|
+
:token="/*YOUR GUEST TOKEN*/"
|
|
117
|
+
chartRendererType="canvas"
|
|
118
|
+
:theme="/*YOUR THEME*/"
|
|
119
|
+
:dashboardId="/*YOUR DASHBORD ID*/"
|
|
120
|
+
width="500"
|
|
121
|
+
height="400"
|
|
122
|
+
:style="/* YOUR STYLEs */"
|
|
123
|
+
className="YOUR CLASS"
|
|
124
|
+
></dbn-metric>
|
|
125
|
+
</template>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Svelte
|
|
129
|
+
|
|
130
|
+
Import in main/index/App
|
|
131
|
+
|
|
132
|
+
```svelte
|
|
133
|
+
<script lang="ts">
|
|
134
|
+
import '@databrainhq/plugin/web';
|
|
135
|
+
</script>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Then use it anywhere in your app
|
|
139
|
+
|
|
140
|
+
Integrating Dashboard
|
|
141
|
+
|
|
142
|
+
```svelte
|
|
143
|
+
<script lang="ts">
|
|
144
|
+
// your component logic
|
|
145
|
+
</script>
|
|
146
|
+
<main>
|
|
147
|
+
<dbn-dashboard
|
|
148
|
+
token={/*YOUR GUEST TOKEN*/}
|
|
149
|
+
options={/*YOUR ACCESS PERMISSION OPTIONS*/}
|
|
150
|
+
theme={/*YOUR THEME*/}
|
|
151
|
+
dashboardId={/*YOUR DASHBORD ID*/}
|
|
152
|
+
></dbn-dashboard>
|
|
153
|
+
</main>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Integrating Metric
|
|
157
|
+
|
|
158
|
+
```svelte
|
|
159
|
+
<script lang="ts">
|
|
160
|
+
// your component logic
|
|
161
|
+
</script>
|
|
162
|
+
<main>
|
|
163
|
+
<dbn-metric
|
|
164
|
+
token={/*YOUR GUEST TOKEN*/}
|
|
165
|
+
chartRendererType="canvas"
|
|
166
|
+
theme={/*YOUR THEME*/}
|
|
167
|
+
dashboardId="/*YOUR DASHBORD ID*/"
|
|
168
|
+
width="500"
|
|
169
|
+
height="400"
|
|
170
|
+
style={/* YOUR STYLEs */}
|
|
171
|
+
className="YOUR CLASS"
|
|
172
|
+
></dbn-metric>
|
|
173
|
+
</main>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Angular
|
|
177
|
+
|
|
178
|
+
Add suport for custom elements/web components in app.module.ts
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
// app.module.ts
|
|
182
|
+
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
183
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
184
|
+
|
|
185
|
+
import { AppComponent } from './app.component';
|
|
186
|
+
|
|
187
|
+
@NgModule({
|
|
188
|
+
declarations: [AppComponent],
|
|
189
|
+
imports: [BrowserModule],
|
|
190
|
+
providers: [],
|
|
191
|
+
bootstrap: [AppComponent],
|
|
192
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
export class AppModule {}
|
|
196
|
+
```
|
|
197
|
+
Import in app.component.ts
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
import '@databrainhq/plugin/web';
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Then use it anywhere in your app
|
|
204
|
+
|
|
205
|
+
Integrating Dashboard
|
|
206
|
+
|
|
207
|
+
```html
|
|
208
|
+
<dbn-dashboard
|
|
209
|
+
token="YOUR GUEST TOKEN"
|
|
210
|
+
options="YOUR ACCESS PERMISSION OPTIONS"
|
|
211
|
+
theme="YOUR THEME"
|
|
212
|
+
dashboardId="YOUR DASHBORD ID"
|
|
213
|
+
></dbn-dashboard>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Integrating Metric
|
|
217
|
+
|
|
218
|
+
```html
|
|
219
|
+
<dbn-metric
|
|
220
|
+
token="YOUR GUEST TOKEN"
|
|
221
|
+
chartRendererType="canvas"
|
|
222
|
+
theme="YOUR THEME"
|
|
223
|
+
dashboardId="YOUR DASHBORD ID"
|
|
224
|
+
width="500"
|
|
225
|
+
height="400"
|
|
226
|
+
style="YOUR STYLE"
|
|
227
|
+
className="YOUR CLASS"
|
|
228
|
+
></dbn-metric>
|
|
229
|
+
```
|
|
230
|
+
|
|
80
231
|
## License
|
|
81
232
|
|
|
82
233
|
MIT © [databrainhq](https://github.com/databrainhq)
|
|
@@ -9,6 +9,7 @@ export type SingleValueChartProps = {
|
|
|
9
9
|
comparisonValueFontSize?: number;
|
|
10
10
|
comparisonTimePeriod?: number;
|
|
11
11
|
comparisonTimeGrain?: string;
|
|
12
|
+
comparisonSuffix?: string;
|
|
12
13
|
};
|
|
13
14
|
value: string | number;
|
|
14
15
|
hideBorder?: boolean;
|
|
@@ -16,6 +17,8 @@ export type SingleValueChartProps = {
|
|
|
16
17
|
className?: string;
|
|
17
18
|
onChartReady?: () => void;
|
|
18
19
|
comparisonValue?: string;
|
|
20
|
+
trendLineOptions?: any;
|
|
21
|
+
events: any;
|
|
19
22
|
};
|
|
20
|
-
declare const _default: React.MemoExoticComponent<({ value, settings, chartClickConfig, hideBorder, className, onChartReady, comparisonValue, }: SingleValueChartProps) => JSX.Element>;
|
|
23
|
+
declare const _default: React.MemoExoticComponent<({ value, settings, chartClickConfig, hideBorder, className, onChartReady, comparisonValue, trendLineOptions, events, }: SingleValueChartProps) => JSX.Element>;
|
|
21
24
|
export default _default;
|
|
@@ -5,7 +5,8 @@ type UnderlyingDataProps = {
|
|
|
5
5
|
isShowUnderlyingData: boolean;
|
|
6
6
|
value: any;
|
|
7
7
|
getUnderlyingData: GetUnderlyingData;
|
|
8
|
-
columnName: string;
|
|
8
|
+
columnName: string | undefined;
|
|
9
|
+
isSingleValueChart: boolean;
|
|
9
10
|
};
|
|
10
|
-
declare const _default: React.MemoExoticComponent<({ isShowUnderlyingData, setShowUnderlyingData, getUnderlyingData, columnName, value, }: UnderlyingDataProps) => JSX.Element>;
|
|
11
|
+
declare const _default: React.MemoExoticComponent<({ isShowUnderlyingData, setShowUnderlyingData, getUnderlyingData, columnName, value, isSingleValueChart, }: UnderlyingDataProps) => JSX.Element>;
|
|
11
12
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import { ClickActionsConfig, GetUnderlyingData } from '@/types';
|
|
|
3
3
|
export type ChartPopupProps = React.PropsWithChildren & {
|
|
4
4
|
getUnderlyingData: GetUnderlyingData;
|
|
5
5
|
value: any;
|
|
6
|
-
columnName: string;
|
|
6
|
+
columnName: string | undefined;
|
|
7
7
|
menuClass?: string;
|
|
8
8
|
menuContainerClass?: string;
|
|
9
9
|
isOpen: boolean;
|
|
@@ -13,8 +13,9 @@ export type ChartPopupProps = React.PropsWithChildren & {
|
|
|
13
13
|
containerRef: React.RefObject<HTMLDivElement>;
|
|
14
14
|
event: any;
|
|
15
15
|
};
|
|
16
|
+
isSingleValueChart: boolean;
|
|
16
17
|
position?: 'left' | 'right' | 'top' | 'bottom' | 'left-bottom-end' | 'right-bottom-end' | 'left-top-end' | 'right-top-end' | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top' | 'center' | 'dynamic';
|
|
17
18
|
};
|
|
18
|
-
export declare const ChartPopup: ({ position, menuContainerClass, menuClass, isOpen, setOpen, value, columnName, getUnderlyingData, clickBehaviourConfigs, elementRef, }: ChartPopupProps) => JSX.Element;
|
|
19
|
-
declare const _default: React.MemoExoticComponent<({ position, menuContainerClass, menuClass, isOpen, setOpen, value, columnName, getUnderlyingData, clickBehaviourConfigs, elementRef, }: ChartPopupProps) => JSX.Element>;
|
|
19
|
+
export declare const ChartPopup: ({ position, menuContainerClass, menuClass, isOpen, setOpen, value, columnName, getUnderlyingData, clickBehaviourConfigs, elementRef, isSingleValueChart, }: ChartPopupProps) => JSX.Element;
|
|
20
|
+
declare const _default: React.MemoExoticComponent<({ position, menuContainerClass, menuClass, isOpen, setOpen, value, columnName, getUnderlyingData, clickBehaviourConfigs, elementRef, isSingleValueChart, }: ChartPopupProps) => JSX.Element>;
|
|
20
21
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const DrillBreadCrumb: ({ dimensions, drilledLevel, }: {
|
|
2
|
+
export declare const DrillBreadCrumb: ({ dimensions, drilledLevel, onResetLevel, }: {
|
|
3
3
|
dimensions: string[];
|
|
4
4
|
drilledLevel: number;
|
|
5
|
+
onResetLevel: () => void;
|
|
5
6
|
}) => JSX.Element;
|
|
6
7
|
export default DrillBreadCrumb;
|
|
@@ -10,13 +10,13 @@ type NumberFieldProps = {
|
|
|
10
10
|
isShowHorizontal?: boolean;
|
|
11
11
|
};
|
|
12
12
|
defaultValues?: {
|
|
13
|
-
min: number;
|
|
14
|
-
max: number;
|
|
13
|
+
min: number | null;
|
|
14
|
+
max: number | null;
|
|
15
15
|
};
|
|
16
16
|
className?: string;
|
|
17
17
|
onChange?: (value: {
|
|
18
|
-
min: number;
|
|
19
|
-
max: number;
|
|
18
|
+
min: number | null;
|
|
19
|
+
max: number | null;
|
|
20
20
|
}) => void;
|
|
21
21
|
label?: string;
|
|
22
22
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FloatingDropDownOption, RlsCondition } from '@/types';
|
|
3
3
|
type Props = {
|
|
4
|
-
rlsConditions?: RlsCondition
|
|
4
|
+
rlsConditions?: RlsCondition;
|
|
5
5
|
onChangeFilterValue?: (name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
|
|
6
6
|
companyId: string;
|
|
7
7
|
integrationId: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RlsCondition } from '@/types';
|
|
3
|
+
type AddMetricFilterProps = {
|
|
4
|
+
filters: RlsCondition[];
|
|
5
|
+
updateFilter: (filter: RlsCondition) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const AddMetricFilter: ({ filters, updateFilter }: AddMetricFilterProps) => JSX.Element;
|
|
8
|
+
export default AddMetricFilter;
|
|
@@ -25,6 +25,7 @@ type HookSelectInput = Omit<SelectInput, 'value'> & {
|
|
|
25
25
|
control: Control;
|
|
26
26
|
name: string;
|
|
27
27
|
};
|
|
28
|
+
export declare const OldSelect: ({ name, label, options, onChange, value, defaultValue, children, placeHolder, className, containerClass, isSearchEnabled, textSize, icon, labelVariant, }: SelectInput) => JSX.Element;
|
|
28
29
|
export declare const Select: ({ name, label, options, onChange, value, defaultValue, children, placeHolder, className, containerClass, isSearchEnabled, textSize, icon, labelVariant, }: SelectInput) => JSX.Element;
|
|
29
30
|
export declare const HookSelect: ({ control, name, ...rest }: HookSelectInput) => JSX.Element;
|
|
30
31
|
export declare const SelectWithSubValue: ({ label, options, onChange, value, defaultValue, }: any) => JSX.Element;
|
|
@@ -45,6 +46,7 @@ type MultiSelectProps = {
|
|
|
45
46
|
isSearchEnabled?: boolean;
|
|
46
47
|
icon?: JSX.Element;
|
|
47
48
|
};
|
|
49
|
+
export declare const OldMultiSelect: React.FC<MultiSelectProps>;
|
|
48
50
|
export declare const MultiSelect: React.FC<MultiSelectProps>;
|
|
49
51
|
type HookMultiSelectProps = MultiSelectProps & {
|
|
50
52
|
control: Control<FieldValues>;
|
package/dist/consts/app.d.ts
CHANGED
|
@@ -66,3 +66,7 @@ export declare const RAW_CSV_OPTIONS: string[];
|
|
|
66
66
|
export declare const NONE = "NONE";
|
|
67
67
|
export declare const REQUESTED = "REQUESTED";
|
|
68
68
|
export declare const AVAILABLE = "AVAILABLE";
|
|
69
|
+
export declare const NUMBER_FORMAT: {
|
|
70
|
+
label: string;
|
|
71
|
+
value: string;
|
|
72
|
+
}[];
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { ThemeType } from '@/utils/theme';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* token - The client based guest token (required).
|
|
5
|
+
* dashboardId - The id of the dashboard you want to see.
|
|
6
|
+
* options - Access permissions and customization.
|
|
7
|
+
* disableMetricCreation - boolean value to enable or disable metric creation
|
|
8
|
+
* disableMetricUpdation - boolean value to enable or disable metric updation
|
|
9
|
+
* disableMetricDeletion - boolean value to enable or disable metric deletion
|
|
10
|
+
* disableLayoutCustomization - boolean value to enable or disable dashboard layout customization
|
|
11
|
+
* chartColors - array of colors where each color should be a valid color string e.g. color name, rgb value, hex value, etc.
|
|
12
|
+
* theme - Theme customization.
|
|
13
|
+
*/
|
|
14
|
+
export interface DashboardProps extends HTMLAttributes<HTMLElement> {
|
|
4
15
|
token: string;
|
|
5
16
|
dashboardId?: string;
|
|
6
17
|
options?: {
|
|
7
|
-
headerVariant?: 'static' | 'floating';
|
|
8
18
|
disableMetricCreation?: boolean;
|
|
9
19
|
disableMetricUpdation?: boolean;
|
|
10
20
|
disableMetricDeletion?: boolean;
|
|
@@ -20,4 +30,4 @@ export interface DashboardProps {
|
|
|
20
30
|
* @prop {object} options (optional) - Additional options like access permissions e.g. metric creation, updation, archiving and layout customization.
|
|
21
31
|
* @prop {object} theme (optional) - A theme object to customize the theme.
|
|
22
32
|
*/
|
|
23
|
-
export declare const Dashboard:
|
|
33
|
+
export declare const Dashboard: ({ token, options, theme, dashboardId, }: DashboardProps) => JSX.Element;
|
|
@@ -4,5 +4,7 @@ export interface EmbeddedMetricProps {
|
|
|
4
4
|
chartColors?: string[];
|
|
5
5
|
metricId: string;
|
|
6
6
|
chartRendererType?: 'svg' | 'canvas';
|
|
7
|
+
variant?: 'card' | 'fullscreen';
|
|
8
|
+
onMinimize?: () => void;
|
|
7
9
|
}
|
|
8
|
-
export declare const EmbeddedMetric: React.MemoExoticComponent<({ token, chartColors, metricId, chartRendererType, }: EmbeddedMetricProps) => JSX.Element>;
|
|
10
|
+
export declare const EmbeddedMetric: React.MemoExoticComponent<({ token, chartColors, metricId, chartRendererType, variant, onMinimize, }: EmbeddedMetricProps) => JSX.Element>;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { EmbeddedMetricProps } from './EmbeddedMetric';
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
3
2
|
import { ThemeType } from '@/utils/theme';
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* token - The client based guest token (required).
|
|
5
|
+
* metricId - The id of the dashboard you want to see.
|
|
6
|
+
* width - The width of the metric card in number.
|
|
7
|
+
* height - The height of the metric card in number.
|
|
8
|
+
* className - The usual className attribute to provide styles.
|
|
9
|
+
* style - The usual style attribute to provide inline styles.
|
|
10
|
+
* chartColors - array of colors where each color should be a valid color string e.g. color name, rgb value, hex value, etc.
|
|
11
|
+
* theme - Theme customization.
|
|
12
|
+
*/
|
|
13
|
+
export interface MetricProps extends HTMLAttributes<HTMLElement> {
|
|
14
|
+
token: string;
|
|
15
|
+
chartColors?: string[];
|
|
16
|
+
metricId: string;
|
|
17
|
+
variant?: 'card' | 'fullscreen';
|
|
18
|
+
onMinimize?: () => void;
|
|
19
|
+
chartRendererType?: 'svg' | 'canvas';
|
|
5
20
|
theme?: ThemeType;
|
|
6
21
|
width?: number;
|
|
7
22
|
height?: number;
|
|
@@ -12,6 +27,8 @@ export interface MetricProps extends EmbeddedMetricProps {
|
|
|
12
27
|
* @name Metric - A react component to display a single metric card.
|
|
13
28
|
* @prop {string} token - A client based guest token.
|
|
14
29
|
* @prop {string} metricId - A metric id (one which you have provided at the time of it's creation) of the metric you want to display.
|
|
30
|
+
* @prop {string} variant (optional) - The variant to render the metric it can be card (fullscreen included) or fullscreen.
|
|
31
|
+
* @prop {function} onMinimize (optional) - An optional callback when minimize button is clicked.
|
|
15
32
|
* @prop {array} chartColors (optional) - An array of colors to be used to visualize the chart.
|
|
16
33
|
* @prop {string} chartRendererType (optional) - Whether to display chart as svg or canvas. In case of low end devices or in general svg is better and in case of frequent data changes or high size data visualization canvas is better. Defaults to canvas.
|
|
17
34
|
* @prop {number} width (optional) - The width of the metric card e.g. 500, 200 etc. will be treated as pixel value.
|
|
@@ -3,6 +3,7 @@ import { EmbeddedDashboardMetricsQuery } from '@/utils/generated/graphql';
|
|
|
3
3
|
interface DashboardContextType {
|
|
4
4
|
isLoading: boolean | undefined;
|
|
5
5
|
token: string | undefined;
|
|
6
|
+
pluginRef?: React.RefObject<HTMLDivElement>;
|
|
6
7
|
data: {
|
|
7
8
|
externalDashboardId: string;
|
|
8
9
|
companyId: string;
|
|
@@ -13,6 +14,7 @@ interface DashboardContextType {
|
|
|
13
14
|
externalDashboard: {
|
|
14
15
|
__typename?: 'externalDashboards' | undefined;
|
|
15
16
|
id: any;
|
|
17
|
+
name: string;
|
|
16
18
|
filters: any;
|
|
17
19
|
layout: any[];
|
|
18
20
|
} | undefined;
|
|
@@ -20,9 +20,10 @@ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, client
|
|
|
20
20
|
onDrillDown: (params: any) => void;
|
|
21
21
|
handleChartClick: (params: any) => void;
|
|
22
22
|
dataDb: Record<string, any>[];
|
|
23
|
-
getUnderlyingData: ({ columnName, value, setData, setLoading, }: {
|
|
24
|
-
columnName: string;
|
|
23
|
+
getUnderlyingData: ({ columnName, value, setData, setLoading, isSingleValueChart, }: {
|
|
24
|
+
columnName: string | undefined;
|
|
25
25
|
value: any;
|
|
26
|
+
isSingleValueChart: boolean;
|
|
26
27
|
setData: import("react").Dispatch<import("react").SetStateAction<any[]>>;
|
|
27
28
|
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
28
29
|
}) => void;
|
|
@@ -36,7 +37,6 @@ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, client
|
|
|
36
37
|
drilledLevel: number;
|
|
37
38
|
dimensions: any;
|
|
38
39
|
rlsConditions: RlsCondition[];
|
|
39
|
-
comparisonValue: string;
|
|
40
40
|
setTableLimit: import("react").Dispatch<import("react").SetStateAction<{
|
|
41
41
|
limit: number;
|
|
42
42
|
offset: number;
|
|
@@ -52,5 +52,6 @@ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, client
|
|
|
52
52
|
isExternalChart: boolean | undefined;
|
|
53
53
|
isEnablePivotTable: boolean;
|
|
54
54
|
groupByList: any[];
|
|
55
|
+
updateFilter: (filter: RlsCondition) => void;
|
|
55
56
|
};
|
|
56
57
|
export {};
|
|
@@ -7,9 +7,10 @@ export declare const useUnderlyingData: ({ clientName, tenancyType, values, quer
|
|
|
7
7
|
workspaceId: string;
|
|
8
8
|
metricId: string;
|
|
9
9
|
}) => {
|
|
10
|
-
getUnderlyingData: ({ columnName, value, setData, setLoading, }: {
|
|
11
|
-
columnName: string;
|
|
12
|
-
value: any;
|
|
10
|
+
getUnderlyingData: ({ columnName, value, setData, setLoading, isSingleValueChart, }: {
|
|
11
|
+
columnName: string | undefined;
|
|
12
|
+
value: any | undefined;
|
|
13
|
+
isSingleValueChart: boolean;
|
|
13
14
|
setData: React.Dispatch<React.SetStateAction<any[]>>;
|
|
14
15
|
setLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
15
16
|
}) => void;
|