@fluentui/chart-web-components 0.0.1-0 → 0.0.2

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 (68) hide show
  1. package/CHANGELOG.md +15 -7
  2. package/dist/chart-web-components.d.ts +213 -0
  3. package/dist/chart-web-components.js +7087 -0
  4. package/dist/chart-web-components.min.js +106 -0
  5. package/dist/dts/donut-chart/define.d.ts +1 -0
  6. package/dist/dts/donut-chart/donut-chart.bench.d.ts +3 -0
  7. package/dist/dts/donut-chart/donut-chart.d.ts +40 -0
  8. package/dist/dts/donut-chart/donut-chart.definition.d.ts +7 -0
  9. package/dist/dts/donut-chart/donut-chart.options.d.ts +38 -0
  10. package/dist/dts/donut-chart/donut-chart.styles.d.ts +6 -0
  11. package/dist/dts/donut-chart/donut-chart.template.d.ts +12 -0
  12. package/dist/dts/donut-chart/index.d.ts +4 -0
  13. package/dist/dts/helpers.tests.d.ts +30 -0
  14. package/dist/dts/horizontal-bar-chart/define.d.ts +1 -0
  15. package/dist/dts/horizontal-bar-chart/horizontal-bar-chart.bench.d.ts +3 -0
  16. package/dist/dts/horizontal-bar-chart/horizontal-bar-chart.d.ts +46 -0
  17. package/dist/dts/horizontal-bar-chart/horizontal-bar-chart.definition.d.ts +9 -0
  18. package/dist/dts/horizontal-bar-chart/horizontal-bar-chart.options.d.ts +40 -0
  19. package/dist/dts/horizontal-bar-chart/horizontal-bar-chart.styles.d.ts +7 -0
  20. package/dist/dts/horizontal-bar-chart/horizontal-bar-chart.template.d.ts +12 -0
  21. package/dist/dts/horizontal-bar-chart/index.d.ts +4 -0
  22. package/dist/dts/index-rollup.d.ts +2 -0
  23. package/dist/dts/index.d.ts +2 -0
  24. package/dist/dts/utils/benchmark-wrapper.d.ts +2 -0
  25. package/dist/dts/utils/chart-helpers.d.ts +37 -0
  26. package/dist/esm/donut-chart/define.js +4 -0
  27. package/dist/esm/donut-chart/define.js.map +1 -0
  28. package/dist/esm/donut-chart/donut-chart.bench.js +10 -0
  29. package/dist/esm/donut-chart/donut-chart.bench.js.map +1 -0
  30. package/dist/esm/donut-chart/donut-chart.definition.js +18 -0
  31. package/dist/esm/donut-chart/donut-chart.definition.js.map +1 -0
  32. package/dist/esm/donut-chart/donut-chart.js +227 -0
  33. package/dist/esm/donut-chart/donut-chart.js.map +1 -0
  34. package/dist/esm/donut-chart/donut-chart.options.js +2 -0
  35. package/dist/esm/donut-chart/donut-chart.options.js.map +1 -0
  36. package/dist/esm/donut-chart/donut-chart.styles.js +133 -0
  37. package/dist/esm/donut-chart/donut-chart.styles.js.map +1 -0
  38. package/dist/esm/donut-chart/donut-chart.template.js +57 -0
  39. package/dist/esm/donut-chart/donut-chart.template.js.map +1 -0
  40. package/dist/esm/donut-chart/index.js +5 -0
  41. package/dist/esm/donut-chart/index.js.map +1 -0
  42. package/dist/esm/helpers.tests.js +73 -0
  43. package/dist/esm/helpers.tests.js.map +1 -0
  44. package/dist/esm/horizontal-bar-chart/define.js +4 -0
  45. package/dist/esm/horizontal-bar-chart/define.js.map +1 -0
  46. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.bench.js +10 -0
  47. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.bench.js.map +1 -0
  48. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.definition.js +20 -0
  49. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.definition.js.map +1 -0
  50. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.js +412 -0
  51. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.js.map +1 -0
  52. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.options.js +7 -0
  53. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.options.js.map +1 -0
  54. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.styles.js +163 -0
  55. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.styles.js.map +1 -0
  56. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.template.js +53 -0
  57. package/dist/esm/horizontal-bar-chart/horizontal-bar-chart.template.js.map +1 -0
  58. package/dist/esm/horizontal-bar-chart/index.js +5 -0
  59. package/dist/esm/horizontal-bar-chart/index.js.map +1 -0
  60. package/dist/esm/index-rollup.js +3 -0
  61. package/dist/esm/index-rollup.js.map +1 -0
  62. package/dist/esm/index.js +3 -0
  63. package/dist/esm/index.js.map +1 -0
  64. package/dist/esm/utils/benchmark-wrapper.js +18 -0
  65. package/dist/esm/utils/benchmark-wrapper.js.map +1 -0
  66. package/dist/esm/utils/chart-helpers.js +160 -0
  67. package/dist/esm/utils/chart-helpers.js.map +1 -0
  68. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,18 +1,26 @@
1
1
  # Change Log - @fluentui/chart-web-components
2
2
 
3
- This log was last generated on Mon, 20 Jan 2025 04:13:01 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 07 Feb 2025 04:07:24 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.1-0](https://github.com/microsoft/fluentui/tree/@fluentui/chart-web-components_v0.0.1-0)
7
+ ## [0.0.2](https://github.com/microsoft/fluentui/tree/@fluentui/chart-web-components_v0.0.2)
8
8
 
9
- Mon, 20 Jan 2025 04:13:01 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/chart-web-components_v0.0.0..@fluentui/chart-web-components_v0.0.1-0)
9
+ Fri, 07 Feb 2025 04:07:24 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/chart-web-components_v0.0.1..@fluentui/chart-web-components_v0.0.2)
11
11
 
12
- ### Changes
12
+ ### Patches
13
+
14
+ - Bump @fluentui/web-components to v3.0.0-beta.79 ([PR #33795](https://github.com/microsoft/fluentui/pull/33795) by beachball)
15
+
16
+ ## [0.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/chart-web-components_v0.0.1)
17
+
18
+ Tue, 04 Feb 2025 04:07:18 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/chart-web-components_v0.0.0..@fluentui/chart-web-components_v0.0.1)
20
+
21
+ ### Patches
13
22
 
14
- - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/tokens to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
23
+ - Bump @fluentui/web-components to v3.0.0-beta.78 ([PR #33756](https://github.com/microsoft/fluentui/pull/33756) by beachball)
16
24
 
17
25
  ## [0.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/chart-web-components_v0.0.0)
18
26
 
@@ -0,0 +1,213 @@
1
+ import { ElementStyles } from '@microsoft/fast-element';
2
+ import { ElementViewTemplate } from '@microsoft/fast-element';
3
+ import { FASTElement } from '@microsoft/fast-element';
4
+ import { FASTElementDefinition } from '@microsoft/fast-element';
5
+
6
+ declare interface ChartDataPoint {
7
+ /**
8
+ * Legend text for the datapoint in the chart
9
+ */
10
+ legend: string;
11
+ /**
12
+ * data the datapoint in the chart
13
+ */
14
+ data: number;
15
+ /**
16
+ * total length of bar
17
+ */
18
+ total?: number;
19
+ /**
20
+ * onClick action for each datapoint in the chart
21
+ */
22
+ onClick?: VoidFunction;
23
+ /**
24
+ * Color for the legend in the chart. If not provided, it will fallback on the default color palette.
25
+ */
26
+ color?: string;
27
+ gradient?: [string, string];
28
+ }
29
+
30
+ declare interface ChartDataPoint_2 {
31
+ /**
32
+ * Legend text for the datapoint in the chart
33
+ */
34
+ legend: string;
35
+ /**
36
+ * data the datapoint in the chart
37
+ */
38
+ data: number;
39
+ /**
40
+ * Color for the legend in the chart. If not provided, it will fallback on the default color palette.
41
+ */
42
+ color?: string;
43
+ /**
44
+ * Callout data for x axis
45
+ * This is an optional prop, If haven;t given legend will take
46
+ */
47
+ xAxisCalloutData?: string;
48
+ /**
49
+ * Callout data for y axis
50
+ * This is an optional prop, If haven't given data will take
51
+ */
52
+ yAxisCalloutData?: string;
53
+ }
54
+
55
+ declare interface ChartProps {
56
+ /**
57
+ * title for the data series
58
+ */
59
+ chartSeriesTitle?: string;
60
+ /**
61
+ * data for the points in the chart
62
+ */
63
+ chartData: ChartDataPoint[];
64
+ benchmarkData?: number;
65
+ chartDataText?: string;
66
+ }
67
+
68
+ declare interface ChartProps_2 {
69
+ /**
70
+ * chart title for the chart
71
+ */
72
+ chartTitle?: string;
73
+ /**
74
+ * data for the points in the chart
75
+ */
76
+ chartData: ChartDataPoint_2[];
77
+ }
78
+
79
+ export declare class DonutChart extends FASTElement {
80
+ height: number;
81
+ width: number;
82
+ hideLegends: boolean;
83
+ hideTooltip: boolean;
84
+ data: ChartProps_2;
85
+ innerRadius: number;
86
+ valueInsideDonut?: string;
87
+ legendListLabel?: string;
88
+ legends: Legend[];
89
+ activeLegend: string;
90
+ protected activeLegendChanged(oldValue: string, newValue: string): void;
91
+ isLegendSelected: boolean;
92
+ tooltipProps: {
93
+ isVisible: boolean;
94
+ legend: string;
95
+ yValue: string;
96
+ color: string;
97
+ xPos: number;
98
+ yPos: number;
99
+ };
100
+ protected tooltipPropsChanged(oldValue: any, newValue: any): void;
101
+ chartWrapper: HTMLDivElement;
102
+ group: SVGGElement;
103
+ elementInternals: ElementInternals;
104
+ private _arcs;
105
+ private _isRTL;
106
+ private _textInsideDonut?;
107
+ constructor();
108
+ handleLegendMouseoverAndFocus(legendTitle: string): void;
109
+ handleLegendMouseoutAndBlur(): void;
110
+ handleLegendClick(legendTitle: string): void;
111
+ connectedCallback(): void;
112
+ private _render;
113
+ private _getLegends;
114
+ private _getTextInsideDonut;
115
+ private _updateTextInsideDonut;
116
+ }
117
+
118
+ /**
119
+ * @public
120
+ * @remarks
121
+ * HTML Element: `<fluent-donut-chart>`
122
+ */
123
+ export declare const DonutChartDefinition: FASTElementDefinition<typeof DonutChart>;
124
+
125
+ /**
126
+ * Styles for the DonutChart component.
127
+ *
128
+ * @public
129
+ */
130
+ export declare const DonutChartStyles: ElementStyles;
131
+
132
+ /**
133
+ * @internal
134
+ */
135
+ export declare const DonutChartTemplate: ElementViewTemplate<DonutChart>;
136
+
137
+ /**
138
+ * A Horizontal Bar Chart HTML Element.
139
+ *
140
+ * @public
141
+ */
142
+ export declare class HorizontalBarChart extends FASTElement {
143
+ variant?: Variant;
144
+ data: ChartProps[];
145
+ hideRatio: boolean;
146
+ hideLegends: boolean;
147
+ hideTooltip: boolean;
148
+ legendListLabel?: string;
149
+ chartTitle?: string;
150
+ uniqueLegends: ChartDataPoint[];
151
+ activeLegend: string;
152
+ protected activeLegendChanged: (oldValue: string, newValue: string) => void;
153
+ isLegendSelected: boolean;
154
+ tooltipProps: {
155
+ isVisible: boolean;
156
+ legend: string;
157
+ yValue: string;
158
+ color: string;
159
+ xPos: number;
160
+ yPos: number;
161
+ };
162
+ chartContainer: HTMLDivElement;
163
+ elementInternals: ElementInternals;
164
+ private _isRTL;
165
+ private _barHeight;
166
+ private _bars;
167
+ constructor();
168
+ handleLegendMouseoverAndFocus: (legendTitle: string) => void;
169
+ handleLegendMouseoutAndBlur: () => void;
170
+ handleLegendClick: (legendTitle: string) => void;
171
+ connectedCallback(): void;
172
+ private _initializeData;
173
+ private _renderChart;
174
+ private _createSingleChartBars;
175
+ private _hydrateLegends;
176
+ private _hydrateData;
177
+ private _calculateBarSpacing;
178
+ private _createBarsAndLegends;
179
+ }
180
+
181
+ /**
182
+ * The Fluent Textarea Element definition.
183
+ *
184
+ * @public
185
+ * @remarks
186
+ * HTML Element: `<fluent-textarea>`
187
+ */
188
+ export declare const HorizontalBarChartDefinition: FASTElementDefinition<typeof HorizontalBarChart>;
189
+
190
+ /**
191
+ * Styles for the HorizontalBarChart component.
192
+ *
193
+ * @public
194
+ */
195
+ export declare const HorizontalBarChartStyles: ElementStyles;
196
+
197
+ /**
198
+ * @internal
199
+ */
200
+ export declare const HorizontalBarChartTemplate: ElementViewTemplate<HorizontalBarChart>;
201
+
202
+ declare type Legend = {
203
+ title: string;
204
+ color: string;
205
+ };
206
+
207
+ declare enum Variant {
208
+ PartToWhole = "part-to-whole",
209
+ AbsoluteScale = "absolute-scale",
210
+ SingleBar = "single-bar"
211
+ }
212
+
213
+ export { }