@spteck/fluentui-react-charts 0.1.9 → 1.0.1
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/RenderLabel/RenderLabel.d.ts +8 -0
- package/dist/components/RenderLabel/index.d.ts +2 -0
- package/dist/components/RenderLabel/useRenderLabelStylesStyles.d.ts +1 -0
- package/dist/components/dashboard/DashBoard.d.ts +4 -0
- package/dist/components/dashboard/ExampleDashboardUsage.d.ts +6 -0
- package/dist/components/dashboard/IDashboardProps.d.ts +9 -0
- package/dist/components/dashboard/NoDashboards.d.ts +5 -0
- package/dist/components/dashboard/index.d.ts +1 -0
- package/dist/components/dashboard/selectZoom/SelectZoom.d.ts +15 -0
- package/dist/components/dashboard/useDashboardStyles.d.ts +7 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/svgImages/BusinessReportIcon.d.ts +9 -0
- package/dist/fluentui-react-charts.cjs.development.js +2 -0
- package/dist/fluentui-react-charts.cjs.development.js.map +1 -1
- package/dist/fluentui-react-charts.cjs.production.min.js +1 -1
- package/dist/fluentui-react-charts.cjs.production.min.js.map +1 -1
- package/dist/fluentui-react-charts.esm.js +2 -0
- package/dist/fluentui-react-charts.esm.js.map +1 -1
- package/dist/models/ChartDatum.d.ts +4 -0
- package/dist/models/ICardChartContainer.d.ts +16 -0
- package/dist/models/index.d.ts +2 -0
- package/package.json +2 -3
- package/src/components/RenderLabel/RenderLabel.tsx +39 -0
- package/src/components/RenderLabel/index.ts +2 -0
- package/src/components/RenderLabel/useRenderLabelStylesStyles.ts +25 -0
- package/src/components/dashboard/DashBoard.tsx +220 -0
- package/src/components/dashboard/ExampleDashboardUsage.tsx +114 -0
- package/src/components/dashboard/IDashboardProps.tsx +13 -0
- package/src/components/dashboard/NoDashboards.tsx +26 -0
- package/src/components/dashboard/index.ts +3 -0
- package/src/components/dashboard/selectZoom/SelectZoom.tsx +189 -0
- package/src/components/dashboard/useDashboardStyles.ts +76 -0
- package/src/components/index.ts +3 -1
- package/src/components/svgImages/BusinessReportIcon.tsx +218 -0
- package/src/models/ChartDatum.ts +4 -0
- package/src/models/ICardChartContainer.tsx +13 -0
- package/src/models/index.ts +2 -0
- package/dist/components/DashBoard.d.ts +0 -3
- package/src/components/DashBoard.tsx +0 -409
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { css } from '@emotion/css';
|
|
2
|
+
import { tokens } from '@fluentui/react-components';
|
|
3
|
+
|
|
4
|
+
export const useDashboardStyles = (): {
|
|
5
|
+
dashboardContainer: string;
|
|
6
|
+
cardBody: string;
|
|
7
|
+
chartContainer: string;
|
|
8
|
+
cardDescription: string;
|
|
9
|
+
cardWrapper: string;
|
|
10
|
+
} => {
|
|
11
|
+
return {
|
|
12
|
+
dashboardContainer: css({
|
|
13
|
+
display: 'grid',
|
|
14
|
+
padding: '20px',
|
|
15
|
+
gap: '16px',
|
|
16
|
+
backgroundColor: tokens.colorNeutralBackground2,
|
|
17
|
+
gridTemplateColumns: 'repeat(auto-fill, minmax(350px, 1fr))',
|
|
18
|
+
gridAutoRows: '350px',
|
|
19
|
+
overflowY: 'auto',
|
|
20
|
+
overflowX: 'hidden',
|
|
21
|
+
|
|
22
|
+
// Scrollbar styles
|
|
23
|
+
'::-webkit-scrollbar': {
|
|
24
|
+
width: '5px', // Width for vertical scrollbars
|
|
25
|
+
height: '5px', // Height for horizontal scrollbars
|
|
26
|
+
},
|
|
27
|
+
'::-webkit-scrollbar-track': {
|
|
28
|
+
background: tokens.colorNeutralBackground4, // Light gray for the track
|
|
29
|
+
borderRadius: '10px',
|
|
30
|
+
},
|
|
31
|
+
'::-webkit-scrollbar-thumb': {
|
|
32
|
+
background: tokens.colorBrandStroke2Hover, // Dark gray for the thumb
|
|
33
|
+
borderRadius: '10px',
|
|
34
|
+
},
|
|
35
|
+
'::-webkit-scrollbar-thumb:hover': {
|
|
36
|
+
background: tokens.colorNeutralStroke2, // Dark gray for the thumb
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
gridAutoFlow: 'dense',
|
|
41
|
+
}),
|
|
42
|
+
cardBody: css({
|
|
43
|
+
display: 'flex',
|
|
44
|
+
flexDirection: 'column',
|
|
45
|
+
height: '100%',
|
|
46
|
+
minHeight: '320px',
|
|
47
|
+
}),
|
|
48
|
+
chartContainer: css({
|
|
49
|
+
flex: 1,
|
|
50
|
+
width: '100%',
|
|
51
|
+
minHeight: '280px',
|
|
52
|
+
}),
|
|
53
|
+
cardDescription: css({
|
|
54
|
+
color: `${tokens.colorNeutralForeground2}`,
|
|
55
|
+
marginTop: '4px',
|
|
56
|
+
}),
|
|
57
|
+
|
|
58
|
+
cardWrapper: css({
|
|
59
|
+
position: 'relative',
|
|
60
|
+
height: '100%',
|
|
61
|
+
minHeight: '300px',
|
|
62
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
63
|
+
transition: 'all 0.2s ease',
|
|
64
|
+
|
|
65
|
+
'&:hover': {
|
|
66
|
+
transform: 'translateY(-2px)',
|
|
67
|
+
boxShadow: `${tokens.shadow16}`,
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
'&:active': {
|
|
71
|
+
transform: 'translateY(0)',
|
|
72
|
+
boxShadow: `${tokens.shadow8}`,
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
75
|
+
};
|
|
76
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '../charts/BarChart';
|
|
2
2
|
export * from '../charts/ComboChart';
|
|
3
|
-
export * from './DashBoard';
|
|
3
|
+
export * from './dashboard/DashBoard';
|
|
4
4
|
export * from '../charts/Doughnut';
|
|
5
5
|
export * from '../charts/PieChart';
|
|
6
6
|
export * from '../charts/areaChart';
|
|
@@ -13,3 +13,5 @@ export * from '../charts/radarChart';
|
|
|
13
13
|
export * from '../charts/scatterChart';
|
|
14
14
|
export * from '../charts/stackedLineChart';
|
|
15
15
|
export * from '../charts/steamChart';
|
|
16
|
+
|
|
17
|
+
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { tokens } from "@fluentui/react-components";
|
|
3
|
+
|
|
4
|
+
interface BusinessReportIconProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const BusinessReportIcon: React.FC<BusinessReportIconProps> = ({
|
|
12
|
+
width = 200,
|
|
13
|
+
height = 200,
|
|
14
|
+
className,
|
|
15
|
+
style,
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<svg
|
|
19
|
+
width={width}
|
|
20
|
+
height={height}
|
|
21
|
+
viewBox="200 400 1400 1000"
|
|
22
|
+
className={className}
|
|
23
|
+
style={{
|
|
24
|
+
fill: tokens.colorNeutralForeground2,
|
|
25
|
+
...style,
|
|
26
|
+
}}
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
>
|
|
29
|
+
<g id="BACKGROUND">
|
|
30
|
+
<rect
|
|
31
|
+
style={{ fill: tokens.colorNeutralBackground1 }}
|
|
32
|
+
x="200"
|
|
33
|
+
y="400"
|
|
34
|
+
width="1400"
|
|
35
|
+
height="1000"
|
|
36
|
+
/>
|
|
37
|
+
</g>
|
|
38
|
+
|
|
39
|
+
{/* Main chart/dashboard area */}
|
|
40
|
+
<g>
|
|
41
|
+
<g>
|
|
42
|
+
<rect
|
|
43
|
+
x="486.006"
|
|
44
|
+
y="568.026"
|
|
45
|
+
style={{ fill: tokens.colorNeutralBackground1 }}
|
|
46
|
+
width="1038.994"
|
|
47
|
+
height="768.164"
|
|
48
|
+
/>
|
|
49
|
+
<path
|
|
50
|
+
style={{ fill: tokens.colorNeutralStroke1 }}
|
|
51
|
+
d="M1527.5,1338.69H483.506V565.526H1527.5V1338.69z M488.506,1333.69H1522.5V570.526H488.506V1333.69z"
|
|
52
|
+
/>
|
|
53
|
+
</g>
|
|
54
|
+
<g>
|
|
55
|
+
{/* Chart bars */}
|
|
56
|
+
<rect
|
|
57
|
+
x="558.003"
|
|
58
|
+
y="1086.698"
|
|
59
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
60
|
+
width="85"
|
|
61
|
+
height="164.492"
|
|
62
|
+
/>
|
|
63
|
+
<rect
|
|
64
|
+
x="693.003"
|
|
65
|
+
y="1004.672"
|
|
66
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
67
|
+
width="85"
|
|
68
|
+
height="246.519"
|
|
69
|
+
/>
|
|
70
|
+
<rect
|
|
71
|
+
x="828.003"
|
|
72
|
+
y="835.487"
|
|
73
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
74
|
+
width="85"
|
|
75
|
+
height="415.703"
|
|
76
|
+
/>
|
|
77
|
+
<rect
|
|
78
|
+
x="963.003"
|
|
79
|
+
y="955.6"
|
|
80
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
81
|
+
width="85"
|
|
82
|
+
height="295.591"
|
|
83
|
+
/>
|
|
84
|
+
<rect
|
|
85
|
+
x="1098.003"
|
|
86
|
+
y="825.238"
|
|
87
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
88
|
+
width="85"
|
|
89
|
+
height="425.952"
|
|
90
|
+
/>
|
|
91
|
+
<rect
|
|
92
|
+
x="1233.003"
|
|
93
|
+
y="847.489"
|
|
94
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
95
|
+
width="85"
|
|
96
|
+
height="403.701"
|
|
97
|
+
/>
|
|
98
|
+
<rect
|
|
99
|
+
x="1368.003"
|
|
100
|
+
y="699.989"
|
|
101
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
102
|
+
width="85"
|
|
103
|
+
height="551.201"
|
|
104
|
+
/>
|
|
105
|
+
{/* Chart line */}
|
|
106
|
+
<polygon
|
|
107
|
+
style={{ fill: tokens.colorBrandBackground }}
|
|
108
|
+
points="583.634,1185.919 581.366,1181.462 723.336,1109.231 869.748,909.808 1003.791,1050.114 1141.593,912.312 1275.235,928.549 1409.365,774.548 1413.135,777.833 1277.265,933.832 1143.407,917.569 1003.709,1057.267 870.251,917.573 726.664,1113.149"
|
|
109
|
+
/>
|
|
110
|
+
</g>
|
|
111
|
+
{/* Chart grid lines */}
|
|
112
|
+
<rect
|
|
113
|
+
x="796.336"
|
|
114
|
+
y="662.857"
|
|
115
|
+
style={{ fill: tokens.colorBrandBackground }}
|
|
116
|
+
width="418.333"
|
|
117
|
+
height="5"
|
|
118
|
+
/>
|
|
119
|
+
<rect
|
|
120
|
+
x="937.543"
|
|
121
|
+
y="717.857"
|
|
122
|
+
style={{ fill: tokens.colorBrandBackground }}
|
|
123
|
+
width="135.92"
|
|
124
|
+
height="5"
|
|
125
|
+
/>
|
|
126
|
+
</g>
|
|
127
|
+
|
|
128
|
+
{/* Small chart on left */}
|
|
129
|
+
<g>
|
|
130
|
+
<g>
|
|
131
|
+
<rect
|
|
132
|
+
x="264.978"
|
|
133
|
+
y="441.049"
|
|
134
|
+
style={{ fill: tokens.colorNeutralBackground1 }}
|
|
135
|
+
width="482.581"
|
|
136
|
+
height="379.067"
|
|
137
|
+
/>
|
|
138
|
+
<path
|
|
139
|
+
style={{ fill: tokens.colorNeutralStroke1 }}
|
|
140
|
+
d="M750.06,822.616H262.478V438.549H750.06V822.616z M267.478,817.616H745.06V443.549H267.478V817.616z"
|
|
141
|
+
/>
|
|
142
|
+
</g>
|
|
143
|
+
<g>
|
|
144
|
+
{/* Small chart elements */}
|
|
145
|
+
<g>
|
|
146
|
+
<rect
|
|
147
|
+
x="330.537"
|
|
148
|
+
y="503.15"
|
|
149
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
150
|
+
width="108.842"
|
|
151
|
+
height="61.633"
|
|
152
|
+
/>
|
|
153
|
+
<g>
|
|
154
|
+
<rect
|
|
155
|
+
x="485.277"
|
|
156
|
+
y="509.093"
|
|
157
|
+
style={{ fill: tokens.colorBrandBackground }}
|
|
158
|
+
width="198.014"
|
|
159
|
+
height="2.623"
|
|
160
|
+
/>
|
|
161
|
+
<rect
|
|
162
|
+
x="485.277"
|
|
163
|
+
y="532.656"
|
|
164
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
165
|
+
width="198.014"
|
|
166
|
+
height="2.623"
|
|
167
|
+
/>
|
|
168
|
+
<rect
|
|
169
|
+
x="485.277"
|
|
170
|
+
y="556.218"
|
|
171
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
172
|
+
width="198.014"
|
|
173
|
+
height="2.623"
|
|
174
|
+
/>
|
|
175
|
+
</g>
|
|
176
|
+
</g>
|
|
177
|
+
{/* Bar chart elements */}
|
|
178
|
+
<g>
|
|
179
|
+
<g>
|
|
180
|
+
<rect
|
|
181
|
+
x="381.691"
|
|
182
|
+
y="687.747"
|
|
183
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
184
|
+
width="22.73"
|
|
185
|
+
height="70.417"
|
|
186
|
+
/>
|
|
187
|
+
<rect
|
|
188
|
+
x="404.421"
|
|
189
|
+
y="653.482"
|
|
190
|
+
style={{ fill: tokens.colorBrandBackground }}
|
|
191
|
+
width="22.73"
|
|
192
|
+
height="104.682"
|
|
193
|
+
/>
|
|
194
|
+
</g>
|
|
195
|
+
<g>
|
|
196
|
+
<rect
|
|
197
|
+
x="466.491"
|
|
198
|
+
y="641.634"
|
|
199
|
+
style={{ fill: tokens.colorNeutralForeground3, opacity: 0.3 }}
|
|
200
|
+
width="22.73"
|
|
201
|
+
height="116.089"
|
|
202
|
+
/>
|
|
203
|
+
<rect
|
|
204
|
+
x="489.221"
|
|
205
|
+
y="714.758"
|
|
206
|
+
style={{ fill: tokens.colorBrandBackground }}
|
|
207
|
+
width="22.73"
|
|
208
|
+
height="42.965"
|
|
209
|
+
/>
|
|
210
|
+
</g>
|
|
211
|
+
</g>
|
|
212
|
+
</g>
|
|
213
|
+
</g>
|
|
214
|
+
</svg>
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export default BusinessReportIcon;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { ChartDatum } from './ChartDatum';
|
|
4
|
+
import { IChart } from '.';
|
|
5
|
+
|
|
6
|
+
export interface ICardChartContainer {
|
|
7
|
+
chart: IChart;
|
|
8
|
+
cardTitle: string;
|
|
9
|
+
showZoom?: boolean;
|
|
10
|
+
id: string;
|
|
11
|
+
data?: { label: string; data: ChartDatum[]; }[];
|
|
12
|
+
defaultSpan?: { spanCols: number; spanRows: number; };
|
|
13
|
+
}
|
package/src/models/index.ts
CHANGED