@fluentui/react-charts 9.3.6 → 9.3.8

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 (210) hide show
  1. package/CHANGELOG.md +46 -2
  2. package/dist/index.d.ts +70 -17
  3. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -16
  4. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
  5. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
  6. package/lib/components/AreaChart/AreaChart.js +3 -43
  7. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  8. package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
  9. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  10. package/lib/components/ChartTable/ChartTable.js +8 -11
  11. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  12. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  13. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +107 -67
  14. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  15. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +7 -1
  16. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
  17. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +7 -1
  18. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
  19. package/lib/components/CommonComponents/CartesianChart.js +52 -32
  20. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  21. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  22. package/lib/components/CommonComponents/ChartPopover.js +1 -2
  23. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  24. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +9 -7
  25. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  26. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +8 -5
  27. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  28. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  29. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -2
  30. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  31. package/lib/components/DeclarativeChart/DeclarativeChart.js +48 -25
  32. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  33. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +309 -209
  34. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  35. package/lib/components/DonutChart/DonutChart.js +9 -15
  36. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  37. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  38. package/lib/components/DonutChart/Pie/Pie.js +4 -2
  39. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  40. package/lib/components/FunnelChart/FunnelChart.js +8 -13
  41. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  42. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  43. package/lib/components/GanttChart/GanttChart.js +4 -17
  44. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  45. package/lib/components/GaugeChart/GaugeChart.js +8 -13
  46. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  47. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  48. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +24 -36
  49. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  50. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
  51. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  52. package/lib/components/HeatMapChart/HeatMapChart.js +3 -16
  53. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  54. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +5 -25
  55. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  56. package/lib/components/Legends/Legends.js +3 -4
  57. package/lib/components/Legends/Legends.js.map +1 -1
  58. package/lib/components/Legends/Legends.types.js.map +1 -1
  59. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  60. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  61. package/lib/components/LineChart/LineChart.js +68 -75
  62. package/lib/components/LineChart/LineChart.js.map +1 -1
  63. package/lib/components/LineChart/LineChart.types.js +1 -1
  64. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  65. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +3 -4
  66. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  67. package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
  68. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  69. package/lib/components/SankeyChart/SankeyChart.js +4 -10
  70. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  71. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  72. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
  73. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  74. package/lib/components/ScatterChart/ScatterChart.js +41 -49
  75. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  76. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  77. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
  78. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  79. package/lib/components/Sparkline/Sparkline.js +11 -7
  80. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  81. package/lib/components/VerticalBarChart/VerticalBarChart.js +15 -92
  82. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  83. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
  84. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  85. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +28 -49
  86. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  87. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
  88. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  89. package/lib/types/ChartAnnotation.js.map +1 -1
  90. package/lib/types/DataPoint.js.map +1 -1
  91. package/lib/utilities/Common.styles.js +0 -1
  92. package/lib/utilities/Common.styles.js.map +1 -1
  93. package/lib/utilities/Common.styles.raw.js +0 -1
  94. package/lib/utilities/Common.styles.raw.js.map +1 -1
  95. package/lib/utilities/FocusableTooltipText.js +1 -1
  96. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  97. package/lib/utilities/getWindow.js +0 -1
  98. package/lib/utilities/getWindow.js.map +1 -1
  99. package/lib/utilities/hooks.js +34 -0
  100. package/lib/utilities/hooks.js.map +1 -0
  101. package/lib/utilities/image-export-utils.js +118 -78
  102. package/lib/utilities/image-export-utils.js.map +1 -1
  103. package/lib/utilities/utilities.js +243 -102
  104. package/lib/utilities/utilities.js.map +1 -1
  105. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -16
  106. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
  107. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
  108. package/lib-commonjs/components/AreaChart/AreaChart.js +2 -41
  109. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  110. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +0 -2
  111. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  112. package/lib-commonjs/components/ChartTable/ChartTable.js +9 -11
  113. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  114. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  115. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +107 -67
  116. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  117. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +7 -1
  118. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
  119. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +7 -1
  120. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
  121. package/lib-commonjs/components/CommonComponents/CartesianChart.js +51 -31
  122. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  123. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  124. package/lib-commonjs/components/CommonComponents/ChartPopover.js +1 -2
  125. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  126. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +7 -6
  127. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  128. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +7 -4
  129. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  130. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  131. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -2
  132. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  133. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +48 -25
  134. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  135. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +309 -208
  136. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  137. package/lib-commonjs/components/DonutChart/DonutChart.js +7 -13
  138. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  139. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  140. package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -2
  141. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  142. package/lib-commonjs/components/FunnelChart/FunnelChart.js +7 -12
  143. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  144. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  145. package/lib-commonjs/components/GanttChart/GanttChart.js +3 -16
  146. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  147. package/lib-commonjs/components/GaugeChart/GaugeChart.js +7 -12
  148. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  149. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  150. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +22 -34
  151. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  152. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -2
  153. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  154. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +2 -15
  155. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  156. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -23
  157. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  158. package/lib-commonjs/components/Legends/Legends.js +3 -4
  159. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  160. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  161. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  162. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  163. package/lib-commonjs/components/LineChart/LineChart.js +67 -74
  164. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  165. package/lib-commonjs/components/LineChart/LineChart.types.js +1 -1
  166. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  167. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +2 -2
  168. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  169. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +0 -2
  170. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  171. package/lib-commonjs/components/SankeyChart/SankeyChart.js +4 -10
  172. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  173. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  174. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +0 -2
  175. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  176. package/lib-commonjs/components/ScatterChart/ScatterChart.js +38 -46
  177. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  178. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  179. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +0 -2
  180. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  181. package/lib-commonjs/components/Sparkline/Sparkline.js +11 -7
  182. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  183. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +14 -91
  184. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  185. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +0 -2
  186. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  187. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +26 -47
  188. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  189. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +0 -2
  190. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  191. package/lib-commonjs/types/ChartAnnotation.js.map +1 -1
  192. package/lib-commonjs/types/DataPoint.js.map +1 -1
  193. package/lib-commonjs/utilities/Common.styles.js +0 -1
  194. package/lib-commonjs/utilities/Common.styles.js.map +1 -1
  195. package/lib-commonjs/utilities/Common.styles.raw.js +0 -1
  196. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
  197. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  198. package/lib-commonjs/utilities/getWindow.js +0 -1
  199. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  200. package/lib-commonjs/utilities/hooks.js +45 -0
  201. package/lib-commonjs/utilities/hooks.js.map +1 -0
  202. package/lib-commonjs/utilities/image-export-utils.js +119 -79
  203. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  204. package/lib-commonjs/utilities/utilities.js +253 -101
  205. package/lib-commonjs/utilities/utilities.js.map +1 -1
  206. package/package.json +9 -9
  207. package/lib/components/DeclarativeChart/imageExporter.js +0 -223
  208. package/lib/components/DeclarativeChart/imageExporter.js.map +0 -1
  209. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +0 -233
  210. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/HeatMapChart/HeatMapChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { HeatMapChartProps } from './HeatMapChart.types';\nimport {\n AccessibilityProps,\n Chart,\n HeatMapChartData,\n HeatMapChartDataPoint,\n Margins,\n ImageExportOptions,\n} from '../../types/index';\nimport {\n ChartTypes,\n getAccessibleDataObject,\n getColorContrast,\n getTypeOfAxis,\n resolveCSSVariables,\n XAxisTypes,\n YAxisType,\n createNumericYAxis,\n IMargins,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n useRtl,\n sortAxisCategories,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { CartesianChart, ChartPopoverProps, ChildProps } from '../CommonComponents/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { useHeatMapChartStyles } from './useHeatMapChartStyles.styles';\nimport { Legend, Legends, LegendContainer } from '../Legends/index';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\nimport { toImage } from '../../utilities/image-export-utils';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = HeatMapChartDataPoint & {\n legend: string;\n};\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\n\nexport const HeatMapChart: React.FunctionComponent<HeatMapChartProps> = React.forwardRef<\n HTMLDivElement,\n HeatMapChartProps\n>(\n (\n props = {\n xAxisCategoryOrder: 'default',\n yAxisCategoryOrder: 'default',\n data: [],\n domainValuesForColorScale: [],\n rangeValuesForColorScale: [],\n },\n forwardedRef,\n ) => {\n const classes = useHeatMapChartStyles(props);\n const _stringXAxisDataPoints = React.useRef<string[]>([]);\n const _stringYAxisDataPoints = React.useRef<string[]>([]);\n const _dataSet = React.useRef<RectanglesGraphData>({});\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _colorScale = React.useRef<any>(undefined);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale = React.useRef<any>(undefined);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale = React.useRef<any>(undefined);\n const _xAxisType = React.useRef<XAxisTypes | undefined>(undefined);\n const _yAxisType = React.useRef<YAxisType | undefined>(undefined);\n const _calloutAnchorPoint = React.useRef<FlattenData | null>(null);\n const _emptyChartId = useId('_HeatMap_empty');\n const _margins = React.useRef<Margins>({});\n const cartesianChartRef = React.useRef<Chart>(null);\n const _legendsRef = React.useRef<LegendContainer>(null);\n const _isRtl = useRtl();\n\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [calloutTextColor, setCalloutTextColor] = React.useState<string>('');\n const [calloutYValue, setCalloutYValue] = React.useState<string>('');\n const [ratio, setRatio] = React.useState<[number, number]>();\n const [descriptionMessage, setDescriptionMessage] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(cartesianChartRef.current?.chartContainer, _legendsRef.current?.toSVG, _isRtl, opts);\n },\n }),\n [],\n );\n\n function _getMinMaxOfYAxis() {\n return { startValue: 0, endValue: 0 };\n }\n\n function _getDomainNRangeValues(\n points: HeatMapChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(_margins.current, width, isRTL);\n }\n return domainNRangeValue;\n }\n\n const _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n props.data.forEach((item: HeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n const _getMargins = (margins: Margins) => {\n _margins.current = margins;\n };\n\n const _getOpacity = (legendTitle: string): string => {\n const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n const _onRectFocus = (id: string, data: FlattenData, focusEvent: React.FocusEvent<SVGGElement>): void => {\n const boundingRect = focusEvent.currentTarget.getBoundingClientRect();\n const clientX = boundingRect.left + boundingRect.width / 2;\n const clientY = boundingRect.top + boundingRect.height / 2;\n updatePosition(clientX, clientY);\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value));\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n };\n\n const _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint.current !== data) {\n _calloutAnchorPoint.current = data;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(\n Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value),\n );\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n }\n };\n\n const _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint.current = null;\n setPopoverOpen(false);\n };\n\n const _getInvertedTextColor = (color: string): string => {\n return color === tokens.colorNeutralForeground1 ? tokens.colorNeutralBackground1 : tokens.colorNeutralForeground1;\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n const _createRectangles = (): React.ReactNode => {\n const rectangles: JSXElement[] = [];\n const yAxisDataPoints = _stringYAxisDataPoints.current.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string) => {\n let index = 0;\n _stringXAxisDataPoints.current.forEach((xAxisDataPoint: string) => {\n let rectElement: JSXElement;\n const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;\n if (\n _dataSet.current[yAxisDataPoint][index]?.x === xAxisDataPoint &&\n typeof _dataSet.current[yAxisDataPoint][index]?.value === 'number'\n ) {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n const dataPointObject = _dataSet.current[yAxisDataPoint][index];\n let styleRules = '';\n let foregroundColor = tokens.colorNeutralForeground1;\n if (cartesianChartRef.current?.chartContainer) {\n styleRules = resolveCSSVariables(cartesianChartRef.current.chartContainer, foregroundColor);\n }\n const contrastRatio = getColorContrast(styleRules, _colorScale.current(dataPointObject.value));\n if (contrastRatio < 3) {\n foregroundColor = _getInvertedTextColor(foregroundColor);\n }\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_legendHighlighted(dataPointObject.legend) || _noLegendHighlighted() ? 0 : -1}\n fillOpacity={_getOpacity(dataPointObject.legend)}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill={_colorScale.current(dataPointObject.value)}\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={classes.text}\n transform={`translate(${_xAxisScale.current.bandwidth() / 2}, ${\n _yAxisScale.current.bandwidth() / 2\n })`}\n fill={foregroundColor}\n >\n {formatToLocaleString(dataPointObject.rectText, props.culture, props.useUTC) as React.ReactNode}\n </text>\n </g>\n );\n index++;\n } else {\n const dataPointObject: FlattenData = {\n x: xAxisDataPoint,\n y: yAxisDataPoint,\n value: NaN,\n rectText: 'No data available',\n legend: '',\n };\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_noLegendHighlighted() ? 0 : -1}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill=\"transparent\"\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n />\n </g>\n );\n }\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n const _onLegendHover = (legendTitle: string): void => {\n setActiveLegend(legendTitle);\n };\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n const _onLegendLeave = (): void => {\n setActiveLegend('');\n };\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n const _onLegendClick = (legendTitle: string): void => {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (selectedLegend === legendTitle) {\n setSelectedLegend('');\n } else {\n setSelectedLegend(legendTitle);\n }\n };\n const _createLegendBars = (): JSXElement => {\n const { data, legendProps } = props;\n const legends: Legend[] = [];\n data.forEach((item: HeatMapChartData) => {\n const legend: Legend = {\n title: item.legend,\n color: _colorScale.current(item.value),\n action: () => {\n _onLegendClick(item.legend);\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} legendRef={_legendsRef} />;\n };\n\n const _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n const _getXIndex = (value: string | Date | number): string => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_xAxisType.current === XAxisTypes.StringAxis) {\n return value as string;\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n const _getYIndex = (value: string | Date | number): string => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_yAxisType.current === YAxisType.StringAxis) {\n return value as string;\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n const { xAxisStringFormatter } = props;\n const _getFormattedLabelForXAxisDataPoint = React.useCallback(\n (point: string): string => {\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n },\n [xAxisStringFormatter],\n );\n\n const { yAxisStringFormatter } = props;\n const _getFormattedLabelForYAxisDataPoint = React.useCallback(\n (point: string): string => {\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n },\n [yAxisStringFormatter],\n );\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n const _getXAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = _getOrderedXAxisLabels(points);\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return _getStringFormattedDate(xPoint, props.xAxisDateFormatString);\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return _getStringFormattedNumber(xPoint, props.xAxisNumberFormatString);\n } else {\n return _getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n },\n [\n _getFormattedLabelForXAxisDataPoint,\n props.sortOrder,\n props.xAxisDateFormatString,\n props.xAxisNumberFormatString,\n ],\n );\n\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n const _getYAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = _getOrderedYAxisLabels(points);\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return _getStringFormattedDate(yPoint, props.yAxisDateFormatString);\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return _getStringFormattedNumber(yPoint, props.yAxisNumberFormatString);\n } else {\n return _getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n },\n [\n _getFormattedLabelForYAxisDataPoint,\n props.sortOrder,\n props.yAxisDateFormatString,\n props.yAxisNumberFormatString,\n ],\n );\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n const _createNewDataSet = React.useCallback(\n (\n data: HeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: HeatMapChartData) => {\n item.data.forEach((point: HeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = _getXIndex(item.x);\n const posY = _getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item] = _getOrderedXPoints(yPoints[item]);\n\n yPoints[item].forEach((datapoint: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n datapoint.x = _getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (_xAxisType.current === XAxisTypes.NumericAxis) {\n datapoint.x = _getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n datapoint.x = _getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (_yAxisType.current === YAxisType.DateAxis) {\n datapoint.y = _getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (_yAxisType.current === YAxisType.NumericAxis) {\n datapoint.y = _getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (_yAxisType.current === YAxisType.StringAxis) {\n datapoint.y = _getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable _stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `_createRectangles` should work perfetcly while looping, and if we don't change\n * then `_createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n yPoints[_getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n yPoints[`${_getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[_getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = _getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = _getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n },\n [\n _getFormattedLabelForXAxisDataPoint,\n _getFormattedLabelForYAxisDataPoint,\n _getXAxisDataPoints,\n _getYAxisDataPoints,\n props.sortOrder,\n ],\n );\n\n const _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n const _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n const _legendHighlighted = (legendTitle: string) => {\n return selectedLegend === legendTitle || (selectedLegend === '' && activeLegend === legendTitle);\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = () => {\n return selectedLegend === '' && activeLegend === '';\n };\n\n const _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n const _isChartEmpty = (): boolean => {\n return !(props.data && props.data.length > 0);\n };\n\n const _getChartTitle = (): string => {\n const { chartTitle } = props;\n const numDataPoints = props.data.reduce((acc, curr) => acc + curr.data.length, 0);\n return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;\n };\n\n const _getOrderedXAxisLabels = (points: { [key: string]: '1' }) => {\n if (!_shouldOrderXAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis || _xAxisType.current === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(_mapCategoryToValues(), props.xAxisCategoryOrder);\n };\n\n const _getOrderedYAxisLabels = (points: { [key: string]: '1' }) => {\n if (!_shouldOrderYAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (_yAxisType.current === YAxisType.DateAxis || _yAxisType.current === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(_mapCategoryToValues(true), props.yAxisCategoryOrder);\n };\n\n const _getOrderedXPoints = (xPoints: FlattenData[]) => {\n if (!_shouldOrderXAxisLabelsByCategoryOrder()) {\n return xPoints.sort((a: HeatMapChartDataPoint, b: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n return props.sortOrder === 'none'\n ? 0\n : (a.x as string).toLowerCase() > (b.x as string).toLowerCase()\n ? 1\n : -1;\n } else if (_xAxisType.current === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n });\n }\n\n const result: FlattenData[] = [];\n\n const xValueToPoints: Record<string, FlattenData[]> = {};\n xPoints.forEach(point => {\n const xValue = point.x as string;\n if (!xValueToPoints[xValue]) {\n xValueToPoints[xValue] = [];\n }\n xValueToPoints[xValue].push(point);\n });\n\n const xAxisLabels = _getOrderedXAxisLabels({});\n xAxisLabels.forEach(xValue => {\n if (xValueToPoints[xValue]) {\n result.push(...xValueToPoints[xValue]);\n }\n });\n\n return result;\n };\n\n const _shouldOrderXAxisLabelsByCategoryOrder = () => {\n return _xAxisType.current === XAxisTypes.StringAxis && props.xAxisCategoryOrder !== 'default';\n };\n\n const _shouldOrderYAxisLabelsByCategoryOrder = () => {\n return _yAxisType.current === YAxisType.StringAxis && props.yAxisCategoryOrder !== 'default';\n };\n\n const _mapCategoryToValues = (isYAxis = false) => {\n const categoryToValues: Record<string, number[]> = {};\n props.data.forEach(item => {\n item.data.forEach(point => {\n const category = (isYAxis ? point.y : point.x) as string;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n categoryToValues[category].push(point.value);\n });\n });\n return categoryToValues;\n };\n\n const updatePosition = (newX: number, newY: number) => {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n }\n };\n\n const { x, y } = _getXandY();\n _xAxisType.current = getTypeOfAxis(x, true) as XAxisTypes;\n _yAxisType.current = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n props;\n _colorScale.current = _getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = React.useMemo(\n () =>\n _createNewDataSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ),\n [\n _createNewDataSet,\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ],\n );\n _dataSet.current = dataSet;\n _stringYAxisDataPoints.current = yAxisPoints;\n _stringXAxisDataPoints.current = xAxisPoints;\n const calloutProps: ChartPopoverProps = {\n ...props.calloutProps,\n isPopoverOpen,\n YValue: calloutYValue,\n legend: calloutLegend,\n color: calloutTextColor,\n ratio,\n descriptionMessage,\n clickPosition,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n styles: {\n calloutContentRoot: classes.calloutContentRoot!,\n },\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n createYAxis={createNumericYAxis}\n datasetForXAxisDomain={_stringXAxisDataPoints.current}\n stringDatasetForYAxisDomain={_stringYAxisDataPoints.current}\n createStringYAxis={createStringYAxis}\n getDomainNRangeValues={_getDomainNRangeValues}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n getmargins={_getMargins}\n xAxisTickCount={_stringXAxisDataPoints.current.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n legendBars={_createLegendBars()}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n tickParams={tickParams}\n /* eslint-disable react/jsx-no-bind */\n children={(p: ChildProps) => {\n _xAxisScale.current = p.xScale;\n _yAxisScale.current = p.yScalePrimary;\n return _createRectangles();\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\n"],"names":["React","ChartTypes","getAccessibleDataObject","getColorContrast","getTypeOfAxis","resolveCSSVariables","XAxisTypes","YAxisType","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","useRtl","sortAxisCategories","formatToLocaleString","CartesianChart","useId","tokens","useHeatMapChartStyles","Legends","scaleLinear","d3ScaleLinear","format","d3Format","timeFormat","d3TimeFormat","toImage","HeatMapChart","forwardRef","props","xAxisCategoryOrder","yAxisCategoryOrder","data","domainValuesForColorScale","rangeValuesForColorScale","forwardedRef","classes","_stringXAxisDataPoints","useRef","_stringYAxisDataPoints","_dataSet","_colorScale","undefined","_xAxisScale","_yAxisScale","_xAxisType","_yAxisType","_calloutAnchorPoint","_emptyChartId","_margins","cartesianChartRef","_legendsRef","_isRtl","selectedLegend","setSelectedLegend","useState","activeLegend","setActiveLegend","isPopoverOpen","setPopoverOpen","calloutLegend","setCalloutLegend","calloutTextColor","setCalloutTextColor","calloutYValue","setCalloutYValue","ratio","setRatio","descriptionMessage","setDescriptionMessage","callOutAccessibilityData","setCallOutAccessibilityData","clickPosition","setClickPosition","x","y","useImperativeHandle","componentRef","chartContainer","current","opts","toSVG","_getMinMaxOfYAxis","startValue","endValue","_getDomainNRangeValues","points","margins","width","chartType","isRTL","xAxisType","barWidth","tickValues","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","_getXandY","forEach","item","length","_getMargins","_getOpacity","legendTitle","opacity","_legendHighlighted","_noLegendHighlighted","_onRectFocus","id","focusEvent","boundingRect","currentTarget","getBoundingClientRect","clientX","left","clientY","top","height","updatePosition","legend","rectText","Number","isNaN","value","colorNeutralForeground1","_onRectMouseOver","mouseEvent","persist","_onRectBlurOrMouseOut","_handleChartMouseLeave","_getInvertedTextColor","color","colorNeutralBackground1","_createRectangles","rectangles","yAxisDataPoints","slice","reverse","yAxisDataPoint","index","xAxisDataPoint","rectElement","dataPointObject","styleRules","foregroundColor","contrastRatio","g","key","role","aria-label","_getAriaLabel","tabIndex","fillOpacity","transform","onFocus","e","onBlur","onMouseOver","onMouseOut","rect","fill","bandwidth","onClick","text","dominantBaseline","textAnchor","className","culture","useUTC","NaN","push","_onLegendHover","_onLegendLeave","_onLegendClick","_createLegendBars","legendProps","legends","title","action","hoverAction","onMouseOutAction","legendRef","_getColorScale","domain","range","_getXIndex","getTime","StringAxis","_getYIndex","xAxisStringFormatter","_getFormattedLabelForXAxisDataPoint","useCallback","point","yAxisStringFormatter","_getFormattedLabelForYAxisDataPoint","_getXAxisDataPoints","xAxisPoints","unFormattedXAxisDataPoints","_getOrderedXAxisLabels","map","xPoint","_getStringFormattedDate","xAxisDateFormatString","_getStringFormattedNumber","xAxisNumberFormatString","sortOrder","_getYAxisDataPoints","yAxisPoints","unFormattedYAxisDataPoints","_getOrderedYAxisLabels","yPoint","yAxisDateFormatString","yAxisNumberFormatString","_createNewDataSet","flattenData","yPoints","uniqueYPoints","uniqueXPoints","posX","posY","Object","keys","_getOrderedXPoints","datapoint","dataSet","formatString","date","Date","setTime","xValue","yValue","zValue","description","ariaLabel","_isChartEmpty","_getChartTitle","chartTitle","numDataPoints","reduce","acc","curr","_shouldOrderXAxisLabelsByCategoryOrder","sort","a","b","toLowerCase","_mapCategoryToValues","_shouldOrderYAxisLabelsByCategoryOrder","xPoints","result","xValueToPoints","xAxisLabels","isYAxis","categoryToValues","category","newX","newY","threshold","distance","Math","sqrt","pow","useMemo","calloutProps","YValue","styles","calloutContentRoot","tickParams","tickFormat","yAxisType","createYAxis","datasetForXAxisDomain","stringDatasetForYAxisDomain","getDomainNRangeValues","getMinMaxOfYAxis","getmargins","xAxisTickCount","xAxistickSize","xAxisPadding","yAxisPadding","legendBars","onChartMouseLeave","children","p","xScale","yScalePrimary","div","style"],"mappings":"AAAA;;;;;+BAkDa0B;;;;;;;iEAhDU,QAAQ;uBAyBxB,wBAAwB;gCACM,4BAA4B;wBACH,4BAA4B;gCACpE,4BAA4B;4BAE3B,wBAAwB;6CACT,iCAAiC;wBACtB,mBAAmB;yBACvB,WAAW;0BACrB,YAAY;8BACJ,iBAAiB;kCACpC,qCAAqC;AAYtD,qBAAMA,WAAAA,GAA2D1B,OAAM2B,UAAU,CAItF,CACEC,QAAQ;IACNC,oBAAoB;IACpBC,oBAAoB;IACpBC,MAAM,EAAE;IACRC,2BAA2B,EAAE;IAC7BC,0BAA0B,EAAE;AAC9B,CAAC,EACDC;IAEA,MAAMC,cAAUlB,kDAAAA,EAAsBW;IACtC,MAAMQ,yBAAyBpC,OAAMqC,MAAM,CAAW,EAAE;IACxD,MAAMC,yBAAyBtC,OAAMqC,MAAM,CAAW,EAAE;IACxD,MAAME,WAAWvC,OAAMqC,MAAM,CAAsB,CAAC;IACpD,8DAA8D;IAC9D,MAAMG,cAAcxC,OAAMqC,MAAM,CAAMI;IACtC,8DAA8D;IAC9D,MAAMC,cAAc1C,OAAMqC,MAAM,CAAMI;IACtC,8DAA8D;IAC9D,MAAME,cAAc3C,OAAMqC,MAAM,CAAMI;IACtC,MAAMG,aAAa5C,OAAMqC,MAAM,CAAyBI;IACxD,MAAMI,aAAa7C,OAAMqC,MAAM,CAAwBI;IACvD,MAAMK,sBAAsB9C,OAAMqC,MAAM,CAAqB;IAC7D,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UAAU;IAC9B;IACA,OAAO,CAAClC,kBAAAA,WAAAA,GACN,OAAA,aAAA,CAAC/N,sBAAAA,EAAAA;QACE,GAAGc,KAAK;QACTmN,YAAYD;QACZzJ,QAAQtD;QACRyD,WAAWvF,iBAAAA,CAAWyB,YAAY;QAClCgE,WAAWpF,iBAAAA,CAAWwL,UAAU;QAChCkF,WAAWzQ,gBAAAA,CAAUuL,UAAU;QAC/B4E,cAAcA;QACdO,aAAazQ,yBAAAA;QACb0Q,uBAAuB9O,uBAAuB0C,OAAO;QACrDqM,6BAA6B7O,uBAAuBwC,OAAO;QAC3DpE,mBAAmBA,wBAAAA;QACnB0Q,uBAAuBhM;QACvBiM,kBAAkBpM;QAClBqM,YAAY9K;QACZ+K,gBAAgBnP,uBAAuB0C,OAAO,CAACyB,MAAM;QACrDiL,eAAe;QACfC,cAAc;QACdC,cAAc;QACdC,YAAY1G;QACZ2G,mBAAmBxJ;QACnBxD,cAAc3B;QACd6N,YAAYA;QACZ,oCAAoC,GACpCe,UAAU,CAACC;YACTpP,YAAYoC,OAAO,GAAGgN,EAAEC,MAAM;YAC9BpP,YAAYmC,OAAO,GAAGgN,EAAEE,aAAa;YACrC,OAAOxJ;QACT;uBAGF,OAAA,aAAA,CAACyJ,OAAAA;QAAIlL,IAAIhE;QAAewG,MAAM;QAAS2I,OAAO;YAAEvL,SAAS;QAAI;QAAG6C,cAAY;;AAEhF,GACA"}
1
+ {"version":3,"sources":["../src/components/HeatMapChart/HeatMapChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { HeatMapChartProps } from './HeatMapChart.types';\nimport { AccessibilityProps, HeatMapChartData, HeatMapChartDataPoint, Margins } from '../../types/index';\nimport {\n ChartTypes,\n getAccessibleDataObject,\n getColorContrast,\n getTypeOfAxis,\n resolveCSSVariables,\n XAxisTypes,\n YAxisType,\n createNumericYAxis,\n IMargins,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n sortAxisCategories,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { CartesianChart, ChartPopoverProps, ChildProps } from '../CommonComponents/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { useHeatMapChartStyles } from './useHeatMapChartStyles.styles';\nimport { Legend, Legends } from '../Legends/index';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\nimport { useImageExport } from '../../utilities/hooks';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = HeatMapChartDataPoint & {\n legend: string;\n};\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\n\nexport const HeatMapChart: React.FunctionComponent<HeatMapChartProps> = React.forwardRef<\n HTMLDivElement,\n HeatMapChartProps\n>(\n (\n props = {\n xAxisCategoryOrder: 'default',\n yAxisCategoryOrder: 'default',\n data: [],\n domainValuesForColorScale: [],\n rangeValuesForColorScale: [],\n },\n forwardedRef,\n ) => {\n const classes = useHeatMapChartStyles(props);\n const _stringXAxisDataPoints = React.useRef<string[]>([]);\n const _stringYAxisDataPoints = React.useRef<string[]>([]);\n const _dataSet = React.useRef<RectanglesGraphData>({});\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _colorScale = React.useRef<any>(undefined);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale = React.useRef<any>(undefined);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale = React.useRef<any>(undefined);\n const _xAxisType = React.useRef<XAxisTypes | undefined>(undefined);\n const _yAxisType = React.useRef<YAxisType | undefined>(undefined);\n const _calloutAnchorPoint = React.useRef<FlattenData | null>(null);\n const _emptyChartId = useId('_HeatMap_empty');\n const _margins = React.useRef<Margins>({});\n const { cartesianChartRef, legendsRef: _legendsRef } = useImageExport(props.componentRef, props.hideLegend);\n\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [calloutTextColor, setCalloutTextColor] = React.useState<string>('');\n const [calloutYValue, setCalloutYValue] = React.useState<string>('');\n const [ratio, setRatio] = React.useState<[number, number]>();\n const [descriptionMessage, setDescriptionMessage] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n\n function _getMinMaxOfYAxis() {\n return { startValue: 0, endValue: 0 };\n }\n\n function _getDomainNRangeValues(\n points: HeatMapChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(_margins.current, width, isRTL);\n }\n return domainNRangeValue;\n }\n\n const _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n props.data.forEach((item: HeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n const _getMargins = (margins: Margins) => {\n _margins.current = margins;\n };\n\n const _getOpacity = (legendTitle: string): string => {\n const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n const _onRectFocus = (id: string, data: FlattenData, focusEvent: React.FocusEvent<SVGGElement>): void => {\n const boundingRect = focusEvent.currentTarget.getBoundingClientRect();\n const clientX = boundingRect.left + boundingRect.width / 2;\n const clientY = boundingRect.top + boundingRect.height / 2;\n updatePosition(clientX, clientY);\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value));\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n };\n\n const _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint.current !== data) {\n _calloutAnchorPoint.current = data;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(\n Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value),\n );\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n }\n };\n\n const _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint.current = null;\n setPopoverOpen(false);\n };\n\n const _getInvertedTextColor = (color: string): string => {\n return color === tokens.colorNeutralForeground1 ? tokens.colorNeutralBackground1 : tokens.colorNeutralForeground1;\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n const _createRectangles = (): React.ReactNode => {\n const rectangles: JSXElement[] = [];\n const yAxisDataPoints = _stringYAxisDataPoints.current.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string) => {\n let index = 0;\n _stringXAxisDataPoints.current.forEach((xAxisDataPoint: string) => {\n let rectElement: JSXElement;\n const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;\n if (\n _dataSet.current[yAxisDataPoint][index]?.x === xAxisDataPoint &&\n typeof _dataSet.current[yAxisDataPoint][index]?.value === 'number'\n ) {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n const dataPointObject = _dataSet.current[yAxisDataPoint][index];\n let styleRules = '';\n let foregroundColor = tokens.colorNeutralForeground1;\n if (cartesianChartRef.current?.chartContainer) {\n styleRules = resolveCSSVariables(cartesianChartRef.current.chartContainer, foregroundColor);\n }\n const contrastRatio = getColorContrast(styleRules, _colorScale.current(dataPointObject.value));\n if (contrastRatio < 3) {\n foregroundColor = _getInvertedTextColor(foregroundColor);\n }\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_legendHighlighted(dataPointObject.legend) || _noLegendHighlighted() ? 0 : -1}\n fillOpacity={_getOpacity(dataPointObject.legend)}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill={_colorScale.current(dataPointObject.value)}\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={classes.text}\n transform={`translate(${_xAxisScale.current.bandwidth() / 2}, ${\n _yAxisScale.current.bandwidth() / 2\n })`}\n fill={foregroundColor}\n >\n {formatToLocaleString(dataPointObject.rectText, props.culture, props.useUTC) as React.ReactNode}\n </text>\n </g>\n );\n index++;\n } else {\n const dataPointObject: FlattenData = {\n x: xAxisDataPoint,\n y: yAxisDataPoint,\n value: NaN,\n rectText: 'No data available',\n legend: '',\n };\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_noLegendHighlighted() ? 0 : -1}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill=\"transparent\"\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n />\n </g>\n );\n }\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n const _onLegendHover = (legendTitle: string): void => {\n setActiveLegend(legendTitle);\n };\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n const _onLegendLeave = (): void => {\n setActiveLegend('');\n };\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n const _onLegendClick = (legendTitle: string): void => {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (selectedLegend === legendTitle) {\n setSelectedLegend('');\n } else {\n setSelectedLegend(legendTitle);\n }\n };\n const _createLegendBars = (): JSXElement => {\n const { data, legendProps } = props;\n const legends: Legend[] = [];\n data.forEach((item: HeatMapChartData) => {\n const legend: Legend = {\n title: item.legend,\n color: _colorScale.current(item.value),\n action: () => {\n _onLegendClick(item.legend);\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} legendRef={_legendsRef} />;\n };\n\n const _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n const _getXIndex = (value: string | Date | number): string => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_xAxisType.current === XAxisTypes.StringAxis) {\n return value as string;\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n const _getYIndex = (value: string | Date | number): string => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_yAxisType.current === YAxisType.StringAxis) {\n return value as string;\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n const { xAxisStringFormatter } = props;\n const _getFormattedLabelForXAxisDataPoint = React.useCallback(\n (point: string): string => {\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n },\n [xAxisStringFormatter],\n );\n\n const { yAxisStringFormatter } = props;\n const _getFormattedLabelForYAxisDataPoint = React.useCallback(\n (point: string): string => {\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n },\n [yAxisStringFormatter],\n );\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n const _getXAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = _getOrderedXAxisLabels(points);\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return _getStringFormattedDate(xPoint, props.xAxisDateFormatString);\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return _getStringFormattedNumber(xPoint, props.xAxisNumberFormatString);\n } else {\n return _getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n },\n [\n _getFormattedLabelForXAxisDataPoint,\n props.sortOrder,\n props.xAxisDateFormatString,\n props.xAxisNumberFormatString,\n ],\n );\n\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n const _getYAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = _getOrderedYAxisLabels(points);\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return _getStringFormattedDate(yPoint, props.yAxisDateFormatString);\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return _getStringFormattedNumber(yPoint, props.yAxisNumberFormatString);\n } else {\n return _getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n },\n [\n _getFormattedLabelForYAxisDataPoint,\n props.sortOrder,\n props.yAxisDateFormatString,\n props.yAxisNumberFormatString,\n ],\n );\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n const _createNewDataSet = React.useCallback(\n (\n data: HeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: HeatMapChartData) => {\n item.data.forEach((point: HeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = _getXIndex(item.x);\n const posY = _getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item] = _getOrderedXPoints(yPoints[item]);\n\n yPoints[item].forEach((datapoint: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n datapoint.x = _getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (_xAxisType.current === XAxisTypes.NumericAxis) {\n datapoint.x = _getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n datapoint.x = _getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (_yAxisType.current === YAxisType.DateAxis) {\n datapoint.y = _getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (_yAxisType.current === YAxisType.NumericAxis) {\n datapoint.y = _getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (_yAxisType.current === YAxisType.StringAxis) {\n datapoint.y = _getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable _stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `_createRectangles` should work perfetcly while looping, and if we don't change\n * then `_createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n yPoints[_getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n yPoints[`${_getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[_getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = _getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = _getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n },\n [\n _getFormattedLabelForXAxisDataPoint,\n _getFormattedLabelForYAxisDataPoint,\n _getXAxisDataPoints,\n _getYAxisDataPoints,\n props.sortOrder,\n ],\n );\n\n const _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n const _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n const _legendHighlighted = (legendTitle: string) => {\n return selectedLegend === legendTitle || (selectedLegend === '' && activeLegend === legendTitle);\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = () => {\n return selectedLegend === '' && activeLegend === '';\n };\n\n const _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n const _isChartEmpty = (): boolean => {\n return !(props.data && props.data.length > 0);\n };\n\n const _getChartTitle = (): string => {\n const { chartTitle } = props;\n const numDataPoints = props.data.reduce((acc, curr) => acc + curr.data.length, 0);\n return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;\n };\n\n const _getOrderedXAxisLabels = (points: { [key: string]: '1' }) => {\n if (!_shouldOrderXAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis || _xAxisType.current === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(_mapCategoryToValues(), props.xAxisCategoryOrder);\n };\n\n const _getOrderedYAxisLabels = (points: { [key: string]: '1' }) => {\n if (!_shouldOrderYAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (_yAxisType.current === YAxisType.DateAxis || _yAxisType.current === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(_mapCategoryToValues(true), props.yAxisCategoryOrder);\n };\n\n const _getOrderedXPoints = (xPoints: FlattenData[]) => {\n if (!_shouldOrderXAxisLabelsByCategoryOrder()) {\n return xPoints.sort((a: HeatMapChartDataPoint, b: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n return props.sortOrder === 'none'\n ? 0\n : (a.x as string).toLowerCase() > (b.x as string).toLowerCase()\n ? 1\n : -1;\n } else if (_xAxisType.current === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n });\n }\n\n const result: FlattenData[] = [];\n\n const xValueToPoints: Record<string, FlattenData[]> = {};\n xPoints.forEach(point => {\n const xValue = point.x as string;\n if (!xValueToPoints[xValue]) {\n xValueToPoints[xValue] = [];\n }\n xValueToPoints[xValue].push(point);\n });\n\n const xAxisLabels = _getOrderedXAxisLabels({});\n xAxisLabels.forEach(xValue => {\n if (xValueToPoints[xValue]) {\n result.push(...xValueToPoints[xValue]);\n }\n });\n\n return result;\n };\n\n const _shouldOrderXAxisLabelsByCategoryOrder = () => {\n return _xAxisType.current === XAxisTypes.StringAxis && props.xAxisCategoryOrder !== 'default';\n };\n\n const _shouldOrderYAxisLabelsByCategoryOrder = () => {\n return _yAxisType.current === YAxisType.StringAxis && props.yAxisCategoryOrder !== 'default';\n };\n\n const _mapCategoryToValues = (isYAxis = false) => {\n const categoryToValues: Record<string, number[]> = {};\n props.data.forEach(item => {\n item.data.forEach(point => {\n const category = (isYAxis ? point.y : point.x) as string;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n categoryToValues[category].push(point.value);\n });\n });\n return categoryToValues;\n };\n\n const updatePosition = (newX: number, newY: number) => {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n }\n };\n\n const { x, y } = _getXandY();\n _xAxisType.current = getTypeOfAxis(x, true) as XAxisTypes;\n _yAxisType.current = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n props;\n _colorScale.current = _getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = React.useMemo(\n () =>\n _createNewDataSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ),\n [\n _createNewDataSet,\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ],\n );\n _dataSet.current = dataSet;\n _stringYAxisDataPoints.current = yAxisPoints;\n _stringXAxisDataPoints.current = xAxisPoints;\n const calloutProps: ChartPopoverProps = {\n ...props.calloutProps,\n isPopoverOpen,\n YValue: calloutYValue,\n legend: calloutLegend,\n color: calloutTextColor,\n ratio,\n descriptionMessage,\n clickPosition,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n styles: {\n calloutContentRoot: classes.calloutContentRoot!,\n },\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n createYAxis={createNumericYAxis}\n datasetForXAxisDomain={_stringXAxisDataPoints.current}\n stringDatasetForYAxisDomain={_stringYAxisDataPoints.current}\n createStringYAxis={createStringYAxis}\n getDomainNRangeValues={_getDomainNRangeValues}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n getmargins={_getMargins}\n xAxisTickCount={_stringXAxisDataPoints.current.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n legendBars={_createLegendBars()}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n tickParams={tickParams}\n /* eslint-disable react/jsx-no-bind */\n children={(p: ChildProps) => {\n _xAxisScale.current = p.xScale;\n _yAxisScale.current = p.yScalePrimary;\n return _createRectangles();\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\n"],"names":["React","ChartTypes","getAccessibleDataObject","getColorContrast","getTypeOfAxis","resolveCSSVariables","XAxisTypes","YAxisType","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","sortAxisCategories","formatToLocaleString","CartesianChart","useId","tokens","useHeatMapChartStyles","Legends","scaleLinear","d3ScaleLinear","format","d3Format","timeFormat","d3TimeFormat","useImageExport","HeatMapChart","forwardRef","props","xAxisCategoryOrder","yAxisCategoryOrder","data","domainValuesForColorScale","rangeValuesForColorScale","forwardedRef","classes","_stringXAxisDataPoints","useRef","_stringYAxisDataPoints","_dataSet","_colorScale","undefined","_xAxisScale","_yAxisScale","_xAxisType","_yAxisType","_calloutAnchorPoint","_emptyChartId","_margins","cartesianChartRef","legendsRef","_legendsRef","componentRef","hideLegend","selectedLegend","setSelectedLegend","useState","activeLegend","setActiveLegend","isPopoverOpen","setPopoverOpen","calloutLegend","setCalloutLegend","calloutTextColor","setCalloutTextColor","calloutYValue","setCalloutYValue","ratio","setRatio","descriptionMessage","setDescriptionMessage","callOutAccessibilityData","setCallOutAccessibilityData","clickPosition","setClickPosition","x","y","_getMinMaxOfYAxis","startValue","endValue","_getDomainNRangeValues","points","margins","width","chartType","isRTL","xAxisType","barWidth","tickValues","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","current","_getXandY","forEach","item","length","_getMargins","_getOpacity","legendTitle","opacity","_legendHighlighted","_noLegendHighlighted","_onRectFocus","id","focusEvent","boundingRect","currentTarget","getBoundingClientRect","clientX","left","clientY","top","height","updatePosition","legend","rectText","Number","isNaN","value","colorNeutralForeground1","_onRectMouseOver","mouseEvent","persist","_onRectBlurOrMouseOut","_handleChartMouseLeave","_getInvertedTextColor","color","colorNeutralBackground1","_createRectangles","rectangles","yAxisDataPoints","slice","reverse","yAxisDataPoint","index","xAxisDataPoint","rectElement","dataPointObject","styleRules","foregroundColor","chartContainer","contrastRatio","g","key","role","aria-label","_getAriaLabel","tabIndex","fillOpacity","transform","onFocus","e","onBlur","onMouseOver","onMouseOut","rect","fill","bandwidth","onClick","text","dominantBaseline","textAnchor","className","culture","useUTC","NaN","push","_onLegendHover","_onLegendLeave","_onLegendClick","_createLegendBars","legendProps","legends","title","action","hoverAction","onMouseOutAction","legendRef","_getColorScale","domain","range","_getXIndex","getTime","StringAxis","_getYIndex","xAxisStringFormatter","_getFormattedLabelForXAxisDataPoint","useCallback","point","yAxisStringFormatter","_getFormattedLabelForYAxisDataPoint","_getXAxisDataPoints","xAxisPoints","unFormattedXAxisDataPoints","_getOrderedXAxisLabels","map","xPoint","_getStringFormattedDate","xAxisDateFormatString","_getStringFormattedNumber","xAxisNumberFormatString","sortOrder","_getYAxisDataPoints","yAxisPoints","unFormattedYAxisDataPoints","_getOrderedYAxisLabels","yPoint","yAxisDateFormatString","yAxisNumberFormatString","_createNewDataSet","flattenData","yPoints","uniqueYPoints","uniqueXPoints","posX","posY","Object","keys","_getOrderedXPoints","datapoint","dataSet","formatString","date","Date","setTime","xValue","yValue","zValue","description","ariaLabel","_isChartEmpty","_getChartTitle","chartTitle","numDataPoints","reduce","acc","curr","_shouldOrderXAxisLabelsByCategoryOrder","sort","a","b","toLowerCase","_mapCategoryToValues","_shouldOrderYAxisLabelsByCategoryOrder","xPoints","result","xValueToPoints","xAxisLabels","isYAxis","categoryToValues","category","newX","newY","threshold","distance","Math","sqrt","pow","useMemo","calloutProps","YValue","styles","calloutContentRoot","tickParams","tickFormat","yAxisType","createYAxis","datasetForXAxisDomain","stringDatasetForYAxisDomain","getDomainNRangeValues","getMinMaxOfYAxis","getmargins","xAxisTickCount","xAxistickSize","xAxisPadding","yAxisPadding","legendBars","onChartMouseLeave","children","p","xScale","yScalePrimary","div","style"],"mappings":"AAAA;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A8M,QAAQxM;QACRsD,QAAQ1D;QACRsE,OAAOpE;QACPI;QACAE;QACAI;QACA,OAAGtE,8BAAAA,EAAwBoE,0BAA0B,QAAQ,MAAM;QACnEmM,QAAQ;YACNC,oBAAoBxO,QAAQwO,kBAAkB;QAChD;IACF;IACA,MAAMC,aAAa;QACjBpL,YAAY5D,MAAM4D,UAAU;QAC5BqL,YAAYjP,MAAMiP,UAAU;IAC9B;IACA,OAAO,CAAClC,kBAAAA,WAAAA,GACN,OAAA,aAAA,CAAC7N,sBAAAA,EAAAA;QACE,GAAGc,KAAK;QACTiN,YAAYD;QACZ3J,QAAQlD;QACRqD,WAAWlF,iBAAAA,CAAWwB,YAAY;QAClC4D,WAAW/E,iBAAAA,CAAWqL,UAAU;QAChCkF,WAAWtQ,gBAAAA,CAAUoL,UAAU;QAC/B4E,cAAcA;QACdO,aAAatQ,yBAAAA;QACbuQ,uBAAuB5O,uBAAuB4D,OAAO;QACrDiL,6BAA6B3O,uBAAuB0D,OAAO;QAC3DrF,mBAAmBA,wBAAAA;QACnBuQ,uBAAuBlM;QACvBmM,kBAAkBtM;QAClBuM,YAAY/K;QACZgL,gBAAgBjP,uBAAuB4D,OAAO,CAACI,MAAM;QACrDkL,eAAe;QACfC,cAAc;QACdC,cAAc;QACdC,YAAY1G;QACZ2G,mBAAmBzJ;QACnB7E,cAAcH;QACd2N,YAAYA;QACZ,oCAAoC,GACpCe,UAAU,CAACC;YACTlP,YAAYsD,OAAO,GAAG4L,EAAEC,MAAM;YAC9BlP,YAAYqD,OAAO,GAAG4L,EAAEE,aAAa;YACrC,OAAOzJ;QACT;uBAGF,OAAA,aAAA,CAAC0J,OAAAA;QAAInL,IAAI7D;QAAesG,MAAM;QAAS2I,OAAO;YAAExL,SAAS;QAAI;QAAG8C,cAAY;;AAEhF,GACA"}
@@ -19,7 +19,7 @@ const _CartesianChart = require("../CommonComponents/CartesianChart");
19
19
  const _ChartPopover = require("../CommonComponents/ChartPopover");
20
20
  const _index = require("../../utilities/index");
21
21
  const _vbcutils = require("../../utilities/vbc-utils");
22
- const _imageexportutils = require("../../utilities/image-export-utils");
22
+ const _hooks = require("../../utilities/hooks");
23
23
  const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
24
24
  yAxisCategoryOrder: 'default'
25
25
  }, forwardedRef)=>{
@@ -44,9 +44,8 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
44
44
  let _domainMargin = _index.MIN_DOMAIN_MARGIN;
45
45
  var _props_yAxisPadding;
46
46
  let _yAxisPadding = (_props_yAxisPadding = props.yAxisPadding) !== null && _props_yAxisPadding !== void 0 ? _props_yAxisPadding : 0.5;
47
- const cartesianChartRef = _react.useRef(null);
47
+ const { cartesianChartRef, legendsRef: _legendsRef } = (0, _hooks.useImageExport)(props.componentRef, props.hideLegend);
48
48
  const X_ORIGIN = 0;
49
- const _legendsRef = _react.useRef(null);
50
49
  const [color, setColor] = _react.useState('');
51
50
  const [dataForHoverCard, setDataForHoverCard] = _react.useState(0);
52
51
  const [isLegendSelected, setIsLegendSelected] = _react.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) && props.legendProps.selectedLegends.length > 0 || ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegend) !== undefined);
@@ -77,17 +76,6 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
77
76
  }, [
78
77
  props
79
78
  ]);
80
- _react.useImperativeHandle(props.componentRef, ()=>{
81
- var _cartesianChartRef_current;
82
- var _cartesianChartRef_current_chartContainer;
83
- return {
84
- chartContainer: (_cartesianChartRef_current_chartContainer = (_cartesianChartRef_current = cartesianChartRef.current) === null || _cartesianChartRef_current === void 0 ? void 0 : _cartesianChartRef_current.chartContainer) !== null && _cartesianChartRef_current_chartContainer !== void 0 ? _cartesianChartRef_current_chartContainer : null,
85
- toImage: (opts)=>{
86
- var _cartesianChartRef_current, _legendsRef_current;
87
- return (0, _imageexportutils.toImage)((_cartesianChartRef_current = cartesianChartRef.current) === null || _cartesianChartRef_current === void 0 ? void 0 : _cartesianChartRef_current.chartContainer, (_legendsRef_current = _legendsRef.current) === null || _legendsRef_current === void 0 ? void 0 : _legendsRef_current.toSVG, _isRtl, opts);
88
- }
89
- };
90
- }, []);
91
79
  function _adjustProps() {
92
80
  _points = props.data || [];
93
81
  _barHeight = props.barHeight || 32;
@@ -110,7 +98,6 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
110
98
  selectedPointIndex = index;
111
99
  }
112
100
  });
113
- // eslint-disable-next-line @typescript-eslint/no-shadow
114
101
  let color;
115
102
  if (useSingleColor) {
116
103
  //if useSingle color , then check if user has given a palette or not
@@ -129,7 +116,6 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
129
116
  isPopoverOpen: isPopoverOpen
130
117
  }));
131
118
  }
132
- // eslint-disable-next-line @typescript-eslint/no-shadow
133
119
  function _renderCallout(props) {
134
120
  return props ? _renderContentForOnlyBars(props) : null;
135
121
  }
@@ -174,7 +160,6 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
174
160
  }
175
161
  function _onBarHover(point, color, mouseEvent) {
176
162
  mouseEvent.persist();
177
- // eslint-disable-next-line @typescript-eslint/no-shadow
178
163
  if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {
179
164
  _calloutAnchorPoint = point;
180
165
  setPopoverOpen(true);
@@ -196,7 +181,6 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
196
181
  _calloutAnchorPoint = null;
197
182
  setPopoverOpen(false);
198
183
  }
199
- // eslint-disable-next-line @typescript-eslint/no-shadow
200
184
  function _onBarFocus(event, point, refArrayIndexNumber, color) {
201
185
  let cx = 0;
202
186
  let cy = 0;
@@ -205,7 +189,6 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
205
189
  cy = targetRect.top + targetRect.height / 2;
206
190
  _updatePosition(cx, cy);
207
191
  if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {
208
- // eslint-disable-next-line @typescript-eslint/no-shadow
209
192
  _refArray.forEach((obj, index)=>{
210
193
  if (refArrayIndexNumber === index) {
211
194
  setPopoverOpen(true);
@@ -329,7 +312,6 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
329
312
  key: point.y,
330
313
  x: xStart,
331
314
  y: yBarScale(point.y) - _barHeight / 2,
332
- "data-is-focusable": shouldHighlight,
333
315
  width: currentWidth - (_isRtl ? gapWidthRTL : gapWidthLTR),
334
316
  height: _barHeight,
335
317
  ref: (e)=>{
@@ -346,7 +328,7 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
346
328
  onBlur: _onBarLeave,
347
329
  fill: startColor,
348
330
  opacity: shouldHighlight ? 1 : 0.1,
349
- tabIndex: point.legend !== '' ? 0 : undefined
331
+ tabIndex: shouldHighlight ? 0 : undefined
350
332
  }));
351
333
  });
352
334
  return bars;
@@ -472,11 +454,10 @@ const HorizontalBarChartWithAxis = /*#__PURE__*/ _react.forwardRef((props = {
472
454
  onMouseOver: (event)=>_onBarHover(point, startColor, event),
473
455
  onMouseLeave: _onBarLeave,
474
456
  onBlur: _onBarLeave,
475
- "data-is-focusable": shouldHighlight,
476
457
  opacity: shouldHighlight ? 1 : 0.1,
477
458
  onFocus: (event)=>_onBarFocus(event, point, index, startColor),
478
459
  fill: startColor,
479
- tabIndex: point.legend !== '' ? 0 : undefined
460
+ tabIndex: shouldHighlight ? 0 : undefined
480
461
  }));
481
462
  });
482
463
  return bars;