@databrainhq/plugin 0.9.15 → 0.9.16
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/dist/components/ChartModal/ChartModalOptions.d.ts +2 -1
- package/dist/components/Charts/TimeSeriesChart.d.ts +4 -0
- package/dist/components/MetricChart/MetricChart.d.ts +6 -2
- package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +5 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +4 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +4 -2
- package/dist/components/TimeSeriesSettings/index.d.ts +4 -0
- package/dist/consts/app.d.ts +1 -0
- package/dist/helpers/timeseries.d.ts +62 -0
- package/dist/hooks/useExternalMetric.d.ts +2 -0
- package/dist/index.es.js +1021 -479
- package/dist/index.umd.js +127 -127
- package/dist/style.css +1 -1
- package/dist/types/metricCreate.d.ts +34 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare type Props = {
|
|
3
3
|
setChartType: React.Dispatch<React.SetStateAction<string>>;
|
|
4
4
|
chartType: string;
|
|
5
|
+
isEnableTimeSeries: boolean;
|
|
5
6
|
};
|
|
6
|
-
export declare const ChartModalOptions: ({ chartType, setChartType }: Props) => JSX.Element;
|
|
7
|
+
export declare const ChartModalOptions: ({ chartType, setChartType, isEnableTimeSeries, }: Props) => JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TimeSeriesChartProps } from '@/types';
|
|
3
|
+
declare const TimeSeriesChart: ({ dataArray, groupBy, timeStampKey, type, valuekeys, margins, colors, customSettings, axisSettings, labelSettings, legendSettings, backGroundColor, }: TimeSeriesChartProps) => JSX.Element;
|
|
4
|
+
export default TimeSeriesChart;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import EChartsReact from 'echarts-for-react';
|
|
3
3
|
import { AxisSettings, LabelSettings, LegendSettings, BackgroundSettings, CustomSettings, TableSettings } from '@/types/app';
|
|
4
|
-
import { ClickActionsConfig } from '@/types';
|
|
4
|
+
import { ClickActionsConfig, TimeSeriesSettingsType } from '@/types';
|
|
5
5
|
export declare type MetricChartProps = {
|
|
6
6
|
data: {
|
|
7
7
|
labels: string[] | undefined;
|
|
@@ -37,5 +37,9 @@ export declare type MetricChartProps = {
|
|
|
37
37
|
handleChartClick?: (params: any) => void;
|
|
38
38
|
drilldown?: () => void;
|
|
39
39
|
setShowChartPopup?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
40
|
+
rawData: Record<string, any>[];
|
|
41
|
+
timeSeriesSettings: TimeSeriesSettingsType;
|
|
42
|
+
xAxis: string;
|
|
43
|
+
yAxisList: string[];
|
|
40
44
|
};
|
|
41
|
-
export declare const MetricChart: ({ labels, data, chartType, funnelData, sankeyData, singleValueData, margins, legendSettings, labelSettings, axisSettings, customSettings, enableSaveAs, colors, backGroundColor, chartClickConfig, tableSettings, chartRef, tableName, handleChartClick, drilldown, setShowChartPopup, }: MetricChartProps) => JSX.Element;
|
|
45
|
+
export declare const MetricChart: ({ labels, data, chartType, funnelData, sankeyData, singleValueData, margins, legendSettings, labelSettings, axisSettings, customSettings, enableSaveAs, colors, backGroundColor, chartClickConfig, tableSettings, chartRef, tableName, handleChartClick, drilldown, setShowChartPopup, rawData, timeSeriesSettings, xAxis, yAxisList, }: MetricChartProps) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MetricOutputProps } from '@/types/metricCreate';
|
|
3
|
-
export declare const MetricOutput: ({ data, error, isLoading, labels, funnelData, chartType, datasets, setChartType, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, sankeyData, previewTableDataList, singleValue, setSingleValue, singleValueData, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, customSettings, setCustomSettings, tableSettings, setTableSettings, backGroundColor, setBackGroundColor, moreTabs, chartColors, isUpdateMetric, }: MetricOutputProps) => JSX.Element;
|
|
3
|
+
export declare const MetricOutput: ({ data, error, isLoading, labels, funnelData, chartType, datasets, setChartType, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, sankeyData, previewTableDataList, singleValue, setSingleValue, singleValueData, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, customSettings, setCustomSettings, tableSettings, setTableSettings, backGroundColor, setBackGroundColor, moreTabs, chartColors, isUpdateMetric, setTimeSeriesSettings, timeSeriesSettings, }: MetricOutputProps) => JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AxisSettings, BackgroundSettings, CustomSettings, LabelSettings, LegendSettings, TableSettings } from '@/types/app';
|
|
3
|
+
import { TimeSeriesSettingsType } from '@/types';
|
|
3
4
|
declare type Props = {
|
|
4
5
|
setMargins: React.Dispatch<React.SetStateAction<Record<string, number>>>;
|
|
5
6
|
margins: Record<string, number>;
|
|
@@ -17,6 +18,9 @@ declare type Props = {
|
|
|
17
18
|
setBackGroundColor: React.Dispatch<React.SetStateAction<BackgroundSettings>>;
|
|
18
19
|
tableSettings: TableSettings;
|
|
19
20
|
setTableSettings: React.Dispatch<React.SetStateAction<TableSettings>>;
|
|
21
|
+
timeSeriesSettings: TimeSeriesSettingsType;
|
|
22
|
+
setTimeSeriesSettings: React.Dispatch<React.SetStateAction<TimeSeriesSettingsType>>;
|
|
23
|
+
yAxisList: string[];
|
|
20
24
|
};
|
|
21
|
-
export declare const ChartConfigure: ({ setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, chartType, setChartType, customSettings, setCustomSettings, backGroundColor, setBackGroundColor, tableSettings, setTableSettings, }: Props) => JSX.Element;
|
|
25
|
+
export declare const ChartConfigure: ({ setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, chartType, setChartType, customSettings, setCustomSettings, backGroundColor, setBackGroundColor, tableSettings, setTableSettings, setTimeSeriesSettings, timeSeriesSettings, yAxisList, }: Props) => JSX.Element;
|
|
22
26
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AxisSettings, BackgroundSettings, CustomSettings, LabelSettings, LegendSettings, TableSettings } from '@/types/app';
|
|
3
|
+
import { TimeSeriesSettingsType } from '@/types';
|
|
3
4
|
declare type Props = {
|
|
4
5
|
data: any[] | undefined;
|
|
5
6
|
chartType: string;
|
|
@@ -30,6 +31,8 @@ declare type Props = {
|
|
|
30
31
|
setBackGroundColor: React.Dispatch<React.SetStateAction<BackgroundSettings>>;
|
|
31
32
|
tableSettings: TableSettings;
|
|
32
33
|
setTableSettings: React.Dispatch<React.SetStateAction<TableSettings>>;
|
|
34
|
+
timeSeriesSettings: TimeSeriesSettingsType;
|
|
35
|
+
setTimeSeriesSettings: React.Dispatch<React.SetStateAction<TimeSeriesSettingsType>>;
|
|
33
36
|
};
|
|
34
|
-
export declare const ChartSettings: ({ chartType, setChartType, data, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, singleValue, setSingleValue, setSettingsShow, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, customSettings, setCustomSettings, backGroundColor, setBackGroundColor, tableSettings, setTableSettings, }: Props) => JSX.Element;
|
|
37
|
+
export declare const ChartSettings: ({ chartType, setChartType, data, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, singleValue, setSingleValue, setSettingsShow, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, axisSettings, setAxisSettings, customSettings, setCustomSettings, backGroundColor, setBackGroundColor, tableSettings, setTableSettings, setTimeSeriesSettings, timeSeriesSettings, }: Props) => JSX.Element;
|
|
35
38
|
export {};
|
package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AxisSettings, LabelSettings, LegendSettings, BackgroundSettings, CustomSettings, TableSettings } from '@/types/app';
|
|
3
|
-
import { ClickActionsConfig } from '@/types';
|
|
3
|
+
import { ClickActionsConfig, TimeSeriesSettingsType } from '@/types';
|
|
4
4
|
declare type Props = {
|
|
5
5
|
data: any[] | undefined;
|
|
6
6
|
labels: string[] | undefined;
|
|
@@ -52,6 +52,8 @@ declare type Props = {
|
|
|
52
52
|
chartColors?: string[];
|
|
53
53
|
handleChartRightClick?: (params: any) => void;
|
|
54
54
|
chartClickConfig?: ClickActionsConfig['chart'];
|
|
55
|
+
timeSeriesSettings: TimeSeriesSettingsType;
|
|
56
|
+
setTimeSeriesSettings: React.Dispatch<React.SetStateAction<TimeSeriesSettingsType>>;
|
|
55
57
|
};
|
|
56
|
-
export declare const ChartTab: ({ labels, datasets, funnelData, chartType, setChartType, data, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, sankeyData, singleValue, setSingleValue, singleValueData, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, customSettings, setCustomSettings, axisSettings, setAxisSettings, isLoading, backGroundColor, setBackGroundColor, headerChild, tableSettings, setTableSettings, tableName, chartColors, handleChartRightClick, chartClickConfig, chartPopupChild, }: Props) => JSX.Element;
|
|
58
|
+
export declare const ChartTab: ({ labels, datasets, funnelData, chartType, setChartType, data, setXAxis, setYAxisList, yAxisList, xAxis, setMeasure, setStep, step, measure, setSankeyValues, sankeyData, singleValue, setSingleValue, singleValueData, setMargins, margins, legendSettings, setLegendSettings, labelSettings, setLabelSettings, customSettings, setCustomSettings, axisSettings, setAxisSettings, isLoading, backGroundColor, setBackGroundColor, headerChild, tableSettings, setTableSettings, tableName, chartColors, handleChartRightClick, chartClickConfig, chartPopupChild, setTimeSeriesSettings, timeSeriesSettings, }: Props) => JSX.Element;
|
|
57
59
|
export {};
|
package/dist/consts/app.d.ts
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BackgroundSettings, CustomSettings, LabelSettings, TimeSeriesGroupType, TimeSeriesType } from '@/types';
|
|
2
|
+
interface TimeSeriesData {
|
|
3
|
+
timeStampKey: string;
|
|
4
|
+
valuekeys: string[];
|
|
5
|
+
data: Record<string, any>[];
|
|
6
|
+
}
|
|
7
|
+
export declare const getTimeSeriesData: ({ dataArray, timeStampKey, type, valuekeys, groupBy, labelSettings, customSettings, backGroundColor, }: {
|
|
8
|
+
dataArray: Record<string, any>[];
|
|
9
|
+
timeStampKey: string;
|
|
10
|
+
valuekeys: string[];
|
|
11
|
+
type: TimeSeriesType;
|
|
12
|
+
groupBy: TimeSeriesGroupType;
|
|
13
|
+
labelSettings: LabelSettings;
|
|
14
|
+
customSettings: CustomSettings;
|
|
15
|
+
backGroundColor: BackgroundSettings;
|
|
16
|
+
}) => ({
|
|
17
|
+
barWidth?: string | undefined;
|
|
18
|
+
showBackground?: boolean | undefined;
|
|
19
|
+
backgroundStyle?: {
|
|
20
|
+
color: string;
|
|
21
|
+
} | undefined;
|
|
22
|
+
itemStyle?: {
|
|
23
|
+
borderRadius: number;
|
|
24
|
+
} | undefined;
|
|
25
|
+
areaStyle: {
|
|
26
|
+
opacity?: undefined;
|
|
27
|
+
};
|
|
28
|
+
data: [string, any][];
|
|
29
|
+
type: "line" | "bar";
|
|
30
|
+
name: string;
|
|
31
|
+
label: {
|
|
32
|
+
show: boolean;
|
|
33
|
+
position: string;
|
|
34
|
+
};
|
|
35
|
+
emphasis: {
|
|
36
|
+
focus: string;
|
|
37
|
+
};
|
|
38
|
+
} | {
|
|
39
|
+
barWidth?: string | undefined;
|
|
40
|
+
showBackground?: boolean | undefined;
|
|
41
|
+
backgroundStyle?: {
|
|
42
|
+
color: string;
|
|
43
|
+
} | undefined;
|
|
44
|
+
itemStyle?: {
|
|
45
|
+
borderRadius: number;
|
|
46
|
+
} | undefined;
|
|
47
|
+
areaStyle: {
|
|
48
|
+
opacity: number;
|
|
49
|
+
};
|
|
50
|
+
data: [string, any][];
|
|
51
|
+
type: "line" | "bar";
|
|
52
|
+
name: string;
|
|
53
|
+
label: {
|
|
54
|
+
show: boolean;
|
|
55
|
+
position: string;
|
|
56
|
+
};
|
|
57
|
+
emphasis: {
|
|
58
|
+
focus: string;
|
|
59
|
+
};
|
|
60
|
+
})[];
|
|
61
|
+
export declare const isTimeSeriesDataValid: ({ data, timeStampKey, valuekeys, }: TimeSeriesData) => boolean;
|
|
62
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
2
|
import { ExternalMetrics } from '@/utils/generated/graphql';
|
|
3
3
|
import { AxisSettings, CustomSettings, TableSettings, DashboardType, GroupBy, LabelSettings, LegendSettings, RlsFilterObjectType, SelectedColumns, BackgroundSettings } from '@/types/app';
|
|
4
|
+
import { TimeSeriesSettingsType } from '@/types';
|
|
4
5
|
declare type Params = {
|
|
5
6
|
onSuccess: () => void;
|
|
6
7
|
companyIntegrationId: string | undefined;
|
|
@@ -24,6 +25,7 @@ declare type Params = {
|
|
|
24
25
|
customSettings?: CustomSettings;
|
|
25
26
|
tableSettings?: TableSettings;
|
|
26
27
|
backGroundColor?: BackgroundSettings;
|
|
28
|
+
timeSeriesSettings?: TimeSeriesSettingsType;
|
|
27
29
|
};
|
|
28
30
|
integrationName: string | undefined;
|
|
29
31
|
clientId?: string | null;
|