@devtable/dashboard 4.1.0 → 4.1.2
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/api-caller/index.d.ts +1 -1
- package/dist/api-caller/request.d.ts +1 -1
- package/dist/contexts/layout-state-context.d.ts +0 -1
- package/dist/contexts/model-context.d.ts +1444 -1444
- package/dist/contexts/panel-context.d.ts +1 -1
- package/dist/dashboard.es.js +11033 -8417
- package/dist/dashboard.umd.js +26 -26
- package/dist/definition-editor/query-editor/form.d.ts +1 -0
- package/dist/definition-editor/query-editor/index.d.ts +1 -4
- package/dist/definition-editor/select-data-source.d.ts +14 -0
- package/dist/definition-editor/sql-snippet-editor/editor.d.ts +2 -5
- package/dist/definition-editor/sql-snippet-editor/index.d.ts +1 -4
- package/dist/filter/filter-checkbox/render.d.ts +3 -3
- package/dist/filter/filter-date-range/render.d.ts +2 -2
- package/dist/filter/filter-multi-select/render.d.ts +2 -2
- package/dist/filter/filter-query-field/index.d.ts +2 -2
- package/dist/filter/filter-select/render.d.ts +2 -2
- package/dist/filter/filter-settings/filter-settings.d.ts +2 -5
- package/dist/filter/filter-text-input/render.d.ts +2 -2
- package/dist/filter/filter.d.ts +2 -2
- package/dist/filter/index.d.ts +2 -5
- package/dist/global.d.ts +2 -0
- package/dist/interactions/attachment-instance-manager.d.ts +14 -0
- package/dist/interactions/components/interaction-settings.d.ts +13 -0
- package/dist/interactions/components/operation-select.d.ts +11 -0
- package/dist/interactions/components/trigger-config-model.d.ts +18 -0
- package/dist/interactions/components/trigger-select.d.ts +8 -0
- package/dist/interactions/components/variable-list.d.ts +7 -0
- package/dist/interactions/hooks/use-current-interaction-manager.d.ts +6 -0
- package/dist/interactions/hooks/use-watch-triggers.d.ts +2 -0
- package/dist/interactions/interaction-manager.d.ts +14 -0
- package/dist/interactions/operation/operation-manager-impl.d.ts +13 -0
- package/dist/interactions/operation/operations/console-log.d.ts +5 -0
- package/dist/interactions/operation/operations/index.d.ts +2 -0
- package/dist/interactions/operation/operations/open-link.d.ts +6 -0
- package/dist/interactions/trigger/trigger-manager-impl.d.ts +18 -0
- package/dist/layout/read-only.d.ts +2 -2
- package/dist/main/actions.d.ts +1 -1
- package/dist/main/main.d.ts +1 -1
- package/dist/main/view-schema-modal.d.ts +1 -1
- package/dist/model/context.d.ts +3 -3
- package/dist/model/dashboard.d.ts +956 -956
- package/dist/model/filters/filter/common.d.ts +2 -1
- package/dist/model/filters/filter/index.d.ts +10 -10
- package/dist/model/filters/filter/multi-select.d.ts +5 -4
- package/dist/model/filters/filter/select.d.ts +5 -4
- package/dist/model/filters/index.d.ts +227 -227
- package/dist/model/queries/index.d.ts +3 -3
- package/dist/model/queries/query.d.ts +1 -1
- package/dist/panel/error-boundary.d.ts +2 -2
- package/dist/panel/panel-description.d.ts +1 -4
- package/dist/panel/settings/common/data-field-selector.d.ts +2 -1
- package/dist/panel/settings/common/numbro-format-selector.d.ts +1 -0
- package/dist/panel/settings/panel-config/index.d.ts +1 -4
- package/dist/panel/settings/pick-query/index.d.ts +1 -4
- package/dist/panel/settings/viz-config/index.d.ts +1 -4
- package/dist/panel/settings/viz-config/preview-viz.d.ts +1 -4
- package/dist/panel/title-bar.d.ts +1 -4
- package/dist/panel/viz/index.d.ts +1 -1
- package/dist/plugins/color-manager/color-manager.d.ts +7 -0
- package/dist/plugins/color-manager/impl.d.ts +10 -0
- package/dist/plugins/color-manager/index.d.ts +2 -0
- package/dist/plugins/hooks/use-storage-data.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/json-plugin-storage.d.ts +4 -4
- package/dist/plugins/message-channels.d.ts +1 -1
- package/dist/plugins/plugin-context.d.ts +3 -1
- package/dist/plugins/plugin-data-migrator/index.d.ts +1 -0
- package/dist/plugins/plugin-data-migrator/plugin-data-migrator.d.ts +3 -3
- package/dist/plugins/plugin-data-migrator/version-based-migrator.d.ts +18 -0
- package/dist/plugins/plugin-manager.d.ts +1 -2
- package/dist/plugins/sub-tree-json-plugin-storage.d.ts +10 -0
- package/dist/plugins/viz-components/bar-3d-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/bar-3d-chart/type.d.ts +13 -0
- package/dist/plugins/viz-components/bar-3d-chart/viz-bar-3d-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/bar-3d-chart/viz-bar-3d-chart.d.ts +3 -0
- package/dist/plugins/viz-components/boxplot-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/boxplot-chart/reference-lines/index.d.ts +9 -0
- package/dist/plugins/viz-components/boxplot-chart/reference-lines/reference-line.d.ts +14 -0
- package/dist/plugins/viz-components/boxplot-chart/type.d.ts +20 -0
- package/dist/plugins/viz-components/boxplot-chart/variables/index.d.ts +10 -0
- package/dist/plugins/viz-components/boxplot-chart/variables/variable.d.ts +11 -0
- package/dist/plugins/viz-components/boxplot-chart/viz-boxplot-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/boxplot-chart/viz-boxplot-chart.d.ts +3 -0
- package/dist/plugins/viz-components/cartesian/index.d.ts +2 -0
- package/dist/plugins/viz-components/cartesian/option/grid.d.ts +5 -0
- package/dist/plugins/viz-components/cartesian/option/index.d.ts +2 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/option/regression.d.ts +2 -2
- package/dist/plugins/viz-components/cartesian/option/series.d.ts +2 -0
- package/dist/plugins/viz-components/cartesian/option/tooltip.d.ts +5 -0
- package/dist/plugins/viz-components/cartesian/option/x-axis.d.ts +2 -0
- package/dist/plugins/viz-components/cartesian/option/y-axis.d.ts +15 -0
- package/dist/plugins/viz-components/cartesian/panel/regressions/index.d.ts +10 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/regressions/regression-item.d.ts +2 -2
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/fields.bar.d.ts +1 -1
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/fields.line.d.ts +1 -1
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/fields.scatter.d.ts +1 -1
- package/dist/plugins/viz-components/cartesian/panel/series/index.d.ts +10 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/series-item.d.ts +2 -2
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/stats/index.d.ts +2 -2
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/stats/variable.d.ts +2 -2
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/y-axes.d.ts +1 -1
- package/dist/{panel/viz → plugins/viz-components}/cartesian/type.d.ts +5 -7
- package/dist/plugins/viz-components/cartesian/viz-cartesian-chart.d.ts +3 -0
- package/dist/plugins/viz-components/cartesian/viz-cartesian-panel.d.ts +3 -0
- package/dist/plugins/viz-components/pie-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/pie-chart/type.d.ts +5 -0
- package/dist/plugins/viz-components/pie-chart/viz-pie-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/pie-chart/viz-pie-chart.d.ts +3 -0
- package/dist/plugins/viz-components/radar-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/radar-chart/option/index.d.ts +26 -0
- package/dist/plugins/viz-components/radar-chart/panel/dimensions.d.ts +10 -0
- package/dist/plugins/viz-components/radar-chart/type.d.ts +11 -0
- package/dist/plugins/viz-components/radar-chart/viz-radar-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/radar-chart/viz-radar-chart.d.ts +3 -0
- package/dist/plugins/viz-components/regression-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/regression-chart/option/index.d.ts +2 -0
- package/dist/plugins/viz-components/regression-chart/option/regression-expression.d.ts +15 -0
- package/dist/plugins/viz-components/regression-chart/option/regression-series.d.ts +14 -0
- package/dist/plugins/viz-components/regression-chart/regression-item.d.ts +14 -0
- package/dist/plugins/viz-components/regression-chart/type.d.ts +12 -0
- package/dist/plugins/viz-components/regression-chart/viz-regression-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/regression-chart/viz-regression-chart.d.ts +3 -0
- package/dist/plugins/viz-components/rich-text/hooks.d.ts +8 -0
- package/dist/plugins/viz-components/rich-text/index.d.ts +2 -0
- package/dist/plugins/viz-components/rich-text/type.d.ts +4 -0
- package/dist/plugins/viz-components/rich-text/viz-rich-text-panel.d.ts +3 -0
- package/dist/plugins/viz-components/rich-text/viz-rich-text.d.ts +3 -0
- package/dist/plugins/viz-components/stats/index.d.ts +2 -0
- package/dist/{panel/viz → plugins/viz-components}/stats/panel/variable.d.ts +3 -3
- package/dist/{panel/viz → plugins/viz-components}/stats/panel/variables.d.ts +3 -3
- package/dist/{panel/viz/stats/types.d.ts → plugins/viz-components/stats/type.d.ts} +2 -1
- package/dist/plugins/viz-components/stats/update/index.d.ts +5 -0
- package/dist/plugins/viz-components/stats/viz-stats-panel.d.ts +3 -0
- package/dist/plugins/viz-components/stats/viz-stats.d.ts +3 -0
- package/dist/plugins/viz-components/sunburst/index.d.ts +2 -0
- package/dist/plugins/viz-components/sunburst/type.d.ts +5 -0
- package/dist/plugins/viz-components/sunburst/viz-sunburst-panel.d.ts +3 -0
- package/dist/plugins/viz-components/sunburst/viz-sunburst.d.ts +3 -0
- package/dist/plugins/viz-components/table/index.d.ts +1 -1
- package/dist/plugins/viz-components/table/triggers/click-cell-content.d.ts +11 -0
- package/dist/plugins/viz-components/table/triggers/index.d.ts +1 -0
- package/dist/plugins/viz-components/table/value.d.ts +3 -2
- package/dist/plugins/viz-components/table/viz-table-panel.d.ts +1 -1
- package/dist/plugins/viz-components/table/viz-table.d.ts +2 -2
- package/dist/plugins/viz-manager/components.d.ts +5 -5
- package/dist/plugins/viz-manager/impl.d.ts +3 -3
- package/dist/plugins/viz-manager/types.d.ts +3 -7
- package/dist/types/dashboard.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/plugin/index.d.ts +94 -8
- package/dist/types/utils.d.ts +4 -0
- package/dist/types/viz-panel.d.ts +1 -1
- package/dist/utils/aggregation.d.ts +9 -1
- package/dist/utils/download.d.ts +2 -2
- package/dist/utils/sql.d.ts +1 -1
- package/dist/utils/template/editor/index.d.ts +3 -0
- package/dist/utils/template/editor/template-input.d.ts +8 -0
- package/dist/utils/template/editor/utils.d.ts +2 -0
- package/dist/utils/template/editor/variable-field.d.ts +10 -0
- package/dist/utils/template/editor/variable-style.d.ts +8 -0
- package/dist/utils/template/index.d.ts +4 -0
- package/dist/utils/template/render/index.d.ts +2 -0
- package/dist/utils/template/{render.d.ts → render/render-jsx.d.ts} +1 -1
- package/dist/utils/template/render/render-string.d.ts +2 -0
- package/dist/utils/template/utils.d.ts +4 -0
- package/package.json +1 -1
- package/dist/filter/filter-query-field/select-data-source.d.ts +0 -8
- package/dist/panel/viz/bar-3d/index.d.ts +0 -9
- package/dist/panel/viz/bar-3d/panel.d.ts +0 -3
- package/dist/panel/viz/cartesian/index.d.ts +0 -10
- package/dist/panel/viz/cartesian/panel/index.d.ts +0 -3
- package/dist/panel/viz/cartesian/panel/regressions/index.d.ts +0 -11
- package/dist/panel/viz/cartesian/panel/series/index.d.ts +0 -11
- package/dist/panel/viz/pie/index.d.ts +0 -9
- package/dist/panel/viz/pie/panel.d.ts +0 -3
- package/dist/panel/viz/rich-text/index.d.ts +0 -10
- package/dist/panel/viz/rich-text/panel.d.ts +0 -3
- package/dist/panel/viz/rich-text/type.d.ts +0 -8
- package/dist/panel/viz/stats/index.d.ts +0 -10
- package/dist/panel/viz/stats/panel/index.d.ts +0 -10
- package/dist/panel/viz/stats/update/index.d.ts +0 -15
- package/dist/panel/viz/sunburst/index.d.ts +0 -9
- package/dist/panel/viz/sunburst/panel.d.ts +0 -3
- package/dist/utils/template/editor.d.ts +0 -16
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IRadarChartConf } from '../type';
|
|
2
|
+
export declare function getOption(conf: IRadarChartConf, data: $TSFixMe[]): {
|
|
3
|
+
legend: {
|
|
4
|
+
show: boolean;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
7
|
+
};
|
|
8
|
+
tooltip: {
|
|
9
|
+
trigger: string;
|
|
10
|
+
};
|
|
11
|
+
} & {
|
|
12
|
+
radar: {
|
|
13
|
+
indicator: {
|
|
14
|
+
name: string;
|
|
15
|
+
max: number;
|
|
16
|
+
color: string | undefined;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
series: {
|
|
20
|
+
type: string;
|
|
21
|
+
data: {
|
|
22
|
+
value: any[];
|
|
23
|
+
name: any;
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Control, UseFormWatch } from 'react-hook-form';
|
|
3
|
+
import { IRadarChartConf } from '../type';
|
|
4
|
+
interface IDimensionsField {
|
|
5
|
+
control: Control<IRadarChartConf, $TSFixMe>;
|
|
6
|
+
watch: UseFormWatch<IRadarChartConf>;
|
|
7
|
+
data: $TSFixMe[];
|
|
8
|
+
}
|
|
9
|
+
export declare function DimensionsField({ control, watch, data }: IDimensionsField): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface IRadarChartDimension {
|
|
2
|
+
name: string;
|
|
3
|
+
data_key: string;
|
|
4
|
+
max: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IRadarChartConf {
|
|
8
|
+
series_name_key: string;
|
|
9
|
+
dimensions: IRadarChartDimension[];
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_CONFIG: IRadarChartConf;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IRegressionChartConf } from '../type';
|
|
3
|
+
export declare function getRegressionDescription(data: $TSFixMe[], conf?: IRegressionChartConf): {
|
|
4
|
+
expression: JSX.Element;
|
|
5
|
+
rSquared: any;
|
|
6
|
+
adjustedRSquared: number;
|
|
7
|
+
} | {
|
|
8
|
+
expression: string;
|
|
9
|
+
rSquared: any;
|
|
10
|
+
adjustedRSquared: number;
|
|
11
|
+
} | {
|
|
12
|
+
expression: string;
|
|
13
|
+
rSquared: number;
|
|
14
|
+
adjustedRSquared?: undefined;
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IRegressionLineConf } from '../../cartesian/type';
|
|
2
|
+
import { IRegressionChartConf } from '../type';
|
|
3
|
+
interface IRegressionSeriesItem extends IRegressionLineConf {
|
|
4
|
+
data: number[][];
|
|
5
|
+
name: string;
|
|
6
|
+
showSymbol: boolean;
|
|
7
|
+
tooltip: Record<string, $TSFixMe>;
|
|
8
|
+
smooth: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function getRegressionConf({ regression }: IRegressionChartConf, data: number[][]): {
|
|
11
|
+
regressionSeries: IRegressionSeriesItem[];
|
|
12
|
+
regressionXAxes: Record<string, any>[];
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE: this file is almost a duplicate of cartesian/panel/regressions/regression-item.tsx
|
|
3
|
+
* FIXME: extract common input widgets & configs, then improve this file
|
|
4
|
+
*/
|
|
5
|
+
/// <reference types="react" />
|
|
6
|
+
import { Control, UseFormWatch } from 'react-hook-form';
|
|
7
|
+
import { IRegressionChartConf } from './type';
|
|
8
|
+
interface IRegressionField {
|
|
9
|
+
control: Control<IRegressionChartConf, $TSFixMe>;
|
|
10
|
+
watch: UseFormWatch<IRegressionChartConf>;
|
|
11
|
+
data: $TSFixMe[];
|
|
12
|
+
}
|
|
13
|
+
export declare function RegressionField({ control, watch, data }: IRegressionField): JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IRegressionConf } from '../cartesian/type';
|
|
2
|
+
export interface IRegressionChartConf {
|
|
3
|
+
x_axis: {
|
|
4
|
+
name: string;
|
|
5
|
+
data_key: string;
|
|
6
|
+
};
|
|
7
|
+
y_axis: {
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
regression: IRegressionConf;
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_CONFIG: IRegressionChartConf;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Editor } from '@mantine/rte';
|
|
3
|
+
/**
|
|
4
|
+
* Sync external changes to the editor
|
|
5
|
+
* see also https://github.com/mantinedev/mantine/issues/1625#issuecomment-1154506482
|
|
6
|
+
* @param content
|
|
7
|
+
*/
|
|
8
|
+
export declare function useSyncEditorContent(content?: string): import("react").RefObject<Editor>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Control, UseFieldArrayRemove } from 'react-hook-form';
|
|
3
|
-
import { IVizStatsConf } from '../
|
|
3
|
+
import { IVizStatsConf } from '../type';
|
|
4
4
|
interface VariableField {
|
|
5
|
-
control: Control<IVizStatsConf,
|
|
5
|
+
control: Control<IVizStatsConf, $TSFixMe>;
|
|
6
6
|
index: number;
|
|
7
7
|
remove: UseFieldArrayRemove;
|
|
8
|
-
data:
|
|
8
|
+
data: $TSFixMe[];
|
|
9
9
|
}
|
|
10
10
|
export declare function VariableField({ control, index, remove, data }: VariableField): JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Control, UseFormWatch } from 'react-hook-form';
|
|
3
|
-
import { IVizStatsConf } from '../
|
|
3
|
+
import { IVizStatsConf } from '../type';
|
|
4
4
|
interface IVariablesField {
|
|
5
|
-
control: Control<IVizStatsConf,
|
|
5
|
+
control: Control<IVizStatsConf, $TSFixMe>;
|
|
6
6
|
watch: UseFormWatch<IVizStatsConf>;
|
|
7
|
-
data:
|
|
7
|
+
data: $TSFixMe[];
|
|
8
8
|
}
|
|
9
9
|
export declare function VariablesField({ control, watch, data }: IVariablesField): JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VizComponent } from '
|
|
1
|
+
import { VizComponent } from '~/types/plugin';
|
|
2
2
|
export declare const TableVizComponent: VizComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ITriggerConfigProps, ITriggerSchema } from '~/types/plugin';
|
|
3
|
+
export declare const ClickCellContent: ITriggerSchema;
|
|
4
|
+
export interface IClickCellContentConfig {
|
|
5
|
+
/**
|
|
6
|
+
* string for the field name,
|
|
7
|
+
* number for the column index
|
|
8
|
+
*/
|
|
9
|
+
column: string | number;
|
|
10
|
+
}
|
|
11
|
+
export declare function ClickCellContentSettings(props: ITriggerConfigProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClickCellContent } from './click-cell-content';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ValueType } from './type';
|
|
3
3
|
interface ICellValue {
|
|
4
|
-
value:
|
|
4
|
+
value: $TSFixMe;
|
|
5
5
|
type: ValueType;
|
|
6
|
+
onContentClick?: () => void;
|
|
6
7
|
}
|
|
7
|
-
export declare function CellValue(
|
|
8
|
+
export declare function CellValue(props: ICellValue): JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { VizViewProps } from '
|
|
3
|
-
export declare function VizTable({ context }: VizViewProps): JSX.Element;
|
|
2
|
+
import { VizViewProps } from '~/types/plugin';
|
|
3
|
+
export declare function VizTable({ context, instance }: VizViewProps): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IPanelInfoEditor } from '
|
|
2
|
+
import { IPanelInfoEditor } from '~/types/plugin';
|
|
3
3
|
import { IPanelInfo, IVizManager } from './types';
|
|
4
4
|
export declare type IViewPanelInfo = IPanelInfo & {
|
|
5
5
|
layout: {
|
|
@@ -7,16 +7,16 @@ export declare type IViewPanelInfo = IPanelInfo & {
|
|
|
7
7
|
h: number;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export declare type IViewComponentProps<TDebug =
|
|
10
|
+
export declare type IViewComponentProps<TDebug = Record<string, unknown>> = {
|
|
11
11
|
panel: IViewPanelInfo;
|
|
12
|
-
data:
|
|
12
|
+
data: $TSFixMe;
|
|
13
13
|
vizManager: IVizManager;
|
|
14
14
|
} & TDebug;
|
|
15
15
|
export declare const VizViewComponent: <T>(props: IViewComponentProps<T>) => JSX.Element;
|
|
16
|
-
export declare type IConfigComponentProps<TDebug =
|
|
16
|
+
export declare type IConfigComponentProps<TDebug = Record<string, unknown>> = {
|
|
17
17
|
panel: IPanelInfo;
|
|
18
18
|
panelInfoEditor: IPanelInfoEditor;
|
|
19
19
|
vizManager: IVizManager;
|
|
20
|
-
data:
|
|
20
|
+
data: $TSFixMe;
|
|
21
21
|
} & TDebug;
|
|
22
22
|
export declare const VizConfigComponent: <T>(props: IConfigComponentProps<T>) => JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IPluginManager, VizComponent } from '
|
|
2
|
-
import { IPanelInfo, IVizManager
|
|
1
|
+
import { IPluginManager, VizComponent, VizInstance } from '~/types/plugin';
|
|
2
|
+
import { IPanelInfo, IVizManager } from './types';
|
|
3
3
|
export declare class VizManager implements IVizManager {
|
|
4
4
|
private pluginManager;
|
|
5
5
|
private instances;
|
|
6
6
|
constructor(pluginManager: IPluginManager);
|
|
7
7
|
get availableVizList(): VizComponent[];
|
|
8
8
|
resolveComponent(name: string): VizComponent;
|
|
9
|
-
getOrCreateInstance(panel: IPanelInfo):
|
|
9
|
+
getOrCreateInstance(panel: IPanelInfo): VizInstance;
|
|
10
10
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { IDashboardPanel } from '
|
|
2
|
-
import {
|
|
1
|
+
import { IDashboardPanel } from '~/types';
|
|
2
|
+
import { VizComponent, VizInstance } from '~/types/plugin';
|
|
3
3
|
export declare type IPanelInfo = Omit<IDashboardPanel, 'layout'>;
|
|
4
4
|
export interface IVizManager {
|
|
5
5
|
readonly availableVizList: VizComponent[];
|
|
6
6
|
resolveComponent(type: string): VizComponent;
|
|
7
|
-
getOrCreateInstance(panel: IPanelInfo):
|
|
8
|
-
}
|
|
9
|
-
export interface VizInstanceInfo extends VizInstance {
|
|
10
|
-
messageChannels: IMessageChannels;
|
|
11
|
-
instanceData: PluginStorage;
|
|
7
|
+
getOrCreateInstance(panel: IPanelInfo): VizInstance;
|
|
12
8
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { AnyObject } from '~/types/utils';
|
|
1
2
|
import { FilterModelInstance } from '../model';
|
|
2
3
|
import { QueryModelInstance } from '../model/queries';
|
|
3
4
|
import { SQLSnippetModelInstance } from '../model/sql-snippets';
|
|
4
5
|
export interface IVizConfig {
|
|
5
6
|
type: string;
|
|
6
|
-
conf:
|
|
7
|
+
conf: AnyObject;
|
|
7
8
|
}
|
|
8
9
|
export interface IDashboardPanel {
|
|
9
10
|
id: string;
|
|
@@ -22,7 +23,6 @@ export interface IDashboardPanel {
|
|
|
22
23
|
}
|
|
23
24
|
export declare enum DashboardMode {
|
|
24
25
|
Use = "use",
|
|
25
|
-
Layout = "layout",
|
|
26
26
|
Edit = "edit"
|
|
27
27
|
}
|
|
28
28
|
export interface IDashboardDefinition {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import EventEmitter2 from 'eventemitter2';
|
|
1
|
+
import { EventEmitter2 } from 'eventemitter2';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { IVizManager } from '~/plugins';
|
|
4
|
+
import { AnyObject } from '~/types';
|
|
3
5
|
/**
|
|
4
6
|
* Basic information of a viz component instance
|
|
5
7
|
*/
|
|
@@ -7,6 +9,8 @@ export interface VizInstance {
|
|
|
7
9
|
id: string;
|
|
8
10
|
name: string;
|
|
9
11
|
type: string;
|
|
12
|
+
messageChannels: IMessageChannels;
|
|
13
|
+
instanceData: PluginStorage;
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
12
16
|
* Props to render the view of viz component
|
|
@@ -15,27 +19,30 @@ export interface VizViewProps {
|
|
|
15
19
|
instance: VizInstance;
|
|
16
20
|
context: VizViewContext;
|
|
17
21
|
}
|
|
22
|
+
export interface IWatchOptions {
|
|
23
|
+
fireImmediately?: boolean;
|
|
24
|
+
}
|
|
18
25
|
export interface PluginStorage {
|
|
19
26
|
getItem<T>(key: string | null): Promise<T>;
|
|
20
27
|
setItem<T>(key: string | null, item: T): Promise<T>;
|
|
21
28
|
deleteItem(key: string): Promise<void>;
|
|
22
|
-
watchItem<T>(key: string | null, callback: (value: T, previous?: T) => void): () => void;
|
|
29
|
+
watchItem<T>(key: string | null, callback: (value: T, previous?: T) => void, options?: IWatchOptions): () => void;
|
|
23
30
|
}
|
|
24
|
-
export interface
|
|
31
|
+
export interface IColorPaletteItem {
|
|
25
32
|
name: string;
|
|
26
33
|
type: string;
|
|
27
34
|
category: string;
|
|
28
35
|
}
|
|
29
|
-
export interface
|
|
36
|
+
export interface ISingleColor extends IColorPaletteItem {
|
|
30
37
|
type: 'single';
|
|
31
38
|
value: string;
|
|
32
39
|
}
|
|
33
|
-
export interface ColorInterpolation extends
|
|
40
|
+
export interface ColorInterpolation extends IColorPaletteItem {
|
|
34
41
|
type: 'interpolation';
|
|
35
42
|
interpolation: (value: number) => string;
|
|
36
43
|
}
|
|
37
44
|
export interface ColorPalette {
|
|
38
|
-
getColor(colorInfo:
|
|
45
|
+
getColor(colorInfo: IColorPaletteItem): (value: unknown) => string;
|
|
39
46
|
}
|
|
40
47
|
export interface IMessageChannels {
|
|
41
48
|
globalChannel: EventEmitter2;
|
|
@@ -48,8 +55,9 @@ export interface VizContext {
|
|
|
48
55
|
locale: string;
|
|
49
56
|
msgChannels: IMessageChannels;
|
|
50
57
|
data: unknown;
|
|
58
|
+
vizManager: IVizManager;
|
|
51
59
|
}
|
|
52
|
-
declare type Setter<T> = (val:
|
|
60
|
+
declare type Setter<T> = (val: T) => void;
|
|
53
61
|
export interface IPanelInfoEditor {
|
|
54
62
|
setTitle: Setter<string>;
|
|
55
63
|
setDescription: Setter<string>;
|
|
@@ -77,6 +85,8 @@ export interface VizComponent {
|
|
|
77
85
|
viewRender: React.ComponentType<VizViewProps>;
|
|
78
86
|
configRender: React.ComponentType<VizConfigProps>;
|
|
79
87
|
migrator: IVizComponentMigrator;
|
|
88
|
+
createConfig: () => AnyObject;
|
|
89
|
+
triggers?: ITriggerSchema[];
|
|
80
90
|
}
|
|
81
91
|
export interface IVizComponentMigrator {
|
|
82
92
|
needMigration(ctx: VizComponentMigrationContext): Promise<boolean>;
|
|
@@ -84,7 +94,7 @@ export interface IVizComponentMigrator {
|
|
|
84
94
|
}
|
|
85
95
|
export interface IPluginManifest {
|
|
86
96
|
viz: VizComponent[];
|
|
87
|
-
color:
|
|
97
|
+
color: IColorPaletteItem[];
|
|
88
98
|
}
|
|
89
99
|
export interface IDashboardPlugin {
|
|
90
100
|
id: string;
|
|
@@ -98,4 +108,80 @@ export interface IPluginManager {
|
|
|
98
108
|
viz: (name: string) => VizComponent;
|
|
99
109
|
};
|
|
100
110
|
}
|
|
111
|
+
export interface IPayloadVariableSchema {
|
|
112
|
+
name: string;
|
|
113
|
+
description: string;
|
|
114
|
+
valueType: 'string' | 'number' | 'object';
|
|
115
|
+
}
|
|
116
|
+
export interface IInteractionConfigProps {
|
|
117
|
+
instance: VizInstance;
|
|
118
|
+
}
|
|
119
|
+
export interface ITriggerConfigProps extends IInteractionConfigProps {
|
|
120
|
+
trigger: ITrigger;
|
|
121
|
+
sampleData: Record<string, unknown>[];
|
|
122
|
+
}
|
|
123
|
+
export interface IOperationConfigProps extends IInteractionConfigProps {
|
|
124
|
+
operation: IDashboardOperation;
|
|
125
|
+
variables: IPayloadVariableSchema[];
|
|
126
|
+
}
|
|
127
|
+
export interface ITriggerSchema {
|
|
128
|
+
id: string;
|
|
129
|
+
displayName: string;
|
|
130
|
+
payload: IPayloadVariableSchema[];
|
|
131
|
+
configRender: React.ComponentType<ITriggerConfigProps>;
|
|
132
|
+
nameRender: React.ComponentType<Omit<ITriggerConfigProps, 'sampleData'>>;
|
|
133
|
+
}
|
|
134
|
+
export interface ITrigger {
|
|
135
|
+
id: string;
|
|
136
|
+
schemaRef: string;
|
|
137
|
+
triggerData: PluginStorage;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* A readonly snapshot of a trigger
|
|
141
|
+
*/
|
|
142
|
+
export interface ITriggerSnapshot<TConfig> {
|
|
143
|
+
id: string;
|
|
144
|
+
schemaRef: string;
|
|
145
|
+
config: TConfig;
|
|
146
|
+
}
|
|
147
|
+
export interface IVizTriggerManager {
|
|
148
|
+
getTriggerSchemaList(): ITriggerSchema[];
|
|
149
|
+
getTriggerList(): Promise<ITrigger[]>;
|
|
150
|
+
removeTrigger(triggerId: string): Promise<void>;
|
|
151
|
+
createOrGetTrigger(id: string, schema: ITriggerSchema): Promise<ITrigger>;
|
|
152
|
+
retrieveTrigger(id: string): Promise<ITrigger | undefined>;
|
|
153
|
+
watchTriggerSnapshotList(callback: (triggerList: ITriggerSnapshot<AnyObject>[]) => void): () => void;
|
|
154
|
+
}
|
|
155
|
+
export interface IDashboardOperationSchema {
|
|
156
|
+
id: string;
|
|
157
|
+
displayName: string;
|
|
158
|
+
configRender: React.ComponentType<IOperationConfigProps>;
|
|
159
|
+
run: (payload: Record<string, unknown>, operation: IDashboardOperation) => Promise<void>;
|
|
160
|
+
}
|
|
161
|
+
export interface IDashboardOperation {
|
|
162
|
+
id: string;
|
|
163
|
+
schemaRef: string;
|
|
164
|
+
operationData: PluginStorage;
|
|
165
|
+
}
|
|
166
|
+
export interface IVizOperationManager {
|
|
167
|
+
getOperationSchemaList(): IDashboardOperationSchema[];
|
|
168
|
+
getOperationList(): Promise<IDashboardOperation[]>;
|
|
169
|
+
removeOperation(operationId: string): Promise<void>;
|
|
170
|
+
createOrGetOperation(id: string, schema: IDashboardOperationSchema): Promise<IDashboardOperation>;
|
|
171
|
+
runOperation(operationId: string, payload: Record<string, unknown>): Promise<void>;
|
|
172
|
+
retrieveTrigger(operationId: string): Promise<IDashboardOperation | undefined>;
|
|
173
|
+
}
|
|
174
|
+
export interface IVizInteraction {
|
|
175
|
+
id: string;
|
|
176
|
+
triggerRef: string;
|
|
177
|
+
operationRef: string;
|
|
178
|
+
}
|
|
179
|
+
export interface IVizInteractionManager {
|
|
180
|
+
triggerManager: IVizTriggerManager;
|
|
181
|
+
operationManager: IVizOperationManager;
|
|
182
|
+
getInteractionList(): Promise<IVizInteraction[]>;
|
|
183
|
+
addInteraction(trigger: ITrigger, operation: IDashboardOperation): Promise<void>;
|
|
184
|
+
removeInteraction(interactionId: string): Promise<void>;
|
|
185
|
+
runInteraction(triggerId: string, payload: Record<string, unknown>): Promise<void>;
|
|
186
|
+
}
|
|
101
187
|
export {};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export declare type AggregationType =
|
|
1
|
+
export declare type AggregationType = {
|
|
2
|
+
type: 'none' | 'sum' | 'mean' | 'median' | 'max' | 'min';
|
|
3
|
+
config: Record<$TSFixMe, never>;
|
|
4
|
+
} | {
|
|
5
|
+
type: 'quantile';
|
|
6
|
+
config: {
|
|
7
|
+
p: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
2
10
|
export declare function aggregateValue(data: Record<string, number>[], data_field: string, aggregation: AggregationType): number;
|
package/dist/utils/download.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function downloadCSV(id: string, csv: string): void;
|
|
2
2
|
export declare function downloadDataListAsZip(idDataList: Array<{
|
|
3
3
|
id: string;
|
|
4
|
-
data:
|
|
4
|
+
data: $TSFixMe[];
|
|
5
5
|
}>): void;
|
|
6
|
-
export declare function makeCSV(data:
|
|
6
|
+
export declare function makeCSV(data: $TSFixMe | $TSFixMe[]): string;
|
package/dist/utils/sql.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { FilterValuesType } from '../model';
|
|
|
2
2
|
import { ContextInfoType } from '../model/context';
|
|
3
3
|
import { SQLSnippetModelInstance } from '../model/sql-snippets';
|
|
4
4
|
export declare function explainSQLSnippet(snippet: string, context: ContextInfoType): any;
|
|
5
|
-
export declare function formatSQL(sql: string, params: Record<string,
|
|
5
|
+
export declare function formatSQL(sql: string, params: Record<string, $TSFixMe>): any;
|
|
6
6
|
export declare function getSQLParams(context: ContextInfoType, sqlSnippets: SQLSnippetModelInstance[], filterValues: FilterValuesType): Record<string, any> & ContextInfoType & {
|
|
7
7
|
filters: FilterValuesType;
|
|
8
8
|
};
|