@fluentui/react-charting 5.16.44 → 5.16.45
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/CHANGELOG.json +22 -1
- package/CHANGELOG.md +12 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/docs/TestPlans/GaugeChart/ComponentTests.md +31 -0
- package/lib/GaugeChart.d.ts +1 -0
- package/lib/GaugeChart.js +2 -0
- package/lib/GaugeChart.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.base.d.ts +67 -0
- package/lib/components/GaugeChart/GaugeChart.base.js +376 -0
- package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.d.ts +3 -0
- package/lib/components/GaugeChart/GaugeChart.js +5 -0
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.styles.d.ts +2 -0
- package/lib/components/GaugeChart/GaugeChart.styles.js +118 -0
- package/lib/components/GaugeChart/GaugeChart.styles.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.types.d.ts +207 -0
- package/lib/components/GaugeChart/GaugeChart.types.js +6 -0
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib/components/GaugeChart/index.d.ts +2 -0
- package/lib/components/GaugeChart/index.js +3 -0
- package/lib/components/GaugeChart/index.js.map +1 -0
- package/lib/components/LineChart/LineChart.base.js +1 -1
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.d.ts +2 -2
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.d.ts +2 -0
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +6 -3
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.d.ts +3 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js +6 -3
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utilities/SVGTooltipText.d.ts +81 -0
- package/lib/utilities/SVGTooltipText.js +173 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -0
- package/lib/utilities/utilities.d.ts +1 -0
- package/lib/utilities/utilities.js +11 -0
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/lib-amd/GaugeChart.d.ts +1 -0
- package/lib-amd/GaugeChart.js +6 -0
- package/lib-amd/GaugeChart.js.map +1 -0
- package/lib-amd/components/GaugeChart/GaugeChart.base.d.ts +67 -0
- package/lib-amd/components/GaugeChart/GaugeChart.base.js +370 -0
- package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -0
- package/lib-amd/components/GaugeChart/GaugeChart.d.ts +3 -0
- package/lib-amd/components/GaugeChart/GaugeChart.js +7 -0
- package/lib-amd/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib-amd/components/GaugeChart/GaugeChart.styles.d.ts +2 -0
- package/lib-amd/components/GaugeChart/GaugeChart.styles.js +122 -0
- package/lib-amd/components/GaugeChart/GaugeChart.styles.js.map +1 -0
- package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +207 -0
- package/lib-amd/components/GaugeChart/GaugeChart.types.js +11 -0
- package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib-amd/components/GaugeChart/index.d.ts +2 -0
- package/lib-amd/components/GaugeChart/index.js +7 -0
- package/lib-amd/components/GaugeChart/index.js.map +1 -0
- package/lib-amd/components/LineChart/LineChart.base.js +1 -1
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.types.d.ts +2 -2
- package/lib-amd/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.d.ts +2 -0
- package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.js +6 -4
- package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib-amd/components/LineChart/eventAnnotation/LabelLink.d.ts +3 -1
- package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js +6 -4
- package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib-amd/index.d.ts +1 -0
- package/lib-amd/index.js +2 -1
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/utilities/SVGTooltipText.d.ts +81 -0
- package/lib-amd/utilities/SVGTooltipText.js +174 -0
- package/lib-amd/utilities/SVGTooltipText.js.map +1 -0
- package/lib-amd/utilities/utilities.d.ts +1 -0
- package/lib-amd/utilities/utilities.js +13 -2
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-amd/version.js +1 -1
- package/lib-amd/version.js.map +1 -1
- package/lib-commonjs/GaugeChart.d.ts +1 -0
- package/lib-commonjs/GaugeChart.js +5 -0
- package/lib-commonjs/GaugeChart.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.d.ts +67 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +379 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.d.ts +3 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +8 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.styles.d.ts +2 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js +122 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +207 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +9 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/index.d.ts +2 -0
- package/lib-commonjs/components/GaugeChart/index.js +6 -0
- package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.base.js +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.d.ts +2 -2
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.d.ts +2 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +6 -3
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.d.ts +3 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +6 -3
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -0
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.d.ts +81 -0
- package/lib-commonjs/utilities/SVGTooltipText.js +176 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
- package/lib-commonjs/utilities/utilities.d.ts +1 -0
- package/lib-commonjs/utilities/utilities.js +13 -1
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/lib-commonjs/version.js +1 -1
- package/lib-commonjs/version.js.map +1 -1
- package/package.json +1 -1
- package/src/components/GaugeChart/GaugeChart.types.ts +258 -0
- package/src/components/LineChart/LineChart.types.ts +2 -2
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { IStyle, ITheme } from '@fluentui/react/lib/Styling';
|
|
2
|
+
import { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';
|
|
3
|
+
import { ILegendsProps } from '../Legends/index';
|
|
4
|
+
import { IAccessibilityProps } from '../../types/index';
|
|
5
|
+
import { ICalloutProps } from '@fluentui/react/lib/Callout';
|
|
6
|
+
|
|
7
|
+
export interface IGaugeChartSegment {
|
|
8
|
+
/**
|
|
9
|
+
* Legend text for a segment
|
|
10
|
+
*/
|
|
11
|
+
legend: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Size of the segment
|
|
15
|
+
*/
|
|
16
|
+
size: number;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Color of the segment
|
|
20
|
+
*/
|
|
21
|
+
color?: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Accessibility data for the segment
|
|
25
|
+
*/
|
|
26
|
+
accessibilityData?: IAccessibilityProps;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum GaugeValueFormat {
|
|
30
|
+
Percentage = 'percentage',
|
|
31
|
+
Fraction = 'fraction',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IGaugeChartProps {
|
|
35
|
+
/**
|
|
36
|
+
* Width of the chart
|
|
37
|
+
*/
|
|
38
|
+
width?: number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Height of the chart
|
|
42
|
+
*/
|
|
43
|
+
height?: number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Title of the chart
|
|
47
|
+
*/
|
|
48
|
+
chartTitle?: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Current value of the gauge
|
|
52
|
+
*/
|
|
53
|
+
chartValue: number;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Sections of the gauge
|
|
57
|
+
*/
|
|
58
|
+
segments: IGaugeChartSegment[];
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Minimum value of the gauge
|
|
62
|
+
* @defaultvalue 0
|
|
63
|
+
*/
|
|
64
|
+
minValue?: number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Maximum value of the gauge
|
|
68
|
+
*/
|
|
69
|
+
maxValue?: number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Additional text to display below the chart value
|
|
73
|
+
*/
|
|
74
|
+
sublabel?: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Hide the min and max values of the gauge
|
|
78
|
+
* @defaultvalue false
|
|
79
|
+
*/
|
|
80
|
+
hideMinMax?: boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Format of the chart value
|
|
84
|
+
* @defaultvalue GaugeValueFormat.Percentage
|
|
85
|
+
*/
|
|
86
|
+
chartValueFormat?: GaugeValueFormat | ((sweepFraction: number[]) => string);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Decides whether to show/hide legends
|
|
90
|
+
* @defaultvalue false
|
|
91
|
+
*/
|
|
92
|
+
hideLegend?: boolean;
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* Props for the legends in the chart
|
|
96
|
+
*/
|
|
97
|
+
legendProps?: Partial<ILegendsProps>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Do not show tooltips in chart
|
|
101
|
+
* @defaultvalue false
|
|
102
|
+
*/
|
|
103
|
+
hideTooltip?: boolean;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Additional CSS class(es) to apply to the chart
|
|
107
|
+
*/
|
|
108
|
+
className?: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Theme (provided through customization)
|
|
112
|
+
*/
|
|
113
|
+
theme?: ITheme;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Call to provide customized styling that will layer on top of the variant rules
|
|
117
|
+
*/
|
|
118
|
+
styles?: IStyleFunctionOrObject<IGaugeChartStyleProps, IGaugeChartStyles>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Defines the culture to localize the numbers and dates
|
|
122
|
+
*/
|
|
123
|
+
culture?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Props for the callout in the chart
|
|
127
|
+
*/
|
|
128
|
+
calloutProps?: Partial<ICalloutProps>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface IGaugeChartStyleProps {
|
|
132
|
+
/**
|
|
133
|
+
* Theme (provided through customization)
|
|
134
|
+
*/
|
|
135
|
+
theme: ITheme;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Font size of the chart value
|
|
139
|
+
*/
|
|
140
|
+
chartValueSize?: number;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Width of the chart
|
|
144
|
+
*/
|
|
145
|
+
chartWidth?: number;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Height of the chart
|
|
149
|
+
*/
|
|
150
|
+
chartHeight?: number;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Additional CSS class(es) to apply to the chart
|
|
154
|
+
*/
|
|
155
|
+
className?: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Color of the line
|
|
159
|
+
*/
|
|
160
|
+
lineColor?: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Boolean flag which determines if shape is drawn in callout
|
|
164
|
+
*/
|
|
165
|
+
toDrawShape?: boolean;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface IGaugeChartStyles {
|
|
169
|
+
/**
|
|
170
|
+
* Styles for the root element
|
|
171
|
+
*/
|
|
172
|
+
root?: IStyle;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Styles for the chart
|
|
176
|
+
*/
|
|
177
|
+
chart?: IStyle;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Styles for the min and max values
|
|
181
|
+
*/
|
|
182
|
+
limits?: IStyle;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Styles for the chart value
|
|
186
|
+
*/
|
|
187
|
+
chartValue?: IStyle;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Styles for the sublabel
|
|
191
|
+
*/
|
|
192
|
+
sublabel?: IStyle;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Styles for the needle
|
|
196
|
+
*/
|
|
197
|
+
needle?: IStyle;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Styles for the chart title
|
|
201
|
+
*/
|
|
202
|
+
chartTitle?: IStyle;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Styles for the segments
|
|
206
|
+
*/
|
|
207
|
+
segment?: IStyle;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Styles for the legends container
|
|
211
|
+
*/
|
|
212
|
+
legendsContainer?: IStyle;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Styles for callout root-content
|
|
216
|
+
*/
|
|
217
|
+
calloutContentRoot?: IStyle;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Styles for callout x-content
|
|
221
|
+
*/
|
|
222
|
+
calloutContentX?: IStyle;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Styles for callout y-content
|
|
226
|
+
*/
|
|
227
|
+
calloutContentY?: IStyle;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Styles for description message
|
|
231
|
+
*/
|
|
232
|
+
descriptionMessage?: IStyle;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Styles for callout Date time container
|
|
236
|
+
*/
|
|
237
|
+
calloutDateTimeContainer?: IStyle;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Styles for callout info container
|
|
241
|
+
*/
|
|
242
|
+
calloutInfoContainer?: IStyle;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Styles for callout block container
|
|
246
|
+
*/
|
|
247
|
+
calloutBlockContainer?: IStyle;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Styles for callout legend text
|
|
251
|
+
*/
|
|
252
|
+
calloutlegendText?: IStyle;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Styles for the shape object in the callout
|
|
256
|
+
*/
|
|
257
|
+
shapeStyles?: IStyle;
|
|
258
|
+
}
|
|
@@ -79,8 +79,8 @@ export interface ILineChartProps extends ICartesianChartProps {
|
|
|
79
79
|
}
|
|
80
80
|
export interface IEventsAnnotationProps {
|
|
81
81
|
events: IEventAnnotation[];
|
|
82
|
-
strokeColor
|
|
83
|
-
labelColor
|
|
82
|
+
strokeColor?: string;
|
|
83
|
+
labelColor?: string;
|
|
84
84
|
labelHeight?: number;
|
|
85
85
|
labelWidth?: number;
|
|
86
86
|
mergedLabel: (count: number) => string;
|