@fluentui/react-charting 5.25.2 → 5.25.4

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 (181) hide show
  1. package/CHANGELOG.json +105 -1
  2. package/CHANGELOG.md +30 -2
  3. package/dist/react-charting.js +1 -1
  4. package/dist/react-charting.min.js +1 -1
  5. package/lib/components/AreaChart/AreaChart.base.js +0 -5
  6. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  7. package/lib/components/ChartTable/ChartTable.base.js +0 -1
  8. package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
  9. package/lib/components/CommonComponents/CartesianChart.base.js +1 -3
  10. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  11. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  12. package/lib/components/DeclarativeChart/DeclarativeChart.js +1 -3
  13. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  14. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +24 -23
  15. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  16. package/lib/components/DonutChart/Arc/Arc.js +0 -1
  17. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  18. package/lib/components/DonutChart/DonutChart.base.js +1 -5
  19. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  20. package/lib/components/DonutChart/Pie/Pie.js +0 -2
  21. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  22. package/lib/components/FunnelChart/FunnelChart.base.js +0 -1
  23. package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
  24. package/lib/components/GanttChart/GanttChart.base.js +1 -1
  25. package/lib/components/GanttChart/GanttChart.base.js.map +1 -1
  26. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +8 -9
  27. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  28. package/lib/components/HeatMapChart/HeatMapChart.base.js +0 -4
  29. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  30. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js +1 -7
  31. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  32. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +0 -6
  33. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  34. package/lib/components/Legends/Legends.base.js +0 -4
  35. package/lib/components/Legends/Legends.base.js.map +1 -1
  36. package/lib/components/LineChart/LineChart.base.js +0 -10
  37. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  38. package/lib/components/PieChart/Arc/Arc.js +0 -2
  39. package/lib/components/PieChart/Arc/Arc.js.map +1 -1
  40. package/lib/components/PieChart/Pie/Pie.js +0 -2
  41. package/lib/components/PieChart/Pie/Pie.js.map +1 -1
  42. package/lib/components/PieChart/PieChart.base.js +0 -1
  43. package/lib/components/PieChart/PieChart.base.js.map +1 -1
  44. package/lib/components/SankeyChart/SankeyChart.base.js +2 -2
  45. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  46. package/lib/components/ScatterChart/ScatterChart.base.js +38 -36
  47. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  48. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  49. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +1 -6
  50. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  51. package/lib/components/StackedBarChart/StackedBarChart.base.js +1 -5
  52. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  53. package/lib/components/TreeChart/TreeChart.base.js +2 -17
  54. package/lib/components/TreeChart/TreeChart.base.js.map +1 -1
  55. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +0 -11
  56. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  57. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +7 -6
  58. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  59. package/lib/utilities/image-export-utils.js +4 -2
  60. package/lib/utilities/image-export-utils.js.map +1 -1
  61. package/lib/utilities/utilities.js +0 -2
  62. package/lib/utilities/utilities.js.map +1 -1
  63. package/lib-amd/components/AreaChart/AreaChart.base.js +0 -5
  64. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  65. package/lib-amd/components/ChartTable/ChartTable.base.js +0 -1
  66. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  67. package/lib-amd/components/CommonComponents/CartesianChart.base.js +1 -3
  68. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  69. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  70. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +1 -3
  71. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  72. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +24 -23
  73. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  74. package/lib-amd/components/DonutChart/Arc/Arc.js +0 -1
  75. package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
  76. package/lib-amd/components/DonutChart/DonutChart.base.js +1 -5
  77. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  78. package/lib-amd/components/DonutChart/Pie/Pie.js +0 -2
  79. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
  80. package/lib-amd/components/FunnelChart/FunnelChart.base.js +0 -1
  81. package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
  82. package/lib-amd/components/GanttChart/GanttChart.base.js +1 -1
  83. package/lib-amd/components/GanttChart/GanttChart.base.js.map +1 -1
  84. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +8 -10
  85. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  86. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +0 -4
  87. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  88. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +1 -7
  89. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  90. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +0 -6
  91. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  92. package/lib-amd/components/Legends/Legends.base.js +0 -4
  93. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  94. package/lib-amd/components/LineChart/LineChart.base.js +0 -10
  95. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  96. package/lib-amd/components/PieChart/Arc/Arc.js +0 -2
  97. package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -1
  98. package/lib-amd/components/PieChart/Pie/Pie.js +0 -2
  99. package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -1
  100. package/lib-amd/components/PieChart/PieChart.base.js +0 -1
  101. package/lib-amd/components/PieChart/PieChart.base.js.map +1 -1
  102. package/lib-amd/components/SankeyChart/SankeyChart.base.js +2 -2
  103. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  104. package/lib-amd/components/ScatterChart/ScatterChart.base.js +37 -35
  105. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  106. package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
  107. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +1 -6
  108. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  109. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +1 -5
  110. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  111. package/lib-amd/components/TreeChart/TreeChart.base.js +2 -17
  112. package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -1
  113. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +0 -11
  114. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  115. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +6 -5
  116. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  117. package/lib-amd/utilities/image-export-utils.js +4 -2
  118. package/lib-amd/utilities/image-export-utils.js.map +1 -1
  119. package/lib-amd/utilities/utilities.js +0 -2
  120. package/lib-amd/utilities/utilities.js.map +1 -1
  121. package/lib-commonjs/components/AreaChart/AreaChart.base.js +0 -5
  122. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  123. package/lib-commonjs/components/ChartTable/ChartTable.base.js +0 -1
  124. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  125. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +1 -3
  126. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  127. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  128. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +1 -3
  129. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  130. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +24 -23
  131. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  132. package/lib-commonjs/components/DonutChart/Arc/Arc.js +0 -1
  133. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  134. package/lib-commonjs/components/DonutChart/DonutChart.base.js +1 -5
  135. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  136. package/lib-commonjs/components/DonutChart/Pie/Pie.js +0 -2
  137. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  138. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +0 -1
  139. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
  140. package/lib-commonjs/components/GanttChart/GanttChart.base.js +1 -1
  141. package/lib-commonjs/components/GanttChart/GanttChart.base.js.map +1 -1
  142. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +8 -9
  143. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  144. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +0 -4
  145. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  146. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js +1 -7
  147. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  148. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +0 -6
  149. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  150. package/lib-commonjs/components/Legends/Legends.base.js +0 -4
  151. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  152. package/lib-commonjs/components/LineChart/LineChart.base.js +0 -10
  153. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  154. package/lib-commonjs/components/PieChart/Arc/Arc.js +0 -2
  155. package/lib-commonjs/components/PieChart/Arc/Arc.js.map +1 -1
  156. package/lib-commonjs/components/PieChart/Pie/Pie.js +0 -2
  157. package/lib-commonjs/components/PieChart/Pie/Pie.js.map +1 -1
  158. package/lib-commonjs/components/PieChart/PieChart.base.js +0 -1
  159. package/lib-commonjs/components/PieChart/PieChart.base.js.map +1 -1
  160. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +2 -2
  161. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  162. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +37 -35
  163. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  164. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  165. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +1 -6
  166. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  167. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js +1 -5
  168. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  169. package/lib-commonjs/components/TreeChart/TreeChart.base.js +2 -17
  170. package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -1
  171. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +0 -11
  172. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  173. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +6 -5
  174. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  175. package/lib-commonjs/utilities/image-export-utils.js +4 -2
  176. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  177. package/lib-commonjs/utilities/utilities.js +0 -2
  178. package/lib-commonjs/utilities/utilities.js.map +1 -1
  179. package/package.json +5 -5
  180. package/src/components/CommonComponents/CartesianChart.types.ts +1 -1
  181. package/src/components/ScatterChart/ScatterChart.types.ts +0 -1
@@ -58,7 +58,6 @@ var Arc = /** @class */ (function (_super) {
58
58
  Arc.prototype.updateChart = function (newProps) {
59
59
  _updateChart(newProps);
60
60
  };
61
- // eslint-disable-next-line @typescript-eslint/no-deprecated
62
61
  Arc.prototype.render = function () {
63
62
  var _a, _b, _c, _d, _e, _f, _g;
64
63
  var _h = this.props, arc = _h.arc, href = _h.href, focusedArcId = _h.focusedArcId, activeArc = _h.activeArc;
@@ -1 +1 @@
1
- {"version":3,"file":"Arc.js","sourceRoot":"../src/","sources":["components/DonutChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AACxC,2DAAkF;AAClF,2CAAyC;AAGzC,uCAA+C;AAC/C,kDAAsE;AAOtE;IAAyB,+BAAqC;IAA9D;;QAKS,WAAK,GAAO,EAAE,CAAC;QA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IAAI,CAAC,GAAI,CACnD;gBACX,uCAAe,CAAC,EAAC,MAAM,EAAC,CAAC,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,QAAQ,EAAE,eAAQ,MAAM,MAAG;oBACrF,6BAAK,SAAS,EAAE,UAAU,CAAC,WAAW,GAAI,CAC5B,CACf,CACJ,CACC,CACL,CAAC;IACJ,CAAC;IAEO,sBAAQ,GAAhB,UAAiB,IAAqB,EAAE,EAAU;QAChD,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAEO,sBAAQ,GAAhB,UAAiB,IAAqB,EAAE,UAA4C;QAClF,UAAU,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAChD,CAAC;IAUO,4BAAc,GAAtB,UAAuB,IAAwB;QAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IA3Ga,gBAAY,GAAuB;QAC/C,GAAG,EAAE,IAAA,cAAK,GAAE;KACb,AAFyB,CAExB;IAuJJ,UAAC;CAAA,AA1JD,CAAyB,KAAK,CAAC,SAAS,GA0JvC;AA1JY,kBAAG;AA4JhB,SAAS,YAAY,CAAC,QAAmB;IACvC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC/C,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import * as React from 'react';\nimport { arc as d3Arc } from 'd3-shape';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Arc.styles';\nimport { IChartDataPoint } from '../index';\nimport { IArcProps, IArcStyleProps, IArcStyles } from './index';\nimport { format as d3Format } from 'd3-format';\nimport { formatScientificLimitWidth } from '../../../utilities/index';\nimport type { JSXElement } from '@fluentui/utilities';\n\nexport interface IArcState {\n isCalloutVisible?: boolean;\n}\n\nexport class Arc extends React.Component<IArcProps, IArcState> {\n public static defaultProps: Partial<IArcProps> = {\n arc: d3Arc(),\n };\n\n public state: {} = {};\n\n private currentRef = React.createRef<SVGPathElement>();\n private _isRTL: boolean = getRTL();\n\n public static getDerivedStateFromProps(nextProps: Readonly<IArcProps>): Partial<IArcState> | null {\n _updateChart(nextProps);\n return null;\n }\n\n public updateChart(newProps: IArcProps): void {\n _updateChart(newProps);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSXElement {\n const { arc, href, focusedArcId, activeArc } = this.props;\n const getClassNames = classNamesFunction<IArcStyleProps, IArcStyles>();\n const id =\n this.props.uniqText! +\n (typeof this.props.data!.data.legend === 'string' ? this.props.data!.data.legend.replace(/\\s+/g, '') : '') +\n this.props.data!.data.data;\n const opacity: number =\n activeArc && activeArc.length > 0 ? (activeArc.includes(this.props.data?.data.legend!) ? 1 : 0.1) : 1;\n const startAngle = this.props.data?.startAngle ?? 0;\n const endAngle = (this.props.data?.endAngle ?? 0) - startAngle;\n const cornerRadius = this.props.roundCorners ? 3 : 0;\n\n const classNames = getClassNames(getStyles, {\n solidFill: this.props.enableGradient ? 'transparent' : this.props.color,\n gradientFill: `conic-gradient(\n from ${startAngle}rad,\n ${this.props.color},\n ${this.props.nextColor} ${endAngle}rad\n )`,\n href: href!,\n theme: this.props.theme!,\n opacity,\n });\n\n const clipId = getId('Arc_clip') + `${this.props.color}_${this.props.nextColor}`;\n\n return (\n <g ref={this.currentRef}>\n {!!focusedArcId && focusedArcId === id && (\n <path\n id={id + 'focusRing'}\n d={arc.cornerRadius(cornerRadius)(this.props.focusData)}\n className={classNames.focusRing}\n />\n )}\n\n <path\n id={id}\n d={arc.cornerRadius(cornerRadius)(this.props.data)}\n onFocus={this._onFocus.bind(this, this.props.data!.data, id)}\n className={classNames.root}\n data-is-focusable={\n this._shouldHighlightArc(this.props.data!.data.legend!) || this.props.activeArc?.length === 0\n }\n onMouseOver={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseMove={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseLeave={this._hoverOff}\n onBlur={this._onBlur}\n onClick={href ? this._redirectToUrl.bind(this, href) : this.props.data?.data.onClick}\n aria-label={this._getAriaLabel()}\n role=\"img\"\n />\n {this._renderArcLabel(classNames.arcLabel)}\n\n {this.props.enableGradient && (\n <>\n <clipPath id={clipId}>\n <path d={arc.cornerRadius(cornerRadius)(this.props.data)} />\n </clipPath>\n <foreignObject x=\"-50%\" y=\"-50%\" width=\"100%\" height=\"100%\" clipPath={`url(#${clipId})`}>\n <div className={classNames.gradientArc} />\n </foreignObject>\n </>\n )}\n </g>\n );\n }\n\n private _onFocus(data: IChartDataPoint, id: string): void {\n this.props.onFocusCallback!(data, id, this.currentRef.current);\n }\n\n private _hoverOn(data: IChartDataPoint, mouseEvent: React.MouseEvent<SVGPathElement>): void {\n mouseEvent.persist();\n this.props.hoverOnCallback!(data, mouseEvent);\n }\n\n private _hoverOff = (): void => {\n this.props.hoverLeaveCallback!();\n };\n\n private _onBlur = (): void => {\n this.props.onBlurCallback!();\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _getAriaLabel = (): string => {\n const point = this.props.data!.data;\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n private _shouldHighlightArc = (legend?: string): boolean => {\n const { activeArc } = this.props;\n // If no activeArc is provided, highlight all arcs. Otherwise, only highlight the arcs that are active.\n return !activeArc || activeArc.length === 0 || legend === undefined || activeArc.includes(legend);\n };\n\n private _renderArcLabel = (className: string) => {\n const { arc, data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels } = this.props;\n if (\n hideLabels ||\n Math.abs(data!.endAngle - data!.startAngle) < Math.PI / 12 ||\n !this._shouldHighlightArc(data!.data.legend!)\n ) {\n return null;\n }\n\n const [base, perp] = arc.centroid(data);\n const hyp = Math.sqrt(base * base + perp * perp);\n const labelRadius = Math.max(innerRadius!, outerRadius!) + 2;\n const angle = (data!.startAngle + data!.endAngle) / 2;\n const arcValue = data!.value;\n\n return (\n <text\n x={(hyp === 0 ? 0 : base / hyp) * labelRadius}\n y={(hyp === 0 ? 0 : perp / hyp) * labelRadius}\n textAnchor={angle > Math.PI !== this._isRTL ? 'end' : 'start'}\n dominantBaseline={angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto'}\n className={className}\n aria-hidden={true}\n >\n {showLabelsInPercent\n ? d3Format('.0%')(totalValue! === 0 ? 0 : arcValue / totalValue!)\n : formatScientificLimitWidth(arcValue)}\n </text>\n );\n };\n}\n\nfunction _updateChart(newProps: IArcProps): void {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n}\n"]}
1
+ {"version":3,"file":"Arc.js","sourceRoot":"../src/","sources":["components/DonutChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AACxC,2DAAkF;AAClF,2CAAyC;AAGzC,uCAA+C;AAC/C,kDAAsE;AAOtE;IAAyB,+BAAqC;IAA9D;;QAKS,WAAK,GAAO,EAAE,CAAC;QAEd,gBAAU,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAC/C,YAAM,GAAY,IAAA,kBAAM,GAAE,CAAC;QAyF3B,eAAS,GAAG;YAClB,KAAI,CAAC,KAAK,CAAC,kBAAmB,EAAE,CAAC;QACnC,CAAC,CAAC;QAEM,aAAO,GAAG;YAChB,KAAI,CAAC,KAAK,CAAC,cAAe,EAAE,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,CAAC;IAEO,sBAAQ,GAAhB,UAAiB,IAAqB,EAAE,EAAU;QAChD,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAEO,sBAAQ,GAAhB,UAAiB,IAAqB,EAAE,UAA4C;QAClF,UAAU,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAChD,CAAC;IAUO,4BAAc,GAAtB,UAAuB,IAAwB;QAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IA1Ga,gBAAY,GAAuB;QAC/C,GAAG,EAAE,IAAA,cAAK,GAAE;KACb,AAFyB,CAExB;IAsJJ,UAAC;CAAA,AAzJD,CAAyB,KAAK,CAAC,SAAS,GAyJvC;AAzJY,kBAAG;AA2JhB,SAAS,YAAY,CAAC,QAAmB;IACvC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC/C,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import * as React from 'react';\nimport { arc as d3Arc } from 'd3-shape';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Arc.styles';\nimport { IChartDataPoint } from '../index';\nimport { IArcProps, IArcStyleProps, IArcStyles } from './index';\nimport { format as d3Format } from 'd3-format';\nimport { formatScientificLimitWidth } from '../../../utilities/index';\nimport type { JSXElement } from '@fluentui/utilities';\n\nexport interface IArcState {\n isCalloutVisible?: boolean;\n}\n\nexport class Arc extends React.Component<IArcProps, IArcState> {\n public static defaultProps: Partial<IArcProps> = {\n arc: d3Arc(),\n };\n\n public state: {} = {};\n\n private currentRef = React.createRef<SVGPathElement>();\n private _isRTL: boolean = getRTL();\n\n public static getDerivedStateFromProps(nextProps: Readonly<IArcProps>): Partial<IArcState> | null {\n _updateChart(nextProps);\n return null;\n }\n\n public updateChart(newProps: IArcProps): void {\n _updateChart(newProps);\n }\n\n public render(): JSXElement {\n const { arc, href, focusedArcId, activeArc } = this.props;\n const getClassNames = classNamesFunction<IArcStyleProps, IArcStyles>();\n const id =\n this.props.uniqText! +\n (typeof this.props.data!.data.legend === 'string' ? this.props.data!.data.legend.replace(/\\s+/g, '') : '') +\n this.props.data!.data.data;\n const opacity: number =\n activeArc && activeArc.length > 0 ? (activeArc.includes(this.props.data?.data.legend!) ? 1 : 0.1) : 1;\n const startAngle = this.props.data?.startAngle ?? 0;\n const endAngle = (this.props.data?.endAngle ?? 0) - startAngle;\n const cornerRadius = this.props.roundCorners ? 3 : 0;\n\n const classNames = getClassNames(getStyles, {\n solidFill: this.props.enableGradient ? 'transparent' : this.props.color,\n gradientFill: `conic-gradient(\n from ${startAngle}rad,\n ${this.props.color},\n ${this.props.nextColor} ${endAngle}rad\n )`,\n href: href!,\n theme: this.props.theme!,\n opacity,\n });\n\n const clipId = getId('Arc_clip') + `${this.props.color}_${this.props.nextColor}`;\n\n return (\n <g ref={this.currentRef}>\n {!!focusedArcId && focusedArcId === id && (\n <path\n id={id + 'focusRing'}\n d={arc.cornerRadius(cornerRadius)(this.props.focusData)}\n className={classNames.focusRing}\n />\n )}\n\n <path\n id={id}\n d={arc.cornerRadius(cornerRadius)(this.props.data)}\n onFocus={this._onFocus.bind(this, this.props.data!.data, id)}\n className={classNames.root}\n data-is-focusable={\n this._shouldHighlightArc(this.props.data!.data.legend!) || this.props.activeArc?.length === 0\n }\n onMouseOver={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseMove={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseLeave={this._hoverOff}\n onBlur={this._onBlur}\n onClick={href ? this._redirectToUrl.bind(this, href) : this.props.data?.data.onClick}\n aria-label={this._getAriaLabel()}\n role=\"img\"\n />\n {this._renderArcLabel(classNames.arcLabel)}\n\n {this.props.enableGradient && (\n <>\n <clipPath id={clipId}>\n <path d={arc.cornerRadius(cornerRadius)(this.props.data)} />\n </clipPath>\n <foreignObject x=\"-50%\" y=\"-50%\" width=\"100%\" height=\"100%\" clipPath={`url(#${clipId})`}>\n <div className={classNames.gradientArc} />\n </foreignObject>\n </>\n )}\n </g>\n );\n }\n\n private _onFocus(data: IChartDataPoint, id: string): void {\n this.props.onFocusCallback!(data, id, this.currentRef.current);\n }\n\n private _hoverOn(data: IChartDataPoint, mouseEvent: React.MouseEvent<SVGPathElement>): void {\n mouseEvent.persist();\n this.props.hoverOnCallback!(data, mouseEvent);\n }\n\n private _hoverOff = (): void => {\n this.props.hoverLeaveCallback!();\n };\n\n private _onBlur = (): void => {\n this.props.onBlurCallback!();\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _getAriaLabel = (): string => {\n const point = this.props.data!.data;\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n private _shouldHighlightArc = (legend?: string): boolean => {\n const { activeArc } = this.props;\n // If no activeArc is provided, highlight all arcs. Otherwise, only highlight the arcs that are active.\n return !activeArc || activeArc.length === 0 || legend === undefined || activeArc.includes(legend);\n };\n\n private _renderArcLabel = (className: string) => {\n const { arc, data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels } = this.props;\n if (\n hideLabels ||\n Math.abs(data!.endAngle - data!.startAngle) < Math.PI / 12 ||\n !this._shouldHighlightArc(data!.data.legend!)\n ) {\n return null;\n }\n\n const [base, perp] = arc.centroid(data);\n const hyp = Math.sqrt(base * base + perp * perp);\n const labelRadius = Math.max(innerRadius!, outerRadius!) + 2;\n const angle = (data!.startAngle + data!.endAngle) / 2;\n const arcValue = data!.value;\n\n return (\n <text\n x={(hyp === 0 ? 0 : base / hyp) * labelRadius}\n y={(hyp === 0 ? 0 : perp / hyp) * labelRadius}\n textAnchor={angle > Math.PI !== this._isRTL ? 'end' : 'start'}\n dominantBaseline={angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto'}\n className={className}\n aria-hidden={true}\n >\n {showLabelsInPercent\n ? d3Format('.0%')(totalValue! === 0 ? 0 : arcValue / totalValue!)\n : formatScientificLimitWidth(arcValue)}\n </text>\n );\n };\n}\n\nfunction _updateChart(newProps: IArcProps): void {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n}\n"]}
@@ -144,7 +144,6 @@ var DonutChartBase = /** @class */ (function (_super) {
144
144
  });
145
145
  }
146
146
  };
147
- // eslint-disable-next-line @typescript-eslint/no-deprecated
148
147
  DonutChartBase.prototype.render = function () {
149
148
  var _this = this;
150
149
  var _a = this.props, data = _a.data, _b = _a.hideLegend, hideLegend = _b === void 0 ? false : _b;
@@ -169,9 +168,7 @@ var DonutChartBase = /** @class */ (function (_super) {
169
168
  React.createElement(react_focus_1.FocusZone, { direction: react_focus_1.FocusZoneDirection.horizontal, handleTabKey: react_focus_1.FocusZoneTabbableElements.all, className: this._classNames.chartWrapper },
170
169
  React.createElement("svg", { className: this._classNames.chart, "aria-label": data === null || data === void 0 ? void 0 : data.chartTitle, ref: function (node) { return _this._setViewBox(node); }, width: this.state._width, height: this.state._height },
171
170
  React.createElement(index_2.Pie, { width: this.state._width, height: this.state._height, outerRadius: outerRadius, innerRadius: this.props.innerRadius, data: chartData, enableGradient: this.props.enableGradient, roundCorners: this.props.roundCorners, onFocusCallback: this._focusCallback, hoverOnCallback: this._hoverCallback, hoverLeaveCallback: this._hoverLeave, uniqText: this._uniqText, onBlurCallback: this._onBlur, activeArc: this._getHighlightedLegend(), focusedArcId: this.state.focusedArcId || '', href: this.props.href, calloutId: this._calloutId, valueInsideDonut: this._toLocaleString(valueInsideDonut), theme: this.props.theme, showLabelsInPercent: this.props.showLabelsInPercent, hideLabels: this.props.hideLabels }))),
172
- React.createElement(Callout_1.Callout, tslib_1.__assign({ target: this._currentHoverElement, alignTargetEdge: true, isBeakVisible: false, directionalHint: Callout_1.DirectionalHint.topAutoEdge, gapSpace: 15, hidden: !(!this.props.hideTooltip && this.state.showHover), id: this._calloutId, onDismiss: this._closeCallout,
173
- // eslint-disable-next-line @typescript-eslint/no-deprecated
174
- preventDismissOnLostFocus: true,
171
+ React.createElement(Callout_1.Callout, tslib_1.__assign({ target: this._currentHoverElement, alignTargetEdge: true, isBeakVisible: false, directionalHint: Callout_1.DirectionalHint.topAutoEdge, gapSpace: 15, hidden: !(!this.props.hideTooltip && this.state.showHover), id: this._calloutId, onDismiss: this._closeCallout, preventDismissOnLostFocus: true,
175
172
  /** Keep the callout updated with details of focused/hovered arc */
176
173
  shouldUpdateWhenHidden: true }, this.props.calloutProps, (0, index_3.getAccessibleDataObject)(this.state.callOutAccessibilityData, 'text', false)), this.props.onRenderCalloutPerDataPoint ? (this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)) : (React.createElement(index_1.ChartHoverCard, { Legend: this.state.xCalloutValue ? this.state.xCalloutValue : this.state.legend, YValue: this.state.yCalloutValue ? this.state.yCalloutValue : this.state.value, color: this.state.color, culture: this.props.culture }))),
177
174
  !hideLegend && React.createElement("div", { className: this._classNames.legendContainer }, legendBars))) : (React.createElement("div", { id: this._emptyChartId, role: 'alert', style: { opacity: '0' }, "aria-label": 'Graph has no data to display' }));
@@ -208,7 +205,6 @@ var DonutChartBase = /** @class */ (function (_super) {
208
205
  var viewbox = "0 0 ".concat(widthVal, " ").concat(heightVal);
209
206
  node.setAttribute('viewBox', viewbox);
210
207
  };
211
- // eslint-disable-next-line @typescript-eslint/no-deprecated
212
208
  DonutChartBase.prototype._createLegends = function (chartData) {
213
209
  var _this = this;
214
210
  if (this.props.order ===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A7Za,2BAAY,GAA8B;QACtD,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,IAAI;KACjB,AAHyB,CAGxB;IA2aJ,qBAAC;CAAA,AA/aD,CAAoC,KAAK,CAAC,SAAS,GA+alD;AA/aY,wCAAc","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId, getRTL, initializeComponentRef } from '@fluentui/react/lib/Utilities';\nimport { ScaleOrdinal } from 'd3-scale';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection, FocusZoneTabbableElements } from '@fluentui/react-focus';\nimport { IAccessibilityProps, ChartHoverCard, ILegend, Legends } from '../../index';\nimport { Pie } from './Pie/index';\nimport { IChartDataPoint, IDonutChartProps, IDonutChartStyleProps, IDonutChartStyles } from './index';\nimport {\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n getNextGradient,\n areArraysEqual,\n MIN_DONUT_RADIUS,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { IChart, IImageExportOptions } from '../../types/index';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport { ILegendContainer } from '../Legends/index';\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<IDonutChartStyleProps, IDonutChartStyles>();\nconst LEGEND_CONTAINER_HEIGHT = 40;\n\nexport interface IDonutChartState {\n showHover?: boolean;\n value?: string | undefined;\n legend?: string | undefined;\n _width?: number | undefined;\n _height?: number | undefined;\n activeLegend?: string;\n color?: string | undefined;\n xCalloutValue?: string;\n yCalloutValue?: string;\n focusedArcId?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n selectedLegends: string[];\n}\n\nexport class DonutChartBase extends React.Component<IDonutChartProps, IDonutChartState> implements IChart {\n public static defaultProps: Partial<IDonutChartProps> = {\n innerRadius: 0,\n hideLabels: true,\n };\n public _colors: ScaleOrdinal<string, {}>;\n private _classNames: IProcessedStyleSet<IDonutChartStyles>;\n private _rootElem: HTMLElement | null;\n private _uniqText: string;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private _currentHoverElement: any;\n private _calloutId: string;\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _emptyChartId: string | null;\n private _legendsRef: React.RefObject<ILegendContainer | null>;\n\n public static getDerivedStateFromProps(\n nextProps: Readonly<IDonutChartProps>,\n prevState: Readonly<IDonutChartState>,\n ): Partial<IDonutChartState> | null {\n let widthState: { _width: number } | undefined;\n if (nextProps.width && nextProps.width !== prevState._width) {\n widthState = { _width: nextProps.width };\n }\n\n let heightState: { _height: number } | undefined;\n if (nextProps.height && nextProps.height !== prevState._height) {\n heightState = { _height: nextProps.height - LEGEND_CONTAINER_HEIGHT };\n }\n\n return { ...widthState, ...heightState };\n }\n\n constructor(props: IDonutChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\n this.state = {\n showHover: false,\n value: '',\n legend: '',\n _width: this.props.width || 200,\n _height: this.props.height || 200,\n activeLegend: undefined,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n focusedArcId: '',\n selectedLegends: props.legendProps?.selectedLegends || [],\n };\n this._hoverCallback = this._hoverCallback.bind(this);\n this._focusCallback = this._focusCallback.bind(this);\n this._hoverLeave = this._hoverLeave.bind(this);\n this._calloutId = getId('callout');\n this._uniqText = getId('_Pie_');\n this._emptyChartId = getId('_DonutChart_empty');\n this._legendsRef = React.createRef();\n }\n\n public componentDidMount(): void {\n if (this._rootElem) {\n this.setState({\n _width: this._rootElem.offsetWidth,\n _height: this._rootElem.offsetHeight - LEGEND_CONTAINER_HEIGHT,\n });\n }\n }\n\n public componentDidUpdate(prevProps: IDonutChartProps): void {\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, this.props.legendProps?.selectedLegends)) {\n this.setState({\n selectedLegends: this.props.legendProps?.selectedLegends || [],\n });\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSXElement {\n const { data, hideLegend = false } = this.props;\n const points = this._addDefaultColors(data?.chartData);\n\n this._classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n color: this.state.color!,\n className: this.props.className!,\n });\n\n const legendBars = this._createLegends(points.filter(d => d.data! >= 0));\n const donutMarginHorizontal = this.props.hideLabels ? 0 : 80;\n const donutMarginVertical = this.props.hideLabels ? 0 : 40;\n const outerRadius =\n Math.min(this.state._width! - donutMarginHorizontal, this.state._height! - donutMarginVertical) / 2;\n const chartData = this._elevateToMinimums(points);\n const valueInsideDonut =\n this.props.innerRadius! > MIN_DONUT_RADIUS\n ? this._valueInsideDonut(this.props.valueInsideDonut!, chartData!)\n : '';\n return !this._isChartEmpty() ? (\n <div\n className={this._classNames.root}\n ref={(rootElem: HTMLElement | null) => {\n this._rootElem = rootElem;\n }}\n onMouseLeave={this._handleChartMouseLeave}\n >\n {this.props.xAxisAnnotation && (\n <text\n className={this._classNames.axisAnnotation}\n x={this.state._width! / 2}\n y={this.state._height! - 10}\n textAnchor=\"middle\"\n >\n {this.props.xAxisAnnotation}\n </text>\n )}\n <FocusZone\n direction={FocusZoneDirection.horizontal}\n handleTabKey={FocusZoneTabbableElements.all}\n className={this._classNames.chartWrapper}\n >\n <svg\n className={this._classNames.chart}\n aria-label={data?.chartTitle}\n ref={(node: SVGElement | null) => this._setViewBox(node)}\n width={this.state._width}\n height={this.state._height}\n >\n <Pie\n width={this.state._width!}\n height={this.state._height!}\n outerRadius={outerRadius}\n innerRadius={this.props.innerRadius!}\n data={chartData!}\n enableGradient={this.props.enableGradient}\n roundCorners={this.props.roundCorners}\n onFocusCallback={this._focusCallback}\n hoverOnCallback={this._hoverCallback}\n hoverLeaveCallback={this._hoverLeave}\n uniqText={this._uniqText}\n onBlurCallback={this._onBlur}\n activeArc={this._getHighlightedLegend()}\n focusedArcId={this.state.focusedArcId || ''}\n href={this.props.href!}\n calloutId={this._calloutId}\n valueInsideDonut={this._toLocaleString(valueInsideDonut)}\n theme={this.props.theme!}\n showLabelsInPercent={this.props.showLabelsInPercent}\n hideLabels={this.props.hideLabels}\n />\n </svg>\n </FocusZone>\n <Callout\n target={this._currentHoverElement}\n alignTargetEdge={true}\n isBeakVisible={false}\n directionalHint={DirectionalHint.topAutoEdge}\n gapSpace={15}\n hidden={!(!this.props.hideTooltip && this.state.showHover)}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered arc */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps!}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps!)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.legend}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.value}\n color={this.state.color}\n culture={this.props.culture}\n />\n )}\n </Callout>\n {!hideLegend && <div className={this._classNames.legendContainer}>{legendBars}</div>}\n </div>\n ) : (\n <div\n id={this._emptyChartId!}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n public get chartContainer(): HTMLElement | null {\n return this._rootElem;\n }\n\n public toImage = (opts?: IImageExportOptions): Promise<string> => {\n return exportChartsAsImage(\n [{ container: this._rootElem }],\n this.props.hideLegend ? undefined : this._legendsRef.current?.toSVG,\n getRTL(),\n opts,\n );\n };\n\n private _closeCallout = () => {\n this.setState({\n showHover: false,\n });\n };\n\n private _elevateToMinimums(data: IChartDataPoint[]) {\n let sumOfData = 0;\n const minPercent = 0.01;\n const elevatedData: IChartDataPoint[] = [];\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 private _setViewBox(node: SVGElement | null): void {\n if (node === null) {\n return;\n }\n\n const widthVal = node.parentElement ? node.parentElement.clientWidth : this.state._width;\n\n const heightVal =\n node.parentElement && node.parentElement?.offsetHeight > this.state._height!\n ? node.parentElement?.offsetHeight\n : this.state._height;\n const viewbox = `0 0 ${widthVal!} ${heightVal!}`;\n node.setAttribute('viewBox', viewbox);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private _createLegends(chartData: IChartDataPoint[]): JSXElement {\n if (this.props.order === 'sorted') {\n chartData.sort((a: IChartDataPoint, b: IChartDataPoint) => {\n return b.data! - a.data!;\n });\n }\n const legendDataItems = chartData.map((point: IChartDataPoint, index: number) => {\n const color: string = this.props.enableGradient\n ? point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0]\n : point.color!;\n\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: point.legend!,\n color,\n hoverAction: () => {\n this._handleChartMouseLeave();\n this.setState({ activeLegend: point.legend! });\n },\n onMouseOutAction: () => {\n this.setState({ activeLegend: undefined });\n },\n };\n return legend;\n });\n\n const legends = (\n <Legends\n legends={legendDataItems}\n centerLegends\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this._onLegendSelectionChange.bind(this)}\n ref={this._legendsRef}\n />\n );\n return legends;\n }\n\n private _onLegendSelectionChange(\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (this.props.legendProps && this.props.legendProps?.canSelectMultipleLegends) {\n this.setState({ selectedLegends });\n } else {\n this.setState({ selectedLegends: selectedLegends.slice(-1) });\n }\n if (this.props.legendProps?.onChange) {\n this.props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n private _focusCallback = (data: IChartDataPoint, id: string, element: SVGPathElement): void => {\n this._currentHoverElement = element;\n this.setState({\n /** Show the callout if highlighted arc is focused and Hide it if unhighlighted arc is focused */\n showHover: this._noLegendsHighlighted() || this._isLegendHighlighted(data.legend),\n value: data.data!.toString(),\n legend: data.legend,\n color: data.color!,\n xCalloutValue: data.xAxisCalloutData!,\n yCalloutValue: data.yAxisCalloutData!,\n focusedArcId: id,\n dataPointCalloutProps: data,\n callOutAccessibilityData: data.callOutAccessibilityData!,\n });\n };\n\n private _hoverCallback = (data: IChartDataPoint, e: React.MouseEvent<SVGPathElement>): void => {\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this._currentHoverElement = e;\n let color: string = data.color!;\n\n if (this.props.enableGradient) {\n const pointIndex = Math.max(this.props.data?.chartData?.findIndex(item => item.legend === data.legend) || 0, 0);\n color = data.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n this.setState({\n /** Show the callout if highlighted arc is hovered and Hide it if unhighlighted arc is hovered */\n showHover: this._noLegendsHighlighted() || this._isLegendHighlighted(data.legend),\n value: data.data!.toString(),\n legend: data.legend,\n color,\n xCalloutValue: data.xAxisCalloutData!,\n yCalloutValue: data.yAxisCalloutData!,\n dataPointCalloutProps: data,\n callOutAccessibilityData: data.callOutAccessibilityData!,\n });\n }\n };\n private _onBlur = (): void => {\n this.setState({ focusedArcId: '' });\n };\n\n private _hoverLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({ showHover: false });\n };\n\n private _valueInsideDonut(valueInsideDonut: string | number | undefined, data: IChartDataPoint[]) {\n const highlightedLegends = this._getHighlightedLegend();\n if (valueInsideDonut !== undefined && (highlightedLegends.length === 1 || this.state.showHover)) {\n const pointValue = data.find(point => this._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 private _toLocaleString(data: string | number | undefined) {\n const localeString = formatToLocaleString(data, this.props.culture, this.props.useUTC);\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 private _getHighlightedLegend() {\n return this.state.selectedLegends.length > 0\n ? this.state.selectedLegends\n : this.state.activeLegend\n ? [this.state.activeLegend]\n : [];\n }\n\n private _isLegendHighlighted = (legend: string | undefined): boolean => {\n return this._getHighlightedLegend().includes(legend!);\n };\n\n private _noLegendsHighlighted = (): boolean => {\n return this._getHighlightedLegend().length === 0;\n };\n\n private _isChartEmpty(): boolean {\n return !(\n this.props.data &&\n this.props.data.chartData &&\n this.props.data.chartData!.filter((d: IChartDataPoint) => d.data! > 0).length > 0\n );\n }\n\n private _addDefaultColors = (donutChartDataPoint?: IChartDataPoint[]): IChartDataPoint[] => {\n return donutChartDataPoint\n ? donutChartDataPoint.map((item, index) => {\n let color: string;\n // isInverted property is applicable to v8 themes only\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0, this.props.theme?.isInverted);\n } else {\n color = getColorFromToken(item.color, this.props.theme?.isInverted);\n }\n\n return { ...item, color };\n })\n : [];\n };\n}\n"]}
1
+ {"version":3,"file":"DonutChart.base.js","sourceRoot":"../src/","sources":["components/DonutChart/DonutChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,2DAA0G;AAG1G,uDAAuE;AACvE,qDAAiG;AACjG,qCAAoF;AACpF,qCAAkC;AAElC,+CAO+B;AAC/B,6DAAiE;AAEjE,yEAAyE;AAIzE,IAAM,aAAa,GAAG,IAAA,8BAA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AAiC;QACvD,IAAM,YAAY,GAAG,IAAA,sCAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACvF,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,EAAE,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACK,8CAAqB,GAA7B;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;YAC1C,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe;YAC5B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY;gBACzB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;gBAC3B,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAUO,sCAAa,GAArB;QACE,OAAO,CAAC,CACN,IAAI,CAAC,KAAK,CAAC,IAAI;YACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS;YACzB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAU,CAAC,MAAM,CAAC,UAAC,CAAkB,IAAK,OAAA,CAAC,CAAC,IAAK,GAAG,CAAC,EAAX,CAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAClF,CAAC;IACJ,CAAC;IA1Za,2BAAY,GAA8B;QACtD,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,IAAI;KACjB,AAHyB,CAGxB;IAwaJ,qBAAC;CAAA,AA5aD,CAAoC,KAAK,CAAC,SAAS,GA4alD;AA5aY,wCAAc","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId, getRTL, initializeComponentRef } from '@fluentui/react/lib/Utilities';\nimport { ScaleOrdinal } from 'd3-scale';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection, FocusZoneTabbableElements } from '@fluentui/react-focus';\nimport { IAccessibilityProps, ChartHoverCard, ILegend, Legends } from '../../index';\nimport { Pie } from './Pie/index';\nimport { IChartDataPoint, IDonutChartProps, IDonutChartStyleProps, IDonutChartStyles } from './index';\nimport {\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n getNextGradient,\n areArraysEqual,\n MIN_DONUT_RADIUS,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { IChart, IImageExportOptions } from '../../types/index';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport { ILegendContainer } from '../Legends/index';\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<IDonutChartStyleProps, IDonutChartStyles>();\nconst LEGEND_CONTAINER_HEIGHT = 40;\n\nexport interface IDonutChartState {\n showHover?: boolean;\n value?: string | undefined;\n legend?: string | undefined;\n _width?: number | undefined;\n _height?: number | undefined;\n activeLegend?: string;\n color?: string | undefined;\n xCalloutValue?: string;\n yCalloutValue?: string;\n focusedArcId?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n selectedLegends: string[];\n}\n\nexport class DonutChartBase extends React.Component<IDonutChartProps, IDonutChartState> implements IChart {\n public static defaultProps: Partial<IDonutChartProps> = {\n innerRadius: 0,\n hideLabels: true,\n };\n public _colors: ScaleOrdinal<string, {}>;\n private _classNames: IProcessedStyleSet<IDonutChartStyles>;\n private _rootElem: HTMLElement | null;\n private _uniqText: string;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private _currentHoverElement: any;\n private _calloutId: string;\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _emptyChartId: string | null;\n private _legendsRef: React.RefObject<ILegendContainer | null>;\n\n public static getDerivedStateFromProps(\n nextProps: Readonly<IDonutChartProps>,\n prevState: Readonly<IDonutChartState>,\n ): Partial<IDonutChartState> | null {\n let widthState: { _width: number } | undefined;\n if (nextProps.width && nextProps.width !== prevState._width) {\n widthState = { _width: nextProps.width };\n }\n\n let heightState: { _height: number } | undefined;\n if (nextProps.height && nextProps.height !== prevState._height) {\n heightState = { _height: nextProps.height - LEGEND_CONTAINER_HEIGHT };\n }\n\n return { ...widthState, ...heightState };\n }\n\n constructor(props: IDonutChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\n this.state = {\n showHover: false,\n value: '',\n legend: '',\n _width: this.props.width || 200,\n _height: this.props.height || 200,\n activeLegend: undefined,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n focusedArcId: '',\n selectedLegends: props.legendProps?.selectedLegends || [],\n };\n this._hoverCallback = this._hoverCallback.bind(this);\n this._focusCallback = this._focusCallback.bind(this);\n this._hoverLeave = this._hoverLeave.bind(this);\n this._calloutId = getId('callout');\n this._uniqText = getId('_Pie_');\n this._emptyChartId = getId('_DonutChart_empty');\n this._legendsRef = React.createRef();\n }\n\n public componentDidMount(): void {\n if (this._rootElem) {\n this.setState({\n _width: this._rootElem.offsetWidth,\n _height: this._rootElem.offsetHeight - LEGEND_CONTAINER_HEIGHT,\n });\n }\n }\n\n public componentDidUpdate(prevProps: IDonutChartProps): void {\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, this.props.legendProps?.selectedLegends)) {\n this.setState({\n selectedLegends: this.props.legendProps?.selectedLegends || [],\n });\n }\n }\n\n public render(): JSXElement {\n const { data, hideLegend = false } = this.props;\n const points = this._addDefaultColors(data?.chartData);\n\n this._classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n color: this.state.color!,\n className: this.props.className!,\n });\n\n const legendBars = this._createLegends(points.filter(d => d.data! >= 0));\n const donutMarginHorizontal = this.props.hideLabels ? 0 : 80;\n const donutMarginVertical = this.props.hideLabels ? 0 : 40;\n const outerRadius =\n Math.min(this.state._width! - donutMarginHorizontal, this.state._height! - donutMarginVertical) / 2;\n const chartData = this._elevateToMinimums(points);\n const valueInsideDonut =\n this.props.innerRadius! > MIN_DONUT_RADIUS\n ? this._valueInsideDonut(this.props.valueInsideDonut!, chartData!)\n : '';\n return !this._isChartEmpty() ? (\n <div\n className={this._classNames.root}\n ref={(rootElem: HTMLElement | null) => {\n this._rootElem = rootElem;\n }}\n onMouseLeave={this._handleChartMouseLeave}\n >\n {this.props.xAxisAnnotation && (\n <text\n className={this._classNames.axisAnnotation}\n x={this.state._width! / 2}\n y={this.state._height! - 10}\n textAnchor=\"middle\"\n >\n {this.props.xAxisAnnotation}\n </text>\n )}\n <FocusZone\n direction={FocusZoneDirection.horizontal}\n handleTabKey={FocusZoneTabbableElements.all}\n className={this._classNames.chartWrapper}\n >\n <svg\n className={this._classNames.chart}\n aria-label={data?.chartTitle}\n ref={(node: SVGElement | null) => this._setViewBox(node)}\n width={this.state._width}\n height={this.state._height}\n >\n <Pie\n width={this.state._width!}\n height={this.state._height!}\n outerRadius={outerRadius}\n innerRadius={this.props.innerRadius!}\n data={chartData!}\n enableGradient={this.props.enableGradient}\n roundCorners={this.props.roundCorners}\n onFocusCallback={this._focusCallback}\n hoverOnCallback={this._hoverCallback}\n hoverLeaveCallback={this._hoverLeave}\n uniqText={this._uniqText}\n onBlurCallback={this._onBlur}\n activeArc={this._getHighlightedLegend()}\n focusedArcId={this.state.focusedArcId || ''}\n href={this.props.href!}\n calloutId={this._calloutId}\n valueInsideDonut={this._toLocaleString(valueInsideDonut)}\n theme={this.props.theme!}\n showLabelsInPercent={this.props.showLabelsInPercent}\n hideLabels={this.props.hideLabels}\n />\n </svg>\n </FocusZone>\n <Callout\n target={this._currentHoverElement}\n alignTargetEdge={true}\n isBeakVisible={false}\n directionalHint={DirectionalHint.topAutoEdge}\n gapSpace={15}\n hidden={!(!this.props.hideTooltip && this.state.showHover)}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered arc */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps!}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps!)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.legend}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.value}\n color={this.state.color}\n culture={this.props.culture}\n />\n )}\n </Callout>\n {!hideLegend && <div className={this._classNames.legendContainer}>{legendBars}</div>}\n </div>\n ) : (\n <div\n id={this._emptyChartId!}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n public get chartContainer(): HTMLElement | null {\n return this._rootElem;\n }\n\n public toImage = (opts?: IImageExportOptions): Promise<string> => {\n return exportChartsAsImage(\n [{ container: this._rootElem }],\n this.props.hideLegend ? undefined : this._legendsRef.current?.toSVG,\n getRTL(),\n opts,\n );\n };\n\n private _closeCallout = () => {\n this.setState({\n showHover: false,\n });\n };\n\n private _elevateToMinimums(data: IChartDataPoint[]) {\n let sumOfData = 0;\n const minPercent = 0.01;\n const elevatedData: IChartDataPoint[] = [];\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 private _setViewBox(node: SVGElement | null): void {\n if (node === null) {\n return;\n }\n\n const widthVal = node.parentElement ? node.parentElement.clientWidth : this.state._width;\n\n const heightVal =\n node.parentElement && node.parentElement?.offsetHeight > this.state._height!\n ? node.parentElement?.offsetHeight\n : this.state._height;\n const viewbox = `0 0 ${widthVal!} ${heightVal!}`;\n node.setAttribute('viewBox', viewbox);\n }\n\n private _createLegends(chartData: IChartDataPoint[]): JSXElement {\n if (this.props.order === 'sorted') {\n chartData.sort((a: IChartDataPoint, b: IChartDataPoint) => {\n return b.data! - a.data!;\n });\n }\n const legendDataItems = chartData.map((point: IChartDataPoint, index: number) => {\n const color: string = this.props.enableGradient\n ? point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0]\n : point.color!;\n\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: point.legend!,\n color,\n hoverAction: () => {\n this._handleChartMouseLeave();\n this.setState({ activeLegend: point.legend! });\n },\n onMouseOutAction: () => {\n this.setState({ activeLegend: undefined });\n },\n };\n return legend;\n });\n\n const legends = (\n <Legends\n legends={legendDataItems}\n centerLegends\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this._onLegendSelectionChange.bind(this)}\n ref={this._legendsRef}\n />\n );\n return legends;\n }\n\n private _onLegendSelectionChange(\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (this.props.legendProps && this.props.legendProps?.canSelectMultipleLegends) {\n this.setState({ selectedLegends });\n } else {\n this.setState({ selectedLegends: selectedLegends.slice(-1) });\n }\n if (this.props.legendProps?.onChange) {\n this.props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n private _focusCallback = (data: IChartDataPoint, id: string, element: SVGPathElement): void => {\n this._currentHoverElement = element;\n this.setState({\n /** Show the callout if highlighted arc is focused and Hide it if unhighlighted arc is focused */\n showHover: this._noLegendsHighlighted() || this._isLegendHighlighted(data.legend),\n value: data.data!.toString(),\n legend: data.legend,\n color: data.color!,\n xCalloutValue: data.xAxisCalloutData!,\n yCalloutValue: data.yAxisCalloutData!,\n focusedArcId: id,\n dataPointCalloutProps: data,\n callOutAccessibilityData: data.callOutAccessibilityData!,\n });\n };\n\n private _hoverCallback = (data: IChartDataPoint, e: React.MouseEvent<SVGPathElement>): void => {\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this._currentHoverElement = e;\n let color: string = data.color!;\n\n if (this.props.enableGradient) {\n const pointIndex = Math.max(this.props.data?.chartData?.findIndex(item => item.legend === data.legend) || 0, 0);\n color = data.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n this.setState({\n /** Show the callout if highlighted arc is hovered and Hide it if unhighlighted arc is hovered */\n showHover: this._noLegendsHighlighted() || this._isLegendHighlighted(data.legend),\n value: data.data!.toString(),\n legend: data.legend,\n color,\n xCalloutValue: data.xAxisCalloutData!,\n yCalloutValue: data.yAxisCalloutData!,\n dataPointCalloutProps: data,\n callOutAccessibilityData: data.callOutAccessibilityData!,\n });\n }\n };\n private _onBlur = (): void => {\n this.setState({ focusedArcId: '' });\n };\n\n private _hoverLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({ showHover: false });\n };\n\n private _valueInsideDonut(valueInsideDonut: string | number | undefined, data: IChartDataPoint[]) {\n const highlightedLegends = this._getHighlightedLegend();\n if (valueInsideDonut !== undefined && (highlightedLegends.length === 1 || this.state.showHover)) {\n const pointValue = data.find(point => this._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 private _toLocaleString(data: string | number | undefined) {\n const localeString = formatToLocaleString(data, this.props.culture, this.props.useUTC);\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 private _getHighlightedLegend() {\n return this.state.selectedLegends.length > 0\n ? this.state.selectedLegends\n : this.state.activeLegend\n ? [this.state.activeLegend]\n : [];\n }\n\n private _isLegendHighlighted = (legend: string | undefined): boolean => {\n return this._getHighlightedLegend().includes(legend!);\n };\n\n private _noLegendsHighlighted = (): boolean => {\n return this._getHighlightedLegend().length === 0;\n };\n\n private _isChartEmpty(): boolean {\n return !(\n this.props.data &&\n this.props.data.chartData &&\n this.props.data.chartData!.filter((d: IChartDataPoint) => d.data! > 0).length > 0\n );\n }\n\n private _addDefaultColors = (donutChartDataPoint?: IChartDataPoint[]): IChartDataPoint[] => {\n return donutChartDataPoint\n ? donutChartDataPoint.map((item, index) => {\n let color: string;\n // isInverted property is applicable to v8 themes only\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0, this.props.theme?.isInverted);\n } else {\n color = getColorFromToken(item.color, this.props.theme?.isInverted);\n }\n\n return { ...item, color };\n })\n : [];\n };\n}\n"]}
@@ -14,7 +14,6 @@ var Pie = /** @class */ (function (_super) {
14
14
  tslib_1.__extends(Pie, _super);
15
15
  function Pie(props) {
16
16
  var _this = _super.call(this, props) || this;
17
- // eslint-disable-next-line @typescript-eslint/no-deprecated
18
17
  _this.arcGenerator = function (d, i, focusData, href) {
19
18
  var _a, _b, _c, _d;
20
19
  var color = d && d.data && d.data.color;
@@ -43,7 +42,6 @@ var Pie = /** @class */ (function (_super) {
43
42
  .padAngle(0);
44
43
  return _this;
45
44
  }
46
- // eslint-disable-next-line @typescript-eslint/no-deprecated
47
45
  Pie.prototype.render = function () {
48
46
  var _this = this;
49
47
  var _a = this.props, pie = _a.pie, data = _a.data;
@@ -1 +1 @@
1
- {"version":3,"file":"Pie.js","sourceRoot":"../src/","sources":["components/DonutChart/Pie/Pie.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AAExC,sCAA6C;AAE7C,2DAAmE;AACnE,2CAAyC;AACzC,kDAAgF;AAGhF,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA8B,CAAC;AACvE,IAAM,YAAY,GAAW,CAAC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YAC1C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAM;SACzB,CAAC,CAAC;QAEH,IAAA,2BAAmB,EAAC,UAAU,CAAC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,WAAY,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;IAChG,CAAC;IAMO,4BAAc,GAAtB,UAAuB,IAAqB,EAAE,CAAmC;QAC/E,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IAnGa,gBAAY,GAAuB;QAC/C,GAAG,EAAE,IAAA,cAAK,GAAE;aACT,IAAI,CAAC,IAAI,CAAC;YACX,8DAA8D;aAC7D,KAAK,CAAC,UAAC,CAAM,IAAK,OAAA,CAAC,CAAC,IAAI,EAAN,CAAM,CAAC;aACzB,QAAQ,CAAC,IAAI,CAAC;KAClB,AANyB,CAMxB;IAsGJ,UAAC;CAAA,AA7GD,CAAyB,KAAK,CAAC,SAAS,GA6GvC;AA7GY,kBAAG","sourcesContent":["import * as React from 'react';\nimport { pie as d3Pie } from 'd3-shape';\nimport { IPieProps, IPieStyleProps, IPieStyles } from './index';\nimport { Arc, IArcData } from '../Arc/index';\nimport { IChartDataPoint } from '../index';\nimport { classNamesFunction } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Pie.styles';\nimport { getNextGradient, wrapTextInsideDonut } from '../../../utilities/index';\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<IPieStyleProps, IPieStyles>();\nconst TEXT_PADDING: number = 5;\n\nexport class Pie extends React.Component<IPieProps, {}> {\n public static defaultProps: Partial<IPieProps> = {\n pie: d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0.02),\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _pieForFocusRing: any;\n private _totalValue: number;\n\n constructor(props: IPieProps) {\n super(props);\n this._hoverCallback = this._hoverCallback.bind(this);\n this._pieForFocusRing = d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public arcGenerator = (d: IArcData, i: number, focusData: IArcData, href?: string): JSXElement => {\n let color = d && d.data && d.data.color;\n let nextColor = color;\n\n if (this.props.enableGradient) {\n color = this.props.data[i].gradient?.[0] ?? getNextGradient(i, 0, this.props.theme!.isInverted)[0];\n nextColor = this.props.data[i].gradient?.[1] ?? getNextGradient(i, 0, this.props.theme!.isInverted)[1];\n }\n\n return (\n <Arc\n key={i}\n data={d}\n focusData={focusData}\n innerRadius={this.props.innerRadius}\n outerRadius={this.props.outerRadius}\n color={color!}\n nextColor={nextColor}\n enableGradient={this.props.enableGradient}\n roundCorners={this.props.roundCorners}\n onFocusCallback={this._focusCallback}\n hoverOnCallback={this._hoverCallback}\n onBlurCallback={this.props.onBlurCallback}\n hoverLeaveCallback={this.props.hoverLeaveCallback}\n uniqText={this.props.uniqText}\n activeArc={this.props.activeArc}\n href={href}\n calloutId={this.props.calloutId}\n valueInsideDonut={this.props.valueInsideDonut}\n theme={this.props.theme!}\n focusedArcId={this.props.focusedArcId}\n showLabelsInPercent={this.props.showLabelsInPercent}\n totalValue={this._totalValue}\n hideLabels={this.props.hideLabels}\n />\n );\n };\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSXElement {\n const { pie, data } = this.props;\n const focusData = this._pieForFocusRing(data);\n const piechart = pie(data);\n const translate = `translate(${this.props.width / 2}, ${this.props.height / 2})`;\n const classNames = getClassNames(getStyles, {\n theme: this.props.theme!,\n });\n\n this._totalValue = this._computeTotalValue();\n\n return (\n <g transform={translate}>\n {piechart.map((d: IArcData, i: number) => this.arcGenerator(d, i, focusData[i], this.props.href))}\n {this.props.valueInsideDonut && (\n <text y={5} textAnchor=\"middle\" dominantBaseline=\"middle\" className={classNames.insideDonutString}>\n {this.props.valueInsideDonut}\n </text>\n )}\n </g>\n );\n }\n\n public componentDidUpdate(): void {\n const classNames = getClassNames(getStyles, {\n theme: this.props.theme!,\n });\n\n wrapTextInsideDonut(classNames.insideDonutString, this.props.innerRadius! * 2 - TEXT_PADDING);\n }\n\n private _focusCallback = (data: IChartDataPoint, id: string, e: SVGPathElement): void => {\n this.props.onFocusCallback!(data, id, e);\n };\n\n private _hoverCallback(data: IChartDataPoint, e: React.MouseEvent<SVGPathElement>): void {\n this.props.hoverOnCallback!(data, e);\n }\n\n private _computeTotalValue = () => {\n let totalValue = 0;\n this.props.data.forEach((arc: IChartDataPoint) => {\n totalValue += arc.data!;\n });\n return totalValue;\n };\n}\n"]}
1
+ {"version":3,"file":"Pie.js","sourceRoot":"../src/","sources":["components/DonutChart/Pie/Pie.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AAExC,sCAA6C;AAE7C,2DAAmE;AACnE,2CAAyC;AACzC,kDAAgF;AAGhF,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA8B,CAAC;AACvE,IAAM,YAAY,GAAW,CAAC,CAAC;AAE/B;IAAyB,+BAA8B;IAarD,aAAY,KAAgB;QAC1B,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QASR,kBAAY,GAAG,UAAC,CAAW,EAAE,CAAS,EAAE,SAAmB,EAAE,IAAa;;YAC/E,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACxC,IAAI,SAAS,GAAG,KAAK,CAAC;YAEtB,IAAI,KAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;gBAC9B,KAAK,GAAG,MAAA,MAAA,KAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,0CAAG,CAAC,CAAC,mCAAI,IAAA,uBAAe,EAAC,CAAC,EAAE,CAAC,EAAE,KAAI,CAAC,KAAK,CAA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IAoGJ,UAAC;CAAA,AA3GD,CAAyB,KAAK,CAAC,SAAS,GA2GvC;AA3GY,kBAAG","sourcesContent":["import * as React from 'react';\nimport { pie as d3Pie } from 'd3-shape';\nimport { IPieProps, IPieStyleProps, IPieStyles } from './index';\nimport { Arc, IArcData } from '../Arc/index';\nimport { IChartDataPoint } from '../index';\nimport { classNamesFunction } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Pie.styles';\nimport { getNextGradient, wrapTextInsideDonut } from '../../../utilities/index';\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<IPieStyleProps, IPieStyles>();\nconst TEXT_PADDING: number = 5;\n\nexport class Pie extends React.Component<IPieProps, {}> {\n public static defaultProps: Partial<IPieProps> = {\n pie: d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0.02),\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _pieForFocusRing: any;\n private _totalValue: number;\n\n constructor(props: IPieProps) {\n super(props);\n this._hoverCallback = this._hoverCallback.bind(this);\n this._pieForFocusRing = d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0);\n }\n\n public arcGenerator = (d: IArcData, i: number, focusData: IArcData, href?: string): JSXElement => {\n let color = d && d.data && d.data.color;\n let nextColor = color;\n\n if (this.props.enableGradient) {\n color = this.props.data[i].gradient?.[0] ?? getNextGradient(i, 0, this.props.theme!.isInverted)[0];\n nextColor = this.props.data[i].gradient?.[1] ?? getNextGradient(i, 0, this.props.theme!.isInverted)[1];\n }\n\n return (\n <Arc\n key={i}\n data={d}\n focusData={focusData}\n innerRadius={this.props.innerRadius}\n outerRadius={this.props.outerRadius}\n color={color!}\n nextColor={nextColor}\n enableGradient={this.props.enableGradient}\n roundCorners={this.props.roundCorners}\n onFocusCallback={this._focusCallback}\n hoverOnCallback={this._hoverCallback}\n onBlurCallback={this.props.onBlurCallback}\n hoverLeaveCallback={this.props.hoverLeaveCallback}\n uniqText={this.props.uniqText}\n activeArc={this.props.activeArc}\n href={href}\n calloutId={this.props.calloutId}\n valueInsideDonut={this.props.valueInsideDonut}\n theme={this.props.theme!}\n focusedArcId={this.props.focusedArcId}\n showLabelsInPercent={this.props.showLabelsInPercent}\n totalValue={this._totalValue}\n hideLabels={this.props.hideLabels}\n />\n );\n };\n\n public render(): JSXElement {\n const { pie, data } = this.props;\n const focusData = this._pieForFocusRing(data);\n const piechart = pie(data);\n const translate = `translate(${this.props.width / 2}, ${this.props.height / 2})`;\n const classNames = getClassNames(getStyles, {\n theme: this.props.theme!,\n });\n\n this._totalValue = this._computeTotalValue();\n\n return (\n <g transform={translate}>\n {piechart.map((d: IArcData, i: number) => this.arcGenerator(d, i, focusData[i], this.props.href))}\n {this.props.valueInsideDonut && (\n <text y={5} textAnchor=\"middle\" dominantBaseline=\"middle\" className={classNames.insideDonutString}>\n {this.props.valueInsideDonut}\n </text>\n )}\n </g>\n );\n }\n\n public componentDidUpdate(): void {\n const classNames = getClassNames(getStyles, {\n theme: this.props.theme!,\n });\n\n wrapTextInsideDonut(classNames.insideDonutString, this.props.innerRadius! * 2 - TEXT_PADDING);\n }\n\n private _focusCallback = (data: IChartDataPoint, id: string, e: SVGPathElement): void => {\n this.props.onFocusCallback!(data, id, e);\n };\n\n private _hoverCallback(data: IChartDataPoint, e: React.MouseEvent<SVGPathElement>): void {\n this.props.hoverOnCallback!(data, e);\n }\n\n private _computeTotalValue = () => {\n let totalValue = 0;\n this.props.data.forEach((arc: IChartDataPoint) => {\n totalValue += arc.data!;\n });\n return totalValue;\n };\n}\n"]}
@@ -204,7 +204,6 @@ exports.FunnelChartBase = React.forwardRef(function (_a, forwardedRef) {
204
204
  var maxTotal = Math.max.apply(Math, totals);
205
205
  var funnelWidth = containerWidth;
206
206
  var funnelHeight = containerHeight * 0.8;
207
- // eslint-disable-next-line @typescript-eslint/no-deprecated
208
207
  var paths = [];
209
208
  var geometryParams = {
210
209
  stages: stages,
@@ -1 +1 @@
1
- {"version":3,"file":"FunnelChart.base.js","sourceRoot":"../src/","sources":["components/FunnelChart/FunnelChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,2DAAkF;AAOlF,qDAAsE;AACtE,0CAAsE;AACtE,uDAAuE;AACvE,gFAA+E;AAC/E,6DAAiE;AAEjE,yEAAyE;AACzE,uDAAiE;AACjE,mDAM0B;AAG1B,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA8C,CAAC;AAE1E,QAAA,eAAe,GAA+C,KAAK,CAAC,UAAU,CAGzF,UAAC,EAAsC,EAAE,YAAY;;IAAlD,IAAA,mBAAwB,EAAxB,WAAW,mBAAG,UAAU,KAAA,EAAK,KAAK,sBAApC,eAAsC,CAAF;IACrC,IAAM,UAAU,GAAW,IAAA,iBAAK,EAAC,uBAAuB,CAAC,CAAC;IAC1D,IAAM,aAAa,GAAW,IAAA,iBAAK,EAAC,oBAAoB,CAAC,CAAC;IAC1D,IAAM,KAAK,GAAG,IAAA,kBAAM,GAAE,CAAC;IAEjB,IAAA,KAAkC,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,EAApE,YAAY,QAAA,EAAE,eAAe,QAAuC,CAAC;IACtE,IAAA,KAA0C,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAA9D,gBAAgB,QAAA,EAAE,mBAAmB,QAAyB,CAAC;IAChE,IAAA,KAAgC,KAAK,CAAC,QAAQ,CAA+B,IAAI,CAAC,EAAjF,WAAW,QAAA,EAAE,cAAc,QAAsD,CAAC;IACnF,IAAA,KAAgC,KAAK,CAAC,QAAQ,CAAoB,IAAI,CAAC,EAAtE,WAAW,QAAA,EAAE,cAAc,QAA2C,CAAC;IACxE,IAAA,KAAwC,KAAK,CAAC,QAAQ,CAAW,EAAE,CAAC,EAAnE,eAAe,QAAA,EAAE,kBAAkB,QAAgC,CAAC;IAC3E,IAAM,iBAAiB,GAA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I;QACrD,oBAAC,uBAAS,IAAC,SAAS,EAAE,gCAAkB,CAAC,UAAU;YACjD,6BAAK,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,gBAAc,KAAK,CAAC,UAAU;gBACvG,2BACE,SAAS,EACP,KAAK;wBACH,CAAC,CAAC,oBAAa,aAAa,GAAG,WAAW,eAAK,eAAe,kBAAe;wBAC7E,CAAC,CAAC,oBAAa,aAAa,eAAK,eAAe,MAAG,IAGtD,SAAS;oBACR,CAAC,CAAC,oBAAoB,CAAC,MAAM,GAAG,eAAe,EAAE,WAAW,CAAC;oBAC7D,CAAC,CAAC,aAAa,CAAC,MAAM,GAAG,eAAe,EAAE,WAAW,CAAC,CACtD;gBACH,gBAAgB,IAAI,CACnB,oBAAC,iBAAO,uBAAK,YAAY;oBACvB,oBAAC,+BAAc,IACb,MAAM,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAgB,EACtC,MAAM,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,EAC5B,KAAK,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,GAC1B,CACM,CACX,CACG,CACI;QACX,cAAc,EAAE,CACb,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,uBAAe,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport {\n IFunnelChartDataPoint,\n IFunnelChartProps,\n IFunnelChartStyleProps,\n IFunnelChartStyles,\n} from './FunnelChart.types';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { ChartHoverCard } from '../../utilities/ChartHoverCard/ChartHoverCard';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { IImageExportOptions } from '../../types/index';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport { getContrastTextColor } from '../../utilities/utilities';\nimport {\n getHorizontalFunnelSegmentGeometry,\n getVerticalFunnelSegmentGeometry,\n getSegmentTextProps,\n getStackedHorizontalFunnelSegmentGeometry,\n getStackedVerticalFunnelSegmentGeometry,\n} from './funnelGeometry';\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<IFunnelChartStyleProps, IFunnelChartStyles>();\n\nexport const FunnelChartBase: React.FunctionComponent<IFunnelChartProps> = React.forwardRef<\n HTMLDivElement,\n IFunnelChartProps\n>(({ orientation = 'vertical', ...props }, forwardedRef) => {\n const _tooltipId: string = getId('FunnelChartTooltipId_');\n const _emptyChartId: string = getId('_FunnelChart_empty');\n const isRTL = getRTL();\n\n const [hoveredStage, setHoveredStage] = React.useState<string | null>(null);\n const [isCalloutVisible, setIsCalloutVisible] = React.useState(false);\n const [calloutData, setCalloutData] = React.useState<IFunnelChartDataPoint | null>(null);\n const [refSelected, setRefSelected] = React.useState<SVGElement | null>(null);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>([]);\n const chartContainerRef = React.useRef<HTMLDivElement | null>(null);\n const legendsRef = React.useRef<ILegendContainer | null>(null);\n const isStacked = isStackedFunnelData(props.data);\n\n React.useEffect(() => {\n if (props.legendProps?.selectedLegends) {\n setSelectedLegends(props.legendProps.selectedLegends);\n }\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: chartContainerRef ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return exportChartsAsImage(\n [{ container: chartContainerRef.current }],\n props.hideLegend ? undefined : legendsRef.current?.toSVG,\n getRTL(),\n opts,\n );\n },\n }),\n [props.hideLegend],\n );\n\n function _handleHover(data: IFunnelChartDataPoint, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent?.persist();\n setHoveredStage(data.stage as string);\n setCalloutData(data);\n setIsCalloutVisible(true);\n setRefSelected(mouseEvent.currentTarget);\n }\n\n function _handleFocus(data: IFunnelChartDataPoint, focusEvent: React.FocusEvent<SVGPathElement>) {\n focusEvent?.persist();\n setCalloutData(data);\n setIsCalloutVisible(true);\n setRefSelected(focusEvent.currentTarget);\n }\n\n function _handleStackedHover(\n stage: string,\n subValue: { category: string; value: number; color: string },\n mouseEvent: React.MouseEvent<SVGElement>,\n ) {\n mouseEvent?.persist();\n setHoveredStage(subValue.category);\n setCalloutData({\n stage,\n value: subValue.value,\n color: subValue.color,\n category: subValue.category,\n } as IFunnelChartDataPoint);\n setIsCalloutVisible(true);\n setRefSelected(mouseEvent.currentTarget);\n }\n\n function _handleStackedFocus(\n stage: string,\n subValue: { category: string; value: number; color: string },\n focusEvent: React.FocusEvent<SVGPathElement>,\n ) {\n focusEvent?.persist();\n setCalloutData({\n stage,\n value: subValue.value,\n color: subValue.color,\n category: subValue.category,\n } as IFunnelChartDataPoint);\n setIsCalloutVisible(true);\n setRefSelected(focusEvent.currentTarget);\n }\n\n function _handleMouseOut() {\n setHoveredStage(null);\n setIsCalloutVisible(false);\n setCalloutData(null);\n setRefSelected(null);\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _onLegendSelectionChangeCallback = React.useCallback(_onLegendSelectionChange, [props.legendProps]);\n\n function getHighlightedLegend(): string[] {\n return selectedLegends.length > 0 ? selectedLegends : hoveredStage ? [hoveredStage] : [];\n }\n\n function legendHighlighted(legend: string): boolean {\n return getHighlightedLegend().includes(legend);\n }\n\n function noLegendHighlighted(): boolean {\n return getHighlightedLegend().length === 0;\n }\n\n function _getEventHandlerProps(\n data: IFunnelChartDataPoint | { stage: string; subValue: { category: string; value: number; color: string } },\n opacity?: number,\n ) {\n if ('subValue' in data) {\n return {\n culture: props.culture,\n onMouseOver:\n opacity === 1\n ? (event: React.MouseEvent<SVGElement>) => _handleStackedHover(data.stage, data.subValue, event)\n : undefined,\n onMouseMove:\n opacity === 1\n ? (event: React.MouseEvent<SVGElement>) => _handleStackedHover(data.stage, data.subValue, event)\n : undefined,\n onFocus: (event: React.FocusEvent<SVGPathElement>) => _handleStackedFocus(data.stage, data.subValue, event),\n onBlur: () => _handleMouseOut(),\n onMouseOut: () => _handleMouseOut(),\n };\n } else {\n return {\n culture: props.culture,\n onMouseOver: opacity === 1 ? (event: React.MouseEvent<SVGElement>) => _handleHover(data, event) : undefined,\n onMouseMove: opacity === 1 ? (event: React.MouseEvent<SVGElement>) => _handleHover(data, event) : undefined,\n onFocus: (event: React.FocusEvent<SVGPathElement>) => _handleFocus(data, event),\n onBlur: () => _handleMouseOut(),\n onMouseOut: () => _handleMouseOut(),\n };\n }\n }\n\n function _renderSegmentText({\n show,\n x,\n y,\n value,\n textColor,\n }: {\n show: boolean;\n x: number;\n y: number;\n value: number;\n textColor: string;\n }) {\n if (!show) {\n return null;\n }\n\n const textElement = (\n <text x={isRTL ? funnelWidth - x : x} y={y} textAnchor=\"middle\" alignmentBaseline=\"middle\" fill={textColor}>\n {formatToLocaleString(value.toString(), props.culture) as React.ReactNode}\n </text>\n );\n\n if (isRTL) {\n return <g transform={`scale(-1,1) translate(${-funnelWidth},0)`}>{textElement}</g>;\n }\n return textElement;\n }\n\n function _renderFunnelSegment({\n key,\n pathD,\n fill,\n opacity,\n textProps,\n data,\n isFocusable,\n }: {\n key: string | number;\n pathD: string;\n fill: string;\n opacity: number;\n textProps?: {\n show: boolean;\n x: number;\n y: number;\n value: number;\n };\n data: IFunnelChartDataPoint | { stage: string; subValue: { category: string; value: number; color: string } };\n isFocusable?: boolean;\n }) {\n const eventHandlers = _getEventHandlerProps(data, opacity);\n const textColor = getContrastTextColor(fill, props.theme!);\n\n return (\n <g key={key}>\n <path d={pathD} fill={fill} opacity={opacity} {...eventHandlers} data-is-focusable={isFocusable} />\n {textProps && <g {...eventHandlers}>{_renderSegmentText({ ...textProps, textColor })}</g>}\n </g>\n );\n }\n\n function _createFunnel(\n containerHeight: number,\n containerWidth: number,\n ): // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSXElement[] {\n const { data } = props;\n const funnelWidth = containerWidth;\n const funnelHeight = containerHeight * 0.8;\n\n return data.map((d, i) => {\n const geometryProps =\n orientation === 'vertical'\n ? getVerticalFunnelSegmentGeometry({ d, i, data, funnelWidth, funnelHeight, isRTL })\n : getHorizontalFunnelSegmentGeometry({ d, i, data, funnelWidth, funnelHeight, isRTL });\n\n const { pathD, textX, textY, availableWidth } = geometryProps;\n const minTextWidth = 16;\n const eventHandlerProps = _getEventHandlerProps(d);\n const textProps = getSegmentTextProps({\n availableWidth,\n minTextWidth,\n textX,\n textY,\n value: d.value!,\n ...eventHandlerProps,\n });\n\n return _renderFunnelSegment({\n key: i,\n pathD,\n fill: d.color!,\n opacity: legendHighlighted(d.stage as string) || noLegendHighlighted() ? 1 : 0.1,\n textProps,\n data: d,\n isFocusable: legendHighlighted(d.stage as string) || noLegendHighlighted() ? true : false,\n });\n });\n }\n\n function isStackedFunnelData(data: IFunnelChartDataPoint[]): boolean {\n return Array.isArray(data) && data.every(stage => Array.isArray(stage.subValues));\n }\n\n function _renderStackedSegment(\n stage: IFunnelChartDataPoint,\n subValue: { value: number; color: string; category: string },\n stageIndex: number,\n subValueIndex: number,\n geometryParams: {\n stages: IFunnelChartDataPoint[];\n totals: number[];\n maxTotal: number;\n funnelWidth: number;\n funnelHeight: number;\n isRTL: boolean;\n },\n ): // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSXElement {\n // Ensure stages have subValues for geometry functions\n const stagesWithSubValues = geometryParams.stages.map(s => ({\n ...s,\n subValues: s.subValues || [],\n }));\n\n const geom =\n orientation === 'vertical'\n ? getStackedVerticalFunnelSegmentGeometry({\n ...geometryParams,\n stages: stagesWithSubValues,\n i: stageIndex,\n k: subValueIndex,\n })\n : getStackedHorizontalFunnelSegmentGeometry({\n ...geometryParams,\n stages: stagesWithSubValues,\n i: stageIndex,\n k: subValueIndex,\n });\n\n const minTextWidth = 16;\n const eventHandlerProps = _getEventHandlerProps({ stage: stage.stage as string, subValue });\n const textProps = getSegmentTextProps({\n availableWidth: geom.availableWidth,\n minTextWidth,\n textX: geom.textX,\n textY: geom.textY,\n value: subValue.value,\n ...eventHandlerProps,\n });\n\n return _renderFunnelSegment({\n key: `${stageIndex}-${subValueIndex}`,\n pathD: geom.pathD,\n fill: subValue.color,\n opacity:\n (isStackedFunnelData(props.data) && legendHighlighted(subValue.category)) || noLegendHighlighted() ? 1 : 0.1,\n textProps,\n data: { stage: stage.stage as string, subValue },\n isFocusable:\n (isStackedFunnelData(props.data) && legendHighlighted(subValue.category)) || noLegendHighlighted()\n ? true\n : false,\n });\n }\n\n function _createStackedFunnel(\n containerHeight: number,\n containerWidth: number,\n ): // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSXElement[] {\n const { data } = props;\n\n const stages = data;\n const totals = stages.map(s => s?.subValues?.reduce((sum, subValue) => sum + subValue.value, 0) ?? 0);\n const maxTotal = Math.max(...totals);\n\n const funnelWidth = containerWidth;\n const funnelHeight = containerHeight * 0.8;\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const paths: JSXElement[] = [];\n\n const geometryParams = {\n stages,\n totals,\n maxTotal,\n funnelWidth,\n funnelHeight,\n isRTL,\n };\n\n for (let i = 0; i < stages.length; i++) {\n const cur = stages[i];\n for (let k = 0; k < (cur.subValues ?? []).length; k++) {\n const v = cur.subValues?.[k];\n if (!v) {\n continue;\n }\n paths.push(_renderStackedSegment(cur, v, i, k, geometryParams));\n }\n }\n return paths;\n }\n\n function _renderLegends(): // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSXElement {\n if (props.hideLegend) {\n return <></>;\n }\n let legends: ILegend[];\n\n if (isStacked) {\n // Collect unique categories and their color\n const categoryMap: Record<string, string> = {};\n props.data.forEach((stage: IFunnelChartDataPoint) => {\n (stage.subValues || []).forEach(sub => {\n if (!(sub.category in categoryMap)) {\n categoryMap[sub.category] = sub.color;\n }\n });\n });\n legends = Object.entries(categoryMap).map(([category, color]) => ({\n title: category,\n color,\n hoverAction: () => setHoveredStage(category),\n onMouseOutAction: () => setHoveredStage(null),\n }));\n } else {\n legends = props.data.map((d: IFunnelChartDataPoint) => ({\n title: d.stage as string,\n color: d.color!,\n hoverAction: () => setHoveredStage(d.stage as string),\n onMouseOutAction: () => setHoveredStage(null),\n }));\n }\n\n return (\n <div style={{ display: 'flex', justifyContent: 'center' }}>\n <Legends\n ref={legendsRef}\n legends={legends}\n centerLegends={true}\n onChange={_onLegendSelectionChangeCallback}\n {...props.legendProps}\n />\n </div>\n );\n }\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n id: `toolTip${_tooltipId}`,\n target: refSelected,\n color: calloutData?.color,\n XValue: calloutData?.stage,\n YValue: calloutData?.value,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: () => {\n setIsCalloutVisible(false);\n },\n preventDismissOnLostFocus: true,\n ...props.calloutProps,\n };\n\n const width = props.width || 350;\n const height = props.height || 500;\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n className: props.className,\n chartWidth: width,\n chartHeight: height,\n });\n\n const funnelMarginTop = 40;\n const funnelWidth = width * 0.8;\n const funnelOffsetX = (width - funnelWidth) / 2;\n\n return !_isChartEmpty() ? (\n <div ref={chartContainerRef} className={classNames.root}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <svg width={width} height={height} className={classNames.chart} role={'img'} aria-label={props.chartTitle}>\n <g\n transform={\n isRTL\n ? `translate(${funnelOffsetX + funnelWidth}, ${funnelMarginTop}) scale(-1,1)`\n : `translate(${funnelOffsetX}, ${funnelMarginTop})`\n }\n >\n {isStacked\n ? _createStackedFunnel(height - funnelMarginTop, funnelWidth)\n : _createFunnel(height - funnelMarginTop, funnelWidth)}\n </g>\n {isCalloutVisible && (\n <Callout {...calloutProps}>\n <ChartHoverCard\n XValue={calloutProps?.XValue as string}\n YValue={calloutProps?.YValue}\n color={calloutProps?.color}\n />\n </Callout>\n )}\n </svg>\n </FocusZone>\n {_renderLegends()}\n </div>\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nFunnelChartBase.displayName = 'FunnelChart';\n"]}
1
+ {"version":3,"file":"FunnelChart.base.js","sourceRoot":"../src/","sources":["components/FunnelChart/FunnelChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,2DAAkF;AAOlF,qDAAsE;AACtE,0CAAsE;AACtE,uDAAuE;AACvE,gFAA+E;AAC/E,6DAAiE;AAEjE,yEAAyE;AACzE,uDAAiE;AACjE,mDAM0B;AAG1B,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA8C,CAAC;AAE1E,QAAA,eAAe,GAA+C,KAAK,CAAC,UAAU,CAGzF,UAAC,EAAsC,EAAE,YAAY;;IAAlD,IAAA,mBAAwB,EAAxB,WAAW,mBAAG,UAAU,KAAA,EAAK,KAAK,sBAApC,eAAsC,CAAF;IACrC,IAAM,UAAU,GAAW,IAAA,iBAAK,EAAC,uBAAuB,CAAC,CAAC;IAC1D,IAAM,aAAa,GAAW,IAAA,iBAAK,EAAC,oBAAoB,CAAC,CAAC;IAC1D,IAAM,KAAK,GAAG,IAAA,kBAAM,GAAE,CAAC;IA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5B,KAAK,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,GAC1B,CACM,CACX,CACG,CACI;QACX,cAAc,EAAE,CACb,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,uBAAe,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport {\n IFunnelChartDataPoint,\n IFunnelChartProps,\n IFunnelChartStyleProps,\n IFunnelChartStyles,\n} from './FunnelChart.types';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { ChartHoverCard } from '../../utilities/ChartHoverCard/ChartHoverCard';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { IImageExportOptions } from '../../types/index';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport { getContrastTextColor } from '../../utilities/utilities';\nimport {\n getHorizontalFunnelSegmentGeometry,\n getVerticalFunnelSegmentGeometry,\n getSegmentTextProps,\n getStackedHorizontalFunnelSegmentGeometry,\n getStackedVerticalFunnelSegmentGeometry,\n} from './funnelGeometry';\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<IFunnelChartStyleProps, IFunnelChartStyles>();\n\nexport const FunnelChartBase: React.FunctionComponent<IFunnelChartProps> = React.forwardRef<\n HTMLDivElement,\n IFunnelChartProps\n>(({ orientation = 'vertical', ...props }, forwardedRef) => {\n const _tooltipId: string = getId('FunnelChartTooltipId_');\n const _emptyChartId: string = getId('_FunnelChart_empty');\n const isRTL = getRTL();\n\n const [hoveredStage, setHoveredStage] = React.useState<string | null>(null);\n const [isCalloutVisible, setIsCalloutVisible] = React.useState(false);\n const [calloutData, setCalloutData] = React.useState<IFunnelChartDataPoint | null>(null);\n const [refSelected, setRefSelected] = React.useState<SVGElement | null>(null);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>([]);\n const chartContainerRef = React.useRef<HTMLDivElement | null>(null);\n const legendsRef = React.useRef<ILegendContainer | null>(null);\n const isStacked = isStackedFunnelData(props.data);\n\n React.useEffect(() => {\n if (props.legendProps?.selectedLegends) {\n setSelectedLegends(props.legendProps.selectedLegends);\n }\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: chartContainerRef ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return exportChartsAsImage(\n [{ container: chartContainerRef.current }],\n props.hideLegend ? undefined : legendsRef.current?.toSVG,\n getRTL(),\n opts,\n );\n },\n }),\n [props.hideLegend],\n );\n\n function _handleHover(data: IFunnelChartDataPoint, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent?.persist();\n setHoveredStage(data.stage as string);\n setCalloutData(data);\n setIsCalloutVisible(true);\n setRefSelected(mouseEvent.currentTarget);\n }\n\n function _handleFocus(data: IFunnelChartDataPoint, focusEvent: React.FocusEvent<SVGPathElement>) {\n focusEvent?.persist();\n setCalloutData(data);\n setIsCalloutVisible(true);\n setRefSelected(focusEvent.currentTarget);\n }\n\n function _handleStackedHover(\n stage: string,\n subValue: { category: string; value: number; color: string },\n mouseEvent: React.MouseEvent<SVGElement>,\n ) {\n mouseEvent?.persist();\n setHoveredStage(subValue.category);\n setCalloutData({\n stage,\n value: subValue.value,\n color: subValue.color,\n category: subValue.category,\n } as IFunnelChartDataPoint);\n setIsCalloutVisible(true);\n setRefSelected(mouseEvent.currentTarget);\n }\n\n function _handleStackedFocus(\n stage: string,\n subValue: { category: string; value: number; color: string },\n focusEvent: React.FocusEvent<SVGPathElement>,\n ) {\n focusEvent?.persist();\n setCalloutData({\n stage,\n value: subValue.value,\n color: subValue.color,\n category: subValue.category,\n } as IFunnelChartDataPoint);\n setIsCalloutVisible(true);\n setRefSelected(focusEvent.currentTarget);\n }\n\n function _handleMouseOut() {\n setHoveredStage(null);\n setIsCalloutVisible(false);\n setCalloutData(null);\n setRefSelected(null);\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _onLegendSelectionChangeCallback = React.useCallback(_onLegendSelectionChange, [props.legendProps]);\n\n function getHighlightedLegend(): string[] {\n return selectedLegends.length > 0 ? selectedLegends : hoveredStage ? [hoveredStage] : [];\n }\n\n function legendHighlighted(legend: string): boolean {\n return getHighlightedLegend().includes(legend);\n }\n\n function noLegendHighlighted(): boolean {\n return getHighlightedLegend().length === 0;\n }\n\n function _getEventHandlerProps(\n data: IFunnelChartDataPoint | { stage: string; subValue: { category: string; value: number; color: string } },\n opacity?: number,\n ) {\n if ('subValue' in data) {\n return {\n culture: props.culture,\n onMouseOver:\n opacity === 1\n ? (event: React.MouseEvent<SVGElement>) => _handleStackedHover(data.stage, data.subValue, event)\n : undefined,\n onMouseMove:\n opacity === 1\n ? (event: React.MouseEvent<SVGElement>) => _handleStackedHover(data.stage, data.subValue, event)\n : undefined,\n onFocus: (event: React.FocusEvent<SVGPathElement>) => _handleStackedFocus(data.stage, data.subValue, event),\n onBlur: () => _handleMouseOut(),\n onMouseOut: () => _handleMouseOut(),\n };\n } else {\n return {\n culture: props.culture,\n onMouseOver: opacity === 1 ? (event: React.MouseEvent<SVGElement>) => _handleHover(data, event) : undefined,\n onMouseMove: opacity === 1 ? (event: React.MouseEvent<SVGElement>) => _handleHover(data, event) : undefined,\n onFocus: (event: React.FocusEvent<SVGPathElement>) => _handleFocus(data, event),\n onBlur: () => _handleMouseOut(),\n onMouseOut: () => _handleMouseOut(),\n };\n }\n }\n\n function _renderSegmentText({\n show,\n x,\n y,\n value,\n textColor,\n }: {\n show: boolean;\n x: number;\n y: number;\n value: number;\n textColor: string;\n }) {\n if (!show) {\n return null;\n }\n\n const textElement = (\n <text x={isRTL ? funnelWidth - x : x} y={y} textAnchor=\"middle\" alignmentBaseline=\"middle\" fill={textColor}>\n {formatToLocaleString(value.toString(), props.culture) as React.ReactNode}\n </text>\n );\n\n if (isRTL) {\n return <g transform={`scale(-1,1) translate(${-funnelWidth},0)`}>{textElement}</g>;\n }\n return textElement;\n }\n\n function _renderFunnelSegment({\n key,\n pathD,\n fill,\n opacity,\n textProps,\n data,\n isFocusable,\n }: {\n key: string | number;\n pathD: string;\n fill: string;\n opacity: number;\n textProps?: {\n show: boolean;\n x: number;\n y: number;\n value: number;\n };\n data: IFunnelChartDataPoint | { stage: string; subValue: { category: string; value: number; color: string } };\n isFocusable?: boolean;\n }) {\n const eventHandlers = _getEventHandlerProps(data, opacity);\n const textColor = getContrastTextColor(fill, props.theme!);\n\n return (\n <g key={key}>\n <path d={pathD} fill={fill} opacity={opacity} {...eventHandlers} data-is-focusable={isFocusable} />\n {textProps && <g {...eventHandlers}>{_renderSegmentText({ ...textProps, textColor })}</g>}\n </g>\n );\n }\n\n function _createFunnel(containerHeight: number, containerWidth: number): JSXElement[] {\n const { data } = props;\n const funnelWidth = containerWidth;\n const funnelHeight = containerHeight * 0.8;\n\n return data.map((d, i) => {\n const geometryProps =\n orientation === 'vertical'\n ? getVerticalFunnelSegmentGeometry({ d, i, data, funnelWidth, funnelHeight, isRTL })\n : getHorizontalFunnelSegmentGeometry({ d, i, data, funnelWidth, funnelHeight, isRTL });\n\n const { pathD, textX, textY, availableWidth } = geometryProps;\n const minTextWidth = 16;\n const eventHandlerProps = _getEventHandlerProps(d);\n const textProps = getSegmentTextProps({\n availableWidth,\n minTextWidth,\n textX,\n textY,\n value: d.value!,\n ...eventHandlerProps,\n });\n\n return _renderFunnelSegment({\n key: i,\n pathD,\n fill: d.color!,\n opacity: legendHighlighted(d.stage as string) || noLegendHighlighted() ? 1 : 0.1,\n textProps,\n data: d,\n isFocusable: legendHighlighted(d.stage as string) || noLegendHighlighted() ? true : false,\n });\n });\n }\n\n function isStackedFunnelData(data: IFunnelChartDataPoint[]): boolean {\n return Array.isArray(data) && data.every(stage => Array.isArray(stage.subValues));\n }\n\n function _renderStackedSegment(\n stage: IFunnelChartDataPoint,\n subValue: { value: number; color: string; category: string },\n stageIndex: number,\n subValueIndex: number,\n geometryParams: {\n stages: IFunnelChartDataPoint[];\n totals: number[];\n maxTotal: number;\n funnelWidth: number;\n funnelHeight: number;\n isRTL: boolean;\n },\n ): JSXElement {\n // Ensure stages have subValues for geometry functions\n const stagesWithSubValues = geometryParams.stages.map(s => ({\n ...s,\n subValues: s.subValues || [],\n }));\n\n const geom =\n orientation === 'vertical'\n ? getStackedVerticalFunnelSegmentGeometry({\n ...geometryParams,\n stages: stagesWithSubValues,\n i: stageIndex,\n k: subValueIndex,\n })\n : getStackedHorizontalFunnelSegmentGeometry({\n ...geometryParams,\n stages: stagesWithSubValues,\n i: stageIndex,\n k: subValueIndex,\n });\n\n const minTextWidth = 16;\n const eventHandlerProps = _getEventHandlerProps({ stage: stage.stage as string, subValue });\n const textProps = getSegmentTextProps({\n availableWidth: geom.availableWidth,\n minTextWidth,\n textX: geom.textX,\n textY: geom.textY,\n value: subValue.value,\n ...eventHandlerProps,\n });\n\n return _renderFunnelSegment({\n key: `${stageIndex}-${subValueIndex}`,\n pathD: geom.pathD,\n fill: subValue.color,\n opacity:\n (isStackedFunnelData(props.data) && legendHighlighted(subValue.category)) || noLegendHighlighted() ? 1 : 0.1,\n textProps,\n data: { stage: stage.stage as string, subValue },\n isFocusable:\n (isStackedFunnelData(props.data) && legendHighlighted(subValue.category)) || noLegendHighlighted()\n ? true\n : false,\n });\n }\n\n function _createStackedFunnel(containerHeight: number, containerWidth: number): JSXElement[] {\n const { data } = props;\n\n const stages = data;\n const totals = stages.map(s => s?.subValues?.reduce((sum, subValue) => sum + subValue.value, 0) ?? 0);\n const maxTotal = Math.max(...totals);\n\n const funnelWidth = containerWidth;\n const funnelHeight = containerHeight * 0.8;\n\n const paths: JSXElement[] = [];\n\n const geometryParams = {\n stages,\n totals,\n maxTotal,\n funnelWidth,\n funnelHeight,\n isRTL,\n };\n\n for (let i = 0; i < stages.length; i++) {\n const cur = stages[i];\n for (let k = 0; k < (cur.subValues ?? []).length; k++) {\n const v = cur.subValues?.[k];\n if (!v) {\n continue;\n }\n paths.push(_renderStackedSegment(cur, v, i, k, geometryParams));\n }\n }\n return paths;\n }\n\n function _renderLegends(): JSXElement {\n if (props.hideLegend) {\n return <></>;\n }\n let legends: ILegend[];\n\n if (isStacked) {\n // Collect unique categories and their color\n const categoryMap: Record<string, string> = {};\n props.data.forEach((stage: IFunnelChartDataPoint) => {\n (stage.subValues || []).forEach(sub => {\n if (!(sub.category in categoryMap)) {\n categoryMap[sub.category] = sub.color;\n }\n });\n });\n legends = Object.entries(categoryMap).map(([category, color]) => ({\n title: category,\n color,\n hoverAction: () => setHoveredStage(category),\n onMouseOutAction: () => setHoveredStage(null),\n }));\n } else {\n legends = props.data.map((d: IFunnelChartDataPoint) => ({\n title: d.stage as string,\n color: d.color!,\n hoverAction: () => setHoveredStage(d.stage as string),\n onMouseOutAction: () => setHoveredStage(null),\n }));\n }\n\n return (\n <div style={{ display: 'flex', justifyContent: 'center' }}>\n <Legends\n ref={legendsRef}\n legends={legends}\n centerLegends={true}\n onChange={_onLegendSelectionChangeCallback}\n {...props.legendProps}\n />\n </div>\n );\n }\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n id: `toolTip${_tooltipId}`,\n target: refSelected,\n color: calloutData?.color,\n XValue: calloutData?.stage,\n YValue: calloutData?.value,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: () => {\n setIsCalloutVisible(false);\n },\n preventDismissOnLostFocus: true,\n ...props.calloutProps,\n };\n\n const width = props.width || 350;\n const height = props.height || 500;\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n className: props.className,\n chartWidth: width,\n chartHeight: height,\n });\n\n const funnelMarginTop = 40;\n const funnelWidth = width * 0.8;\n const funnelOffsetX = (width - funnelWidth) / 2;\n\n return !_isChartEmpty() ? (\n <div ref={chartContainerRef} className={classNames.root}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <svg width={width} height={height} className={classNames.chart} role={'img'} aria-label={props.chartTitle}>\n <g\n transform={\n isRTL\n ? `translate(${funnelOffsetX + funnelWidth}, ${funnelMarginTop}) scale(-1,1)`\n : `translate(${funnelOffsetX}, ${funnelMarginTop})`\n }\n >\n {isStacked\n ? _createStackedFunnel(height - funnelMarginTop, funnelWidth)\n : _createFunnel(height - funnelMarginTop, funnelWidth)}\n </g>\n {isCalloutVisible && (\n <Callout {...calloutProps}>\n <ChartHoverCard\n XValue={calloutProps?.XValue as string}\n YValue={calloutProps?.YValue}\n color={calloutProps?.color}\n />\n </Callout>\n )}\n </svg>\n </FocusZone>\n {_renderLegends()}\n </div>\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nFunnelChartBase.displayName = 'FunnelChart';\n"]}
@@ -281,7 +281,7 @@ exports.GanttChartBase = React.forwardRef(function (_a, forwardedRef) {
281
281
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
282
282
  var rectY = yScale(point.y) + (scaleBandwidth - _barHeight.current) / 2;
283
283
  var shouldHighlight = _noLegendHighlighted() || _legendHighlighted(point.legend);
284
- return (React.createElement("rect", { key: index, x: Math.min(rectStartX, rectEndX), y: rectY, width: Math.abs(rectEndX - rectStartX), height: _barHeight.current, rx: props.roundCorners ? 3 : 0, fill: props.enableGradient ? "url(#".concat(getGradientId(point.legend), ")") : point.color, opacity: shouldHighlight ? 1 : 0.1, onClick: point.onClick, onMouseOver: function (event) { return _onBarHover(point, event); }, onMouseLeave: _onBarLeave, onFocus: function (event) { return _onBarFocus(point, event); }, onBlur: _onBarLeave, "data-is-focusable": shouldHighlight, role: "img", "aria-label": _getAriaLabel(point) }));
284
+ return (React.createElement("rect", { key: index, x: Math.min(rectStartX, rectEndX), y: rectY, width: Math.max(Math.abs(rectEndX - rectStartX), 2), height: _barHeight.current, rx: props.roundCorners ? 3 : 0, fill: props.enableGradient ? "url(#".concat(getGradientId(point.legend), ")") : point.color, opacity: shouldHighlight ? 1 : 0.1, onClick: point.onClick, onMouseOver: function (event) { return _onBarHover(point, event); }, onMouseLeave: _onBarLeave, onFocus: function (event) { return _onBarFocus(point, event); }, onBlur: _onBarLeave, "data-is-focusable": shouldHighlight, role: "img", "aria-label": _getAriaLabel(point) }));
285
285
  });
286
286
  return (React.createElement("g", null,
287
287
  gradientDefs.length > 0 ? React.createElement("defs", null, gradientDefs) : null,