@fluentui/react-charts 9.2.3 → 9.2.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 (194) hide show
  1. package/CHANGELOG.md +49 -10
  2. package/dist/index.d.ts +98 -5
  3. package/lib/components/AreaChart/AreaChart.js +3 -3
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/AreaChart/useAreaChartStyles.styles.js +2 -2
  6. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  7. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -15
  8. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.js +89 -6
  10. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  11. package/lib/components/CommonComponents/CartesianChart.js +38 -34
  12. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  13. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  14. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +17 -14
  15. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  16. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +6 -33
  17. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  18. package/lib/components/DeclarativeChart/DeclarativeChart.js +55 -16
  19. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  20. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +19 -0
  21. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  22. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +1058 -291
  23. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  24. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +8 -3
  25. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  26. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -2
  27. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  28. package/lib/components/DonutChart/DonutChart.js +6 -1
  29. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  30. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  31. package/lib/components/DonutChart/useDonutChartStyles.styles.js +21 -4
  32. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  33. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
  34. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  35. package/lib/components/FunnelChart/FunnelChart.js +4 -2
  36. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  37. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  38. package/lib/components/GaugeChart/GaugeChart.js +1 -2
  39. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  40. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +2 -2
  41. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  42. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +4 -17
  43. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  44. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +4 -21
  45. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  46. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +1 -1
  47. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  48. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +7 -3
  49. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  50. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -2
  51. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  52. package/lib/components/LineChart/LineChart.js +271 -271
  53. package/lib/components/LineChart/LineChart.js.map +1 -1
  54. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  55. package/lib/components/LineChart/useLineChartStyles.styles.js +23 -10
  56. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  57. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +4 -21
  58. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  59. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  60. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  61. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +12 -25
  62. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  63. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -12
  64. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  65. package/lib/components/ScatterChart/ScatterChart.js +114 -75
  66. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  67. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  68. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +11 -7
  69. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  70. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +4 -22
  71. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  72. package/lib/components/VerticalBarChart/VerticalBarChart.js +2 -2
  73. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  74. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +8 -6
  75. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  76. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +5 -19
  77. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  78. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +2 -2
  79. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  80. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +7 -6
  81. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  82. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +4 -19
  83. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  84. package/lib/types/DataPoint.js +3 -1
  85. package/lib/types/DataPoint.js.map +1 -1
  86. package/lib/utilities/Common.styles.js +47 -0
  87. package/lib/utilities/Common.styles.js.map +1 -0
  88. package/lib/utilities/Common.styles.raw.js +47 -0
  89. package/lib/utilities/Common.styles.raw.js.map +1 -0
  90. package/lib/utilities/SVGTooltipText.js.map +1 -1
  91. package/lib/utilities/image-export-utils.js.map +1 -1
  92. package/lib/utilities/index.js +1 -0
  93. package/lib/utilities/index.js.map +1 -1
  94. package/lib/utilities/scatterpolar-utils.js +52 -0
  95. package/lib/utilities/scatterpolar-utils.js.map +1 -0
  96. package/lib/utilities/utilities.js +309 -142
  97. package/lib/utilities/utilities.js.map +1 -1
  98. package/lib/utilities/vbc-utils.js.map +1 -1
  99. package/lib-commonjs/components/AreaChart/AreaChart.js +2 -2
  100. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  101. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  102. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +2 -14
  103. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  104. package/lib-commonjs/components/ChartTable/ChartTable.js +89 -6
  105. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  106. package/lib-commonjs/components/CommonComponents/CartesianChart.js +38 -34
  107. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  108. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  109. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +15 -13
  110. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  111. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +4 -32
  112. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  113. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +58 -19
  114. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  115. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +22 -0
  116. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  117. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +1070 -291
  118. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  119. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +12 -3
  120. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  121. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -2
  122. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  123. package/lib-commonjs/components/DonutChart/DonutChart.js +6 -1
  124. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  125. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  126. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +32 -4
  127. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  128. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
  129. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  130. package/lib-commonjs/components/FunnelChart/FunnelChart.js +4 -2
  131. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  132. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  133. package/lib-commonjs/components/GaugeChart/GaugeChart.js +1 -2
  134. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  135. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +2 -2
  136. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  137. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -19
  138. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  139. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -20
  140. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  141. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +1 -1
  142. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  143. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +10 -3
  144. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  145. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -2
  146. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  147. package/lib-commonjs/components/LineChart/LineChart.js +269 -269
  148. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  149. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  150. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +30 -9
  151. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  152. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +2 -20
  153. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  154. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  155. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  156. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +23 -33
  157. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  158. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +1 -12
  159. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  160. package/lib-commonjs/components/ScatterChart/ScatterChart.js +112 -73
  161. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  162. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  163. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +13 -7
  164. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  165. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +2 -20
  166. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  167. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +1 -1
  168. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  169. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +5 -3
  170. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  171. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -17
  172. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  173. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +1 -1
  174. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  175. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +5 -3
  176. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  177. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -18
  178. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  179. package/lib-commonjs/types/DataPoint.js +3 -1
  180. package/lib-commonjs/types/DataPoint.js.map +1 -1
  181. package/lib-commonjs/utilities/Common.styles.js +71 -0
  182. package/lib-commonjs/utilities/Common.styles.js.map +1 -0
  183. package/lib-commonjs/utilities/Common.styles.raw.js +71 -0
  184. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -0
  185. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  186. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  187. package/lib-commonjs/utilities/index.js +1 -0
  188. package/lib-commonjs/utilities/index.js.map +1 -1
  189. package/lib-commonjs/utilities/scatterpolar-utils.js +67 -0
  190. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
  191. package/lib-commonjs/utilities/utilities.js +322 -133
  192. package/lib-commonjs/utilities/utilities.js.map +1 -1
  193. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  194. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ChartTable/ChartTable.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChartTableProps } from './ChartTable.types';\nimport { useChartTableStyles } from './useChartTableStyles.styles';\nimport { useRtl } from '../../utilities/utilities';\nimport { ImageExportOptions } from '../../types/index';\nimport { toImage } from '../../utilities/image-export-utils';\n\nexport const ChartTable: React.FunctionComponent<ChartTableProps> = React.forwardRef<HTMLDivElement, ChartTableProps>(\n (props, forwardedRef) => {\n const { headers, rows, width, height } = props;\n const _isRTL: boolean = useRtl();\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n const classes = useChartTableStyles(props);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(_rootElem.current, undefined, _isRTL, opts);\n },\n }),\n [],\n );\n\n if (!headers || headers.length === 0) {\n return <div>No data available</div>;\n }\n\n return (\n <div\n ref={el => (_rootElem.current = el)}\n className={classes.root as string}\n style={{ height: height ? `${height}px` : '650px', overflow: 'hidden' }}\n >\n <svg width={width ?? '100%'} height={height ?? '650px'}>\n <foreignObject x=\"0\" y=\"0\" width=\"100%\" height=\"100%\">\n <div\n style={{\n maxHeight: height ? `${height}px` : '650px',\n overflowY: 'auto',\n overflowX: 'auto',\n }}\n >\n <table\n className={classes.table}\n style={{\n width: width ? `${width}px` : '100%',\n height: height ? `${height}px` : '650px',\n }}\n >\n <thead>\n <tr>\n {headers.map((header, idx) => (\n <th key={idx} className={classes.headerCell} style={header?.style}>\n {header.value}\n </th>\n ))}\n </tr>\n </thead>\n {rows && rows.length > 0 && (\n <tbody>\n {rows.map((row, rowIdx) => (\n <tr key={rowIdx}>\n {row.map((cell, colIdx) => (\n <td key={colIdx} className={classes.bodyCell} style={cell?.style}>\n {cell.value}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n )}\n </table>\n </div>\n </foreignObject>\n </svg>\n </div>\n );\n },\n);\n\nChartTable.displayName = 'ChartTable';\n"],"names":["React","useChartTableStyles","useRtl","toImage","ChartTable","forwardRef","props","forwardedRef","headers","rows","width","height","_isRTL","_rootElem","useRef","classes","useImperativeHandle","componentRef","chartContainer","current","opts","undefined","length","div","ref","el","className","root","style","overflow","svg","foreignObject","x","y","maxHeight","overflowY","overflowX","table","thead","tr","map","header","idx","th","key","headerCell","value","tbody","row","rowIdx","cell","colIdx","td","bodyCell","displayName"],"mappings":";;;;+BAOaI;;;;;;;iEAPU,QAAQ;2CAEK,+BAA+B;2BAC5C,4BAA4B;kCAE3B,qCAAqC;AAEtD,mBAAMA,WAAAA,GAAuDJ,OAAMK,UAAU,CAClF,CAACC,OAAOC;IACN,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAEC,KAAK,EAAEC,MAAM,EAAE,GAAGL;IACzC,MAAMM,SAAkBV,qBAAAA;IACxB,MAAMW,YAAYb,OAAMc,MAAM,CAAwB;IACtD,MAAMC,cA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WAAAA,GACpB,OAAA,aAAA,CAACC,MAAAA;YAAGC,KAAKF;YAAKhB,WAAWX,QAAQ8B,UAAU;YAAEjB,KAAK,EAAEa,WAAAA,QAAAA,WAAAA,KAAAA,IAAAA,KAAAA,IAAAA,OAAQb,KAAK;WAC9Da,OAAOK,KAAK,MAKpBrC,QAAQA,KAAKa,MAAM,GAAG,KAAA,WAAA,GACrB,OAAA,aAAA,CAACyB,SAAAA,MACEtC,KAAK+B,GAAG,CAAC,CAACQ,KAAKC,SAAAA,WAAAA,GACd,OAAA,aAAA,CAACV,MAAAA;YAAGK,KAAKK;WACND,IAAIR,GAAG,CAAC,CAACU,MAAMC,SAAAA,WAAAA,GACd,OAAA,aAAA,CAACC,MAAAA;gBAAGR,KAAKO;gBAAQzB,WAAWX,QAAQsC,QAAQ;gBAAEzB,KAAK,EAAEsB,SAAAA,QAAAA,SAAAA,KAAAA,IAAAA,KAAAA,IAAAA,KAAMtB,KAAK;eAC7DsB,KAAKJ,KAAK;AAarC,GACA;AAEF1C,WAAWkD,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/ChartTable/ChartTable.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChartTableProps } from './ChartTable.types';\nimport { useChartTableStyles } from './useChartTableStyles.styles';\nimport { useRtl } from '../../utilities/utilities';\nimport { ImageExportOptions } from '../../types/index';\nimport { toImage } from '../../utilities/image-export-utils';\nimport { tokens } from '@fluentui/react-theme';\nimport * as d3 from 'd3-color';\nimport { getColorContrast } from '../../utilities/colors';\n\nfunction invertHexColor(hex: string): string {\n const color = d3.color(hex);\n if (!color) {\n return tokens.colorNeutralForeground1!;\n }\n const rgb = color.rgb();\n return d3.rgb(255 - rgb.r, 255 - rgb.g, 255 - rgb.b).formatHex();\n}\n\nfunction getSafeBackgroundColor(foreground?: string, background?: string): string {\n const fallbackFg = tokens.colorNeutralForeground1;\n const fallbackBg = tokens.colorNeutralBackground1;\n\n const fg = d3.color(foreground || fallbackFg);\n const bg = d3.color(background || fallbackBg);\n if (!fg || !bg) {\n return fallbackBg;\n }\n const contrast = getColorContrast(fg.formatHex(), bg.formatHex());\n if (contrast >= 3) {\n return bg.formatHex();\n }\n\n const invertedBg = invertHexColor(bg.formatHex());\n const invertedContrast = getColorContrast(fg.formatHex(), invertedBg);\n return invertedContrast >= 3 ? invertedBg : fallbackBg;\n}\n\nexport const ChartTable: React.FunctionComponent<ChartTableProps> = React.forwardRef<HTMLDivElement, ChartTableProps>(\n (props, forwardedRef) => {\n const { headers, rows, width, height } = props;\n const _isRTL: boolean = useRtl();\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n const classes = useChartTableStyles(props);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(_rootElem.current, undefined, _isRTL, opts);\n },\n }),\n [],\n );\n\n if (!headers || headers.length === 0) {\n return <div>No data available</div>;\n }\n\n const bgColorSet = new Set<string>();\n headers.forEach(header => {\n const bg = header?.style?.backgroundColor;\n const normalized = d3.color(bg || '')?.formatHex();\n if (normalized) {\n bgColorSet.add(normalized);\n }\n });\n let sharedBackgroundColor: string | undefined;\n let useSharedBackground = false;\n\n /*\n If we have only one or two unique background colors, we can consider using a shared background color\n for the table headers. This is to ensure better contrast with the foreground text.\n For size 1, we will consider that as default color if it satisfies the contrast ratio.\n There could also be a scenario where backgroundcolor array is of size 2, for eg: [\"dimsgray\", \"gray\"],\n which will assign 1st column header bg color to dimsgray and rest to gray. so our logic of shared background\n color won't run here. So will consider for size 2 as well.\n For size greater than this, we will consider that user wants different colors and will let color contrast fail\n if any.\n */\n if (bgColorSet.size === 1 || bgColorSet.size === 2) {\n const candidateBg = bgColorSet.size === 1 ? Array.from(bgColorSet)[0] : Array.from(bgColorSet)[1];\n for (const header of headers) {\n const fg = header?.style?.color;\n if (fg && getColorContrast(fg, candidateBg) >= 3) {\n sharedBackgroundColor = candidateBg;\n useSharedBackground = true;\n break;\n }\n }\n }\n\n return (\n <div\n ref={el => (_rootElem.current = el)}\n className={classes.root as string}\n style={{ height: height ? `${height}px` : '650px', overflow: 'hidden' }}\n >\n <svg width={width ?? '100%'} height={height ?? '650px'}>\n <foreignObject x=\"0\" y=\"0\" width=\"100%\" height=\"100%\">\n <div\n style={{\n maxHeight: height ? `${height}px` : '650px',\n overflowY: 'auto',\n overflowX: 'auto',\n }}\n >\n <table\n className={classes.table}\n style={{\n width: width ? `${width}px` : '100%',\n height: height ? `${height}px` : '650px',\n }}\n >\n <thead>\n <tr>\n {headers.map((header, idx) => {\n const style = { ...header?.style };\n const fg = style.color;\n const bg = style.backgroundColor;\n\n if (useSharedBackground) {\n style.backgroundColor = sharedBackgroundColor;\n } else if (fg || bg) {\n style.backgroundColor = getSafeBackgroundColor(fg, bg);\n }\n return (\n <th key={idx} className={classes.headerCell} style={style} tabIndex={0}>\n {header.value}\n </th>\n );\n })}\n </tr>\n </thead>\n {rows && rows.length > 0 && (\n <tbody>\n {rows.map((row, rowIdx) => (\n <tr key={rowIdx}>\n {row.map((cell, colIdx) => {\n const style = { ...cell?.style };\n const fg = style.color;\n const bg = style.backgroundColor;\n if (fg || bg) {\n style.backgroundColor = getSafeBackgroundColor(fg, bg);\n }\n return (\n <td key={colIdx} className={classes.bodyCell} style={style} tabIndex={0}>\n {cell.value}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n )}\n </table>\n </div>\n </foreignObject>\n </svg>\n </div>\n );\n },\n);\n\nChartTable.displayName = 'ChartTable';\n"],"names":["React","useChartTableStyles","useRtl","toImage","tokens","d3","getColorContrast","invertHexColor","hex","color","colorNeutralForeground1","rgb","r","g","b","formatHex","getSafeBackgroundColor","foreground","background","fallbackFg","fallbackBg","colorNeutralBackground1","fg","bg","contrast","invertedBg","invertedContrast","ChartTable","forwardRef","props","forwardedRef","headers","rows","width","height","_isRTL","_rootElem","useRef","classes","useImperativeHandle","componentRef","chartContainer","current","opts","undefined","length","div","bgColorSet","Set","forEach","header","style","backgroundColor","normalized","add","sharedBackgroundColor","useSharedBackground","size","candidateBg","Array","from","ref","el","className","root","overflow","svg","foreignObject","x","y","maxHeight","overflowY","overflowX","table","thead","tr","map","idx","th","key","headerCell","tabIndex","value","tbody","row","rowIdx","cell","colIdx","td","bodyCell","displayName"],"mappings":";;;;+BAsCa2B;;;;;;;iEAtCU,QAAQ;2CAEK,+BAA+B;2BAC5C,4BAA4B;kCAE3B,qCAAqC;4BACtC,wBAAwB;mEAC3B,WAAW;wBACE,yBAAyB;AAE1D,SAASpB,eAAeC,GAAW;IACjC,MAAMC,QAAQJ,SAAGI,KAAK,CAACD;IACvB,IAAI,CAACC,OAAO;QACV,OAAOL,kBAAAA,CAAOM,uBAAuB;IACvC;IACA,MAAMC,MAAMF,MAAME,GAAG;IACrB,OAAON,SAAGM,GAAG,CAAC,MAAMA,IAAIC,CAAC,EAAE,MAAMD,IAAIE,CAAC,EAAE,MAAMF,IAAIG,CAAC,EAAEC,SAAS;AAChE;AAEA,SAASC,uBAAuBC,UAAmB,EAAEC,UAAmB;IACtE,MAAMC,aAAaf,kBAAAA,CAAOM,uBAAuB;IACjD,MAAMU,aAAahB,kBAAAA,CAAOiB,uBAAuB;IAEjD,MAAMC,KAAKjB,SAAGI,KAAK,CAACQ,cAAcE;IAClC,MAAMI,KAAKlB,SAAGI,KAAK,CAACS,cAAcE;IAClC,IAAI,CAACE,MAAM,CAACC,IAAI;QACd,OAAOH;IACT;IACA,MAAMI,eAAWlB,wBAAAA,EAAiBgB,GAAGP,SAAS,IAAIQ,GAAGR,SAAS;IAC9D,IAAIS,YAAY,GAAG;QACjB,OAAOD,GAAGR,SAAS;IACrB;IAEA,MAAMU,aAAalB,eAAegB,GAAGR,SAAS;IAC9C,MAAMW,uBAAmBpB,wBAAAA,EAAiBgB,GAAGP,SAAS,IAAIU;IAC1D,OAAOC,oBAAoB,IAAID,aAAaL;AAC9C;AAEO,mBAAMO,WAAAA,GAAuD3B,OAAM4B,UAAU,CAClF,C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51
  _index.ChartTypes.HeatMapChart,
52
52
  _index.ChartTypes.VerticalStackedBarChart,
53
- _index.ChartTypes.GanttChart
53
+ _index.ChartTypes.GanttChart,
54
+ _index.ChartTypes.ScatterChart
54
55
  ];
55
56
  var _props_margins_top, _props_margins_bottom, _props_margins_left, _props_margins_right, _props_margins_right1, _props_margins_left1;
56
57
  /**
@@ -65,33 +66,34 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
65
66
  right: _useRtl ? (_props_margins_left = (_props_margins2 = props.margins) === null || _props_margins2 === void 0 ? void 0 : _props_margins2.left) !== null && _props_margins_left !== void 0 ? _props_margins_left : 40 : ((_props_margins_right = (_props_margins3 = props.margins) === null || _props_margins3 === void 0 ? void 0 : _props_margins3.right) !== null && _props_margins_right !== void 0 ? _props_margins_right : props === null || props === void 0 ? void 0 : props.secondaryYScaleOptions) ? 40 : 20,
66
67
  left: _useRtl ? ((_props_margins_right1 = (_props_margins4 = props.margins) === null || _props_margins4 === void 0 ? void 0 : _props_margins4.right) !== null && _props_margins_right1 !== void 0 ? _props_margins_right1 : props === null || props === void 0 ? void 0 : props.secondaryYScaleOptions) ? 40 : 20 : (_props_margins_left1 = (_props_margins5 = props.margins) === null || _props_margins5 === void 0 ? void 0 : _props_margins5.left) !== null && _props_margins_left1 !== void 0 ? _props_margins_left1 : 40
67
68
  };
68
- const TITLE_MARGIN = 20;
69
+ const TITLE_MARGIN_HORIZONTAL = 24;
70
+ const TITLE_MARGIN_VERTICAL = 20;
69
71
  if (props.xAxisTitle !== undefined && props.xAxisTitle !== '') {
70
72
  var _props_margins6;
71
73
  var _props_margins_bottom1;
72
- margins.bottom = (_props_margins_bottom1 = (_props_margins6 = props.margins) === null || _props_margins6 === void 0 ? void 0 : _props_margins6.bottom) !== null && _props_margins_bottom1 !== void 0 ? _props_margins_bottom1 : margins.bottom + TITLE_MARGIN;
74
+ margins.bottom = (_props_margins_bottom1 = (_props_margins6 = props.margins) === null || _props_margins6 === void 0 ? void 0 : _props_margins6.bottom) !== null && _props_margins_bottom1 !== void 0 ? _props_margins_bottom1 : margins.bottom + TITLE_MARGIN_VERTICAL;
73
75
  }
74
76
  if (props.yAxisTitle !== undefined && props.yAxisTitle !== '') {
75
77
  var _props_margins7, _props_margins8, _props_margins9, _props_margins10;
76
78
  var _props_margins_right2, _props_margins_left2;
77
- margins.left = _useRtl ? ((_props_margins_right2 = (_props_margins7 = props.margins) === null || _props_margins7 === void 0 ? void 0 : _props_margins7.right) !== null && _props_margins_right2 !== void 0 ? _props_margins_right2 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN : margins.right + TITLE_MARGIN : (_props_margins_left2 = (_props_margins8 = props.margins) === null || _props_margins8 === void 0 ? void 0 : _props_margins8.left) !== null && _props_margins_left2 !== void 0 ? _props_margins_left2 : margins.left + TITLE_MARGIN;
79
+ margins.left = _useRtl ? ((_props_margins_right2 = (_props_margins7 = props.margins) === null || _props_margins7 === void 0 ? void 0 : _props_margins7.right) !== null && _props_margins_right2 !== void 0 ? _props_margins_right2 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN_HORIZONTAL : margins.right + TITLE_MARGIN_HORIZONTAL : (_props_margins_left2 = (_props_margins8 = props.margins) === null || _props_margins8 === void 0 ? void 0 : _props_margins8.left) !== null && _props_margins_left2 !== void 0 ? _props_margins_left2 : margins.left + TITLE_MARGIN_HORIZONTAL;
78
80
  var _props_margins_left3, _props_margins_right3;
79
- margins.right = _useRtl ? (_props_margins_left3 = (_props_margins9 = props.margins) === null || _props_margins9 === void 0 ? void 0 : _props_margins9.left) !== null && _props_margins_left3 !== void 0 ? _props_margins_left3 : margins.left + TITLE_MARGIN : ((_props_margins_right3 = (_props_margins10 = props.margins) === null || _props_margins10 === void 0 ? void 0 : _props_margins10.right) !== null && _props_margins_right3 !== void 0 ? _props_margins_right3 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN : margins.right + TITLE_MARGIN;
81
+ margins.right = _useRtl ? (_props_margins_left3 = (_props_margins9 = props.margins) === null || _props_margins9 === void 0 ? void 0 : _props_margins9.left) !== null && _props_margins_left3 !== void 0 ? _props_margins_left3 : margins.left + TITLE_MARGIN_HORIZONTAL : ((_props_margins_right3 = (_props_margins10 = props.margins) === null || _props_margins10 === void 0 ? void 0 : _props_margins10.right) !== null && _props_margins_right3 !== void 0 ? _props_margins_right3 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN_HORIZONTAL : margins.right + TITLE_MARGIN_HORIZONTAL;
80
82
  }
81
83
  if (props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '') {
82
84
  var _props_margins11;
83
85
  var _props_margins_top1;
84
- margins.top = (_props_margins_top1 = (_props_margins11 = props.margins) === null || _props_margins11 === void 0 ? void 0 : _props_margins11.top) !== null && _props_margins_top1 !== void 0 ? _props_margins_top1 : margins.top + TITLE_MARGIN;
86
+ margins.top = (_props_margins_top1 = (_props_margins11 = props.margins) === null || _props_margins11 === void 0 ? void 0 : _props_margins11.top) !== null && _props_margins_top1 !== void 0 ? _props_margins_top1 : margins.top + TITLE_MARGIN_VERTICAL;
85
87
  }
86
88
  if (props.yAxisAnnotation !== undefined && props.yAxisAnnotation !== '' && (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '')) {
87
89
  if (_useRtl) {
88
90
  var _props_margins12;
89
91
  var _props_margins_right4;
90
- margins.left = (_props_margins_right4 = (_props_margins12 = props.margins) === null || _props_margins12 === void 0 ? void 0 : _props_margins12.right) !== null && _props_margins_right4 !== void 0 ? _props_margins_right4 : margins.right + TITLE_MARGIN;
92
+ margins.left = (_props_margins_right4 = (_props_margins12 = props.margins) === null || _props_margins12 === void 0 ? void 0 : _props_margins12.right) !== null && _props_margins_right4 !== void 0 ? _props_margins_right4 : margins.right + TITLE_MARGIN_HORIZONTAL;
91
93
  } else {
92
94
  var _props_margins13;
93
95
  var _props_margins_right5;
94
- margins.right = (_props_margins_right5 = (_props_margins13 = props.margins) === null || _props_margins13 === void 0 ? void 0 : _props_margins13.right) !== null && _props_margins_right5 !== void 0 ? _props_margins_right5 : margins.right + TITLE_MARGIN;
96
+ margins.right = (_props_margins_right5 = (_props_margins13 = props.margins) === null || _props_margins13 === void 0 ? void 0 : _props_margins13.right) !== null && _props_margins_right5 !== void 0 ? _props_margins_right5 : margins.right + TITLE_MARGIN_HORIZONTAL;
95
97
  }
96
98
  }
97
99
  const classes = (0, _useCartesianChartStylesstyles.useCartesianChartStyles)(props);
@@ -189,6 +191,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
189
191
  let callout = null;
190
192
  let children = null;
191
193
  if (props.enableFirstRenderOptimization && chartContainer.current || !props.enableFirstRenderOptimization) {
194
+ var _props_xAxis, _props_xAxis1, _props_yAxis, _props_yAxis1;
192
195
  _isFirstRender.current = false;
193
196
  var _props_showRoundOffXTickValues;
194
197
  const XAxisParams = {
@@ -211,7 +214,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
211
214
  xAxisOuterPadding: props.xAxisOuterPadding,
212
215
  containerWidth: containerWidth,
213
216
  hideTickOverlap: props.rotateXAxisLables ? false : props.hideTickOverlap,
214
- calcMaxLabelWidth: _calcMaxLabelWidthWithTransform
217
+ calcMaxLabelWidth: _calcMaxLabelWidthWithTransform,
218
+ tickStep: (_props_xAxis = props.xAxis) === null || _props_xAxis === void 0 ? void 0 : _props_xAxis.tickStep,
219
+ tick0: (_props_xAxis1 = props.xAxis) === null || _props_xAxis1 === void 0 ? void 0 : _props_xAxis1.tick0
215
220
  };
216
221
  /**
217
222
  * These scales used for 2 purposes.
@@ -223,7 +228,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
223
228
  let tickValues;
224
229
  switch(props.xAxisType){
225
230
  case _index.XAxisTypes.NumericAxis:
226
- ({ xScale, tickValues } = (0, _index.createNumericXAxis)(XAxisParams, props.tickParams, props.chartType, culture));
231
+ ({ xScale, tickValues } = (0, _index.createNumericXAxis)(XAxisParams, props.tickParams, props.chartType, culture, props.xScaleType));
227
232
  break;
228
233
  case _index.XAxisTypes.DateAxis:
229
234
  ({ xScale, tickValues } = (0, _index.createDateXAxis)(XAxisParams, props.tickParams, culture, dateLocalizeOptions, timeFormatLocale, customDateTimeFormatter, props.useUTC, props.chartType));
@@ -232,7 +237,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
232
237
  ({ xScale, tickValues } = (0, _index.createStringXAxis)(XAxisParams, props.tickParams, props.datasetForXAxisDomain, culture));
233
238
  break;
234
239
  default:
235
- ({ xScale, tickValues } = (0, _index.createNumericXAxis)(XAxisParams, props.tickParams, props.chartType, culture));
240
+ ({ xScale, tickValues } = (0, _index.createNumericXAxis)(XAxisParams, props.tickParams, props.chartType, culture, props.xScaleType));
236
241
  }
237
242
  _xScale = xScale;
238
243
  _tickValues = tickValues;
@@ -252,7 +257,10 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
252
257
  // please note these padding default values must be consistent in here
253
258
  // and the parent chart(HBWA/Vertical etc..) for more details refer example
254
259
  // http://using-d3js.com/04_07_ordinal_scales.html
255
- yAxisPadding: props.yAxisPadding || 0
260
+ yAxisPadding: props.yAxisPadding || 0,
261
+ tickValues: props.yAxisTickValues,
262
+ tickStep: (_props_yAxis = props.yAxis) === null || _props_yAxis === void 0 ? void 0 : _props_yAxis.tickStep,
263
+ tick0: (_props_yAxis1 = props.yAxis) === null || _props_yAxis1 === void 0 ? void 0 : _props_yAxis1.tick0
256
264
  };
257
265
  /**
258
266
  * These scales used for 2 purposes.
@@ -290,9 +298,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
290
298
  yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType, true),
291
299
  yAxisPadding: props.yAxisPadding
292
300
  };
293
- yScaleSecondary = props.createYAxis(YAxisParamsSecondary, _useRtl, axisData, isIntegralDataset, chartType, true, props.roundedTicks);
301
+ yScaleSecondary = props.createYAxis(YAxisParamsSecondary, _useRtl, axisData, isIntegralDataset, chartType, true, props.roundedTicks, props.secondaryYScaleType);
294
302
  }
295
- yScalePrimary = props.createYAxis(YAxisParams, _useRtl, axisData, isIntegralDataset, chartType, false, props.roundedTicks);
303
+ yScalePrimary = props.createYAxis(YAxisParams, _useRtl, axisData, isIntegralDataset, chartType, false, props.roundedTicks, props.yScaleType);
296
304
  }
297
305
  if (chartTypesWithStringYAxis.includes(props.chartType) && props.yAxisType === _index.YAxisType.StringAxis) {
298
306
  // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
@@ -349,6 +357,12 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
349
357
  };
350
358
  const xAxisTitleMaximumAllowedWidth = svgDimensions.width - margins.left - margins.right - startFromX;
351
359
  const yAxisTitleMaximumAllowedHeight = svgDimensions.height - margins.bottom - margins.top - _removalValueForTextTuncate - titleMargin;
360
+ const commonSvgToolTipProps = {
361
+ wrapContent: _index.wrapContent,
362
+ showBackground: true,
363
+ className: classes.svgTooltip,
364
+ content: ''
365
+ };
352
366
  /**
353
367
  * When screen resizes, along with screen, chart also auto adjusted.
354
368
  * This method used to adjust height and width of the charts.
@@ -508,6 +522,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
508
522
  transform: `translate(0, ${svgDimensions.height - margins.bottom - _removalValueForTextTuncate})`,
509
523
  className: classes.xAxis
510
524
  }), props.xAxisTitle !== undefined && props.xAxisTitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
525
+ ...commonSvgToolTipProps,
511
526
  content: props.xAxisTitle,
512
527
  textProps: {
513
528
  x: margins.left + startFromX + xAxisTitleMaximumAllowedWidth / 2,
@@ -515,11 +530,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
515
530
  className: classes.axisTitle,
516
531
  textAnchor: 'middle'
517
532
  },
518
- maxWidth: xAxisTitleMaximumAllowedWidth,
519
- wrapContent: _index.wrapContent,
520
- showBackground: true,
521
- className: classes.svgTooltip
533
+ maxWidth: xAxisTitleMaximumAllowedWidth
522
534
  }), props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
535
+ ...commonSvgToolTipProps,
523
536
  content: props.xAxisAnnotation,
524
537
  textProps: {
525
538
  x: margins.left + startFromX + xAxisTitleMaximumAllowedWidth / 2,
@@ -528,10 +541,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
528
541
  textAnchor: 'middle',
529
542
  'aria-hidden': true
530
543
  },
531
- maxWidth: xAxisTitleMaximumAllowedWidth,
532
- wrapContent: _index.wrapContent,
533
- showBackground: true,
534
- className: classes.svgTooltip
544
+ maxWidth: xAxisTitleMaximumAllowedWidth
535
545
  }), /*#__PURE__*/ _react.createElement("g", {
536
546
  ref: (e)=>{
537
547
  yAxisElement.current = e;
@@ -547,6 +557,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
547
557
  transform: `translate(${_useRtl ? margins.left + startFromX : svgDimensions.width - margins.right - startFromX}, 0)`,
548
558
  className: classes.yAxis
549
559
  }), props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
560
+ ...commonSvgToolTipProps,
550
561
  content: props.secondaryYAxistitle,
551
562
  textProps: {
552
563
  x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + _removalValueForTextTuncate,
@@ -556,11 +567,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
556
567
  ${svgDimensions.height - margins.bottom - margins.top - titleMargin})rotate(-90)`,
557
568
  className: classes.axisTitle
558
569
  },
559
- maxWidth: yAxisTitleMaximumAllowedHeight,
560
- wrapContent: _index.wrapContent,
561
- showBackground: true,
562
- className: classes.svgTooltip
570
+ maxWidth: yAxisTitleMaximumAllowedHeight
563
571
  })), children, props.yAxisTitle !== undefined && props.yAxisTitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
572
+ ...commonSvgToolTipProps,
564
573
  content: props.yAxisTitle,
565
574
  textProps: {
566
575
  x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + _removalValueForTextTuncate,
@@ -570,11 +579,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
570
579
  ${svgDimensions.height - margins.bottom - margins.top - titleMargin})rotate(-90)`,
571
580
  className: classes.axisTitle
572
581
  },
573
- maxWidth: yAxisTitleMaximumAllowedHeight,
574
- wrapContent: _index.wrapContent,
575
- showBackground: true,
576
- className: classes.svgTooltip
582
+ maxWidth: yAxisTitleMaximumAllowedHeight
577
583
  }), props.yAxisAnnotation !== undefined && props.yAxisAnnotation !== '' && (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '') && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
584
+ ...commonSvgToolTipProps,
578
585
  content: props.yAxisAnnotation,
579
586
  textProps: {
580
587
  x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + _removalValueForTextTuncate,
@@ -585,10 +592,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
585
592
  className: classes.axisAnnotation,
586
593
  'aria-hidden': true
587
594
  },
588
- maxWidth: yAxisTitleMaximumAllowedHeight,
589
- wrapContent: _index.wrapContent,
590
- showBackground: true,
591
- className: classes.svgTooltip
595
+ maxWidth: yAxisTitleMaximumAllowedHeight
592
596
  }))), !props.hideLegend && /*#__PURE__*/ _react.createElement("div", {
593
597
  ref: (e)=>legendContainer = e,
594
598
  className: classes.legendContainer
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/CommonComponents/CartesianChart.tsx"],"sourcesContent":["import * as React from 'react';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { ModifiedCartesianChartProps } from '../../index';\nimport { useCartesianChartStyles } from './useCartesianChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport {\n createNumericXAxis,\n createStringXAxis,\n IAxisData,\n createDateXAxis,\n IMargins,\n XAxisTypes,\n YAxisType,\n createWrapOfXLabels,\n rotateXAxisLabels,\n calculateLongestLabelWidth,\n createYAxisLabels,\n ChartTypes,\n wrapContent,\n useRtl,\n truncateString,\n tooltipOfAxislabels,\n getSecureProps,\n DEFAULT_WRAP_WIDTH,\n} from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { SVGTooltipText } from '../../utilities/SVGTooltipText';\nimport { ChartPopover } from './ChartPopover';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\n\n/**\n * Cartesian Chart component\n * {@docCategory CartesianChart}\n */\nexport const CartesianChart: React.FunctionComponent<ModifiedCartesianChartProps> = React.forwardRef<\n HTMLDivElement,\n ModifiedCartesianChartProps\n>((props, forwardedRef) => {\n const chartContainer = React.useRef<HTMLDivElement>();\n let legendContainer: HTMLDivElement;\n const minLegendContainerHeight: number = 40;\n const xAxisElement = React.useRef<SVGSVGElement>();\n const yAxisElement = React.useRef<SVGSVGElement>();\n const yAxisElementSecondary = React.useRef<SVGSVGElement>();\n let margins: IMargins;\n const idForGraph: string = 'chart_';\n let _reqID: number;\n const _useRtl: boolean = useRtl();\n let _tickValues: (string | number)[];\n const titleMargin: number = 8;\n const _isFirstRender = React.useRef<boolean>(true);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xScale: any;\n let isIntegralDataset: boolean = true;\n let _tooltipId: string = useId('tooltip_');\n /* Used for when WrapXAxisLabels props appeared.\n * To display the total word (space separated words), Need to have more space than usual.\n * This height will get total height need to disaply total word.\n * These value need to be removed from actual svg height/graph height.\n * Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.\n */\n let _removalValueForTextTuncate: number = 0;\n\n const [containerWidth, setContainerWidth] = React.useState<number>(0);\n const [containerHeight, setContainerHeight] = React.useState<number>(0);\n const [startFromX, setStartFromX] = React.useState<number>(0);\n const [prevProps, setPrevProps] = React.useState<ModifiedCartesianChartProps | null>(null);\n\n const chartTypesWithStringYAxis = [\n ChartTypes.HorizontalBarChartWithAxis,\n ChartTypes.HeatMapChart,\n ChartTypes.VerticalStackedBarChart,\n ChartTypes.GanttChart,\n ];\n /**\n * In RTL mode, Only graph will be rendered left/right. We need to provide left and right margins manually.\n * So that, in RTL, left margins becomes right margins and viceversa.\n * As graph needs to be drawn perfecty, these values consider as default values.\n * Same margins using for all other cartesian charts. Can be accessible through 'getMargins' call back method.\n */\n // eslint-disable-next-line prefer-const\n margins = {\n top: props.margins?.top ?? 20,\n bottom: props.margins?.bottom ?? 35,\n right: _useRtl ? props.margins?.left ?? 40 : props.margins?.right ?? props?.secondaryYScaleOptions ? 40 : 20,\n left: _useRtl ? (props.margins?.right ?? props?.secondaryYScaleOptions ? 40 : 20) : props.margins?.left ?? 40,\n };\n const TITLE_MARGIN = 20;\n if (props.xAxisTitle !== undefined && props.xAxisTitle !== '') {\n margins.bottom! = props.margins?.bottom ?? margins.bottom! + TITLE_MARGIN;\n }\n if (props.yAxisTitle !== undefined && props.yAxisTitle !== '') {\n margins.left! = _useRtl\n ? props.margins?.right ?? props?.secondaryYAxistitle\n ? margins.right! + 2 * TITLE_MARGIN\n : margins.right! + TITLE_MARGIN\n : props.margins?.left ?? margins.left! + TITLE_MARGIN;\n margins.right! = _useRtl\n ? props.margins?.left ?? margins.left! + TITLE_MARGIN\n : props.margins?.right ?? props?.secondaryYAxistitle\n ? margins.right! + 2 * TITLE_MARGIN\n : margins.right! + TITLE_MARGIN;\n }\n if (props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '') {\n margins.top! = props.margins?.top ?? margins.top! + TITLE_MARGIN;\n }\n if (\n props.yAxisAnnotation !== undefined &&\n props.yAxisAnnotation !== '' &&\n (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '')\n ) {\n if (_useRtl) {\n margins.left! = props.margins?.right ?? margins.right! + TITLE_MARGIN;\n } else {\n margins.right! = props.margins?.right ?? margins.right! + TITLE_MARGIN;\n }\n }\n\n const classes = useCartesianChartStyles(props);\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal' });\n // ComponentdidMount and Componentwillunmount logic\n React.useEffect(() => {\n _fitParentContainer();\n if (props !== null) {\n setPrevProps(props);\n }\n if (\n chartTypesWithStringYAxis.includes(props.chartType) &&\n props.showYAxisLables &&\n yAxisElement &&\n props.yAxisType === YAxisType.StringAxis\n ) {\n const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis!);\n if (startFromX !== maxYAxisLabelLength) {\n setStartFromX(maxYAxisLabelLength);\n }\n } else if (startFromX !== 0) {\n setStartFromX(0);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n isIntegralDataset = !props.points.some((point: { y: number }) => point.y % 1 !== 0);\n return () => {\n cancelAnimationFrame(_reqID);\n };\n }, [props]);\n\n // ComponentDidUpdate logic\n React.useEffect(() => {\n if (prevProps) {\n if (prevProps.height !== props.height || prevProps.width !== props.width) {\n _fitParentContainer();\n }\n }\n if (\n chartTypesWithStringYAxis.includes(props.chartType) &&\n props.showYAxisLables &&\n yAxisElement &&\n props.yAxisType === YAxisType.StringAxis\n ) {\n const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis!);\n if (startFromX !== maxYAxisLabelLength) {\n setStartFromX(maxYAxisLabelLength);\n }\n } else if (startFromX !== 0) {\n setStartFromX(0);\n }\n if (prevProps !== null && prevProps.points !== props.points) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n isIntegralDataset = !props.points.some((point: { y: number }) => point.y % 1 !== 0);\n }\n }, [props, prevProps]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: chartContainer.current ?? null,\n }),\n [],\n );\n\n /**\n * Dedicated function to return the Callout JSX Element , which can further be used to only call this when\n * only the calloutprops and charthover props changes.\n * @param calloutProps\n * @param chartHoverProps\n * @returns\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _generateCallout(calloutProps: any): JSXElement {\n return <ChartPopover {...calloutProps} />;\n }\n\n function calculateMaxYAxisLabelLength(className: string): number {\n const formatTickLabel = (str: string) => {\n if (props.showYAxisLablesTooltip) {\n return truncateString(str, props.noOfCharsToTruncate || 4);\n }\n\n return str;\n };\n return calculateLongestLabelWidth(\n props.stringDatasetForYAxisDomain!.map(label => formatTickLabel(label)),\n `.${className} text`,\n );\n }\n\n const {\n calloutProps,\n points,\n chartType,\n svgProps,\n culture,\n dateLocalizeOptions,\n timeFormatLocale,\n customDateTimeFormatter,\n } = props;\n if (props.parentRef) {\n _fitParentContainer();\n }\n const margin = { ...margins };\n // Note: This check is unnecessary since startFromX is only set for charts with string y-axis.\n if (chartTypesWithStringYAxis.includes(props.chartType)) {\n if (!_useRtl) {\n margin.left! += startFromX;\n } else {\n margin.right! += startFromX;\n }\n }\n // Callback for margins to the chart\n props.getmargins && props.getmargins(margin);\n\n let callout: JSXElement | null = null;\n\n let children = null;\n if ((props.enableFirstRenderOptimization && chartContainer.current) || !props.enableFirstRenderOptimization) {\n _isFirstRender.current = false;\n const XAxisParams = {\n domainNRangeValues: props.getDomainNRangeValues(\n points,\n props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins,\n containerWidth,\n chartType,\n _useRtl,\n props.xAxisType,\n props.barwidth!,\n props.tickValues!,\n // This is only used for Horizontal Bar Chart with Axis for y as string axis\n startFromX,\n ),\n // FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.\n // Since the x-axis in HBWA is numeric, it typically doesn't require transformation.\n // However, if transformation props are enabled, the updated _removalValueForTextTuncate\n // will only be available in the next render, as it's set after the axis is created.\n // Solution: Delay the creation of gridlines until after the transformation has been applied,\n // or precompute the required height for transformed labels (_removalValueForTextTuncate).\n containerHeight: containerHeight - _removalValueForTextTuncate,\n margins: margins,\n xAxisElement: xAxisElement.current!,\n showRoundOffXTickValues: props.showRoundOffXTickValues ?? true,\n xAxisCount: props.xAxisTickCount,\n xAxistickSize: props.xAxistickSize,\n tickPadding: props.tickPadding || props.showXAxisLablesTooltip ? 5 : 10,\n xAxisPadding: props.xAxisPadding,\n xAxisInnerPadding: props.xAxisInnerPadding,\n xAxisOuterPadding: props.xAxisOuterPadding,\n containerWidth: containerWidth,\n hideTickOverlap: props.rotateXAxisLables ? false : props.hideTickOverlap,\n calcMaxLabelWidth: _calcMaxLabelWidthWithTransform,\n };\n\n /**\n * These scales used for 2 purposes.\n * 1. To create x and y axis\n * 2. To draw the graph.\n * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let xScale: any;\n let tickValues: (string | number)[];\n switch (props.xAxisType!) {\n case XAxisTypes.NumericAxis:\n ({ xScale, tickValues } = createNumericXAxis(XAxisParams, props.tickParams!, props.chartType, culture));\n break;\n case XAxisTypes.DateAxis:\n ({ xScale, tickValues } = createDateXAxis(\n XAxisParams,\n props.tickParams!,\n culture,\n dateLocalizeOptions,\n timeFormatLocale,\n customDateTimeFormatter,\n props.useUTC,\n props.chartType,\n ));\n break;\n case XAxisTypes.StringAxis:\n ({ xScale, tickValues } = createStringXAxis(\n XAxisParams,\n props.tickParams!,\n props.datasetForXAxisDomain!,\n culture,\n ));\n break;\n default:\n ({ xScale, tickValues } = createNumericXAxis(XAxisParams, props.tickParams!, props.chartType, culture));\n }\n _xScale = xScale;\n _tickValues = tickValues;\n\n _transformXAxisLabels();\n\n const YAxisParams = {\n margins: props.getYDomainMargins ? props.getYDomainMargins(containerHeight) : margins,\n containerWidth: containerWidth,\n containerHeight: containerHeight - _removalValueForTextTuncate,\n yAxisElement: yAxisElement.current!,\n yAxisTickFormat: props.yAxisTickFormat!,\n yAxisTickCount: props.yAxisTickCount!,\n yMinValue: props.yMinValue || 0,\n yMaxValue: props.yMaxValue || 0,\n tickPadding: 10,\n maxOfYVal: props.maxOfYVal,\n yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType),\n // please note these padding default values must be consistent in here\n // and the parent chart(HBWA/Vertical etc..) for more details refer example\n // http://using-d3js.com/04_07_ordinal_scales.html\n yAxisPadding: props.yAxisPadding || 0,\n };\n /**\n * These scales used for 2 purposes.\n * 1. To create x and y axis\n * 2. To draw the graph.\n * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let yScalePrimary: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let yScaleSecondary: any;\n const axisData: IAxisData = { yAxisDomainValues: [] };\n if (props.yAxisType && props.yAxisType === YAxisType.StringAxis) {\n yScalePrimary = props.createStringYAxis(\n YAxisParams,\n props.stringDatasetForYAxisDomain!,\n _useRtl,\n props.barwidth,\n props.chartType,\n );\n } else {\n // TODO: Since the scale domain values are now computed independently for both the primary and\n // secondary y-axes, the yMinValue and yMaxValue props are no longer necessary for accurately\n // rendering the secondary y-axis. Therefore, rather than checking the secondaryYScaleOptions\n // prop to determine whether to create a secondary y-axis, it's more appropriate to check if any\n // data points are assigned to use the secondary y-scale.\n if (props?.secondaryYScaleOptions) {\n const YAxisParamsSecondary = {\n margins: margins,\n containerWidth: containerWidth,\n containerHeight: containerHeight - _removalValueForTextTuncate!,\n yAxisElement: yAxisElementSecondary.current,\n yAxisTickFormat: props.yAxisTickFormat!,\n yAxisTickCount: props.yAxisTickCount!,\n yMinValue: props.secondaryYScaleOptions?.yMinValue || 0,\n yMaxValue: props.secondaryYScaleOptions?.yMaxValue ?? 100,\n tickPadding: 10,\n yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType, true),\n yAxisPadding: props.yAxisPadding,\n };\n\n yScaleSecondary = props.createYAxis(\n YAxisParamsSecondary,\n _useRtl,\n axisData,\n isIntegralDataset,\n chartType,\n true,\n props.roundedTicks!,\n );\n }\n yScalePrimary = props.createYAxis(\n YAxisParams,\n _useRtl,\n axisData,\n isIntegralDataset,\n chartType,\n false,\n props.roundedTicks!,\n );\n }\n\n if (chartTypesWithStringYAxis.includes(props.chartType) && props.yAxisType === YAxisType.StringAxis) {\n // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup\n // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur\n // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with _tooltipId)\n if (!props.showYAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n //eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at y axis labels.\n if (props.showYAxisLablesTooltip) {\n // To create y axis tick values by if specified truncating the rest of the text\n // and showing elipsis or showing the whole string,\n yScalePrimary &&\n // Note: This function should be invoked within the showYAxisLablesTooltip check,\n // as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.\n createYAxisLabels(\n yAxisElement.current!,\n yScalePrimary,\n props.noOfCharsToTruncate || 4,\n props.showYAxisLablesTooltip || false,\n _useRtl,\n );\n const _yAxisElement = d3Select(yAxisElement.current!).call(yScalePrimary);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n //eslint-disable-next-line no-empty\n } catch (e) {}\n const ytooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: _yAxisElement,\n };\n _yAxisElement && tooltipOfAxislabels(ytooltipProps);\n }\n }\n\n // Call back to the chart.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _getData = (xScale: any, yScalePrimary: any, yScaleSecondary: any) => {\n props.getGraphData &&\n props.getGraphData(\n xScale,\n yScalePrimary,\n containerHeight - _removalValueForTextTuncate!,\n containerWidth,\n xAxisElement.current,\n yAxisElement.current,\n yScaleSecondary,\n );\n };\n\n props.getAxisData && props.getAxisData(axisData);\n // Callback function for chart, returns axis\n _getData(xScale, yScalePrimary, yScaleSecondary);\n\n children = props.children({\n xScale,\n yScalePrimary,\n yScaleSecondary,\n containerHeight,\n containerWidth,\n });\n\n if (!props.hideTooltip && calloutProps!.isPopoverOpen) {\n callout = _generateCallout(calloutProps);\n }\n }\n const svgDimensions = {\n width: containerWidth,\n height: containerHeight,\n };\n\n const xAxisTitleMaximumAllowedWidth = svgDimensions.width - margins.left! - margins.right! - startFromX!;\n const yAxisTitleMaximumAllowedHeight =\n svgDimensions.height - margins.bottom! - margins.top! - _removalValueForTextTuncate! - titleMargin;\n /**\n * When screen resizes, along with screen, chart also auto adjusted.\n * This method used to adjust height and width of the charts.\n */\n function _fitParentContainer(): void {\n //_reqID = requestAnimationFrame(() => {\n let legendContainerHeight;\n if (props.hideLegend) {\n // If there is no legend, need not to allocate some space from total chart space.\n legendContainerHeight = 0;\n } else {\n const legendContainerComputedStyles = legendContainer && getComputedStyle(legendContainer);\n legendContainerHeight =\n ((legendContainer && legendContainer.getBoundingClientRect().height) || minLegendContainerHeight) +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginTop) || '0') +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginBottom) || '0');\n }\n if (props.parentRef || chartContainer.current) {\n const container = props.parentRef ? props.parentRef : chartContainer.current!;\n const currentContainerWidth =\n props.reflowProps?.mode === 'min-width' && !_isFirstRender.current\n ? Math.max(container.getBoundingClientRect().width, _calculateChartMinWidth())\n : container.getBoundingClientRect().width;\n const currentContainerHeight =\n container.getBoundingClientRect().height > legendContainerHeight\n ? container.getBoundingClientRect().height\n : 350;\n const shouldResize =\n containerWidth !== currentContainerWidth || containerHeight !== currentContainerHeight - legendContainerHeight;\n if (shouldResize) {\n setContainerWidth(currentContainerWidth);\n setContainerHeight(currentContainerHeight - legendContainerHeight);\n }\n }\n //});\n }\n\n function _onChartLeave(): void {\n props.onChartMouseLeave && props.onChartMouseLeave();\n }\n\n function _calculateChartMinWidth(): number {\n // Adding 10px for padding on both sides\n const labelWidth = _calcMaxLabelWidthWithTransform(_tickValues) + 10;\n\n let minChartWidth = margins.left! + margins.right! + labelWidth * (_tickValues.length - 1);\n\n if (\n [ChartTypes.GroupedVerticalBarChart, ChartTypes.VerticalBarChart, ChartTypes.VerticalStackedBarChart].includes(\n props.chartType,\n )\n ) {\n const minDomainMargin = 8;\n minChartWidth += minDomainMargin * 2;\n }\n\n return minChartWidth;\n }\n\n function _calcMaxLabelWidthWithTransform(x: (string | number)[]) {\n // Case: rotated labels\n if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType! === XAxisTypes.StringAxis) {\n const longestLabelWidth = calculateLongestLabelWidth(x, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth * Math.cos(Math.PI / 4));\n }\n\n // Case: truncated labels\n if (props.showXAxisLablesTooltip) {\n const tickValues = x.map(val => {\n const numChars = props.noOfCharsToTruncate || 4;\n return val.toString().length > numChars ? `${val.toString().slice(0, numChars)}...` : val;\n });\n\n const longestLabelWidth = calculateLongestLabelWidth(tickValues, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth);\n }\n\n // Case: wrapped labels\n if (props.wrapXAxisLables) {\n // FIXME: Calculate the max width of lines instead of words. This requires applying\n // the wrapping transformation earlier to obtain the actual rendered lines.\n const words: string[] = [];\n x.forEach((val: string) => {\n words.push(...val.toString().split(/\\s+/));\n });\n\n // This approach works well in most cases, since overflow typically occurs only when\n // a single word exceeds the specified width — otherwise, the text will wrap as expected.\n const longestLabelWidth = calculateLongestLabelWidth(words, `.${classes.xAxis} text`);\n return Math.max(Math.ceil(longestLabelWidth), DEFAULT_WRAP_WIDTH);\n }\n\n // Default case\n const longestLabelWidth = calculateLongestLabelWidth(x, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth);\n }\n\n function _transformXAxisLabels() {\n _removalValueForTextTuncate = 0;\n\n /*\n * To enable wrapping of x axis tick values or to display complete x axis tick values,\n * we need to calculate how much space it needed to render the text.\n * No need to re-calculate every time the chart renders and same time need to get an update. So using setState.\n * Required space will be calculated first time chart rendering and if any width/height of chart updated.\n * */\n if (props.wrapXAxisLables || props.showXAxisLablesTooltip) {\n let maxXAxisLabelWidth: number | undefined;\n if (props.xAxisType === XAxisTypes.StringAxis) {\n if ((props.datasetForXAxisDomain?.length || 0) > 1) {\n maxXAxisLabelWidth = _xScale.step();\n } else {\n maxXAxisLabelWidth = containerWidth;\n }\n }\n\n const wrapLabelProps = {\n node: xAxisElement.current!,\n xAxis: _xScale,\n showXAxisLablesTooltip: props.showXAxisLablesTooltip || false,\n noOfCharsToTruncate: props.noOfCharsToTruncate || 4,\n width: maxXAxisLabelWidth,\n };\n _removalValueForTextTuncate = createWrapOfXLabels(wrapLabelProps) ?? 0;\n }\n\n if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType! === XAxisTypes.StringAxis) {\n const rotateLabelProps = {\n node: xAxisElement.current!,\n xAxis: _xScale,\n };\n const rotatedHeight = rotateXAxisLabels(rotateLabelProps) ?? 0;\n // margins.bottom is used as padding here\n _removalValueForTextTuncate = rotatedHeight + margins.bottom!;\n }\n }\n\n /**\n * We have use the {@link defaultTabbableElement } to fix\n * the Focus not landing on chart while tabbing, instead goes to legend.\n * This issue is observed in Area, line chart after performance optimization done in the PR {@link https://github.com/microsoft/fluentui/pull/27721 }\n * This issue is observed in Bar charts after the changes done by FocusZone team in the PR: {@link https://github.com/microsoft/fluentui/pull/24175 }\n * The issue in Bar Charts(VB and VSB) is due to a {@link FocusZone } update where previously an event listener was\n * attached on keydown to the window, so that whenever the tab key is pressed all outer FocusZone's\n * tab-indexes are updated (an outer FocusZone is a FocusZone that is not within another one).\n * But now after the above PR : they are attaching the\n * listeners to the FocusZone elements instead of the window. So in the first render cycle in Bar charts\n * bars are not created as in the first render cycle the size of the chart container is not known( or is 0)\n * which creates bars of height 0 so instead we do not create any bars and instead return empty fragments.\n *\n * We have tried 2 Approaches to fix the issue:\n * 1. Using the {@link elementRef} property of FocusZone where we dispatch event for tab keydown\n * after the second render cycle which triggers an update of the tab index in FocusZone.\n * But this is a hacky solution and not a proper fix and also elementRef is deprecated.\n * 2. Using the default tabbable element to fix the issue.\n */\n\n return (\n <div\n id={idForGraph}\n className={classes.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => (chartContainer.current = rootElem)}\n onMouseLeave={_onChartLeave}\n >\n <div className={classes.chartWrapper} {...focusAttributes} {...arrowAttributes}>\n {_isFirstRender.current}\n <svg\n width={svgDimensions.width}\n height={svgDimensions.height}\n aria-label={props.chartTitle}\n style={{ display: 'block' }}\n className={classes.chart}\n {...getSecureProps(svgProps)}\n >\n <g\n ref={(e: SVGSVGElement | null) => {\n xAxisElement.current = e!;\n }}\n id={`xAxisGElement${idForGraph}`}\n // To add wrap of x axis lables feature, need to remove word height from svg height.\n transform={`translate(0, ${svgDimensions.height - margins.bottom! - _removalValueForTextTuncate!})`}\n className={classes.xAxis}\n />\n {props.xAxisTitle !== undefined && props.xAxisTitle !== '' && (\n <SVGTooltipText\n content={props.xAxisTitle}\n textProps={{\n x: margins.left! + startFromX + xAxisTitleMaximumAllowedWidth / 2,\n y: svgDimensions.height - titleMargin,\n className: classes.axisTitle!,\n textAnchor: 'middle',\n }}\n maxWidth={xAxisTitleMaximumAllowedWidth}\n wrapContent={wrapContent}\n showBackground={true}\n className={classes.svgTooltip}\n />\n )}\n {props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '' && (\n <SVGTooltipText\n content={props.xAxisAnnotation}\n textProps={{\n x: margins.left! + startFromX + xAxisTitleMaximumAllowedWidth / 2,\n y: titleMargin + 3,\n className: classes.axisAnnotation!,\n textAnchor: 'middle',\n 'aria-hidden': true,\n }}\n maxWidth={xAxisTitleMaximumAllowedWidth}\n wrapContent={wrapContent}\n showBackground={true}\n className={classes.svgTooltip}\n />\n )}\n <g\n ref={(e: SVGSVGElement | null) => {\n yAxisElement.current = e!;\n }}\n id={`yAxisGElement${idForGraph}`}\n transform={`translate(${\n _useRtl ? svgDimensions.width - margins.right! - startFromX : margins.left! + startFromX\n }, 0)`}\n className={classes.yAxis}\n />\n {props.secondaryYScaleOptions && (\n <g>\n <g\n ref={(e: SVGSVGElement | null) => {\n yAxisElementSecondary.current = e!;\n }}\n id={`yAxisGElementSecondary${idForGraph}`}\n transform={`translate(${\n _useRtl ? margins.left! + startFromX : svgDimensions.width - margins.right! - startFromX\n }, 0)`}\n className={classes.yAxis}\n />\n {props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '' && (\n <SVGTooltipText\n content={props.secondaryYAxistitle}\n textProps={{\n x: (yAxisTitleMaximumAllowedHeight - margins.bottom!) / 2 + _removalValueForTextTuncate!,\n y: _useRtl ? startFromX - titleMargin : svgDimensions.width - margins.right!,\n textAnchor: 'middle',\n transform: `translate(${\n _useRtl ? margins.right! / 2 - titleMargin : margins.right! / 2 + titleMargin\n },\n ${svgDimensions.height - margins.bottom! - margins.top! - titleMargin})rotate(-90)`,\n className: classes.axisTitle!,\n }}\n maxWidth={yAxisTitleMaximumAllowedHeight}\n wrapContent={wrapContent}\n showBackground={true}\n className={classes.svgTooltip}\n />\n )}\n </g>\n )}\n {children}\n {props.yAxisTitle !== undefined && props.yAxisTitle !== '' && (\n <SVGTooltipText\n content={props.yAxisTitle}\n textProps={{\n x: (yAxisTitleMaximumAllowedHeight - margins.bottom!) / 2 + _removalValueForTextTuncate!,\n y: _useRtl ? svgDimensions.width - margins.right! / 2 + titleMargin : margins.left! / 2 - titleMargin,\n textAnchor: 'middle',\n transform: `translate(0,\n ${svgDimensions.height - margins.bottom! - margins.top! - titleMargin})rotate(-90)`,\n className: classes.axisTitle!,\n }}\n maxWidth={yAxisTitleMaximumAllowedHeight}\n wrapContent={wrapContent}\n showBackground={true}\n className={classes.svgTooltip}\n />\n )}\n {props.yAxisAnnotation !== undefined &&\n props.yAxisAnnotation !== '' &&\n (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '') && (\n <SVGTooltipText\n content={props.yAxisAnnotation}\n textProps={{\n x: (yAxisTitleMaximumAllowedHeight - margins.bottom!) / 2 + _removalValueForTextTuncate!,\n y: _useRtl ? startFromX - titleMargin : svgDimensions.width - margins.right!,\n textAnchor: 'middle',\n transform: `translate(${\n _useRtl ? margins.right! / 2 - titleMargin : margins.right! / 2 + titleMargin\n },\n ${svgDimensions.height - margins.bottom! - margins.top! - titleMargin})rotate(-90)`,\n className: classes.axisAnnotation!,\n 'aria-hidden': true,\n }}\n maxWidth={yAxisTitleMaximumAllowedHeight}\n wrapContent={wrapContent}\n showBackground={true}\n className={classes.svgTooltip}\n />\n )}\n </svg>\n </div>\n\n {!props.hideLegend && (\n <div ref={(e: HTMLDivElement) => (legendContainer = e)} className={classes.legendContainer}>\n {props.legendBars}\n </div>\n )}\n {/** The callout is used for narration, so keep it mounted on the DOM */}\n {callout && <React.Suspense fallback={<div>Loading...</div>}>{callout}</React.Suspense>}\n </div>\n );\n});\nCartesianChart.displayName = 'CartesianChart';\nCartesianChart.defaultProps = {\n hideTickOverlap: true,\n};\n"],"names":["React","useCartesianChartStyles","select","d3Select","createNumericXAxis","createStringXAxis","createDateXAxis","XAxisTypes","YAxisType","createWrapOfXLabels","rotateXAxisLabels","calculateLongestLabelWidth","createYAxisLabels","ChartTypes","wrapContent","useRtl","truncateString","tooltipOfAxislabels","getSecureProps","DEFAULT_WRAP_WIDTH","useId","SVGTooltipText","ChartPopover","useFocusableGroup","useArrowNavigationGroup","CartesianChart","forwardRef","props","forwardedRef","chartContainer","useRef","legendContainer","minLegendContainerHeight","xAxisElement","yAxisElement","yAxisElementSecondary","margins","idForGraph","_reqID","_useRtl","_tickValues","titleMargin","_isFirstRender","_xScale","isIntegralDataset","_tooltipId","_removalValueForTextTuncate","containerWidth","setContainerWidth","useState","containerHeight","setContainerHeight","startFromX","setStartFromX","prevProps","setPrevProps","chartTypesWithStringYAxis","HorizontalBarChartWithAxis","HeatMapChart","VerticalStackedBarChart","GanttChart","top","bottom","right","left","secondaryYScaleOptions","TITLE_MARGIN","xAxisTitle","undefined","yAxisTitle","secondaryYAxistitle","xAxisAnnotation","yAxisAnnotation","classes","focusAttributes","arrowAttributes","axis","useEffect","_fitParentContainer","includes","chartType","showYAxisLables","yAxisType","StringAxis","maxYAxisLabelLength","calculateMaxYAxisLabelLength","yAxis","points","some","point","y","cancelAnimationFrame","height","width","useImperativeHandle","componentRef","current","_generateCallout","calloutProps","className","formatTickLabel","str","showYAxisLablesTooltip","noOfCharsToTruncate","stringDatasetForYAxisDomain","map","label","svgProps","culture","dateLocalizeOptions","timeFormatLocale","customDateTimeFormatter","parentRef","margin","getmargins","callout","children","enableFirstRenderOptimization","XAxisParams","domainNRangeValues","getDomainNRangeValues","getDomainMargins","xAxisType","barwidth","tickValues","showRoundOffXTickValues","xAxisCount","xAxisTickCount","xAxistickSize","tickPadding","showXAxisLablesTooltip","xAxisPadding","xAxisInnerPadding","xAxisOuterPadding","hideTickOverlap","rotateXAxisLables","calcMaxLabelWidth","_calcMaxLabelWidthWithTransform","xScale","NumericAxis","tickParams","DateAxis","useUTC","datasetForXAxisDomain","_transformXAxisLabels","YAxisParams","getYDomainMargins","yAxisTickFormat","yAxisTickCount","yMinValue","yMaxValue","maxOfYVal","yMinMaxValues","getMinMaxOfYAxis","yAxisPadding","yScalePrimary","yScaleSecondary","axisData","yAxisDomainValues","createStringYAxis","YAxisParamsSecondary","createYAxis","roundedTicks","document","getElementById","remove","e","_yAxisElement","call","ytooltipProps","tooltipCls","tooltip","id","_getData","getGraphData","getAxisData","hideTooltip","isPopoverOpen","svgDimensions","xAxisTitleMaximumAllowedWidth","yAxisTitleMaximumAllowedHeight","legendContainerHeight","hideLegend","legendContainerComputedStyles","getComputedStyle","getBoundingClientRect","parseFloat","marginTop","marginBottom","container","currentContainerWidth","reflowProps","mode","Math","max","_calculateChartMinWidth","currentContainerHeight","shouldResize","_onChartLeave","onChartMouseLeave","labelWidth","minChartWidth","length","GroupedVerticalBarChart","VerticalBarChart","minDomainMargin","x","wrapXAxisLables","longestLabelWidth","xAxis","ceil","cos","PI","val","numChars","toString","slice","words","forEach","push","split","maxXAxisLabelWidth","step","wrapLabelProps","node","rotateLabelProps","rotatedHeight","div","root","role","ref","rootElem","onMouseLeave","chartWrapper","svg","aria-label","chartTitle","style","display","chart","g","transform","content","textProps","axisTitle","textAnchor","maxWidth","showBackground","svgTooltip","axisAnnotation","legendBars","Suspense","fallback","displayName","defaultProps"],"mappings":";;;;+BAmCayB;;;;;;;iEAnCU,QAAQ;+CAGS,mCAAmC;6BACxC,eAAe;uBAoB3C,wBAAwB;gCACT,4BAA4B;gCAEnB,iCAAiC;8BACnC,iBAAiB;8BACa,0BAA0B;AAM9E,uBAAMA,WAAAA,GAAuEzB,OAAM0B,UAAU,CAGlG,CAACC,OAAOC;QA6CDD,gBACGA,iBACSA,iBAA4BA,iBAC5BA,iBAAmEA;IA/CtF,MAAME,iBAAiB7B,OAAM8B,MAAM;IACnC,IAAIC;IACJ,MAAMC,2BAAmC;IACzC,MAAMC,eAAejC,OAAM8B,MAAM;IACjC,MAAMI,eAAelC,OAAM8B,MAAM;IACjC,MAAMK,wBAAwBnC,OAAM8B,MAAM;IAC1C,IAAIM;IACJ,MAAMC,aAAqB;IAC3B,IAAIC;IACJ,MAAMC,cAAmBxB,aAAAA;IACzB,IAAIyB;IACJ,MAAMC,cAAsB;IAC5B,MAAMC,iBAAiB1C,OAAM8B,MAAM,CAAU;IAC7C,8DAA8D;IAC9D,IAAIa;IACJ,IAAIC,oBAA6B;IACjC,IAAIC,aAAqBzB,yBAAAA,EAAM;IAC/B;;;;;GAKC,GACD,IAAI0B,8BAAsC;IAE1C,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGhD,OAAMiD,QAAQ,CAAS;IACnE,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGnD,OAAMiD,QAAQ,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AGpE,GAAG;AACH1F,eAAeoO,WAAW,GAAG;AAC7BpO,eAAeqO,YAAY,GAAG;IAC5BxH,iBAAiB;AACnB"}
1
+ {"version":3,"sources":["../src/components/CommonComponents/CartesianChart.tsx"],"sourcesContent":["import * as React from 'react';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { ModifiedCartesianChartProps } from '../../index';\nimport { useCartesianChartStyles } from './useCartesianChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport {\n createNumericXAxis,\n createStringXAxis,\n IAxisData,\n createDateXAxis,\n IMargins,\n XAxisTypes,\n YAxisType,\n createWrapOfXLabels,\n rotateXAxisLabels,\n calculateLongestLabelWidth,\n createYAxisLabels,\n ChartTypes,\n wrapContent,\n useRtl,\n truncateString,\n tooltipOfAxislabels,\n getSecureProps,\n DEFAULT_WRAP_WIDTH,\n} from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { SVGTooltipText, SVGTooltipTextProps } from '../../utilities/SVGTooltipText';\nimport { ChartPopover } from './ChartPopover';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\n\n/**\n * Cartesian Chart component\n * {@docCategory CartesianChart}\n */\nexport const CartesianChart: React.FunctionComponent<ModifiedCartesianChartProps> = React.forwardRef<\n HTMLDivElement,\n ModifiedCartesianChartProps\n>((props, forwardedRef) => {\n const chartContainer = React.useRef<HTMLDivElement>();\n let legendContainer: HTMLDivElement;\n const minLegendContainerHeight: number = 40;\n const xAxisElement = React.useRef<SVGSVGElement>();\n const yAxisElement = React.useRef<SVGSVGElement>();\n const yAxisElementSecondary = React.useRef<SVGSVGElement>();\n let margins: IMargins;\n const idForGraph: string = 'chart_';\n let _reqID: number;\n const _useRtl: boolean = useRtl();\n let _tickValues: (string | number)[];\n const titleMargin: number = 8;\n const _isFirstRender = React.useRef<boolean>(true);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xScale: any;\n let isIntegralDataset: boolean = true;\n let _tooltipId: string = useId('tooltip_');\n /* Used for when WrapXAxisLabels props appeared.\n * To display the total word (space separated words), Need to have more space than usual.\n * This height will get total height need to disaply total word.\n * These value need to be removed from actual svg height/graph height.\n * Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.\n */\n let _removalValueForTextTuncate: number = 0;\n\n const [containerWidth, setContainerWidth] = React.useState<number>(0);\n const [containerHeight, setContainerHeight] = React.useState<number>(0);\n const [startFromX, setStartFromX] = React.useState<number>(0);\n const [prevProps, setPrevProps] = React.useState<ModifiedCartesianChartProps | null>(null);\n\n const chartTypesWithStringYAxis = [\n ChartTypes.HorizontalBarChartWithAxis,\n ChartTypes.HeatMapChart,\n ChartTypes.VerticalStackedBarChart,\n ChartTypes.GanttChart,\n ChartTypes.ScatterChart,\n ];\n /**\n * In RTL mode, Only graph will be rendered left/right. We need to provide left and right margins manually.\n * So that, in RTL, left margins becomes right margins and viceversa.\n * As graph needs to be drawn perfecty, these values consider as default values.\n * Same margins using for all other cartesian charts. Can be accessible through 'getMargins' call back method.\n */\n // eslint-disable-next-line prefer-const\n margins = {\n top: props.margins?.top ?? 20,\n bottom: props.margins?.bottom ?? 35,\n right: _useRtl ? props.margins?.left ?? 40 : props.margins?.right ?? props?.secondaryYScaleOptions ? 40 : 20,\n left: _useRtl ? (props.margins?.right ?? props?.secondaryYScaleOptions ? 40 : 20) : props.margins?.left ?? 40,\n };\n const TITLE_MARGIN_HORIZONTAL = 24;\n const TITLE_MARGIN_VERTICAL = 20;\n if (props.xAxisTitle !== undefined && props.xAxisTitle !== '') {\n margins.bottom! = props.margins?.bottom ?? margins.bottom! + TITLE_MARGIN_VERTICAL;\n }\n if (props.yAxisTitle !== undefined && props.yAxisTitle !== '') {\n margins.left! = _useRtl\n ? props.margins?.right ?? props?.secondaryYAxistitle\n ? margins.right! + 2 * TITLE_MARGIN_HORIZONTAL\n : margins.right! + TITLE_MARGIN_HORIZONTAL\n : props.margins?.left ?? margins.left! + TITLE_MARGIN_HORIZONTAL;\n margins.right! = _useRtl\n ? props.margins?.left ?? margins.left! + TITLE_MARGIN_HORIZONTAL\n : props.margins?.right ?? props?.secondaryYAxistitle\n ? margins.right! + 2 * TITLE_MARGIN_HORIZONTAL\n : margins.right! + TITLE_MARGIN_HORIZONTAL;\n }\n if (props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '') {\n margins.top! = props.margins?.top ?? margins.top! + TITLE_MARGIN_VERTICAL;\n }\n if (\n props.yAxisAnnotation !== undefined &&\n props.yAxisAnnotation !== '' &&\n (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '')\n ) {\n if (_useRtl) {\n margins.left! = props.margins?.right ?? margins.right! + TITLE_MARGIN_HORIZONTAL;\n } else {\n margins.right! = props.margins?.right ?? margins.right! + TITLE_MARGIN_HORIZONTAL;\n }\n }\n\n const classes = useCartesianChartStyles(props);\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal' });\n // ComponentdidMount and Componentwillunmount logic\n React.useEffect(() => {\n _fitParentContainer();\n if (props !== null) {\n setPrevProps(props);\n }\n if (\n chartTypesWithStringYAxis.includes(props.chartType) &&\n props.showYAxisLables &&\n yAxisElement &&\n props.yAxisType === YAxisType.StringAxis\n ) {\n const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis!);\n if (startFromX !== maxYAxisLabelLength) {\n setStartFromX(maxYAxisLabelLength);\n }\n } else if (startFromX !== 0) {\n setStartFromX(0);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n isIntegralDataset = !props.points.some((point: { y: number }) => point.y % 1 !== 0);\n return () => {\n cancelAnimationFrame(_reqID);\n };\n }, [props]);\n\n // ComponentDidUpdate logic\n React.useEffect(() => {\n if (prevProps) {\n if (prevProps.height !== props.height || prevProps.width !== props.width) {\n _fitParentContainer();\n }\n }\n if (\n chartTypesWithStringYAxis.includes(props.chartType) &&\n props.showYAxisLables &&\n yAxisElement &&\n props.yAxisType === YAxisType.StringAxis\n ) {\n const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis!);\n if (startFromX !== maxYAxisLabelLength) {\n setStartFromX(maxYAxisLabelLength);\n }\n } else if (startFromX !== 0) {\n setStartFromX(0);\n }\n if (prevProps !== null && prevProps.points !== props.points) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n isIntegralDataset = !props.points.some((point: { y: number }) => point.y % 1 !== 0);\n }\n }, [props, prevProps]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: chartContainer.current ?? null,\n }),\n [],\n );\n\n /**\n * Dedicated function to return the Callout JSX Element , which can further be used to only call this when\n * only the calloutprops and charthover props changes.\n * @param calloutProps\n * @param chartHoverProps\n * @returns\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _generateCallout(calloutProps: any): JSXElement {\n return <ChartPopover {...calloutProps} />;\n }\n\n function calculateMaxYAxisLabelLength(className: string): number {\n const formatTickLabel = (str: string) => {\n if (props.showYAxisLablesTooltip) {\n return truncateString(str, props.noOfCharsToTruncate || 4);\n }\n\n return str;\n };\n return calculateLongestLabelWidth(\n props.stringDatasetForYAxisDomain!.map(label => formatTickLabel(label)),\n `.${className} text`,\n );\n }\n\n const {\n calloutProps,\n points,\n chartType,\n svgProps,\n culture,\n dateLocalizeOptions,\n timeFormatLocale,\n customDateTimeFormatter,\n } = props;\n if (props.parentRef) {\n _fitParentContainer();\n }\n const margin = { ...margins };\n // Note: This check is unnecessary since startFromX is only set for charts with string y-axis.\n if (chartTypesWithStringYAxis.includes(props.chartType)) {\n if (!_useRtl) {\n margin.left! += startFromX;\n } else {\n margin.right! += startFromX;\n }\n }\n // Callback for margins to the chart\n props.getmargins && props.getmargins(margin);\n\n let callout: JSXElement | null = null;\n\n let children = null;\n if ((props.enableFirstRenderOptimization && chartContainer.current) || !props.enableFirstRenderOptimization) {\n _isFirstRender.current = false;\n const XAxisParams = {\n domainNRangeValues: props.getDomainNRangeValues(\n points,\n props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins,\n containerWidth,\n chartType,\n _useRtl,\n props.xAxisType,\n props.barwidth!,\n props.tickValues!,\n // This is only used for Horizontal Bar Chart with Axis for y as string axis\n startFromX,\n ),\n // FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.\n // Since the x-axis in HBWA is numeric, it typically doesn't require transformation.\n // However, if transformation props are enabled, the updated _removalValueForTextTuncate\n // will only be available in the next render, as it's set after the axis is created.\n // Solution: Delay the creation of gridlines until after the transformation has been applied,\n // or precompute the required height for transformed labels (_removalValueForTextTuncate).\n containerHeight: containerHeight - _removalValueForTextTuncate,\n margins: margins,\n xAxisElement: xAxisElement.current!,\n showRoundOffXTickValues: props.showRoundOffXTickValues ?? true,\n xAxisCount: props.xAxisTickCount,\n xAxistickSize: props.xAxistickSize,\n tickPadding: props.tickPadding || props.showXAxisLablesTooltip ? 5 : 10,\n xAxisPadding: props.xAxisPadding,\n xAxisInnerPadding: props.xAxisInnerPadding,\n xAxisOuterPadding: props.xAxisOuterPadding,\n containerWidth: containerWidth,\n hideTickOverlap: props.rotateXAxisLables ? false : props.hideTickOverlap,\n calcMaxLabelWidth: _calcMaxLabelWidthWithTransform,\n tickStep: props.xAxis?.tickStep,\n tick0: props.xAxis?.tick0,\n };\n\n /**\n * These scales used for 2 purposes.\n * 1. To create x and y axis\n * 2. To draw the graph.\n * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let xScale: any;\n let tickValues: (string | number)[];\n switch (props.xAxisType!) {\n case XAxisTypes.NumericAxis:\n ({ xScale, tickValues } = createNumericXAxis(\n XAxisParams,\n props.tickParams!,\n props.chartType,\n culture,\n props.xScaleType,\n ));\n break;\n case XAxisTypes.DateAxis:\n ({ xScale, tickValues } = createDateXAxis(\n XAxisParams,\n props.tickParams!,\n culture,\n dateLocalizeOptions,\n timeFormatLocale,\n customDateTimeFormatter,\n props.useUTC,\n props.chartType,\n ));\n break;\n case XAxisTypes.StringAxis:\n ({ xScale, tickValues } = createStringXAxis(\n XAxisParams,\n props.tickParams!,\n props.datasetForXAxisDomain!,\n culture,\n ));\n break;\n default:\n ({ xScale, tickValues } = createNumericXAxis(\n XAxisParams,\n props.tickParams!,\n props.chartType,\n culture,\n props.xScaleType,\n ));\n }\n _xScale = xScale;\n _tickValues = tickValues;\n\n _transformXAxisLabels();\n\n const YAxisParams = {\n margins: props.getYDomainMargins ? props.getYDomainMargins(containerHeight) : margins,\n containerWidth: containerWidth,\n containerHeight: containerHeight - _removalValueForTextTuncate,\n yAxisElement: yAxisElement.current!,\n yAxisTickFormat: props.yAxisTickFormat!,\n yAxisTickCount: props.yAxisTickCount!,\n yMinValue: props.yMinValue || 0,\n yMaxValue: props.yMaxValue || 0,\n tickPadding: 10,\n maxOfYVal: props.maxOfYVal,\n yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType),\n // please note these padding default values must be consistent in here\n // and the parent chart(HBWA/Vertical etc..) for more details refer example\n // http://using-d3js.com/04_07_ordinal_scales.html\n yAxisPadding: props.yAxisPadding || 0,\n tickValues: props.yAxisTickValues,\n tickStep: props.yAxis?.tickStep,\n tick0: props.yAxis?.tick0,\n };\n /**\n * These scales used for 2 purposes.\n * 1. To create x and y axis\n * 2. To draw the graph.\n * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let yScalePrimary: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let yScaleSecondary: any;\n const axisData: IAxisData = { yAxisDomainValues: [] };\n if (props.yAxisType && props.yAxisType === YAxisType.StringAxis) {\n yScalePrimary = props.createStringYAxis(\n YAxisParams,\n props.stringDatasetForYAxisDomain!,\n _useRtl,\n props.barwidth,\n props.chartType,\n );\n } else {\n // TODO: Since the scale domain values are now computed independently for both the primary and\n // secondary y-axes, the yMinValue and yMaxValue props are no longer necessary for accurately\n // rendering the secondary y-axis. Therefore, rather than checking the secondaryYScaleOptions\n // prop to determine whether to create a secondary y-axis, it's more appropriate to check if any\n // data points are assigned to use the secondary y-scale.\n if (props?.secondaryYScaleOptions) {\n const YAxisParamsSecondary = {\n margins: margins,\n containerWidth: containerWidth,\n containerHeight: containerHeight - _removalValueForTextTuncate!,\n yAxisElement: yAxisElementSecondary.current,\n yAxisTickFormat: props.yAxisTickFormat!,\n yAxisTickCount: props.yAxisTickCount!,\n yMinValue: props.secondaryYScaleOptions?.yMinValue || 0,\n yMaxValue: props.secondaryYScaleOptions?.yMaxValue ?? 100,\n tickPadding: 10,\n yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType, true),\n yAxisPadding: props.yAxisPadding,\n };\n\n yScaleSecondary = props.createYAxis(\n YAxisParamsSecondary,\n _useRtl,\n axisData,\n isIntegralDataset,\n chartType,\n true,\n props.roundedTicks!,\n props.secondaryYScaleType,\n );\n }\n yScalePrimary = props.createYAxis(\n YAxisParams,\n _useRtl,\n axisData,\n isIntegralDataset,\n chartType,\n false,\n props.roundedTicks!,\n props.yScaleType,\n );\n }\n\n if (chartTypesWithStringYAxis.includes(props.chartType) && props.yAxisType === YAxisType.StringAxis) {\n // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup\n // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur\n // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with _tooltipId)\n if (!props.showYAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n //eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at y axis labels.\n if (props.showYAxisLablesTooltip) {\n // To create y axis tick values by if specified truncating the rest of the text\n // and showing elipsis or showing the whole string,\n yScalePrimary &&\n // Note: This function should be invoked within the showYAxisLablesTooltip check,\n // as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.\n createYAxisLabels(\n yAxisElement.current!,\n yScalePrimary,\n props.noOfCharsToTruncate || 4,\n props.showYAxisLablesTooltip || false,\n _useRtl,\n );\n const _yAxisElement = d3Select(yAxisElement.current!).call(yScalePrimary);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n //eslint-disable-next-line no-empty\n } catch (e) {}\n const ytooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: _yAxisElement,\n };\n _yAxisElement && tooltipOfAxislabels(ytooltipProps);\n }\n }\n\n // Call back to the chart.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _getData = (xScale: any, yScalePrimary: any, yScaleSecondary: any) => {\n props.getGraphData &&\n props.getGraphData(\n xScale,\n yScalePrimary,\n containerHeight - _removalValueForTextTuncate!,\n containerWidth,\n xAxisElement.current,\n yAxisElement.current,\n yScaleSecondary,\n );\n };\n\n props.getAxisData && props.getAxisData(axisData);\n // Callback function for chart, returns axis\n _getData(xScale, yScalePrimary, yScaleSecondary);\n\n children = props.children({\n xScale,\n yScalePrimary,\n yScaleSecondary,\n containerHeight,\n containerWidth,\n });\n\n if (!props.hideTooltip && calloutProps!.isPopoverOpen) {\n callout = _generateCallout(calloutProps);\n }\n }\n const svgDimensions = {\n width: containerWidth,\n height: containerHeight,\n };\n\n const xAxisTitleMaximumAllowedWidth = svgDimensions.width - margins.left! - margins.right! - startFromX!;\n const yAxisTitleMaximumAllowedHeight =\n svgDimensions.height - margins.bottom! - margins.top! - _removalValueForTextTuncate! - titleMargin;\n\n const commonSvgToolTipProps: SVGTooltipTextProps = {\n wrapContent,\n showBackground: true,\n className: classes.svgTooltip,\n content: '',\n };\n /**\n * When screen resizes, along with screen, chart also auto adjusted.\n * This method used to adjust height and width of the charts.\n */\n function _fitParentContainer(): void {\n //_reqID = requestAnimationFrame(() => {\n let legendContainerHeight;\n if (props.hideLegend) {\n // If there is no legend, need not to allocate some space from total chart space.\n legendContainerHeight = 0;\n } else {\n const legendContainerComputedStyles = legendContainer && getComputedStyle(legendContainer);\n legendContainerHeight =\n ((legendContainer && legendContainer.getBoundingClientRect().height) || minLegendContainerHeight) +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginTop) || '0') +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginBottom) || '0');\n }\n if (props.parentRef || chartContainer.current) {\n const container = props.parentRef ? props.parentRef : chartContainer.current!;\n const currentContainerWidth =\n props.reflowProps?.mode === 'min-width' && !_isFirstRender.current\n ? Math.max(container.getBoundingClientRect().width, _calculateChartMinWidth())\n : container.getBoundingClientRect().width;\n const currentContainerHeight =\n container.getBoundingClientRect().height > legendContainerHeight\n ? container.getBoundingClientRect().height\n : 350;\n const shouldResize =\n containerWidth !== currentContainerWidth || containerHeight !== currentContainerHeight - legendContainerHeight;\n if (shouldResize) {\n setContainerWidth(currentContainerWidth);\n setContainerHeight(currentContainerHeight - legendContainerHeight);\n }\n }\n //});\n }\n\n function _onChartLeave(): void {\n props.onChartMouseLeave && props.onChartMouseLeave();\n }\n\n function _calculateChartMinWidth(): number {\n // Adding 10px for padding on both sides\n const labelWidth = _calcMaxLabelWidthWithTransform(_tickValues) + 10;\n\n let minChartWidth = margins.left! + margins.right! + labelWidth * (_tickValues.length - 1);\n\n if (\n [ChartTypes.GroupedVerticalBarChart, ChartTypes.VerticalBarChart, ChartTypes.VerticalStackedBarChart].includes(\n props.chartType,\n )\n ) {\n const minDomainMargin = 8;\n minChartWidth += minDomainMargin * 2;\n }\n\n return minChartWidth;\n }\n\n function _calcMaxLabelWidthWithTransform(x: (string | number)[]) {\n // Case: rotated labels\n if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType! === XAxisTypes.StringAxis) {\n const longestLabelWidth = calculateLongestLabelWidth(x, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth * Math.cos(Math.PI / 4));\n }\n\n // Case: truncated labels\n if (props.showXAxisLablesTooltip) {\n const tickValues = x.map(val => {\n const numChars = props.noOfCharsToTruncate || 4;\n return val.toString().length > numChars ? `${val.toString().slice(0, numChars)}...` : val;\n });\n\n const longestLabelWidth = calculateLongestLabelWidth(tickValues, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth);\n }\n\n // Case: wrapped labels\n if (props.wrapXAxisLables) {\n // FIXME: Calculate the max width of lines instead of words. This requires applying\n // the wrapping transformation earlier to obtain the actual rendered lines.\n const words: string[] = [];\n x.forEach((val: string) => {\n words.push(...val.toString().split(/\\s+/));\n });\n\n // This approach works well in most cases, since overflow typically occurs only when\n // a single word exceeds the specified width — otherwise, the text will wrap as expected.\n const longestLabelWidth = calculateLongestLabelWidth(words, `.${classes.xAxis} text`);\n return Math.max(Math.ceil(longestLabelWidth), DEFAULT_WRAP_WIDTH);\n }\n\n // Default case\n const longestLabelWidth = calculateLongestLabelWidth(x, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth);\n }\n\n function _transformXAxisLabels() {\n _removalValueForTextTuncate = 0;\n\n /*\n * To enable wrapping of x axis tick values or to display complete x axis tick values,\n * we need to calculate how much space it needed to render the text.\n * No need to re-calculate every time the chart renders and same time need to get an update. So using setState.\n * Required space will be calculated first time chart rendering and if any width/height of chart updated.\n * */\n if (props.wrapXAxisLables || props.showXAxisLablesTooltip) {\n let maxXAxisLabelWidth: number | undefined;\n if (props.xAxisType === XAxisTypes.StringAxis) {\n if ((props.datasetForXAxisDomain?.length || 0) > 1) {\n maxXAxisLabelWidth = _xScale.step();\n } else {\n maxXAxisLabelWidth = containerWidth;\n }\n }\n\n const wrapLabelProps = {\n node: xAxisElement.current!,\n xAxis: _xScale,\n showXAxisLablesTooltip: props.showXAxisLablesTooltip || false,\n noOfCharsToTruncate: props.noOfCharsToTruncate || 4,\n width: maxXAxisLabelWidth,\n };\n _removalValueForTextTuncate = createWrapOfXLabels(wrapLabelProps) ?? 0;\n }\n\n if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType! === XAxisTypes.StringAxis) {\n const rotateLabelProps = {\n node: xAxisElement.current!,\n xAxis: _xScale,\n };\n const rotatedHeight = rotateXAxisLabels(rotateLabelProps) ?? 0;\n // margins.bottom is used as padding here\n _removalValueForTextTuncate = rotatedHeight + margins.bottom!;\n }\n }\n\n /**\n * We have use the {@link defaultTabbableElement } to fix\n * the Focus not landing on chart while tabbing, instead goes to legend.\n * This issue is observed in Area, line chart after performance optimization done in the PR {@link https://github.com/microsoft/fluentui/pull/27721 }\n * This issue is observed in Bar charts after the changes done by FocusZone team in the PR: {@link https://github.com/microsoft/fluentui/pull/24175 }\n * The issue in Bar Charts(VB and VSB) is due to a {@link FocusZone } update where previously an event listener was\n * attached on keydown to the window, so that whenever the tab key is pressed all outer FocusZone's\n * tab-indexes are updated (an outer FocusZone is a FocusZone that is not within another one).\n * But now after the above PR : they are attaching the\n * listeners to the FocusZone elements instead of the window. So in the first render cycle in Bar charts\n * bars are not created as in the first render cycle the size of the chart container is not known( or is 0)\n * which creates bars of height 0 so instead we do not create any bars and instead return empty fragments.\n *\n * We have tried 2 Approaches to fix the issue:\n * 1. Using the {@link elementRef} property of FocusZone where we dispatch event for tab keydown\n * after the second render cycle which triggers an update of the tab index in FocusZone.\n * But this is a hacky solution and not a proper fix and also elementRef is deprecated.\n * 2. Using the default tabbable element to fix the issue.\n */\n\n return (\n <div\n id={idForGraph}\n className={classes.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => (chartContainer.current = rootElem)}\n onMouseLeave={_onChartLeave}\n >\n <div className={classes.chartWrapper} {...focusAttributes} {...arrowAttributes}>\n {_isFirstRender.current}\n <svg\n width={svgDimensions.width}\n height={svgDimensions.height}\n aria-label={props.chartTitle}\n style={{ display: 'block' }}\n className={classes.chart}\n {...getSecureProps(svgProps)}\n >\n <g\n ref={(e: SVGSVGElement | null) => {\n xAxisElement.current = e!;\n }}\n id={`xAxisGElement${idForGraph}`}\n // To add wrap of x axis lables feature, need to remove word height from svg height.\n transform={`translate(0, ${svgDimensions.height - margins.bottom! - _removalValueForTextTuncate!})`}\n className={classes.xAxis}\n />\n {props.xAxisTitle !== undefined && props.xAxisTitle !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.xAxisTitle}\n textProps={{\n x: margins.left! + startFromX + xAxisTitleMaximumAllowedWidth / 2,\n y: svgDimensions.height - titleMargin,\n className: classes.axisTitle!,\n textAnchor: 'middle',\n }}\n maxWidth={xAxisTitleMaximumAllowedWidth}\n />\n )}\n {props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.xAxisAnnotation}\n textProps={{\n x: margins.left! + startFromX + xAxisTitleMaximumAllowedWidth / 2,\n y: titleMargin + 3,\n className: classes.axisAnnotation!,\n textAnchor: 'middle',\n 'aria-hidden': true,\n }}\n maxWidth={xAxisTitleMaximumAllowedWidth}\n />\n )}\n <g\n ref={(e: SVGSVGElement | null) => {\n yAxisElement.current = e!;\n }}\n id={`yAxisGElement${idForGraph}`}\n transform={`translate(${\n _useRtl ? svgDimensions.width - margins.right! - startFromX : margins.left! + startFromX\n }, 0)`}\n className={classes.yAxis}\n />\n {props.secondaryYScaleOptions && (\n <g>\n <g\n ref={(e: SVGSVGElement | null) => {\n yAxisElementSecondary.current = e!;\n }}\n id={`yAxisGElementSecondary${idForGraph}`}\n transform={`translate(${\n _useRtl ? margins.left! + startFromX : svgDimensions.width - margins.right! - startFromX\n }, 0)`}\n className={classes.yAxis}\n />\n {props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.secondaryYAxistitle}\n textProps={{\n x: (yAxisTitleMaximumAllowedHeight - margins.bottom!) / 2 + _removalValueForTextTuncate!,\n y: _useRtl ? startFromX - titleMargin : svgDimensions.width - margins.right!,\n textAnchor: 'middle',\n transform: `translate(${\n _useRtl ? margins.right! / 2 - titleMargin : margins.right! / 2 + titleMargin\n },\n ${svgDimensions.height - margins.bottom! - margins.top! - titleMargin})rotate(-90)`,\n className: classes.axisTitle!,\n }}\n maxWidth={yAxisTitleMaximumAllowedHeight}\n />\n )}\n </g>\n )}\n {children}\n {props.yAxisTitle !== undefined && props.yAxisTitle !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.yAxisTitle}\n textProps={{\n x: (yAxisTitleMaximumAllowedHeight - margins.bottom!) / 2 + _removalValueForTextTuncate!,\n y: _useRtl ? svgDimensions.width - margins.right! / 2 + titleMargin : margins.left! / 2 - titleMargin,\n textAnchor: 'middle',\n transform: `translate(0,\n ${svgDimensions.height - margins.bottom! - margins.top! - titleMargin})rotate(-90)`,\n className: classes.axisTitle!,\n }}\n maxWidth={yAxisTitleMaximumAllowedHeight}\n />\n )}\n {props.yAxisAnnotation !== undefined &&\n props.yAxisAnnotation !== '' &&\n (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '') && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.yAxisAnnotation}\n textProps={{\n x: (yAxisTitleMaximumAllowedHeight - margins.bottom!) / 2 + _removalValueForTextTuncate!,\n y: _useRtl ? startFromX - titleMargin : svgDimensions.width - margins.right!,\n textAnchor: 'middle',\n transform: `translate(${\n _useRtl ? margins.right! / 2 - titleMargin : margins.right! / 2 + titleMargin\n },\n ${svgDimensions.height - margins.bottom! - margins.top! - titleMargin})rotate(-90)`,\n className: classes.axisAnnotation!,\n 'aria-hidden': true,\n }}\n maxWidth={yAxisTitleMaximumAllowedHeight}\n />\n )}\n </svg>\n </div>\n\n {!props.hideLegend && (\n <div ref={(e: HTMLDivElement) => (legendContainer = e)} className={classes.legendContainer}>\n {props.legendBars}\n </div>\n )}\n {/** The callout is used for narration, so keep it mounted on the DOM */}\n {callout && <React.Suspense fallback={<div>Loading...</div>}>{callout}</React.Suspense>}\n </div>\n );\n});\nCartesianChart.displayName = 'CartesianChart';\nCartesianChart.defaultProps = {\n hideTickOverlap: true,\n};\n"],"names":["React","useCartesianChartStyles","select","d3Select","createNumericXAxis","createStringXAxis","createDateXAxis","XAxisTypes","YAxisType","createWrapOfXLabels","rotateXAxisLabels","calculateLongestLabelWidth","createYAxisLabels","ChartTypes","wrapContent","useRtl","truncateString","tooltipOfAxislabels","getSecureProps","DEFAULT_WRAP_WIDTH","useId","SVGTooltipText","ChartPopover","useFocusableGroup","useArrowNavigationGroup","CartesianChart","forwardRef","props","forwardedRef","chartContainer","useRef","legendContainer","minLegendContainerHeight","xAxisElement","yAxisElement","yAxisElementSecondary","margins","idForGraph","_reqID","_useRtl","_tickValues","titleMargin","_isFirstRender","_xScale","isIntegralDataset","_tooltipId","_removalValueForTextTuncate","containerWidth","setContainerWidth","useState","containerHeight","setContainerHeight","startFromX","setStartFromX","prevProps","setPrevProps","chartTypesWithStringYAxis","HorizontalBarChartWithAxis","HeatMapChart","VerticalStackedBarChart","GanttChart","ScatterChart","top","bottom","right","left","secondaryYScaleOptions","TITLE_MARGIN_HORIZONTAL","TITLE_MARGIN_VERTICAL","xAxisTitle","undefined","yAxisTitle","secondaryYAxistitle","xAxisAnnotation","yAxisAnnotation","classes","focusAttributes","arrowAttributes","axis","useEffect","_fitParentContainer","includes","chartType","showYAxisLables","yAxisType","StringAxis","maxYAxisLabelLength","calculateMaxYAxisLabelLength","yAxis","points","some","point","y","cancelAnimationFrame","height","width","useImperativeHandle","componentRef","current","_generateCallout","calloutProps","className","formatTickLabel","str","showYAxisLablesTooltip","noOfCharsToTruncate","stringDatasetForYAxisDomain","map","label","svgProps","culture","dateLocalizeOptions","timeFormatLocale","customDateTimeFormatter","parentRef","margin","getmargins","callout","children","enableFirstRenderOptimization","XAxisParams","domainNRangeValues","getDomainNRangeValues","getDomainMargins","xAxisType","barwidth","tickValues","showRoundOffXTickValues","xAxisCount","xAxisTickCount","xAxistickSize","tickPadding","showXAxisLablesTooltip","xAxisPadding","xAxisInnerPadding","xAxisOuterPadding","hideTickOverlap","rotateXAxisLables","calcMaxLabelWidth","_calcMaxLabelWidthWithTransform","tickStep","xAxis","tick0","xScale","NumericAxis","tickParams","xScaleType","DateAxis","useUTC","datasetForXAxisDomain","_transformXAxisLabels","YAxisParams","getYDomainMargins","yAxisTickFormat","yAxisTickCount","yMinValue","yMaxValue","maxOfYVal","yMinMaxValues","getMinMaxOfYAxis","yAxisPadding","yAxisTickValues","yScalePrimary","yScaleSecondary","axisData","yAxisDomainValues","createStringYAxis","YAxisParamsSecondary","createYAxis","roundedTicks","secondaryYScaleType","yScaleType","document","getElementById","remove","e","_yAxisElement","call","ytooltipProps","tooltipCls","tooltip","id","_getData","getGraphData","getAxisData","hideTooltip","isPopoverOpen","svgDimensions","xAxisTitleMaximumAllowedWidth","yAxisTitleMaximumAllowedHeight","commonSvgToolTipProps","showBackground","svgTooltip","content","legendContainerHeight","hideLegend","legendContainerComputedStyles","getComputedStyle","getBoundingClientRect","parseFloat","marginTop","marginBottom","container","currentContainerWidth","reflowProps","mode","Math","max","_calculateChartMinWidth","currentContainerHeight","shouldResize","_onChartLeave","onChartMouseLeave","labelWidth","minChartWidth","length","GroupedVerticalBarChart","VerticalBarChart","minDomainMargin","x","wrapXAxisLables","longestLabelWidth","ceil","cos","PI","val","numChars","toString","slice","words","forEach","push","split","maxXAxisLabelWidth","step","wrapLabelProps","node","rotateLabelProps","rotatedHeight","div","root","role","ref","rootElem","onMouseLeave","chartWrapper","svg","aria-label","chartTitle","style","display","chart","g","transform","textProps","axisTitle","textAnchor","maxWidth","axisAnnotation","legendBars","Suspense","fallback","displayName","defaultProps"],"mappings":";;;;+BAmCayB;;;;;;;iEAnCU,QAAQ;+CAGS,mCAAmC;6BACxC,eAAe;uBAoB3C,wBAAwB;gCACT,4BAA4B;gCAEE,iCAAiC;8BACxD,iBAAiB;8BACa,0BAA0B;AAM9E,uBAAMA,WAAAA,GAAuEzB,OAAM0B,UAAU,CAGlG,CAACC,OAAOC;QA8CDD,gBACGA,iBACSA,iBAA4BA,iBAC5BA,iBAAmEA;IAhDtF,MAAME,iBAAiB7B,OAAM8B,MAAM;IACnC,IAAIC;IACJ,MAAMC,2BAAmC;IACzC,MAAMC,eAAejC,O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