@fluentui/react-charts 0.0.0-nightly-20260113-0406.1 → 0.0.0-nightly-20260114-0406.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/CHANGELOG.md +13 -13
- package/dist/index.d.ts +4 -0
- package/lib/components/DonutChart/DonutChart.js +4 -2
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +2 -1
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +25 -16
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +23 -15
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +4 -2
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +2 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +29 -14
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +22 -14
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
- package/package.json +10 -10
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
4
4
|
import { __styles, mergeClasses } from '@griffel/react';
|
|
5
|
-
import { getChartTitleStyles } from '../../utilities/index';
|
|
5
|
+
import { getChartTitleStyles, HighContrastSelector } from '../../utilities/index';
|
|
6
6
|
export const gaugeChartClassNames = {
|
|
7
7
|
root: 'fui-gc__root',
|
|
8
8
|
chart: 'fui-gc__chart',
|
|
@@ -23,7 +23,8 @@ export const gaugeChartClassNames = {
|
|
|
23
23
|
descriptionMessage: 'fui-gc__descriptionMessage',
|
|
24
24
|
calloutInfoContainer: '',
|
|
25
25
|
legendsContainer: 'fui-gc__legendsContainer',
|
|
26
|
-
chartWrapper: 'fui-gc__chartWrapper'
|
|
26
|
+
chartWrapper: 'fui-gc__chartWrapper',
|
|
27
|
+
svgTooltip: 'fui-gc__svgTooltip'
|
|
27
28
|
};
|
|
28
29
|
const useStyles = /*#__PURE__*/__styles({
|
|
29
30
|
root: {
|
|
@@ -66,6 +67,10 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
66
67
|
Bkfmm31: "fhuob2q",
|
|
67
68
|
ojy3ng: "f1yuyku4"
|
|
68
69
|
},
|
|
70
|
+
svgTooltip: {
|
|
71
|
+
Bkfmm31: "f5q6cfr",
|
|
72
|
+
Bxms50k: "f1bgda6t"
|
|
73
|
+
},
|
|
69
74
|
chartTitle: {
|
|
70
75
|
Bahqtrf: "fk6fouc",
|
|
71
76
|
Be2twd7: "f13mqy1h",
|
|
@@ -153,16 +158,19 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
153
158
|
a9b677: "fly5x3f"
|
|
154
159
|
}
|
|
155
160
|
}, {
|
|
156
|
-
d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f22iagw{display:flex;}", ".f1vx9l62{flex-direction:column;}", ".f122n59{align-items:center;}", ".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".ftgm304{display:block;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fhuob2q{fill:var(--colorNeutralForeground1);}", ".fhv2zbx{forced-color-adjust:auto;}", ".f1yuyku4{stroke:var(--colorNeutralBackground1);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".f17mccla{text-align:center;}", ".fqcjy3b{margin-bottom:var(--spacingVerticalS);}", [".f13htf1t{outline:none;}", {
|
|
161
|
+
d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f22iagw{display:flex;}", ".f1vx9l62{flex-direction:column;}", ".f122n59{align-items:center;}", ".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}", ".ftgm304{display:block;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fhuob2q{fill:var(--colorNeutralForeground1);}", ".fhv2zbx{forced-color-adjust:auto;}", ".f1yuyku4{stroke:var(--colorNeutralBackground1);}", ".f5q6cfr{fill:var(--colorNeutralBackground1);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".f17mccla{text-align:center;}", ".fqcjy3b{margin-bottom:var(--spacingVerticalS);}", [".f13htf1t{outline:none;}", {
|
|
157
162
|
p: -1
|
|
158
163
|
}], ".f1v24fw0{stroke:var(--colorNeutralStroke1);}", ".f13qh94s{display:grid;}", [".f1a3p1vp{overflow:hidden;}", {
|
|
159
164
|
p: -1
|
|
160
165
|
}], ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fronft5{background-blend-mode:normal,luminosity;}", ".f1063pyq{flex-direction:row;}", ".f1869bpl{justify-content:space-between;}", ".f104wqfl{line-height:16px;}", ".fd43bvn{opacity:0.85;}", ".f7jvbu2{margin-top:13px;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f177v4lu{padding-left:8px;}", ".f19lj068{padding-right:8px;}", ".fdgv6k0{forced-color-adjust:none;}", ".f1phki43{margin-right:8px;}", ".ff9s3yw{margin-left:8px;}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f82itaf{line-height:22px;}", ".ffemd8d{margin-top:10px;}", ".f1809wu7{padding-top:10px;}", [".f10ci6s2{border-top:1px solid var(--colorNeutralStroke1);}", {
|
|
161
166
|
p: -1
|
|
167
|
+
}]],
|
|
168
|
+
m: [["@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.f1bgda6t{fill:Canvas;}}", {
|
|
169
|
+
m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
|
|
162
170
|
}]]
|
|
163
171
|
});
|
|
164
172
|
export const useGaugeChartStyles = props => {
|
|
165
|
-
var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9, _props_styles10, _props_styles11, _props_styles12, _props_styles13, _props_styles14, _props_styles15, _props_styles16, _props_styles17, _props_styles18;
|
|
173
|
+
var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9, _props_styles10, _props_styles11, _props_styles12, _props_styles13, _props_styles14, _props_styles15, _props_styles16, _props_styles17, _props_styles18, _props_styles19;
|
|
166
174
|
const baseStyles = useStyles();
|
|
167
175
|
return {
|
|
168
176
|
root: mergeClasses(gaugeChartClassNames.root, baseStyles.root, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
|
|
@@ -172,17 +180,18 @@ export const useGaugeChartStyles = props => {
|
|
|
172
180
|
sublabel: mergeClasses(gaugeChartClassNames.sublabel, baseStyles.sublabel, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.sublabel),
|
|
173
181
|
needle: mergeClasses(gaugeChartClassNames.needle, baseStyles.needle, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.needle),
|
|
174
182
|
chartTitle: mergeClasses(gaugeChartClassNames.chartTitle, baseStyles.chartTitle, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.chartTitle),
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
svgTooltip: mergeClasses(gaugeChartClassNames.svgTooltip, baseStyles.svgTooltip, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.svgTooltip),
|
|
184
|
+
segment: mergeClasses(gaugeChartClassNames.segment, baseStyles.segment, (_props_styles8 = props.styles) === null || _props_styles8 === void 0 ? void 0 : _props_styles8.segment),
|
|
185
|
+
gradientSegment: mergeClasses(gaugeChartClassNames.gradientSegment, baseStyles.gradientSegment, (_props_styles9 = props.styles) === null || _props_styles9 === void 0 ? void 0 : _props_styles9.gradientSegment),
|
|
186
|
+
calloutContentRoot: mergeClasses(gaugeChartClassNames.calloutContentRoot, baseStyles.calloutContentRoot, (_props_styles10 = props.styles) === null || _props_styles10 === void 0 ? void 0 : _props_styles10.calloutContentRoot),
|
|
187
|
+
calloutDateTimeContainer: mergeClasses(gaugeChartClassNames.calloutDateTimeContainer, baseStyles.calloutDateTimeContainer, (_props_styles11 = props.styles) === null || _props_styles11 === void 0 ? void 0 : _props_styles11.calloutDateTimeContainer),
|
|
188
|
+
calloutContentX: mergeClasses(gaugeChartClassNames.calloutContentX, baseStyles.calloutContentX, (_props_styles12 = props.styles) === null || _props_styles12 === void 0 ? void 0 : _props_styles12.calloutContentX),
|
|
189
|
+
calloutBlockContainer: mergeClasses(gaugeChartClassNames.calloutBlockContainer, baseStyles.calloutBlockContainer, (_props_styles13 = props.styles) === null || _props_styles13 === void 0 ? void 0 : _props_styles13.calloutBlockContainer),
|
|
190
|
+
shapeStyles: mergeClasses(gaugeChartClassNames.shapeStyles, baseStyles.shapeStyles, (_props_styles14 = props.styles) === null || _props_styles14 === void 0 ? void 0 : _props_styles14.shapeStyles),
|
|
191
|
+
calloutlegendText: mergeClasses(gaugeChartClassNames.calloutlegendText, baseStyles.calloutlegendText, (_props_styles15 = props.styles) === null || _props_styles15 === void 0 ? void 0 : _props_styles15.calloutlegendText),
|
|
192
|
+
calloutContentY: mergeClasses(gaugeChartClassNames.calloutContentY, baseStyles.calloutContentY, (_props_styles16 = props.styles) === null || _props_styles16 === void 0 ? void 0 : _props_styles16.calloutContentY),
|
|
193
|
+
descriptionMessage: mergeClasses(gaugeChartClassNames.descriptionMessage, baseStyles.descriptionMessage, (_props_styles17 = props.styles) === null || _props_styles17 === void 0 ? void 0 : _props_styles17.descriptionMessage),
|
|
194
|
+
chartWrapper: mergeClasses(gaugeChartClassNames.chartWrapper, (_props_styles18 = props.styles) === null || _props_styles18 === void 0 ? void 0 : _props_styles18.chartWrapper),
|
|
195
|
+
legendsContainer: mergeClasses(gaugeChartClassNames.legendsContainer, baseStyles.legendsContainer, (_props_styles19 = props.styles) === null || _props_styles19 === void 0 ? void 0 : _props_styles19.legendsContainer)
|
|
187
196
|
};
|
|
188
197
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["tokens","typographyStyles","__styles","mergeClasses","getChartTitleStyles","gaugeChartClassNames","root","chart","limits","chartValue","sublabel","needle","chartTitle","segment","gradientSegment","calloutContentRoot","calloutDateTimeContainer","calloutContentX","calloutBlockContainer","shapeStyles","calloutlegendText","calloutContentY","descriptionMessage","calloutInfoContainer","legendsContainer","chartWrapper","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","Bt984gj","a9b677","Bqenvij","fsow6f","Bkfmm31","Bvjb7m6","ojy3ng","jrapky","Bw0xxkn","oeaueh","Bpd4iqm","Befb4lg","B68tc82","Bmxbyg5","Bpg54ce","De3pzq","jy2i9i","Brf1p80","abs64n","B6of3ja","sj55zd","uwmqm3","t21cq0","z8tnut","g2u3we","icvyot","B4j52fo","i8vvqc","d","p","useGaugeChartStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","_props_styles4","_props_styles5","_props_styles6","_props_styles7","_props_styles8","_props_styles9","_props_styles10","_props_styles11","_props_styles12","_props_styles13","_props_styles14","_props_styles15","_props_styles16","_props_styles17","_props_styles18","baseStyles","styles"],"sources":["useGaugeChartStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { getChartTitleStyles } from '../../utilities/index';\nexport const gaugeChartClassNames = {\n root: 'fui-gc__root',\n chart: 'fui-gc__chart',\n limits: 'fui-gc__limits',\n chartValue: 'fui-gc__chartValue',\n sublabel: 'fui-gc__sublabel',\n needle: 'fui-gc__needle',\n chartTitle: 'fui-gc__chartTitle',\n segment: 'fui-gc__segment',\n gradientSegment: 'fui-gc__gradientSegment',\n calloutContentRoot: 'fui-gc__calloutContentRoot',\n calloutDateTimeContainer: 'fui-gc__calloutDateTimeContainer',\n calloutContentX: 'fui-gc__calloutContentX',\n calloutBlockContainer: 'fui-gc__calloutBlockContainer',\n shapeStyles: 'fui-gc__shapeStyles',\n calloutlegendText: 'fui-gc__calloutlegendText',\n calloutContentY: 'fui-gc__calloutContentY',\n descriptionMessage: 'fui-gc__descriptionMessage',\n calloutInfoContainer: '',\n legendsContainer: 'fui-gc__legendsContainer',\n chartWrapper: 'fui-gc__chartWrapper'\n};\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n width: '100%',\n height: '100%',\n textAlign: 'left'\n },\n chart: {\n display: 'block'\n },\n limits: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n chartValue: {\n fontWeight: tokens.fontWeightSemibold,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n sublabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n needle: {\n fill: tokens.colorNeutralForeground1,\n stroke: tokens.colorNeutralBackground1\n },\n chartTitle: getChartTitleStyles(),\n segment: {\n outline: 'none',\n stroke: tokens.colorNeutralStroke1\n },\n gradientSegment: {\n width: '100%',\n height: '100%'\n },\n calloutContentRoot: {\n display: 'grid',\n overflow: 'hidden',\n backgroundColor: tokens.colorNeutralBackground1,\n backgroundBlendMode: 'normal, luminosity'\n },\n calloutDateTimeContainer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between'\n },\n calloutContentX: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n opacity: '0.85'\n },\n calloutBlockContainer: {\n ...typographyStyles.body1Strong,\n marginTop: '13px',\n color: tokens.colorNeutralForeground1,\n paddingLeft: '8px',\n display: 'block',\n forcedColorAdjust: 'none'\n },\n shapeStyles: {\n marginRight: '8px'\n },\n calloutlegendText: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n color: tokens.colorNeutralForeground2,\n forcedColorAdjust: 'auto'\n },\n calloutContentY: {\n ...typographyStyles.body1Strong,\n lineHeight: '22px',\n forcedColorAdjust: 'auto'\n },\n descriptionMessage: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n marginTop: '10px',\n paddingTop: '10px',\n borderTop: `1px solid ${tokens.colorNeutralStroke1}`\n },\n legendsContainer: {\n width: '100%'\n }\n});\nexport const useGaugeChartStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9, _props_styles10, _props_styles11, _props_styles12, _props_styles13, _props_styles14, _props_styles15, _props_styles16, _props_styles17, _props_styles18;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(gaugeChartClassNames.root, baseStyles.root, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chart: mergeClasses(gaugeChartClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),\n limits: mergeClasses(gaugeChartClassNames.limits, baseStyles.limits, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.limits),\n chartValue: mergeClasses(gaugeChartClassNames.chartValue, baseStyles.chartValue, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartValue),\n sublabel: mergeClasses(gaugeChartClassNames.sublabel, baseStyles.sublabel, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.sublabel),\n needle: mergeClasses(gaugeChartClassNames.needle, baseStyles.needle, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.needle),\n chartTitle: mergeClasses(gaugeChartClassNames.chartTitle, baseStyles.chartTitle, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.chartTitle),\n segment: mergeClasses(gaugeChartClassNames.segment, baseStyles.segment, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.segment),\n gradientSegment: mergeClasses(gaugeChartClassNames.gradientSegment, baseStyles.gradientSegment, (_props_styles8 = props.styles) === null || _props_styles8 === void 0 ? void 0 : _props_styles8.gradientSegment),\n calloutContentRoot: mergeClasses(gaugeChartClassNames.calloutContentRoot, baseStyles.calloutContentRoot, (_props_styles9 = props.styles) === null || _props_styles9 === void 0 ? void 0 : _props_styles9.calloutContentRoot),\n calloutDateTimeContainer: mergeClasses(gaugeChartClassNames.calloutDateTimeContainer, baseStyles.calloutDateTimeContainer, (_props_styles10 = props.styles) === null || _props_styles10 === void 0 ? void 0 : _props_styles10.calloutDateTimeContainer),\n calloutContentX: mergeClasses(gaugeChartClassNames.calloutContentX, baseStyles.calloutContentX, (_props_styles11 = props.styles) === null || _props_styles11 === void 0 ? void 0 : _props_styles11.calloutContentX),\n calloutBlockContainer: mergeClasses(gaugeChartClassNames.calloutBlockContainer, baseStyles.calloutBlockContainer, (_props_styles12 = props.styles) === null || _props_styles12 === void 0 ? void 0 : _props_styles12.calloutBlockContainer),\n shapeStyles: mergeClasses(gaugeChartClassNames.shapeStyles, baseStyles.shapeStyles, (_props_styles13 = props.styles) === null || _props_styles13 === void 0 ? void 0 : _props_styles13.shapeStyles),\n calloutlegendText: mergeClasses(gaugeChartClassNames.calloutlegendText, baseStyles.calloutlegendText, (_props_styles14 = props.styles) === null || _props_styles14 === void 0 ? void 0 : _props_styles14.calloutlegendText),\n calloutContentY: mergeClasses(gaugeChartClassNames.calloutContentY, baseStyles.calloutContentY, (_props_styles15 = props.styles) === null || _props_styles15 === void 0 ? void 0 : _props_styles15.calloutContentY),\n descriptionMessage: mergeClasses(gaugeChartClassNames.descriptionMessage, baseStyles.descriptionMessage, (_props_styles16 = props.styles) === null || _props_styles16 === void 0 ? void 0 : _props_styles16.descriptionMessage),\n chartWrapper: mergeClasses(gaugeChartClassNames.chartWrapper, (_props_styles17 = props.styles) === null || _props_styles17 === void 0 ? void 0 : _props_styles17.chartWrapper),\n legendsContainer: mergeClasses(gaugeChartClassNames.legendsContainer, baseStyles.legendsContainer, (_props_styles18 = props.styles) === null || _props_styles18 === void 0 ? void 0 : _props_styles18.legendsContainer)\n };\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAAAC,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,OAAO,MAAMC,oBAAoB,GAAG;EAChCC,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,eAAe;EACtBC,MAAM,EAAE,gBAAgB;EACxBC,UAAU,EAAE,oBAAoB;EAChCC,QAAQ,EAAE,kBAAkB;EAC5BC,MAA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EAAEnB,YAAY,CAACE,oBAAoB,CAACiB,kBAAkB,EAAE8D,UAAU,CAAC9D,kBAAkB,EAAE,CAAC2D,eAAe,GAAGjB,KAAK,CAACqB,MAAM,MAAM,IAAI,IAAIJ,eAAe,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,eAAe,CAAC3D,kBAAkB,CAAC;IAC/NG,YAAY,EAAEtB,YAAY,CAACE,oBAAoB,CAACoB,YAAY,EAAE,CAACyD,eAAe,GAAGlB,KAAK,CAACqB,MAAM,MAAM,IAAI,IAAIH,eAAe,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,eAAe,CAACzD,YAAY,CAAC;IAC9KD,gBAAgB,EAAErB,YAAY,CAACE,oBAAoB,CAACmB,gBAAgB,EAAE4D,UAAU,CAAC5D,gBAAgB,EAAE,CAAC2D,eAAe,GAAGnB,KAAK,CAACqB,MAAM,MAAM,IAAI,IAAIF,eAAe,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,eAAe,CAAC3D,gBAAgB;EAC1N,CAAC;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["tokens","typographyStyles","__styles","mergeClasses","getChartTitleStyles","HighContrastSelector","gaugeChartClassNames","root","chart","limits","chartValue","sublabel","needle","chartTitle","segment","gradientSegment","calloutContentRoot","calloutDateTimeContainer","calloutContentX","calloutBlockContainer","shapeStyles","calloutlegendText","calloutContentY","descriptionMessage","calloutInfoContainer","legendsContainer","chartWrapper","svgTooltip","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","Bt984gj","a9b677","Bqenvij","fsow6f","Bkfmm31","Bvjb7m6","ojy3ng","Bxms50k","jrapky","Bw0xxkn","oeaueh","Bpd4iqm","Befb4lg","B68tc82","Bmxbyg5","Bpg54ce","De3pzq","jy2i9i","Brf1p80","abs64n","B6of3ja","sj55zd","uwmqm3","t21cq0","z8tnut","g2u3we","icvyot","B4j52fo","i8vvqc","d","p","m","useGaugeChartStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","_props_styles4","_props_styles5","_props_styles6","_props_styles7","_props_styles8","_props_styles9","_props_styles10","_props_styles11","_props_styles12","_props_styles13","_props_styles14","_props_styles15","_props_styles16","_props_styles17","_props_styles18","_props_styles19","baseStyles","styles"],"sources":["useGaugeChartStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { getChartTitleStyles, HighContrastSelector } from '../../utilities/index';\nexport const gaugeChartClassNames = {\n root: 'fui-gc__root',\n chart: 'fui-gc__chart',\n limits: 'fui-gc__limits',\n chartValue: 'fui-gc__chartValue',\n sublabel: 'fui-gc__sublabel',\n needle: 'fui-gc__needle',\n chartTitle: 'fui-gc__chartTitle',\n segment: 'fui-gc__segment',\n gradientSegment: 'fui-gc__gradientSegment',\n calloutContentRoot: 'fui-gc__calloutContentRoot',\n calloutDateTimeContainer: 'fui-gc__calloutDateTimeContainer',\n calloutContentX: 'fui-gc__calloutContentX',\n calloutBlockContainer: 'fui-gc__calloutBlockContainer',\n shapeStyles: 'fui-gc__shapeStyles',\n calloutlegendText: 'fui-gc__calloutlegendText',\n calloutContentY: 'fui-gc__calloutContentY',\n descriptionMessage: 'fui-gc__descriptionMessage',\n calloutInfoContainer: '',\n legendsContainer: 'fui-gc__legendsContainer',\n chartWrapper: 'fui-gc__chartWrapper',\n svgTooltip: 'fui-gc__svgTooltip'\n};\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n width: '100%',\n height: '100%',\n textAlign: 'left'\n },\n chart: {\n display: 'block'\n },\n limits: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n chartValue: {\n fontWeight: tokens.fontWeightSemibold,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n sublabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n needle: {\n fill: tokens.colorNeutralForeground1,\n stroke: tokens.colorNeutralBackground1\n },\n svgTooltip: {\n fill: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n fill: 'Canvas'\n }\n },\n chartTitle: getChartTitleStyles(),\n segment: {\n outline: 'none',\n stroke: tokens.colorNeutralStroke1\n },\n gradientSegment: {\n width: '100%',\n height: '100%'\n },\n calloutContentRoot: {\n display: 'grid',\n overflow: 'hidden',\n backgroundColor: tokens.colorNeutralBackground1,\n backgroundBlendMode: 'normal, luminosity'\n },\n calloutDateTimeContainer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between'\n },\n calloutContentX: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n opacity: '0.85'\n },\n calloutBlockContainer: {\n ...typographyStyles.body1Strong,\n marginTop: '13px',\n color: tokens.colorNeutralForeground1,\n paddingLeft: '8px',\n display: 'block',\n forcedColorAdjust: 'none'\n },\n shapeStyles: {\n marginRight: '8px'\n },\n calloutlegendText: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n color: tokens.colorNeutralForeground2,\n forcedColorAdjust: 'auto'\n },\n calloutContentY: {\n ...typographyStyles.body1Strong,\n lineHeight: '22px',\n forcedColorAdjust: 'auto'\n },\n descriptionMessage: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n marginTop: '10px',\n paddingTop: '10px',\n borderTop: `1px solid ${tokens.colorNeutralStroke1}`\n },\n legendsContainer: {\n width: '100%'\n }\n});\nexport const useGaugeChartStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9, _props_styles10, _props_styles11, _props_styles12, _props_styles13, _props_styles14, _props_styles15, _props_styles16, _props_styles17, _props_styles18, _props_styles19;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(gaugeChartClassNames.root, baseStyles.root, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chart: mergeClasses(gaugeChartClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),\n limits: mergeClasses(gaugeChartClassNames.limits, baseStyles.limits, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.limits),\n chartValue: mergeClasses(gaugeChartClassNames.chartValue, baseStyles.chartValue, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartValue),\n sublabel: mergeClasses(gaugeChartClassNames.sublabel, baseStyles.sublabel, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.sublabel),\n needle: mergeClasses(gaugeChartClassNames.needle, baseStyles.needle, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.needle),\n chartTitle: mergeClasses(gaugeChartClassNames.chartTitle, baseStyles.chartTitle, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.chartTitle),\n svgTooltip: mergeClasses(gaugeChartClassNames.svgTooltip, baseStyles.svgTooltip, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.svgTooltip),\n segment: mergeClasses(gaugeChartClassNames.segment, baseStyles.segment, (_props_styles8 = props.styles) === null || _props_styles8 === void 0 ? void 0 : _props_styles8.segment),\n gradientSegment: mergeClasses(gaugeChartClassNames.gradientSegment, baseStyles.gradientSegment, (_props_styles9 = props.styles) === null || _props_styles9 === void 0 ? void 0 : _props_styles9.gradientSegment),\n calloutContentRoot: mergeClasses(gaugeChartClassNames.calloutContentRoot, baseStyles.calloutContentRoot, (_props_styles10 = props.styles) === null || _props_styles10 === void 0 ? void 0 : _props_styles10.calloutContentRoot),\n calloutDateTimeContainer: mergeClasses(gaugeChartClassNames.calloutDateTimeContainer, baseStyles.calloutDateTimeContainer, (_props_styles11 = props.styles) === null || _props_styles11 === void 0 ? void 0 : _props_styles11.calloutDateTimeContainer),\n calloutContentX: mergeClasses(gaugeChartClassNames.calloutContentX, baseStyles.calloutContentX, (_props_styles12 = props.styles) === null || _props_styles12 === void 0 ? void 0 : _props_styles12.calloutContentX),\n calloutBlockContainer: mergeClasses(gaugeChartClassNames.calloutBlockContainer, baseStyles.calloutBlockContainer, (_props_styles13 = props.styles) === null || _props_styles13 === void 0 ? void 0 : _props_styles13.calloutBlockContainer),\n shapeStyles: mergeClasses(gaugeChartClassNames.shapeStyles, baseStyles.shapeStyles, (_props_styles14 = props.styles) === null || _props_styles14 === void 0 ? void 0 : _props_styles14.shapeStyles),\n calloutlegendText: mergeClasses(gaugeChartClassNames.calloutlegendText, baseStyles.calloutlegendText, (_props_styles15 = props.styles) === null || _props_styles15 === void 0 ? void 0 : _props_styles15.calloutlegendText),\n calloutContentY: mergeClasses(gaugeChartClassNames.calloutContentY, baseStyles.calloutContentY, (_props_styles16 = props.styles) === null || _props_styles16 === void 0 ? void 0 : _props_styles16.calloutContentY),\n descriptionMessage: mergeClasses(gaugeChartClassNames.descriptionMessage, baseStyles.descriptionMessage, (_props_styles17 = props.styles) === null || _props_styles17 === void 0 ? void 0 : _props_styles17.descriptionMessage),\n chartWrapper: mergeClasses(gaugeChartClassNames.chartWrapper, (_props_styles18 = props.styles) === null || _props_styles18 === void 0 ? void 0 : _props_styles18.chartWrapper),\n legendsContainer: mergeClasses(gaugeChartClassNames.legendsContainer, baseStyles.legendsContainer, (_props_styles19 = props.styles) === null || _props_styles19 === void 0 ? void 0 : _props_styles19.legendsContainer)\n };\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAAAC,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,uBAAuB;AACjF,OAAO,MAAMC,oBAAoB,GAAG;EAChC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2
2
|
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
3
|
import { makeStyles, mergeClasses } from '@griffel/react';
|
|
4
|
-
import { getChartTitleStyles } from '../../utilities/index';
|
|
4
|
+
import { getChartTitleStyles, HighContrastSelector } from '../../utilities/index';
|
|
5
5
|
export const gaugeChartClassNames = {
|
|
6
6
|
root: 'fui-gc__root',
|
|
7
7
|
chart: 'fui-gc__chart',
|
|
@@ -22,7 +22,8 @@ export const gaugeChartClassNames = {
|
|
|
22
22
|
descriptionMessage: 'fui-gc__descriptionMessage',
|
|
23
23
|
calloutInfoContainer: '',
|
|
24
24
|
legendsContainer: 'fui-gc__legendsContainer',
|
|
25
|
-
chartWrapper: 'fui-gc__chartWrapper'
|
|
25
|
+
chartWrapper: 'fui-gc__chartWrapper',
|
|
26
|
+
svgTooltip: 'fui-gc__svgTooltip'
|
|
26
27
|
};
|
|
27
28
|
const useStyles = makeStyles({
|
|
28
29
|
root: {
|
|
@@ -56,6 +57,12 @@ const useStyles = makeStyles({
|
|
|
56
57
|
fill: tokens.colorNeutralForeground1,
|
|
57
58
|
stroke: tokens.colorNeutralBackground1
|
|
58
59
|
},
|
|
60
|
+
svgTooltip: {
|
|
61
|
+
fill: tokens.colorNeutralBackground1,
|
|
62
|
+
[HighContrastSelector]: {
|
|
63
|
+
fill: 'Canvas'
|
|
64
|
+
}
|
|
65
|
+
},
|
|
59
66
|
chartTitle: getChartTitleStyles(),
|
|
60
67
|
segment: {
|
|
61
68
|
outline: 'none',
|
|
@@ -115,7 +122,7 @@ const useStyles = makeStyles({
|
|
|
115
122
|
}
|
|
116
123
|
});
|
|
117
124
|
export const useGaugeChartStyles = (props)=>{
|
|
118
|
-
var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9, _props_styles10, _props_styles11, _props_styles12, _props_styles13, _props_styles14, _props_styles15, _props_styles16, _props_styles17, _props_styles18;
|
|
125
|
+
var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9, _props_styles10, _props_styles11, _props_styles12, _props_styles13, _props_styles14, _props_styles15, _props_styles16, _props_styles17, _props_styles18, _props_styles19;
|
|
119
126
|
const baseStyles = useStyles();
|
|
120
127
|
return {
|
|
121
128
|
root: mergeClasses(gaugeChartClassNames.root, baseStyles.root, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
|
|
@@ -125,17 +132,18 @@ export const useGaugeChartStyles = (props)=>{
|
|
|
125
132
|
sublabel: mergeClasses(gaugeChartClassNames.sublabel, baseStyles.sublabel, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.sublabel),
|
|
126
133
|
needle: mergeClasses(gaugeChartClassNames.needle, baseStyles.needle, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.needle),
|
|
127
134
|
chartTitle: mergeClasses(gaugeChartClassNames.chartTitle, baseStyles.chartTitle, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.chartTitle),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
svgTooltip: mergeClasses(gaugeChartClassNames.svgTooltip, baseStyles.svgTooltip, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.svgTooltip),
|
|
136
|
+
segment: mergeClasses(gaugeChartClassNames.segment, baseStyles.segment, (_props_styles8 = props.styles) === null || _props_styles8 === void 0 ? void 0 : _props_styles8.segment),
|
|
137
|
+
gradientSegment: mergeClasses(gaugeChartClassNames.gradientSegment, baseStyles.gradientSegment, (_props_styles9 = props.styles) === null || _props_styles9 === void 0 ? void 0 : _props_styles9.gradientSegment),
|
|
138
|
+
calloutContentRoot: mergeClasses(gaugeChartClassNames.calloutContentRoot, baseStyles.calloutContentRoot, (_props_styles10 = props.styles) === null || _props_styles10 === void 0 ? void 0 : _props_styles10.calloutContentRoot),
|
|
139
|
+
calloutDateTimeContainer: mergeClasses(gaugeChartClassNames.calloutDateTimeContainer, baseStyles.calloutDateTimeContainer, (_props_styles11 = props.styles) === null || _props_styles11 === void 0 ? void 0 : _props_styles11.calloutDateTimeContainer),
|
|
140
|
+
calloutContentX: mergeClasses(gaugeChartClassNames.calloutContentX, baseStyles.calloutContentX, (_props_styles12 = props.styles) === null || _props_styles12 === void 0 ? void 0 : _props_styles12.calloutContentX),
|
|
141
|
+
calloutBlockContainer: mergeClasses(gaugeChartClassNames.calloutBlockContainer, baseStyles.calloutBlockContainer, (_props_styles13 = props.styles) === null || _props_styles13 === void 0 ? void 0 : _props_styles13.calloutBlockContainer),
|
|
142
|
+
shapeStyles: mergeClasses(gaugeChartClassNames.shapeStyles, baseStyles.shapeStyles, (_props_styles14 = props.styles) === null || _props_styles14 === void 0 ? void 0 : _props_styles14.shapeStyles),
|
|
143
|
+
calloutlegendText: mergeClasses(gaugeChartClassNames.calloutlegendText, baseStyles.calloutlegendText, (_props_styles15 = props.styles) === null || _props_styles15 === void 0 ? void 0 : _props_styles15.calloutlegendText),
|
|
144
|
+
calloutContentY: mergeClasses(gaugeChartClassNames.calloutContentY, baseStyles.calloutContentY, (_props_styles16 = props.styles) === null || _props_styles16 === void 0 ? void 0 : _props_styles16.calloutContentY),
|
|
145
|
+
descriptionMessage: mergeClasses(gaugeChartClassNames.descriptionMessage, baseStyles.descriptionMessage, (_props_styles17 = props.styles) === null || _props_styles17 === void 0 ? void 0 : _props_styles17.descriptionMessage),
|
|
146
|
+
chartWrapper: mergeClasses(gaugeChartClassNames.chartWrapper, (_props_styles18 = props.styles) === null || _props_styles18 === void 0 ? void 0 : _props_styles18.chartWrapper),
|
|
147
|
+
legendsContainer: mergeClasses(gaugeChartClassNames.legendsContainer, baseStyles.legendsContainer, (_props_styles19 = props.styles) === null || _props_styles19 === void 0 ? void 0 : _props_styles19.legendsContainer)
|
|
140
148
|
};
|
|
141
149
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/GaugeChart/useGaugeChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities/src/index';\nimport { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport { GaugeChartProps, GaugeChartStyles } from './GaugeChart.types';\nimport { getChartTitleStyles } from '../../utilities/index';\n\nexport const gaugeChartClassNames: SlotClassNames<GaugeChartStyles> = {\n root: 'fui-gc__root',\n chart: 'fui-gc__chart',\n limits: 'fui-gc__limits',\n chartValue: 'fui-gc__chartValue',\n sublabel: 'fui-gc__sublabel',\n needle: 'fui-gc__needle',\n chartTitle: 'fui-gc__chartTitle',\n segment: 'fui-gc__segment',\n gradientSegment: 'fui-gc__gradientSegment',\n calloutContentRoot: 'fui-gc__calloutContentRoot',\n calloutDateTimeContainer: 'fui-gc__calloutDateTimeContainer',\n calloutContentX: 'fui-gc__calloutContentX',\n calloutBlockContainer: 'fui-gc__calloutBlockContainer',\n shapeStyles: 'fui-gc__shapeStyles',\n calloutlegendText: 'fui-gc__calloutlegendText',\n calloutContentY: 'fui-gc__calloutContentY',\n descriptionMessage: 'fui-gc__descriptionMessage',\n calloutInfoContainer: '',\n legendsContainer: 'fui-gc__legendsContainer',\n chartWrapper: 'fui-gc__chartWrapper',\n};\n\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n width: '100%',\n height: '100%',\n textAlign: 'left',\n },\n chart: {\n display: 'block',\n },\n limits: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n chartValue: {\n fontWeight: tokens.fontWeightSemibold,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n sublabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n needle: {\n fill: tokens.colorNeutralForeground1,\n stroke: tokens.colorNeutralBackground1,\n },\n chartTitle: getChartTitleStyles() as GriffelStyle,\n segment: {\n outline: 'none',\n stroke: tokens.colorNeutralStroke1,\n },\n gradientSegment: {\n width: '100%',\n height: '100%',\n },\n calloutContentRoot: {\n display: 'grid',\n overflow: 'hidden',\n backgroundColor: tokens.colorNeutralBackground1,\n backgroundBlendMode: 'normal, luminosity',\n },\n calloutDateTimeContainer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n calloutContentX: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n opacity: '0.85',\n },\n calloutBlockContainer: {\n ...typographyStyles.body1Strong,\n marginTop: '13px',\n color: tokens.colorNeutralForeground1,\n paddingLeft: '8px',\n display: 'block',\n forcedColorAdjust: 'none',\n },\n shapeStyles: {\n marginRight: '8px',\n },\n calloutlegendText: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n color: tokens.colorNeutralForeground2,\n forcedColorAdjust: 'auto',\n },\n calloutContentY: {\n ...typographyStyles.body1Strong,\n lineHeight: '22px',\n forcedColorAdjust: 'auto',\n },\n descriptionMessage: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n marginTop: '10px',\n paddingTop: '10px',\n borderTop: `1px solid ${tokens.colorNeutralStroke1}`,\n },\n legendsContainer: {\n width: '100%',\n },\n});\nexport const useGaugeChartStyles = (props: GaugeChartProps): GaugeChartStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(gaugeChartClassNames.root, baseStyles.root, props.styles?.root),\n chart: mergeClasses(gaugeChartClassNames.chart, baseStyles.chart, props.styles?.chart),\n limits: mergeClasses(gaugeChartClassNames.limits, baseStyles.limits, props.styles?.limits),\n chartValue: mergeClasses(gaugeChartClassNames.chartValue, baseStyles.chartValue, props.styles?.chartValue),\n sublabel: mergeClasses(gaugeChartClassNames.sublabel, baseStyles.sublabel, props.styles?.sublabel),\n needle: mergeClasses(gaugeChartClassNames.needle, baseStyles.needle, props.styles?.needle),\n chartTitle: mergeClasses(gaugeChartClassNames.chartTitle, baseStyles.chartTitle, props.styles?.chartTitle),\n segment: mergeClasses(gaugeChartClassNames.segment, baseStyles.segment, props.styles?.segment),\n gradientSegment: mergeClasses(\n gaugeChartClassNames.gradientSegment,\n baseStyles.gradientSegment,\n props.styles?.gradientSegment,\n ),\n calloutContentRoot: mergeClasses(\n gaugeChartClassNames.calloutContentRoot,\n baseStyles.calloutContentRoot,\n props.styles?.calloutContentRoot,\n ),\n calloutDateTimeContainer: mergeClasses(\n gaugeChartClassNames.calloutDateTimeContainer,\n baseStyles.calloutDateTimeContainer,\n props.styles?.calloutDateTimeContainer,\n ),\n calloutContentX: mergeClasses(\n gaugeChartClassNames.calloutContentX,\n baseStyles.calloutContentX,\n props.styles?.calloutContentX,\n ),\n calloutBlockContainer: mergeClasses(\n gaugeChartClassNames.calloutBlockContainer,\n baseStyles.calloutBlockContainer,\n props.styles?.calloutBlockContainer,\n ),\n shapeStyles: mergeClasses(gaugeChartClassNames.shapeStyles, baseStyles.shapeStyles, props.styles?.shapeStyles),\n calloutlegendText: mergeClasses(\n gaugeChartClassNames.calloutlegendText,\n baseStyles.calloutlegendText,\n props.styles?.calloutlegendText,\n ),\n calloutContentY: mergeClasses(\n gaugeChartClassNames.calloutContentY,\n baseStyles.calloutContentY,\n props.styles?.calloutContentY,\n ),\n descriptionMessage: mergeClasses(\n gaugeChartClassNames.descriptionMessage,\n baseStyles.descriptionMessage,\n props.styles?.descriptionMessage,\n ),\n chartWrapper: mergeClasses(gaugeChartClassNames.chartWrapper, props.styles?.chartWrapper),\n legendsContainer: mergeClasses(\n gaugeChartClassNames.legendsContainer,\n baseStyles.legendsContainer,\n props.styles?.legendsContainer,\n ),\n };\n};\n"],"names":["tokens","typographyStyles","makeStyles","mergeClasses","getChartTitleStyles","gaugeChartClassNames","root","chart","limits","chartValue","sublabel","needle","chartTitle","segment","gradientSegment","calloutContentRoot","calloutDateTimeContainer","calloutContentX","calloutBlockContainer","shapeStyles","calloutlegendText","calloutContentY","descriptionMessage","calloutInfoContainer","legendsContainer","chartWrapper","useStyles","body1","display","flexDirection","alignItems","width","height","textAlign","caption1Strong","fill","colorNeutralForeground1","forcedColorAdjust","fontWeight","fontWeightSemibold","stroke","colorNeutralBackground1","outline","colorNeutralStroke1","overflow","backgroundColor","backgroundBlendMode","justifyContent","caption1","lineHeight","opacity","body1Strong","marginTop","color","paddingLeft","marginRight","colorNeutralForeground2","paddingTop","borderTop","useGaugeChartStyles","props","baseStyles","styles"],"mappings":"AAAA;AAEA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,SAAuBC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAExE,SAASC,mBAAmB,QAAQ,wBAAwB;AAE5D,OAAO,MAAMC,uBAAyD;IACpEC,MAAM;IACNC,OAAO;IACPC,QAAQ;IACRC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,YAAY;IACZC,SAAS;IACTC,iBAAiB;IACjBC,oBAAoB;IACpBC,0BAA0B;IAC1BC,iBAAiB;IACjBC,uBAAuB;IACvBC,aAAa;IACbC,mBAAmB;IACnBC,iBAAiB;IACjBC,oBAAoB;IACpBC,sBAAsB;IACtBC,kBAAkB;IAClBC,cAAc;AAChB,EAAE;AAEF,MAAMC,YAAYxB,WAAW;IAC3BI,MAAM;QACJ,GAAGL,iBAAiB0B,KAAK;QACzBC,SAAS;QACTC,eAAe;QACfC,YAAY;QACZC,OAAO;QACPC,QAAQ;QACRC,WAAW;IACb;IACA1B,OAAO;QACLqB,SAAS;IACX;IACApB,QAAQ;QACN,GAAGP,iBAAiBiC,cAAc;QAClCC,MAAMnC,OAAOoC,uBAAuB;QACpCC,mBAAmB;IACrB;IACA5B,YAAY;QACV6B,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AAgB,GAC3BoC,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAAcpC,gBAAgB;IAElC;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/GaugeChart/useGaugeChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities/src/index';\nimport { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport { GaugeChartProps, GaugeChartStyles } from './GaugeChart.types';\nimport { getChartTitleStyles, HighContrastSelector } from '../../utilities/index';\n\nexport const gaugeChartClassNames: SlotClassNames<GaugeChartStyles> = {\n root: 'fui-gc__root',\n chart: 'fui-gc__chart',\n limits: 'fui-gc__limits',\n chartValue: 'fui-gc__chartValue',\n sublabel: 'fui-gc__sublabel',\n needle: 'fui-gc__needle',\n chartTitle: 'fui-gc__chartTitle',\n segment: 'fui-gc__segment',\n gradientSegment: 'fui-gc__gradientSegment',\n calloutContentRoot: 'fui-gc__calloutContentRoot',\n calloutDateTimeContainer: 'fui-gc__calloutDateTimeContainer',\n calloutContentX: 'fui-gc__calloutContentX',\n calloutBlockContainer: 'fui-gc__calloutBlockContainer',\n shapeStyles: 'fui-gc__shapeStyles',\n calloutlegendText: 'fui-gc__calloutlegendText',\n calloutContentY: 'fui-gc__calloutContentY',\n descriptionMessage: 'fui-gc__descriptionMessage',\n calloutInfoContainer: '',\n legendsContainer: 'fui-gc__legendsContainer',\n chartWrapper: 'fui-gc__chartWrapper',\n svgTooltip: 'fui-gc__svgTooltip',\n};\n\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n width: '100%',\n height: '100%',\n textAlign: 'left',\n },\n chart: {\n display: 'block',\n },\n limits: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n chartValue: {\n fontWeight: tokens.fontWeightSemibold,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n sublabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n needle: {\n fill: tokens.colorNeutralForeground1,\n stroke: tokens.colorNeutralBackground1,\n },\n svgTooltip: {\n fill: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n chartTitle: getChartTitleStyles() as GriffelStyle,\n segment: {\n outline: 'none',\n stroke: tokens.colorNeutralStroke1,\n },\n gradientSegment: {\n width: '100%',\n height: '100%',\n },\n calloutContentRoot: {\n display: 'grid',\n overflow: 'hidden',\n backgroundColor: tokens.colorNeutralBackground1,\n backgroundBlendMode: 'normal, luminosity',\n },\n calloutDateTimeContainer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n calloutContentX: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n opacity: '0.85',\n },\n calloutBlockContainer: {\n ...typographyStyles.body1Strong,\n marginTop: '13px',\n color: tokens.colorNeutralForeground1,\n paddingLeft: '8px',\n display: 'block',\n forcedColorAdjust: 'none',\n },\n shapeStyles: {\n marginRight: '8px',\n },\n calloutlegendText: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n color: tokens.colorNeutralForeground2,\n forcedColorAdjust: 'auto',\n },\n calloutContentY: {\n ...typographyStyles.body1Strong,\n lineHeight: '22px',\n forcedColorAdjust: 'auto',\n },\n descriptionMessage: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n marginTop: '10px',\n paddingTop: '10px',\n borderTop: `1px solid ${tokens.colorNeutralStroke1}`,\n },\n legendsContainer: {\n width: '100%',\n },\n});\nexport const useGaugeChartStyles = (props: GaugeChartProps): GaugeChartStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(gaugeChartClassNames.root, baseStyles.root, props.styles?.root),\n chart: mergeClasses(gaugeChartClassNames.chart, baseStyles.chart, props.styles?.chart),\n limits: mergeClasses(gaugeChartClassNames.limits, baseStyles.limits, props.styles?.limits),\n chartValue: mergeClasses(gaugeChartClassNames.chartValue, baseStyles.chartValue, props.styles?.chartValue),\n sublabel: mergeClasses(gaugeChartClassNames.sublabel, baseStyles.sublabel, props.styles?.sublabel),\n needle: mergeClasses(gaugeChartClassNames.needle, baseStyles.needle, props.styles?.needle),\n chartTitle: mergeClasses(gaugeChartClassNames.chartTitle, baseStyles.chartTitle, props.styles?.chartTitle),\n svgTooltip: mergeClasses(gaugeChartClassNames.svgTooltip, baseStyles.svgTooltip, props.styles?.svgTooltip),\n segment: mergeClasses(gaugeChartClassNames.segment, baseStyles.segment, props.styles?.segment),\n gradientSegment: mergeClasses(\n gaugeChartClassNames.gradientSegment,\n baseStyles.gradientSegment,\n props.styles?.gradientSegment,\n ),\n calloutContentRoot: mergeClasses(\n gaugeChartClassNames.calloutContentRoot,\n baseStyles.calloutContentRoot,\n props.styles?.calloutContentRoot,\n ),\n calloutDateTimeContainer: mergeClasses(\n gaugeChartClassNames.calloutDateTimeContainer,\n baseStyles.calloutDateTimeContainer,\n props.styles?.calloutDateTimeContainer,\n ),\n calloutContentX: mergeClasses(\n gaugeChartClassNames.calloutContentX,\n baseStyles.calloutContentX,\n props.styles?.calloutContentX,\n ),\n calloutBlockContainer: mergeClasses(\n gaugeChartClassNames.calloutBlockContainer,\n baseStyles.calloutBlockContainer,\n props.styles?.calloutBlockContainer,\n ),\n shapeStyles: mergeClasses(gaugeChartClassNames.shapeStyles, baseStyles.shapeStyles, props.styles?.shapeStyles),\n calloutlegendText: mergeClasses(\n gaugeChartClassNames.calloutlegendText,\n baseStyles.calloutlegendText,\n props.styles?.calloutlegendText,\n ),\n calloutContentY: mergeClasses(\n gaugeChartClassNames.calloutContentY,\n baseStyles.calloutContentY,\n props.styles?.calloutContentY,\n ),\n descriptionMessage: mergeClasses(\n gaugeChartClassNames.descriptionMessage,\n baseStyles.descriptionMessage,\n props.styles?.descriptionMessage,\n ),\n chartWrapper: mergeClasses(gaugeChartClassNames.chartWrapper, props.styles?.chartWrapper),\n legendsContainer: mergeClasses(\n gaugeChartClassNames.legendsContainer,\n baseStyles.legendsContainer,\n props.styles?.legendsContainer,\n ),\n };\n};\n"],"names":["tokens","typographyStyles","makeStyles","mergeClasses","getChartTitleStyles","HighContrastSelector","gaugeChartClassNames","root","chart","limits","chartValue","sublabel","needle","chartTitle","segment","gradientSegment","calloutContentRoot","calloutDateTimeContainer","calloutContentX","calloutBlockContainer","shapeStyles","calloutlegendText","calloutContentY","descriptionMessage","calloutInfoContainer","legendsContainer","chartWrapper","svgTooltip","useStyles","body1","display","flexDirection","alignItems","width","height","textAlign","caption1Strong","fill","colorNeutralForeground1","forcedColorAdjust","fontWeight","fontWeightSemibold","stroke","colorNeutralBackground1","outline","colorNeutralStroke1","overflow","backgroundColor","backgroundBlendMode","justifyContent","caption1","lineHeight","opacity","body1Strong","marginTop","color","paddingLeft","marginRight","colorNeutralForeground2","paddingTop","borderTop","useGaugeChartStyles","props","baseStyles","styles"],"mappings":"AAAA;AAEA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,SAAuBC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAExE,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,wBAAwB;AAElF,OAAO,MAAMC,uBAAyD;IACpEC,MAAM;IACNC,OAAO;IACPC,QAAQ;IACRC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,YAAY;IACZC,SAAS;IACTC,iBAAiB;IACjBC,oBAAoB;IACpBC,0BAA0B;IAC1BC,iBAAiB;IACjBC,uBAAuB;IACvBC,aAAa;IACbC,mBAAmB;IACnBC,iBAAiB;IACjBC,oBAAoB;IACpBC,sBAAsB;IACtBC,kBAAkB;IAClBC,cAAc;IACdC,YAAY;AACd,EAAE;AAEF,MAAMC,YAAY1B,WAAW;IAC3BK,MAAM;QACJ,GAAGN,iBAAiB4B,KAAK;QACzBC,SAAS;QACTC,e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gBAAczC,iBAAiB;QAEjCC,iBAAiBnB,aACfG,qBAAqBgB,eAAe,EACpCyC,WAAWzC,eAAe,GAC1BwC,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAAcxC,eAAe;QAE/BC,oBAAoBpB,aAClBG,qBAAqBiB,kBAAkB,EACvCwC,WAAWxC,kBAAkB,GAC7BuC,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAAcvC,kBAAkB;QAElCG,cAAcvB,aAAaG,qBAAqBoB,YAAY,GAAEoC,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAAcpC,YAAY;QACxFD,kBAAkBtB,aAChBG,qBAAqBmB,gBAAgB,EACrCsC,WAAWtC,gBAAgB,GAC3BqC,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAAcrC,gBAAgB;IAElC;AACF,EAAE"}
|
|
@@ -288,7 +288,9 @@ const DonutChart = /*#__PURE__*/ _react.forwardRef(({ innerRadius = 0, hideLabel
|
|
|
288
288
|
className: classes.chartTitle,
|
|
289
289
|
titleStyles: props.titleStyles,
|
|
290
290
|
tooltipClassName: classes.svgTooltip
|
|
291
|
-
}), /*#__PURE__*/ _react.createElement(
|
|
291
|
+
}), /*#__PURE__*/ _react.createElement("g", {
|
|
292
|
+
transform: `translate(0, ${titleHeight})`
|
|
293
|
+
}, /*#__PURE__*/ _react.createElement(_index.Pie, {
|
|
292
294
|
width: _width,
|
|
293
295
|
height: _height,
|
|
294
296
|
outerRadius: outerRadius,
|
|
@@ -305,7 +307,7 @@ const DonutChart = /*#__PURE__*/ _react.forwardRef(({ innerRadius = 0, hideLabel
|
|
|
305
307
|
valueInsideDonut: _toLocaleString(valueInsideDonut),
|
|
306
308
|
showLabelsInPercent: props.showLabelsInPercent,
|
|
307
309
|
hideLabels: props.hideLabels
|
|
308
|
-
}))), /*#__PURE__*/ _react.createElement(_ChartPopover.ChartPopover, {
|
|
310
|
+
})))), /*#__PURE__*/ _react.createElement(_ChartPopover.ChartPopover, {
|
|
309
311
|
xCalloutValue: xCalloutValue,
|
|
310
312
|
yCalloutValue: yCalloutValue,
|
|
311
313
|
culture: props.culture,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DonutChart/DonutChart.tsx"],"sourcesContent":["'use client';\n\n/* eslint-disable react/jsx-no-bind */\nimport * as React from 'react';\nimport { Pie } from './Pie/index';\nimport { DonutChartProps } from './DonutChart.types';\nimport { useDonutChartStyles } from './useDonutChartStyles.styles';\nimport { ChartDataPoint } from '../../DonutChart';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport {\n areArraysEqual,\n getColorFromToken,\n getNextColor,\n MIN_DONUT_RADIUS,\n ChartTitle,\n CHART_TITLE_PADDING,\n} from '../../utilities/index';\nimport { Legend, Legends } from '../../index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport { useImageExport } from '../../utilities/hooks';\n\nconst MIN_LEGEND_CONTAINER_HEIGHT = 40;\n\n// Create a DonutChart variant which uses these default styles and this styled subcomponent.\n/**\n * Donutchart component.\n * {@docCategory DonutChart}\n */\nexport const DonutChart: React.FunctionComponent<DonutChartProps> = React.forwardRef<HTMLDivElement, DonutChartProps>(\n ({ innerRadius = 0, hideLabels = true, ...restProps }, forwardedRef) => {\n const props = { innerRadius, hideLabels, ...restProps };\n const { chartContainerRef: _rootElem, legendsRef: _legendsRef } = useImageExport(\n props.componentRef,\n props.hideLegend,\n false,\n );\n const _uniqText: string = useId('_Pie_');\n /* eslint-disable @typescript-eslint/no-explicit-any */\n let _calloutAnchorPoint: ChartDataPoint | null;\n let _emptyChartId: string | null;\n const legendContainer = React.useRef<HTMLDivElement | null>(null);\n const prevSize = React.useRef<{ width?: number; height?: number }>({});\n\n const [value, setValue] = React.useState<string | undefined>('');\n const [legend, setLegend] = React.useState<string | undefined>('');\n const [_width, setWidth] = React.useState<number | undefined>(props.width || 200);\n const [_height, setHeight] = React.useState<number | undefined>(props.height || 200);\n const [activeLegend, setActiveLegend] = React.useState<string | undefined>(undefined);\n const [color, setColor] = React.useState<string | undefined>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [focusedArcId, setFocusedArcId] = React.useState<string>('');\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<ChartDataPoint | undefined>();\n const [refSelected, setRefSelected] = React.useState<HTMLElement | null>(null);\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const prevPropsRef = React.useRef<DonutChartProps | null>(null);\n\n React.useEffect(() => {\n _fitParentContainer();\n }, []);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useEffect(() => {\n if (prevSize.current.height !== props.height || prevSize.current.width !== props.width) {\n _fitParentContainer();\n }\n prevSize.current.height = props.height;\n prevSize.current.width = props.width;\n }, [props.width, props.height]);\n\n function _elevateToMinimums(data: ChartDataPoint[]) {\n let sumOfData = 0;\n const minPercent = 0.01;\n const elevatedData: ChartDataPoint[] = [];\n data.forEach(item => {\n sumOfData += item.data!;\n });\n data.forEach(item => {\n elevatedData.push(\n minPercent * sumOfData > item.data! && item.data! > 0\n ? {\n ...item,\n data: minPercent * sumOfData,\n yAxisCalloutData:\n item.yAxisCalloutData === undefined ? item.data!.toLocaleString() : item.yAxisCalloutData,\n }\n : item,\n );\n });\n return elevatedData;\n }\n function _createLegends(chartData: ChartDataPoint[]): JSXElement {\n if (props.order === 'sorted') {\n chartData.sort((a: ChartDataPoint, b: ChartDataPoint) => {\n return b.data! - a.data!;\n });\n }\n const legendDataItems = chartData.map((point: ChartDataPoint, index: number) => {\n const color: string = point.color!;\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend!);\n },\n onMouseOutAction: () => {\n setActiveLegend(undefined);\n },\n };\n return legend;\n });\n const legends = (\n <Legends\n legends={legendDataItems}\n centerLegends\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n return legends;\n }\n function _onLegendSelectionChange(\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps && props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n function _focusCallback(\n data: ChartDataPoint,\n id: string,\n e: React.FocusEvent<SVGPathElement>,\n targetElement?: HTMLElement | null,\n ): void {\n setPopoverOpen(_noLegendsHighlighted() || _isLegendHighlighted(data.legend));\n setValue(data.data!.toString());\n setLegend(data.legend);\n setColor(data.color!);\n setXCalloutValue(data.xAxisCalloutData!);\n setYCalloutValue(data.yAxisCalloutData!);\n setFocusedArcId(id);\n setDataPointCalloutProps(data);\n setRefSelected(targetElement!);\n }\n\n function _hoverCallback(\n data: ChartDataPoint,\n e: React.MouseEvent<SVGPathElement>,\n targetElement?: HTMLElement | null,\n ): void {\n if (_calloutAnchorPoint !== data) {\n _calloutAnchorPoint = data;\n setPopoverOpen(_noLegendsHighlighted() || _isLegendHighlighted(data.legend));\n setValue(data.data!.toString());\n setLegend(data.legend);\n setColor(data.color!);\n setXCalloutValue(data.xAxisCalloutData!);\n setYCalloutValue(data.yAxisCalloutData!);\n setDataPointCalloutProps(data);\n setRefSelected(targetElement!);\n }\n }\n function _onBlur(): void {\n setFocusedArcId('');\n }\n\n function _hoverLeave(): void {\n /**/\n }\n\n function _handleChartMouseLeave() {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n }\n\n function _valueInsideDonut(valueInsideDonut: string | number | undefined, data: ChartDataPoint[]) {\n const highlightedLegends = _getHighlightedLegend();\n if (valueInsideDonut !== undefined && (highlightedLegends.length === 1 || isPopoverOpen)) {\n const pointValue = data.find(point => _isLegendHighlighted(point.legend));\n return pointValue\n ? pointValue.yAxisCalloutData\n ? pointValue.yAxisCalloutData\n : pointValue.data!\n : valueInsideDonut;\n } else if (highlightedLegends.length > 0) {\n let totalValue = 0;\n data.forEach(point => {\n if (highlightedLegends.includes(point.legend!)) {\n totalValue += point.data!;\n }\n });\n return totalValue;\n } else {\n return valueInsideDonut;\n }\n }\n\n function _toLocaleString(data: string | number | undefined) {\n const localeString = formatToLocaleString(data, props.culture);\n if (!localeString) {\n return data;\n }\n return localeString?.toString();\n }\n\n /**\n * This function returns\n * the selected legend if there is one\n * or the hovered legend if none of the legends is selected.\n */\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _isLegendHighlighted(legend: string | undefined): boolean {\n return _getHighlightedLegend().includes(legend!);\n }\n\n function _noLegendsHighlighted(): boolean {\n return _getHighlightedLegend().length === 0;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.chartData &&\n props.data.chartData!.filter((d: ChartDataPoint) => d.data! > 0).length > 0\n );\n }\n\n function _addDefaultColors(donutChartDataPoint?: ChartDataPoint[]): ChartDataPoint[] {\n return donutChartDataPoint\n ? donutChartDataPoint.map((item, index) => {\n let defaultColor: string;\n if (typeof item.color === 'undefined') {\n defaultColor = getNextColor(index, 0);\n } else {\n defaultColor = getColorFromToken(item.color);\n }\n return { ...item, defaultColor };\n })\n : [];\n }\n\n /**\n * When screen resizes, along with screen, chart also auto adjusted.\n * This method used to adjust height and width of the charts.\n */\n function _fitParentContainer(): void {\n //_reqID = requestAnimationFrame(() => {\n let legendContainerHeight;\n if (props.hideLegend) {\n // If there is no legend, need not to allocate some space from total chart space.\n legendContainerHeight = 0;\n } else {\n const legendContainerComputedStyles = legendContainer.current && getComputedStyle(legendContainer.current);\n legendContainerHeight =\n ((legendContainer.current && legendContainer.current.getBoundingClientRect().height) ||\n MIN_LEGEND_CONTAINER_HEIGHT) +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginTop) || '0') +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginBottom) || '0');\n }\n if (props.parentRef || _rootElem.current) {\n const container = props.parentRef ? props.parentRef : _rootElem.current!;\n const currentContainerWidth = container.getBoundingClientRect().width;\n const currentContainerHeight =\n container.getBoundingClientRect().height > legendContainerHeight\n ? container.getBoundingClientRect().height\n : 200;\n const shouldResize =\n _width !== currentContainerWidth || _height !== currentContainerHeight - legendContainerHeight;\n if (shouldResize) {\n setWidth(currentContainerWidth);\n setHeight(currentContainerHeight - legendContainerHeight);\n }\n }\n //});\n }\n\n const { data, hideLegend = false } = props;\n const points = _addDefaultColors(data?.chartData);\n\n const classes = useDonutChartStyles(props);\n\n const legendBars = _createLegends(points.filter(d => d.data! >= 0));\n const donutMarginHorizontal = props.hideLabels ? 0 : 80;\n const donutMarginVertical = props.hideLabels ? 0 : 40;\n const titleHeight = data?.chartTitle\n ? Math.max(\n (typeof props.titleStyles?.titleFont?.size === 'number' ? props.titleStyles.titleFont.size : 13) +\n CHART_TITLE_PADDING,\n 36,\n )\n : 0;\n const outerRadius = Math.min(_width! - donutMarginHorizontal, _height! - donutMarginVertical - titleHeight) / 2;\n const chartData = _elevateToMinimums(points);\n const valueInsideDonut =\n props.innerRadius! > MIN_DONUT_RADIUS ? _valueInsideDonut(props.valueInsideDonut!, chartData!) : '';\n const arrowAttributes = useArrowNavigationGroup({ circular: true, axis: 'horizontal' });\n return !_isChartEmpty() ? (\n <div\n className={classes.root}\n ref={(rootElem: HTMLDivElement | null) => {\n _rootElem.current = rootElem;\n }}\n onMouseLeave={_handleChartMouseLeave}\n >\n {props.xAxisAnnotation && (\n <text className={classes.axisAnnotation} x={_width! / 2} y={_height! - 10} textAnchor=\"middle\">\n {props.xAxisAnnotation}\n </text>\n )}\n <div className={classes.chartWrapper} {...arrowAttributes}>\n <svg className={classes.chart} aria-label={data?.chartTitle} width={_width} height={_height}>\n {!hideLegend && data?.chartTitle && (\n <ChartTitle\n title={data.chartTitle}\n x={_width! / 2}\n maxWidth={_width! - 20}\n className={classes.chartTitle}\n titleStyles={props.titleStyles}\n tooltipClassName={classes.svgTooltip}\n />\n )}\n <Pie\n width={_width!}\n height={_height!}\n outerRadius={outerRadius}\n innerRadius={props.innerRadius!}\n data={chartData!}\n onFocusCallback={_focusCallback}\n hoverOnCallback={_hoverCallback}\n hoverLeaveCallback={_hoverLeave}\n uniqText={_uniqText}\n onBlurCallback={_onBlur}\n activeArc={_getHighlightedLegend()}\n focusedArcId={focusedArcId || ''}\n href={props.href!}\n valueInsideDonut={_toLocaleString(valueInsideDonut)}\n showLabelsInPercent={props.showLabelsInPercent}\n hideLabels={props.hideLabels}\n />\n </svg>\n </div>\n <ChartPopover\n xCalloutValue={xCalloutValue}\n yCalloutValue={yCalloutValue}\n culture={props.culture}\n positioning={{\n target: refSelected,\n }}\n isPopoverOpen={\n !props.hideTooltip && isPopoverOpen && (_noLegendsHighlighted() || _isLegendHighlighted(legend))\n }\n legend={legend!}\n YValue={value!}\n color={color}\n isCalloutForStack={false}\n customCallout={{\n customizedCallout: props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps!)\n : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n }}\n isCartesian={false}\n />\n {!hideLegend && (\n <div\n ref={(e: HTMLDivElement) => {\n legendContainer.current = e;\n }}\n className={classes.legendContainer}\n >\n {legendBars}\n </div>\n )}\n </div>\n ) : (\n <div id={_emptyChartId!} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\n\nDonutChart.displayName = 'DonutChart';\n"],"names":["React","Pie","useDonutChartStyles","formatToLocaleString","areArraysEqual","getColorFromToken","getNextColor","MIN_DONUT_RADIUS","ChartTitle","CHART_TITLE_PADDING","Legends","useId","useArrowNavigationGroup","ChartPopover","useImageExport","MIN_LEGEND_CONTAINER_HEIGHT","DonutChart","forwardRef","innerRadius","hideLabels","restProps","forwardedRef","props","chartContainerRef","_rootElem","legendsRef","_legendsRef","componentRef","hideLegend","_uniqText","_calloutAnchorPoint","_emptyChartId","legendContainer","useRef","prevSize","value","setValue","useState","legend","setLegend","_width","setWidth","width","_height","setHeight","height","activeLegend","setActiveLegend","undefined","color","setColor","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","selectedLegends","setSelectedLegends","legendProps","focusedArcId","setFocusedArcId","dataPointCalloutProps","setDataPointCalloutProps","refSelected","setRefSelected","isPopoverOpen","setPopoverOpen","prevPropsRef","useEffect","_fitParentContainer","current","prevProps","_elevateToMinimums","data","sumOfData","minPercent","elevatedData","forEach","item","push","yAxisCalloutData","toLocaleString","_createLegends","chartData","order","sort","a","b","legendDataItems","map","point","index","title","hoverAction","_handleChartMouseLeave","onMouseOutAction","legends","centerLegends","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","legendRef","event","currentLegend","canSelectMultipleLegends","slice","_focusCallback","id","e","targetElement","_noLegendsHighlighted","_isLegendHighlighted","toString","xAxisCalloutData","_hoverCallback","_onBlur","_hoverLeave","_valueInsideDonut","valueInsideDonut","highlightedLegends","_getHighlightedLegend","length","pointValue","find","totalValue","includes","_toLocaleString","localeString","culture","_isChartEmpty","filter","d","_addDefaultColors","donutChartDataPoint","defaultColor","legendContainerHeight","legendContainerComputedStyles","getComputedStyle","getBoundingClientRect","parseFloat","marginTop","marginBottom","parentRef","container","currentContainerWidth","currentContainerHeight","shouldResize","points","classes","legendBars","donutMarginHorizontal","donutMarginVertical","titleHeight","chartTitle","Math","max","titleStyles","titleFont","size","outerRadius","min","arrowAttributes","circular","axis","div","className","root","ref","rootElem","onMouseLeave","xAxisAnnotation","text","axisAnnotation","x","y","textAnchor","chartWrapper","svg","chart","aria-label","maxWidth","tooltipClassName","svgTooltip","onFocusCallback","hoverOnCallback","hoverLeaveCallback","uniqText","onBlurCallback","activeArc","href","showLabelsInPercent","positioning","target","hideTooltip","YValue","isCalloutForStack","customCallout","customizedCallout","onRenderCalloutPerDataPoint","customCalloutProps","calloutPropsPerDataPoint","isCartesian","role","style","opacity","displayName"],"mappings":"AAAA;;;;;+BA+BagB;;;;;;;iEA5BU,QAAQ;uBACX,cAAc;2CAEE,+BAA+B;gCAE9B,4BAA4B;wBAQ1D,wBAAwB;wBACC,cAAc;gCACxB,4BAA4B;8BAEV,0BAA0B;8BACrC,mCAAmC;uBACjC,wBAAwB;AAEvD,MAAMD,8BAA8B;AAO7B,mBAAMC,WAAAA,GAAuDhB,OAAMiB,UAAU,CAClF,CAAC,EAAEC,cAAc,CAAC,EAAEC,aAAa,IAAI,EAAE,GAAGC,WAAW,EAAEC;QAsBkBC,oBAqQzDA,8BAAAA;IA1Rd,MAAMA,QAAQ;QAAEJ;QAAaC;QAAY,GAAGC,SAAS;IAAC;IACtD,MAAM,EAAEG,mBAAmBC,SAAS,EAAEC,YAAYC,WAAW,EAAE,OAAGZ,qBAAAA,EAChEQ,MAAMK,YAAY,EAClBL,MAAMM,UAAU,EAChB;IAEF,MAAMC,gBAAoBlB,qBAAAA,EAAM;IAChC,qDAAqD,GACrD,IAAImB;IACJ,IAAIC;IACJ,MAAMC,kBAAkBhC,OAAMiC,MAAM,CAAwB;IAC5D,MAAMC,WAAWlC,OAAMiC,MAAM,CAAsC,CAAC;IAEpE,MAAM,CAACE,OAAOC,SAAS,GAAGpC,OAAMqC,QAAQ,CAAqB;IAC7D,MAAM,CAACC,QAAQC,U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,CAAC5I,yBAC/BZ;QACN;QACAyJ,aAAa;QAEd,CAAC7K,cAAAA,WAAAA,GACA,OAAA,aAAA,CAACwI,OAAAA;QACCG,KAAK,CAAC3D;YACJ5E,gBAAgBqC,OAAO,GAAGuC;QAC5B;QACAyD,WAAWjB,QAAQpH,eAAe;OAEjCqH,eAAAA,WAAAA,GAKP,OAAA,aAAA,CAACe,OAAAA;QAAIzD,IAAI5E;QAAgB2K,MAAM;QAASC,OAAO;YAAEC,SAAS;QAAI;QAAGzB,cAAY;;AAEjF,GACA;AAEFnK,WAAW6L,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/DonutChart/DonutChart.tsx"],"sourcesContent":["'use client';\n\n/* eslint-disable react/jsx-no-bind */\nimport * as React from 'react';\nimport { Pie } from './Pie/index';\nimport { DonutChartProps } from './DonutChart.types';\nimport { useDonutChartStyles } from './useDonutChartStyles.styles';\nimport { ChartDataPoint } from '../../DonutChart';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport {\n areArraysEqual,\n getColorFromToken,\n getNextColor,\n MIN_DONUT_RADIUS,\n ChartTitle,\n CHART_TITLE_PADDING,\n} from '../../utilities/index';\nimport { Legend, Legends } from '../../index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport { useImageExport } from '../../utilities/hooks';\n\nconst MIN_LEGEND_CONTAINER_HEIGHT = 40;\n\n// Create a DonutChart variant which uses these default styles and this styled subcomponent.\n/**\n * Donutchart component.\n * {@docCategory DonutChart}\n */\nexport const DonutChart: React.FunctionComponent<DonutChartProps> = React.forwardRef<HTMLDivElement, DonutChartProps>(\n ({ innerRadius = 0, hideLabels = true, ...restProps }, forwardedRef) => {\n const props = { innerRadius, hideLabels, ...restProps };\n const { chartContainerRef: _rootElem, legendsRef: _legendsRef } = useImageExport(\n props.componentRef,\n props.hideLegend,\n false,\n );\n const _uniqText: string = useId('_Pie_');\n /* eslint-disable @typescript-eslint/no-explicit-any */\n let _calloutAnchorPoint: ChartDataPoint | null;\n let _emptyChartId: string | null;\n const legendContainer = React.useRef<HTMLDivElement | null>(null);\n const prevSize = React.useRef<{ width?: number; height?: number }>({});\n\n const [value, setValue] = React.useState<string | undefined>('');\n const [legend, setLegend] = React.useState<string | undefined>('');\n const [_width, setWidth] = React.useState<number | undefined>(props.width || 200);\n const [_height, setHeight] = React.useState<number | undefined>(props.height || 200);\n const [activeLegend, setActiveLegend] = React.useState<string | undefined>(undefined);\n const [color, setColor] = React.useState<string | undefined>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [focusedArcId, setFocusedArcId] = React.useState<string>('');\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<ChartDataPoint | undefined>();\n const [refSelected, setRefSelected] = React.useState<HTMLElement | null>(null);\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const prevPropsRef = React.useRef<DonutChartProps | null>(null);\n\n React.useEffect(() => {\n _fitParentContainer();\n }, []);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useEffect(() => {\n if (prevSize.current.height !== props.height || prevSize.current.width !== props.width) {\n _fitParentContainer();\n }\n prevSize.current.height = props.height;\n prevSize.current.width = props.width;\n }, [props.width, props.height]);\n\n function _elevateToMinimums(data: ChartDataPoint[]) {\n let sumOfData = 0;\n const minPercent = 0.01;\n const elevatedData: ChartDataPoint[] = [];\n data.forEach(item => {\n sumOfData += item.data!;\n });\n data.forEach(item => {\n elevatedData.push(\n minPercent * sumOfData > item.data! && item.data! > 0\n ? {\n ...item,\n data: minPercent * sumOfData,\n yAxisCalloutData:\n item.yAxisCalloutData === undefined ? item.data!.toLocaleString() : item.yAxisCalloutData,\n }\n : item,\n );\n });\n return elevatedData;\n }\n function _createLegends(chartData: ChartDataPoint[]): JSXElement {\n if (props.order === 'sorted') {\n chartData.sort((a: ChartDataPoint, b: ChartDataPoint) => {\n return b.data! - a.data!;\n });\n }\n const legendDataItems = chartData.map((point: ChartDataPoint, index: number) => {\n const color: string = point.color!;\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend!);\n },\n onMouseOutAction: () => {\n setActiveLegend(undefined);\n },\n };\n return legend;\n });\n const legends = (\n <Legends\n legends={legendDataItems}\n centerLegends\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n return legends;\n }\n function _onLegendSelectionChange(\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps && props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n function _focusCallback(\n data: ChartDataPoint,\n id: string,\n e: React.FocusEvent<SVGPathElement>,\n targetElement?: HTMLElement | null,\n ): void {\n setPopoverOpen(_noLegendsHighlighted() || _isLegendHighlighted(data.legend));\n setValue(data.data!.toString());\n setLegend(data.legend);\n setColor(data.color!);\n setXCalloutValue(data.xAxisCalloutData!);\n setYCalloutValue(data.yAxisCalloutData!);\n setFocusedArcId(id);\n setDataPointCalloutProps(data);\n setRefSelected(targetElement!);\n }\n\n function _hoverCallback(\n data: ChartDataPoint,\n e: React.MouseEvent<SVGPathElement>,\n targetElement?: HTMLElement | null,\n ): void {\n if (_calloutAnchorPoint !== data) {\n _calloutAnchorPoint = data;\n setPopoverOpen(_noLegendsHighlighted() || _isLegendHighlighted(data.legend));\n setValue(data.data!.toString());\n setLegend(data.legend);\n setColor(data.color!);\n setXCalloutValue(data.xAxisCalloutData!);\n setYCalloutValue(data.yAxisCalloutData!);\n setDataPointCalloutProps(data);\n setRefSelected(targetElement!);\n }\n }\n function _onBlur(): void {\n setFocusedArcId('');\n }\n\n function _hoverLeave(): void {\n /**/\n }\n\n function _handleChartMouseLeave() {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n }\n\n function _valueInsideDonut(valueInsideDonut: string | number | undefined, data: ChartDataPoint[]) {\n const highlightedLegends = _getHighlightedLegend();\n if (valueInsideDonut !== undefined && (highlightedLegends.length === 1 || isPopoverOpen)) {\n const pointValue = data.find(point => _isLegendHighlighted(point.legend));\n return pointValue\n ? pointValue.yAxisCalloutData\n ? pointValue.yAxisCalloutData\n : pointValue.data!\n : valueInsideDonut;\n } else if (highlightedLegends.length > 0) {\n let totalValue = 0;\n data.forEach(point => {\n if (highlightedLegends.includes(point.legend!)) {\n totalValue += point.data!;\n }\n });\n return totalValue;\n } else {\n return valueInsideDonut;\n }\n }\n\n function _toLocaleString(data: string | number | undefined) {\n const localeString = formatToLocaleString(data, props.culture);\n if (!localeString) {\n return data;\n }\n return localeString?.toString();\n }\n\n /**\n * This function returns\n * the selected legend if there is one\n * or the hovered legend if none of the legends is selected.\n */\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _isLegendHighlighted(legend: string | undefined): boolean {\n return _getHighlightedLegend().includes(legend!);\n }\n\n function _noLegendsHighlighted(): boolean {\n return _getHighlightedLegend().length === 0;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.chartData &&\n props.data.chartData!.filter((d: ChartDataPoint) => d.data! > 0).length > 0\n );\n }\n\n function _addDefaultColors(donutChartDataPoint?: ChartDataPoint[]): ChartDataPoint[] {\n return donutChartDataPoint\n ? donutChartDataPoint.map((item, index) => {\n let defaultColor: string;\n if (typeof item.color === 'undefined') {\n defaultColor = getNextColor(index, 0);\n } else {\n defaultColor = getColorFromToken(item.color);\n }\n return { ...item, defaultColor };\n })\n : [];\n }\n\n /**\n * When screen resizes, along with screen, chart also auto adjusted.\n * This method used to adjust height and width of the charts.\n */\n function _fitParentContainer(): void {\n //_reqID = requestAnimationFrame(() => {\n let legendContainerHeight;\n if (props.hideLegend) {\n // If there is no legend, need not to allocate some space from total chart space.\n legendContainerHeight = 0;\n } else {\n const legendContainerComputedStyles = legendContainer.current && getComputedStyle(legendContainer.current);\n legendContainerHeight =\n ((legendContainer.current && legendContainer.current.getBoundingClientRect().height) ||\n MIN_LEGEND_CONTAINER_HEIGHT) +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginTop) || '0') +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginBottom) || '0');\n }\n if (props.parentRef || _rootElem.current) {\n const container = props.parentRef ? props.parentRef : _rootElem.current!;\n const currentContainerWidth = container.getBoundingClientRect().width;\n const currentContainerHeight =\n container.getBoundingClientRect().height > legendContainerHeight\n ? container.getBoundingClientRect().height\n : 200;\n const shouldResize =\n _width !== currentContainerWidth || _height !== currentContainerHeight - legendContainerHeight;\n if (shouldResize) {\n setWidth(currentContainerWidth);\n setHeight(currentContainerHeight - legendContainerHeight);\n }\n }\n //});\n }\n\n const { data, hideLegend = false } = props;\n const points = _addDefaultColors(data?.chartData);\n\n const classes = useDonutChartStyles(props);\n\n const legendBars = _createLegends(points.filter(d => d.data! >= 0));\n const donutMarginHorizontal = props.hideLabels ? 0 : 80;\n const donutMarginVertical = props.hideLabels ? 0 : 40;\n const titleHeight = data?.chartTitle\n ? Math.max(\n (typeof props.titleStyles?.titleFont?.size === 'number' ? props.titleStyles.titleFont.size : 13) +\n CHART_TITLE_PADDING,\n 36,\n )\n : 0;\n const outerRadius = Math.min(_width! - donutMarginHorizontal, _height! - donutMarginVertical - titleHeight) / 2;\n const chartData = _elevateToMinimums(points);\n const valueInsideDonut =\n props.innerRadius! > MIN_DONUT_RADIUS ? _valueInsideDonut(props.valueInsideDonut!, chartData!) : '';\n const arrowAttributes = useArrowNavigationGroup({ circular: true, axis: 'horizontal' });\n return !_isChartEmpty() ? (\n <div\n className={classes.root}\n ref={(rootElem: HTMLDivElement | null) => {\n _rootElem.current = rootElem;\n }}\n onMouseLeave={_handleChartMouseLeave}\n >\n {props.xAxisAnnotation && (\n <text className={classes.axisAnnotation} x={_width! / 2} y={_height! - 10} textAnchor=\"middle\">\n {props.xAxisAnnotation}\n </text>\n )}\n <div className={classes.chartWrapper} {...arrowAttributes}>\n <svg className={classes.chart} aria-label={data?.chartTitle} width={_width} height={_height}>\n {!hideLegend && data?.chartTitle && (\n <ChartTitle\n title={data.chartTitle}\n x={_width! / 2}\n maxWidth={_width! - 20}\n className={classes.chartTitle}\n titleStyles={props.titleStyles}\n tooltipClassName={classes.svgTooltip}\n />\n )}\n <g transform={`translate(0, ${titleHeight})`}>\n <Pie\n width={_width!}\n height={_height!}\n outerRadius={outerRadius}\n innerRadius={props.innerRadius!}\n data={chartData!}\n onFocusCallback={_focusCallback}\n hoverOnCallback={_hoverCallback}\n hoverLeaveCallback={_hoverLeave}\n uniqText={_uniqText}\n onBlurCallback={_onBlur}\n activeArc={_getHighlightedLegend()}\n focusedArcId={focusedArcId || ''}\n href={props.href!}\n valueInsideDonut={_toLocaleString(valueInsideDonut)}\n showLabelsInPercent={props.showLabelsInPercent}\n hideLabels={props.hideLabels}\n />\n </g>\n </svg>\n </div>\n <ChartPopover\n xCalloutValue={xCalloutValue}\n yCalloutValue={yCalloutValue}\n culture={props.culture}\n positioning={{\n target: refSelected,\n }}\n isPopoverOpen={\n !props.hideTooltip && isPopoverOpen && (_noLegendsHighlighted() || _isLegendHighlighted(legend))\n }\n legend={legend!}\n YValue={value!}\n color={color}\n isCalloutForStack={false}\n customCallout={{\n customizedCallout: props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps!)\n : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n }}\n isCartesian={false}\n />\n {!hideLegend && (\n <div\n ref={(e: HTMLDivElement) => {\n legendContainer.current = e;\n }}\n className={classes.legendContainer}\n >\n {legendBars}\n </div>\n )}\n </div>\n ) : (\n <div id={_emptyChartId!} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\n\nDonutChart.displayName = 'DonutChart';\n"],"names":["React","Pie","useDonutChartStyles","formatToLocaleString","areArraysEqual","getColorFromToken","getNextColor","MIN_DONUT_RADIUS","ChartTitle","CHART_TITLE_PADDING","Legends","useId","useArrowNavigationGroup","ChartPopover","useImageExport","MIN_LEGEND_CONTAINER_HEIGHT","DonutChart","forwardRef","innerRadius","hideLabels","restProps","forwardedRef","props","chartContainerRef","_rootElem","legendsRef","_legendsRef","componentRef","hideLegend","_uniqText","_calloutAnchorPoint","_emptyChartId","legendContainer","useRef","prevSize","value","setValue","useState","legend","setLegend","_width","setWidth","width","_height","setHeight","height","activeLegend","setActiveLegend","undefined","color","setColor","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","selectedLegends","setSelectedLegends","legendProps","focusedArcId","setFocusedArcId","dataPointCalloutProps","setDataPointCalloutProps","refSelected","setRefSelected","isPopoverOpen","setPopoverOpen","prevPropsRef","useEffect","_fitParentContainer","current","prevProps","_elevateToMinimums","data","sumOfData","minPercent","elevatedData","forEach","item","push","yAxisCalloutData","toLocaleString","_createLegends","chartData","order","sort","a","b","legendDataItems","map","point","index","title","hoverAction","_handleChartMouseLeave","onMouseOutAction","legends","centerLegends","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","legendRef","event","currentLegend","canSelectMultipleLegends","slice","_focusCallback","id","e","targetElement","_noLegendsHighlighted","_isLegendHighlighted","toString","xAxisCalloutData","_hoverCallback","_onBlur","_hoverLeave","_valueInsideDonut","valueInsideDonut","highlightedLegends","_getHighlightedLegend","length","pointValue","find","totalValue","includes","_toLocaleString","localeString","culture","_isChartEmpty","filter","d","_addDefaultColors","donutChartDataPoint","defaultColor","legendContainerHeight","legendContainerComputedStyles","getComputedStyle","getBoundingClientRect","parseFloat","marginTop","marginBottom","parentRef","container","currentContainerWidth","currentContainerHeight","shouldResize","points","classes","legendBars","donutMarginHorizontal","donutMarginVertical","titleHeight","chartTitle","Math","max","titleStyles","titleFont","size","outerRadius","min","arrowAttributes","circular","axis","div","className","root","ref","rootElem","onMouseLeave","xAxisAnnotation","text","axisAnnotation","x","y","textAnchor","chartWrapper","svg","chart","aria-label","maxWidth","tooltipClassName","svgTooltip","g","transform","onFocusCallback","hoverOnCallback","hoverLeaveCallback","uniqText","onBlurCallback","activeArc","href","showLabelsInPercent","positioning","target","hideTooltip","YValue","isCalloutForStack","customCallout","customizedCallout","onRenderCalloutPerDataPoint","customCalloutProps","calloutPropsPerDataPoint","isCartesian","role","style","opacity","displayName"],"mappings":"AAAA;;;;;+BA+BagB;;;;;;;iEA5BU,QAAQ;uBACX,cAAc;2CAEE,+BAA+B;gCAE9B,4BAA4B;wBAQ1D,wBAAwB;wBACC,cAAc;gCACxB,4BAA4B;8BAEV,0BAA0B;8BACrC,mCAAmC;uBACjC,wBAAwB;AAEvD,MAAMD,8BAA8B;AAO7B,mBAAMC,WAAAA,GAAuDhB,OAAMiB,UAAU,CAClF,CAAC,EAAEC,cAAc,CAAC,EAAEC,aAAa,IAAI,EAAE,GAAGC,WAAW,EAAEC;QAsBkBC,oBAqQzDA,8BAAAA;IA1Rd,MAAMA,QAAQ;QAAEJ;QAAaC;QAAY,GAAGC,SAAS;IAAC;IACtD,MAAM,EAAEG,mBAAmBC,SAAS,EAAEC,YAAYC,WAAW,EAAE,OAAGZ,qBAAAA,EAChEQ,MAAMK,Y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eAAeA;QACfE,eAAeA;QACf2E,SAAS1G,MAAM0G,OAAO;QACtBiE,aAAa;YACXC,QAAQpI;QACV;QACAE,eACE,CAAC1C,MAAM6K,WAAW,IAAInI,iBAAkB8C,CAAAA,2BAA2BC,qBAAqBzE,OAAAA,CAAM;QAEhGA,QAAQA;QACR8J,QAAQjK;QACRc,OAAOA;QACPoJ,mBAAmB;QACnBC,eAAe;YACbC,mBAAmBjL,MAAMkL,2BAA2B,GAChDlL,MAAMkL,2BAA2B,CAAC5I,yBAClCZ;YACJyJ,oBAAoBnL,MAAMoL,wBAAwB,GAC9CpL,MAAMoL,wBAAwB,CAAC9I,yBAC/BZ;QACN;QACA2J,aAAa;QAEd,CAAC/K,cAAAA,WAAAA,GACA,OAAA,aAAA,CAACwI,OAAAA;QACCG,KAAK,CAAC3D;YACJ5E,gBAAgBqC,OAAO,GAAGuC;QAC5B;QACAyD,WAAWjB,QAAQpH,eAAe;OAEjCqH,eAAAA,WAAAA,GAKP,OAAA,aAAA,CAACe,OAAAA;QAAIzD,IAAI5E;QAAgB6K,MAAM;QAASC,OAAO;YAAEC,SAAS;QAAI;QAAG3B,cAAY;;AAEjF,GACA;AAEFnK,WAAW+L,WAAW,GAAG"}
|
|
@@ -518,7 +518,8 @@ const GaugeChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
518
518
|
x: 0,
|
|
519
519
|
y: -(_outerRadius + TITLE_OFFSET),
|
|
520
520
|
className: classes.chartTitle,
|
|
521
|
-
titleStyles: props.titleStyles
|
|
521
|
+
titleStyles: props.titleStyles,
|
|
522
|
+
tooltipClassName: classes.svgTooltip
|
|
522
523
|
}), !props.hideMinMax && /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("text", {
|
|
523
524
|
x: (_isRTL ? 1 : -1) * (_outerRadius + LABEL_OFFSET),
|
|
524
525
|
y: 0,
|