@fluentui/react-charting 5.16.44 → 5.16.46

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.
Files changed (125) hide show
  1. package/CHANGELOG.json +43 -1
  2. package/CHANGELOG.md +22 -2
  3. package/dist/react-charting.js +1 -1
  4. package/dist/react-charting.min.js +1 -1
  5. package/docs/TestPlans/GaugeChart/ComponentTests.md +31 -0
  6. package/lib/GaugeChart.d.ts +1 -0
  7. package/lib/GaugeChart.js +2 -0
  8. package/lib/GaugeChart.js.map +1 -0
  9. package/lib/components/GaugeChart/GaugeChart.base.d.ts +67 -0
  10. package/lib/components/GaugeChart/GaugeChart.base.js +376 -0
  11. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -0
  12. package/lib/components/GaugeChart/GaugeChart.d.ts +3 -0
  13. package/lib/components/GaugeChart/GaugeChart.js +5 -0
  14. package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
  15. package/lib/components/GaugeChart/GaugeChart.styles.d.ts +2 -0
  16. package/lib/components/GaugeChart/GaugeChart.styles.js +118 -0
  17. package/lib/components/GaugeChart/GaugeChart.styles.js.map +1 -0
  18. package/lib/components/GaugeChart/GaugeChart.types.d.ts +207 -0
  19. package/lib/components/GaugeChart/GaugeChart.types.js +6 -0
  20. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
  21. package/lib/components/GaugeChart/index.d.ts +2 -0
  22. package/lib/components/GaugeChart/index.js +3 -0
  23. package/lib/components/GaugeChart/index.js.map +1 -0
  24. package/lib/components/LineChart/LineChart.base.js +1 -1
  25. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  26. package/lib/components/LineChart/LineChart.types.d.ts +2 -2
  27. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  28. package/lib/components/LineChart/eventAnnotation/EventAnnotation.d.ts +2 -0
  29. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +6 -3
  30. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  31. package/lib/components/LineChart/eventAnnotation/LabelLink.d.ts +3 -1
  32. package/lib/components/LineChart/eventAnnotation/LabelLink.js +6 -3
  33. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  34. package/lib/index.d.ts +1 -0
  35. package/lib/index.js +1 -0
  36. package/lib/index.js.map +1 -1
  37. package/lib/utilities/SVGTooltipText.d.ts +81 -0
  38. package/lib/utilities/SVGTooltipText.js +173 -0
  39. package/lib/utilities/SVGTooltipText.js.map +1 -0
  40. package/lib/utilities/utilities.d.ts +1 -0
  41. package/lib/utilities/utilities.js +11 -0
  42. package/lib/utilities/utilities.js.map +1 -1
  43. package/lib/version.js +1 -1
  44. package/lib/version.js.map +1 -1
  45. package/lib-amd/GaugeChart.d.ts +1 -0
  46. package/lib-amd/GaugeChart.js +6 -0
  47. package/lib-amd/GaugeChart.js.map +1 -0
  48. package/lib-amd/components/GaugeChart/GaugeChart.base.d.ts +67 -0
  49. package/lib-amd/components/GaugeChart/GaugeChart.base.js +370 -0
  50. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -0
  51. package/lib-amd/components/GaugeChart/GaugeChart.d.ts +3 -0
  52. package/lib-amd/components/GaugeChart/GaugeChart.js +7 -0
  53. package/lib-amd/components/GaugeChart/GaugeChart.js.map +1 -0
  54. package/lib-amd/components/GaugeChart/GaugeChart.styles.d.ts +2 -0
  55. package/lib-amd/components/GaugeChart/GaugeChart.styles.js +122 -0
  56. package/lib-amd/components/GaugeChart/GaugeChart.styles.js.map +1 -0
  57. package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +207 -0
  58. package/lib-amd/components/GaugeChart/GaugeChart.types.js +11 -0
  59. package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -0
  60. package/lib-amd/components/GaugeChart/index.d.ts +2 -0
  61. package/lib-amd/components/GaugeChart/index.js +7 -0
  62. package/lib-amd/components/GaugeChart/index.js.map +1 -0
  63. package/lib-amd/components/LineChart/LineChart.base.js +1 -1
  64. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  65. package/lib-amd/components/LineChart/LineChart.types.d.ts +2 -2
  66. package/lib-amd/components/LineChart/LineChart.types.js.map +1 -1
  67. package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.d.ts +2 -0
  68. package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.js +6 -4
  69. package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  70. package/lib-amd/components/LineChart/eventAnnotation/LabelLink.d.ts +3 -1
  71. package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js +6 -4
  72. package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  73. package/lib-amd/index.d.ts +1 -0
  74. package/lib-amd/index.js +2 -1
  75. package/lib-amd/index.js.map +1 -1
  76. package/lib-amd/utilities/SVGTooltipText.d.ts +81 -0
  77. package/lib-amd/utilities/SVGTooltipText.js +174 -0
  78. package/lib-amd/utilities/SVGTooltipText.js.map +1 -0
  79. package/lib-amd/utilities/utilities.d.ts +1 -0
  80. package/lib-amd/utilities/utilities.js +13 -2
  81. package/lib-amd/utilities/utilities.js.map +1 -1
  82. package/lib-amd/version.js +1 -1
  83. package/lib-amd/version.js.map +1 -1
  84. package/lib-commonjs/GaugeChart.d.ts +1 -0
  85. package/lib-commonjs/GaugeChart.js +5 -0
  86. package/lib-commonjs/GaugeChart.js.map +1 -0
  87. package/lib-commonjs/components/GaugeChart/GaugeChart.base.d.ts +67 -0
  88. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +379 -0
  89. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -0
  90. package/lib-commonjs/components/GaugeChart/GaugeChart.d.ts +3 -0
  91. package/lib-commonjs/components/GaugeChart/GaugeChart.js +8 -0
  92. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
  93. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.d.ts +2 -0
  94. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js +122 -0
  95. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js.map +1 -0
  96. package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +207 -0
  97. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +9 -0
  98. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
  99. package/lib-commonjs/components/GaugeChart/index.d.ts +2 -0
  100. package/lib-commonjs/components/GaugeChart/index.js +6 -0
  101. package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
  102. package/lib-commonjs/components/LineChart/LineChart.base.js +1 -1
  103. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  104. package/lib-commonjs/components/LineChart/LineChart.types.d.ts +2 -2
  105. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  106. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.d.ts +2 -0
  107. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +6 -3
  108. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  109. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.d.ts +3 -1
  110. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +6 -3
  111. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  112. package/lib-commonjs/index.d.ts +1 -0
  113. package/lib-commonjs/index.js +1 -0
  114. package/lib-commonjs/index.js.map +1 -1
  115. package/lib-commonjs/utilities/SVGTooltipText.d.ts +81 -0
  116. package/lib-commonjs/utilities/SVGTooltipText.js +176 -0
  117. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
  118. package/lib-commonjs/utilities/utilities.d.ts +1 -0
  119. package/lib-commonjs/utilities/utilities.js +13 -1
  120. package/lib-commonjs/utilities/utilities.js.map +1 -1
  121. package/lib-commonjs/version.js +1 -1
  122. package/lib-commonjs/version.js.map +1 -1
  123. package/package.json +4 -4
  124. package/src/components/GaugeChart/GaugeChart.types.ts +258 -0
  125. 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: string;
83
- labelColor: string;
82
+ strokeColor?: string;
83
+ labelColor?: string;
84
84
  labelHeight?: number;
85
85
  labelWidth?: number;
86
86
  mergedLabel: (count: number) => string;