onesight-charts 0.2.3 → 0.2.5

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.
@@ -29,7 +29,9 @@ function HorizontalBar(props) {
29
29
  _props$color = props.color,
30
30
  color = _props$color === void 0 ? '#1da9a0' : _props$color,
31
31
  _props$clickFlag = props.clickFlag,
32
- clickFlag = _props$clickFlag === void 0 ? true : _props$clickFlag;
32
+ clickFlag = _props$clickFlag === void 0 ? true : _props$clickFlag,
33
+ _props$callbackGetPag = props.callbackGetPage,
34
+ callbackGetPage = _props$callbackGetPag === void 0 ? function () {} : _props$callbackGetPag;
33
35
 
34
36
  // 总数页码数
35
37
  var _useState = useState(0),
@@ -80,6 +82,7 @@ function HorizontalBar(props) {
80
82
  }
81
83
  item.rate = rate;
82
84
  });
85
+ callbackGetPage(Index);
83
86
  setBarData(splice_data);
84
87
  }, [currentPage, JSON.stringify(data)]);
85
88
  var handlePopoverMouseEnter = function handlePopoverMouseEnter(index) {
package/es/index.d.ts CHANGED
@@ -1,17 +1,77 @@
1
1
  import { FC } from 'react';
2
2
 
3
3
  declare module 'onesight-charts' {
4
- export interface ChartProps {
5
- // 添加通用的图表属性
4
+ export interface HorizontalBarProps {
5
+ width: string;
6
+ height: string;
6
7
  data: any[];
7
- width?: number;
8
- height?: number;
9
- // 根据需要添加更多属性
8
+ number: number;
9
+ callBackClick: Function;
10
+ tipName: string;
11
+ tooltipOnlyShowPer: boolean;
12
+ showProportion: boolean;
13
+ color: string;
14
+ clickFlag: boolean;
15
+ callbackGetPage: Function;
10
16
  }
11
17
 
12
- export const HorizontalBar: FC<ChartProps>;
13
- export const Line: FC<ChartProps>;
14
- export const Pie: FC<ChartProps>;
15
- export const StackedBar: FC<ChartProps>;
16
- export const WordCloud: FC<ChartProps>;
18
+ export interface LineProps {
19
+ width: string;
20
+ height: string;
21
+ id: string;
22
+ color: string;
23
+ xAxis: any[];
24
+ tooltipClassName: string;
25
+ legendValue: boolean;
26
+ showRate: boolean;
27
+ tooltipTotalName: string;
28
+ tooltipPosition: boolean;
29
+ seriesData: {
30
+ [key: string]: number[];
31
+ };
32
+ }
33
+
34
+ export interface PieProps {
35
+ width: string;
36
+ height: string;
37
+ id: string;
38
+ color: string;
39
+ valueType: string;
40
+ seriesData: any[];
41
+ radius: number[];
42
+ emphasisRich: string;
43
+ tooltipNumShow: boolean;
44
+ tooltipPerShow: boolean;
45
+ centerShow: boolean;
46
+ centerName: string;
47
+ tooltipShow: boolean;
48
+ tooltipName: string;
49
+ legendPerShow: boolean;
50
+ legendNumShow: boolean;
51
+ legendNumber: number;
52
+ order: string[];
53
+ handleClick: Function;
54
+ }
55
+
56
+ export interface StackedBarProps {
57
+ width: string;
58
+ height: string;
59
+ special: boolean;
60
+ color: string;
61
+ yAxisData: string[];
62
+ series: any[];
63
+ }
64
+
65
+ export interface WordCloudProps {
66
+ data: any[];
67
+ smallSize: boolean;
68
+ tooltipShow: boolean;
69
+ tooltipName: string;
70
+ }
71
+
72
+ export const HorizontalBar: FC<HorizontalBarProps>;
73
+ export const Line: FC<LineProps>;
74
+ export const Pie: FC<PieProps>;
75
+ export const StackedBar: FC<StackedBarProps>;
76
+ export const WordCloud: FC<WordCloudProps>;
17
77
  }
@@ -49,7 +49,9 @@ function HorizontalBar(props) {
49
49
  tooltipOnlyShowPer = false,
50
50
  showProportion = false,
51
51
  color = "#1da9a0",
52
- clickFlag = true
52
+ clickFlag = true,
53
+ callbackGetPage = () => {
54
+ }
53
55
  } = props;
54
56
  const [total, setTotal] = (0, import_react.useState)(0);
55
57
  const [hoveredIndex, setHoveredIndex] = (0, import_react.useState)(null);
@@ -82,6 +84,7 @@ function HorizontalBar(props) {
82
84
  }
83
85
  item.rate = rate;
84
86
  });
87
+ callbackGetPage(Index);
85
88
  setBarData(splice_data);
86
89
  }, [currentPage, JSON.stringify(data)]);
87
90
  const handlePopoverMouseEnter = (index) => {
package/lib/index.d.ts CHANGED
@@ -1,17 +1,77 @@
1
1
  import { FC } from 'react';
2
2
 
3
3
  declare module 'onesight-charts' {
4
- export interface ChartProps {
5
- // 添加通用的图表属性
4
+ export interface HorizontalBarProps {
5
+ width: string;
6
+ height: string;
6
7
  data: any[];
7
- width?: number;
8
- height?: number;
9
- // 根据需要添加更多属性
8
+ number: number;
9
+ callBackClick: Function;
10
+ tipName: string;
11
+ tooltipOnlyShowPer: boolean;
12
+ showProportion: boolean;
13
+ color: string;
14
+ clickFlag: boolean;
15
+ callbackGetPage: Function;
10
16
  }
11
17
 
12
- export const HorizontalBar: FC<ChartProps>;
13
- export const Line: FC<ChartProps>;
14
- export const Pie: FC<ChartProps>;
15
- export const StackedBar: FC<ChartProps>;
16
- export const WordCloud: FC<ChartProps>;
18
+ export interface LineProps {
19
+ width: string;
20
+ height: string;
21
+ id: string;
22
+ color: string;
23
+ xAxis: any[];
24
+ tooltipClassName: string;
25
+ legendValue: boolean;
26
+ showRate: boolean;
27
+ tooltipTotalName: string;
28
+ tooltipPosition: boolean;
29
+ seriesData: {
30
+ [key: string]: number[];
31
+ };
32
+ }
33
+
34
+ export interface PieProps {
35
+ width: string;
36
+ height: string;
37
+ id: string;
38
+ color: string;
39
+ valueType: string;
40
+ seriesData: any[];
41
+ radius: number[];
42
+ emphasisRich: string;
43
+ tooltipNumShow: boolean;
44
+ tooltipPerShow: boolean;
45
+ centerShow: boolean;
46
+ centerName: string;
47
+ tooltipShow: boolean;
48
+ tooltipName: string;
49
+ legendPerShow: boolean;
50
+ legendNumShow: boolean;
51
+ legendNumber: number;
52
+ order: string[];
53
+ handleClick: Function;
54
+ }
55
+
56
+ export interface StackedBarProps {
57
+ width: string;
58
+ height: string;
59
+ special: boolean;
60
+ color: string;
61
+ yAxisData: string[];
62
+ series: any[];
63
+ }
64
+
65
+ export interface WordCloudProps {
66
+ data: any[];
67
+ smallSize: boolean;
68
+ tooltipShow: boolean;
69
+ tooltipName: string;
70
+ }
71
+
72
+ export const HorizontalBar: FC<HorizontalBarProps>;
73
+ export const Line: FC<LineProps>;
74
+ export const Pie: FC<PieProps>;
75
+ export const StackedBar: FC<StackedBarProps>;
76
+ export const WordCloud: FC<WordCloudProps>;
17
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onesight-charts",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "private": false,
5
5
  "description": "OneSight前端图表公共组件库",
6
6
  "license": "MIT",