@devtable/dashboard 6.34.1 → 6.36.0

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.
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { Control, UseFormWatch } from 'react-hook-form';
3
+ import { AnyObject } from '~/types';
4
+ import { IParetoChartConf } from '../type';
5
+ interface IBarField {
6
+ control: Control<IParetoChartConf, $TSFixMe>;
7
+ watch: UseFormWatch<IParetoChartConf>;
8
+ data: AnyObject[];
9
+ }
10
+ export declare function BarField({ data, control, watch }: IBarField): JSX.Element;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { Control, UseFormWatch } from 'react-hook-form';
3
+ import { AnyObject } from '~/types';
4
+ import { IParetoChartConf } from '../type';
5
+ interface ILineField {
6
+ control: Control<IParetoChartConf, $TSFixMe>;
7
+ watch: UseFormWatch<IParetoChartConf>;
8
+ data: AnyObject[];
9
+ }
10
+ export declare function LineField({ data, control, watch }: ILineField): JSX.Element;
11
+ export {};
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { Control, UseFormWatch } from 'react-hook-form';
3
+ import { AnyObject } from '~/types';
4
+ import { IParetoChartConf } from '../type';
5
+ export declare const DescribeParetoParams: () => JSX.Element;
6
+ interface IMarkLineField {
7
+ control: Control<IParetoChartConf, $TSFixMe>;
8
+ watch: UseFormWatch<IParetoChartConf>;
9
+ data: AnyObject[];
10
+ }
11
+ export declare function MarkLineField({ data, control, watch }: IMarkLineField): JSX.Element;
12
+ export {};
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { Control, UseFormWatch } from 'react-hook-form';
3
+ import { AnyObject } from '~/types';
4
+ import { IParetoChartConf } from '../type';
5
+ interface IXAxisField {
6
+ control: Control<IParetoChartConf, $TSFixMe>;
7
+ watch: UseFormWatch<IParetoChartConf>;
8
+ data: AnyObject[];
9
+ }
10
+ export declare function XAxisField({ data, control, watch }: IXAxisField): JSX.Element;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { Control, UseFormWatch } from 'react-hook-form';
3
+ import { AnyObject } from '~/types';
4
+ import { IParetoChartConf } from '../type';
5
+ interface IYAxisField {
6
+ control: Control<IParetoChartConf, $TSFixMe>;
7
+ watch: UseFormWatch<IParetoChartConf>;
8
+ data: AnyObject[];
9
+ }
10
+ export declare function YAxisField({ data, control, watch }: IYAxisField): JSX.Element;
11
+ export {};
@@ -55,6 +55,10 @@ export declare function getOption(conf: IParetoChartConf, data: $TSFixMe[], _var
55
55
  show: boolean;
56
56
  alignWithLabel: boolean;
57
57
  };
58
+ axisLabel: {
59
+ formatter: (value: string | number, index: number) => any;
60
+ rotate: number;
61
+ };
58
62
  }[];
59
63
  yAxis: ({
60
64
  name: string;
@@ -67,10 +71,13 @@ export declare function getOption(conf: IParetoChartConf, data: $TSFixMe[], _var
67
71
  axisLine: {
68
72
  show: boolean;
69
73
  };
74
+ axisLabel: {
75
+ show: boolean;
76
+ formatter: (payload: any) => void;
77
+ };
70
78
  splitLine: {
71
79
  show: boolean;
72
80
  };
73
- axisLabel?: undefined;
74
81
  } | {
75
82
  name: string;
76
83
  nameGap: number;
@@ -96,11 +103,16 @@ export declare function getOption(conf: IParetoChartConf, data: $TSFixMe[], _var
96
103
  itemStyle: {
97
104
  color: string;
98
105
  };
106
+ label: {
107
+ show: boolean;
108
+ position: string;
109
+ formatter: (payload: any) => void;
110
+ };
99
111
  yAxisIndex: number;
100
112
  data: any[][];
101
113
  symbolSize?: undefined;
102
114
  lineStyle?: undefined;
103
- label?: undefined;
115
+ markLine?: undefined;
104
116
  } | {
105
117
  name: string;
106
118
  type: string;
@@ -114,10 +126,35 @@ export declare function getOption(conf: IParetoChartConf, data: $TSFixMe[], _var
114
126
  label: {
115
127
  show: boolean;
116
128
  position: string;
117
- formatter: (payload: any) => any;
129
+ formatter: (payload: any) => void;
118
130
  };
119
131
  yAxisIndex: number;
120
- data: any[][];
132
+ data: import("./types").TLineDataItem[];
133
+ markLine: {
134
+ name?: undefined;
135
+ silent?: undefined;
136
+ symbol?: undefined;
137
+ symbolRotate?: undefined;
138
+ symbolSize?: undefined;
139
+ data?: undefined;
140
+ } | {
141
+ name: string;
142
+ silent: boolean;
143
+ symbol: string;
144
+ symbolRotate: number;
145
+ symbolSize: number[];
146
+ data: {
147
+ name: string;
148
+ symbol: string;
149
+ xAxis: string | number;
150
+ lineStyle: {
151
+ color: string;
152
+ };
153
+ label: {
154
+ formatter: any;
155
+ };
156
+ }[];
157
+ };
121
158
  })[];
122
159
  grid: {
123
160
  top: number;
@@ -0,0 +1,27 @@
1
+ import { IParetoChartConf } from '../type';
2
+ import { TLineDataItem } from './types';
3
+ export declare function getMarkLine(conf: IParetoChartConf, lineData: TLineDataItem[]): {
4
+ name?: undefined;
5
+ silent?: undefined;
6
+ symbol?: undefined;
7
+ symbolRotate?: undefined;
8
+ symbolSize?: undefined;
9
+ data?: undefined;
10
+ } | {
11
+ name: string;
12
+ silent: boolean;
13
+ symbol: string;
14
+ symbolRotate: number;
15
+ symbolSize: number[];
16
+ data: {
17
+ name: string;
18
+ symbol: string;
19
+ xAxis: string | number;
20
+ lineStyle: {
21
+ color: string;
22
+ };
23
+ label: {
24
+ formatter: any;
25
+ };
26
+ }[];
27
+ };
@@ -1,17 +1,23 @@
1
1
  import { AnyObject } from '~/types';
2
2
  import { IParetoChartConf } from '../type';
3
- declare function formatterForLine(payload: $TSFixMe): any;
4
- export declare function getSeries(conf: IParetoChartConf, data: AnyObject[]): ({
3
+ import { TLineDataItem } from './types';
4
+ import { TParetoFormatters } from './utils';
5
+ export declare function getSeries(conf: IParetoChartConf, data: AnyObject[], formatters: TParetoFormatters): ({
5
6
  name: string;
6
7
  type: string;
7
8
  itemStyle: {
8
9
  color: string;
9
10
  };
11
+ label: {
12
+ show: boolean;
13
+ position: string;
14
+ formatter: (payload: any) => void;
15
+ };
10
16
  yAxisIndex: number;
11
17
  data: any[][];
12
18
  symbolSize?: undefined;
13
19
  lineStyle?: undefined;
14
- label?: undefined;
20
+ markLine?: undefined;
15
21
  } | {
16
22
  name: string;
17
23
  type: string;
@@ -25,9 +31,33 @@ export declare function getSeries(conf: IParetoChartConf, data: AnyObject[]): ({
25
31
  label: {
26
32
  show: boolean;
27
33
  position: string;
28
- formatter: typeof formatterForLine;
34
+ formatter: (payload: any) => void;
29
35
  };
30
36
  yAxisIndex: number;
31
- data: any[][];
37
+ data: TLineDataItem[];
38
+ markLine: {
39
+ name?: undefined;
40
+ silent?: undefined;
41
+ symbol?: undefined;
42
+ symbolRotate?: undefined;
43
+ symbolSize?: undefined;
44
+ data?: undefined;
45
+ } | {
46
+ name: string;
47
+ silent: boolean;
48
+ symbol: string;
49
+ symbolRotate: number;
50
+ symbolSize: number[];
51
+ data: {
52
+ name: string;
53
+ symbol: string;
54
+ xAxis: string | number;
55
+ lineStyle: {
56
+ color: string;
57
+ };
58
+ label: {
59
+ formatter: any;
60
+ };
61
+ }[];
62
+ };
32
63
  })[];
33
- export {};
@@ -1,8 +1,7 @@
1
1
  import { CallbackDataParams } from 'echarts/types/dist/shared';
2
2
  import { IParetoChartConf } from '../type';
3
- declare function tooltipFormatter(params: CallbackDataParams): string;
4
- export declare function getTooltip(conf: IParetoChartConf): {
3
+ import { TParetoFormatters } from './utils';
4
+ export declare function getTooltip(conf: IParetoChartConf, formatters: TParetoFormatters): {
5
5
  trigger: string;
6
- formatter: typeof tooltipFormatter;
6
+ formatter: (params: CallbackDataParams) => string;
7
7
  };
8
- export {};
@@ -0,0 +1 @@
1
+ export declare type TLineDataItem = [string | number, number];
@@ -1 +1,8 @@
1
+ import { IParetoChartConf } from '../type';
1
2
  export declare function formatPercentage(value: number): string;
3
+ export declare type TParetoFormatters = {
4
+ bar: (payload: $TSFixMe) => void;
5
+ line: (payload: $TSFixMe) => void;
6
+ lineValue: typeof formatPercentage;
7
+ };
8
+ export declare function getFormatters(conf: IParetoChartConf): TParetoFormatters;
@@ -15,4 +15,8 @@ export declare function getXAxis(conf: IParetoChartConf): {
15
15
  show: boolean;
16
16
  alignWithLabel: boolean;
17
17
  };
18
+ axisLabel: {
19
+ formatter: (value: string | number, index: number) => any;
20
+ rotate: number;
21
+ };
18
22
  }[];
@@ -1,6 +1,6 @@
1
1
  import { IParetoChartConf } from '../type';
2
- import { formatPercentage } from './utils';
3
- export declare function getYAxes(conf: IParetoChartConf): ({
2
+ import { TParetoFormatters } from './utils';
3
+ export declare function getYAxes(conf: IParetoChartConf, formatters: TParetoFormatters): ({
4
4
  name: string;
5
5
  nameGap: number;
6
6
  nameTextStyle: {
@@ -11,10 +11,13 @@ export declare function getYAxes(conf: IParetoChartConf): ({
11
11
  axisLine: {
12
12
  show: boolean;
13
13
  };
14
+ axisLabel: {
15
+ show: boolean;
16
+ formatter: (payload: any) => void;
17
+ };
14
18
  splitLine: {
15
19
  show: boolean;
16
20
  };
17
- axisLabel?: undefined;
18
21
  } | {
19
22
  name: string;
20
23
  nameGap: number;
@@ -28,7 +31,7 @@ export declare function getYAxes(conf: IParetoChartConf): ({
28
31
  };
29
32
  axisLabel: {
30
33
  show: boolean;
31
- formatter: typeof formatPercentage;
34
+ formatter: typeof import("./utils").formatPercentage;
32
35
  };
33
36
  splitLine: {
34
37
  show: boolean;
@@ -1,18 +1,33 @@
1
+ import { TNumbroFormat } from '~/panel/settings/common/numbro-format-selector';
1
2
  import { TEchartsDataZoomConfig } from '../cartesian/panel/echarts-zooming-field/types';
3
+ import { IXAxisLabelFormatter } from '../cartesian/panel/x-axis/x-axis-label-formatter/types';
4
+ export declare const DEFAULT_PARETO_MARK_LINE: {
5
+ label_template: string;
6
+ color: string;
7
+ };
2
8
  export interface IParetoChartConf {
3
9
  x_axis: {
4
10
  name: string;
5
11
  data_key: string;
12
+ axisLabel: {
13
+ rotate: number;
14
+ formatter: IXAxisLabelFormatter;
15
+ };
6
16
  };
7
17
  data_key: string;
8
18
  bar: {
9
19
  name: string;
10
20
  color: string;
21
+ label_formatter: TNumbroFormat;
11
22
  };
12
23
  line: {
13
24
  name: string;
14
25
  color: string;
15
26
  };
16
27
  dataZoom: TEchartsDataZoomConfig;
28
+ markLine: {
29
+ label_template: string;
30
+ color: string;
31
+ };
17
32
  }
18
33
  export declare const DEFAULT_CONFIG: IParetoChartConf;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/dashboard",
3
- "version": "6.34.1",
3
+ "version": "6.36.0",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public",