@fluentui/react-charts 9.1.5 → 9.1.7

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 (153) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/dist/index.d.ts +46 -4
  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 -1
  6. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  7. package/lib/components/CommonComponents/CartesianChart.js +42 -9
  8. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  9. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  10. package/lib/components/CommonComponents/ChartPopover.js +3 -2
  11. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  12. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  13. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +37 -9
  14. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  15. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +11 -5
  16. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  17. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +13 -13
  18. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  19. package/lib/components/DonutChart/Arc/Arc.js +10 -3
  20. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  21. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  22. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +7 -2
  23. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  24. package/lib/components/DonutChart/useDonutChartStyles.styles.js +7 -6
  25. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  26. package/lib/components/GaugeChart/GaugeChart.js +16 -17
  27. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  28. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  29. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +15 -13
  30. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  31. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +3 -3
  32. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  33. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -1
  34. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  35. package/lib/components/HeatMapChart/HeatMapChart.js +4 -1
  36. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  37. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  38. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +9 -3
  39. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  40. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +14 -3
  41. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  42. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +0 -61
  43. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  44. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +6 -31
  45. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  46. package/lib/components/Legends/useLegendsStyles.styles.js +2 -1
  47. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  48. package/lib/components/LineChart/LineChart.js +3 -3
  49. package/lib/components/LineChart/LineChart.js.map +1 -1
  50. package/lib/components/LineChart/useLineChartStyles.styles.js +2 -1
  51. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  52. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +25 -23
  53. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  54. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  55. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +29 -0
  56. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -0
  57. package/lib/components/SankeyChart/SankeyChart.js +29 -35
  58. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  59. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  60. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +13 -7
  61. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  62. package/lib/components/ScatterChart/ScatterChart.js +15 -17
  63. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  64. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +3 -2
  65. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  66. package/lib/components/VerticalBarChart/VerticalBarChart.js +19 -21
  67. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  68. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  69. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +2 -1
  70. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  71. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +17 -14
  72. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  73. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  74. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +2 -1
  75. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  76. package/lib/utilities/utilities.js +11 -5
  77. package/lib/utilities/utilities.js.map +1 -1
  78. package/lib-commonjs/components/AreaChart/AreaChart.js +2 -2
  79. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  80. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +2 -1
  81. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  82. package/lib-commonjs/components/CommonComponents/CartesianChart.js +41 -8
  83. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  84. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  85. package/lib-commonjs/components/CommonComponents/ChartPopover.js +3 -2
  86. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  87. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  88. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +55 -9
  89. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  90. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +14 -5
  91. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  92. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +13 -13
  93. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  94. package/lib-commonjs/components/DonutChart/Arc/Arc.js +10 -3
  95. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  96. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  97. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +10 -2
  98. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  99. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +8 -7
  100. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  101. package/lib-commonjs/components/GaugeChart/GaugeChart.js +16 -17
  102. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  103. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  104. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +13 -23
  105. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  106. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +2 -2
  107. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  108. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -1
  109. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  110. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +4 -1
  111. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  112. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  113. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +10 -3
  114. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  115. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +14 -3
  116. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  117. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +0 -61
  118. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  119. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +5 -54
  120. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  121. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +2 -0
  122. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  123. package/lib-commonjs/components/LineChart/LineChart.js +2 -2
  124. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  125. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +2 -1
  126. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  127. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +25 -23
  128. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  129. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  130. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +49 -0
  131. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -0
  132. package/lib-commonjs/components/SankeyChart/SankeyChart.js +29 -35
  133. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  134. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  135. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +15 -8
  136. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  137. package/lib-commonjs/components/ScatterChart/ScatterChart.js +13 -15
  138. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  139. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +5 -4
  140. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  141. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +18 -20
  142. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  143. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  144. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +2 -1
  145. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  146. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +16 -13
  147. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  148. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  149. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +2 -1
  150. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  151. package/lib-commonjs/utilities/utilities.js +16 -7
  152. package/lib-commonjs/utilities/utilities.js.map +1 -1
  153. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["ResponsiveContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getWindow } from '../../utilities/getWindow';\nimport { ResponsiveChildProps, ResponsiveContainerProps } from './ResponsiveContainer.types';\n\n/**\n * Responsive Container component\n * {@docCategory ResponsiveContainer}\n */\nexport const ResponsiveContainer: React.FC<ResponsiveContainerProps> = props => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const onResizeRef = React.useRef<ResponsiveContainerProps['onResize']>();\n\n const [size, setSize] = React.useState<{ containerWidth?: number; containerHeight?: number }>({});\n\n onResizeRef.current = props.onResize;\n\n React.useEffect(() => {\n const _window = getWindow(containerRef.current) as (Window & typeof globalThis) | undefined;\n let animationFrameId: number | undefined;\n let resizeObserver: ResizeObserver | undefined;\n\n const resizeCallback = (entries: ResizeObserverEntry[]) => {\n const { width: containerWidth, height: containerHeight } = entries[0].contentRect;\n // rAF is an alternative to the throttle function. For more info, see:\n // https://css-tricks.com/debouncing-throttling-explained-examples/#aa-requestanimationframe-raf\n animationFrameId = _window?.requestAnimationFrame(() => {\n setSize(prevSize => {\n const roundedWidth = Math.floor(containerWidth);\n const roundedHeight = Math.floor(containerHeight);\n if (prevSize.containerWidth === roundedWidth && prevSize.containerHeight === roundedHeight) {\n return prevSize;\n }\n\n return { containerWidth: roundedWidth, containerHeight: roundedHeight };\n });\n });\n onResizeRef.current?.(containerWidth, containerHeight);\n };\n\n if (_window && _window.ResizeObserver) {\n resizeObserver = new _window.ResizeObserver(resizeCallback);\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n }\n\n return () => {\n if (animationFrameId) {\n _window?.cancelAnimationFrame(animationFrameId);\n }\n\n resizeObserver?.disconnect();\n };\n }, []);\n\n const chartContent = React.useMemo(() => {\n let calculatedWidth = size.containerWidth;\n let calculatedHeight = size.containerHeight;\n\n if (typeof props.aspect === 'number' && props.aspect > 0) {\n if (calculatedWidth) {\n calculatedHeight = calculatedWidth / props.aspect;\n } else if (calculatedHeight) {\n calculatedWidth = calculatedHeight * props.aspect;\n }\n\n if (typeof props.maxHeight === 'number' && calculatedHeight && calculatedHeight > props.maxHeight) {\n calculatedHeight = props.maxHeight;\n }\n }\n\n return (\n <div\n ref={containerRef}\n style={\n {\n width: props.width ?? '100%',\n height: props.height ?? '100%',\n minWidth: props.minWidth,\n minHeight: props.minHeight,\n maxHeight: props.maxHeight,\n // Ensure the child element fills the parent container\n // https://stackoverflow.com/questions/8468066/child-inside-parent-with-min-height-100-not-inheriting-height\n '--root-width': calculatedWidth + 'px',\n '--root-height': calculatedHeight + 'px',\n } as React.CSSProperties\n }\n >\n {React.Children.map(props.children, child => {\n return React.cloneElement<ResponsiveChildProps>(child, {\n width: calculatedWidth,\n height: calculatedHeight,\n shouldResize: (calculatedWidth ?? 0) + (calculatedHeight ?? 0),\n });\n })}\n </div>\n );\n }, [size, props.aspect, props.maxHeight, props.children, props.width, props.height, props.minHeight, props.minWidth]);\n\n return chartContent;\n};\nResponsiveContainer.displayName = 'ResponsiveContainer';\n"],"names":["React","getWindow","ResponsiveContainer","props","containerRef","useRef","onResizeRef","size","setSize","useState","current","onResize","useEffect","_window","animationFrameId","resizeObserver","resizeCallback","entries","width","containerWidth","height","containerHeight","contentRect","requestAnimationFrame","prevSize","roundedWidth","Math","floor","roundedHeight","ResizeObserver","observe","cancelAnimationFrame","disconnect","chartContent","useMemo","calculatedWidth","calculatedHeight","aspect","maxHeight","div","ref","style","minWidth","minHeight","Children","map","children","child","cloneElement","shouldResize","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,QAAQ,4BAA4B;AAGtD;;;CAGC,G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AEjB,MAAMwC,SAAS;QAAExC,MAAMuC,QAAQ;KAAC;IAEpH,OAAOT;AACT,EAAE;AACF/B,oBAAoBgD,WAAW,GAAG"}
1
+ {"version":3,"sources":["ResponsiveContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getWindow } from '../../utilities/getWindow';\nimport { ResponsiveChildProps, ResponsiveContainerProps } from './ResponsiveContainer.types';\nimport { useResponsiveChildStyles } from './useResponsiveChildStyles.styles';\nimport { mergeClasses } from '@griffel/react';\n\n/**\n * Responsive Container component\n * {@docCategory ResponsiveContainer}\n */\nexport const ResponsiveContainer: React.FC<ResponsiveContainerProps> = props => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const onResizeRef = React.useRef<ResponsiveContainerProps['onResize']>();\n const childClasses = useResponsiveChildStyles();\n\n const [size, setSize] = React.useState<{ containerWidth?: number; containerHeight?: number }>({});\n\n onResizeRef.current = props.onResize;\n\n React.useEffect(() => {\n const _window = getWindow(containerRef.current) as (Window & typeof globalThis) | undefined;\n let animationFrameId: number | undefined;\n let resizeObserver: ResizeObserver | undefined;\n\n const resizeCallback = (entries: ResizeObserverEntry[]) => {\n const { width: containerWidth, height: containerHeight } = entries[0].contentRect;\n // rAF is an alternative to the throttle function. For more info, see:\n // https://css-tricks.com/debouncing-throttling-explained-examples/#aa-requestanimationframe-raf\n animationFrameId = _window?.requestAnimationFrame(() => {\n setSize(prevSize => {\n const roundedWidth = Math.floor(containerWidth);\n const roundedHeight = Math.floor(containerHeight);\n if (prevSize.containerWidth === roundedWidth && prevSize.containerHeight === roundedHeight) {\n return prevSize;\n }\n\n return { containerWidth: roundedWidth, containerHeight: roundedHeight };\n });\n });\n onResizeRef.current?.(containerWidth, containerHeight);\n };\n\n if (_window && _window.ResizeObserver) {\n resizeObserver = new _window.ResizeObserver(resizeCallback);\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n }\n\n return () => {\n if (animationFrameId) {\n _window?.cancelAnimationFrame(animationFrameId);\n }\n\n resizeObserver?.disconnect();\n };\n }, []);\n\n const chartContent = React.useMemo(() => {\n let calculatedWidth = size.containerWidth;\n let calculatedHeight = size.containerHeight;\n\n if (typeof props.aspect === 'number' && props.aspect > 0) {\n if (calculatedWidth) {\n calculatedHeight = calculatedWidth / props.aspect;\n } else if (calculatedHeight) {\n calculatedWidth = calculatedHeight * props.aspect;\n }\n\n if (typeof props.maxHeight === 'number' && calculatedHeight && calculatedHeight > props.maxHeight) {\n calculatedHeight = props.maxHeight;\n }\n }\n\n return React.Children.map(props.children, child => {\n return React.cloneElement<ResponsiveChildProps>(child, {\n width: calculatedWidth,\n height: calculatedHeight,\n // For SankeyChart\n shouldResize: (calculatedWidth ?? 0) + (calculatedHeight ?? 0),\n styles: {\n root: mergeClasses(child.props.styles?.root, childClasses.root),\n chartWrapper: mergeClasses(child.props.styles?.chartWrapper, childClasses.chartWrapper),\n chart: mergeClasses(child.props.styles?.chart, childClasses.chart),\n },\n });\n });\n }, [size, props.aspect, props.maxHeight, props.children]);\n\n return (\n <div\n ref={containerRef}\n style={{\n width: props.width ?? '100%',\n height: props.height ?? '100%',\n minWidth: props.minWidth,\n minHeight: props.minHeight,\n maxHeight: props.maxHeight,\n }}\n >\n {chartContent}\n </div>\n );\n};\nResponsiveContainer.displayName = 'ResponsiveContainer';\n"],"names":["React","getWindow","useResponsiveChildStyles","mergeClasses","ResponsiveContainer","props","containerRef","useRef","onResizeRef","childClasses","size","setSize","useState","current","onResize","useEffect","_window","animationFrameId","resizeObserver","resizeCallback","entries","width","containerWidth","height","containerHeight","contentRect","requestAnimationFrame","prevSize","roundedWidth","Math","floor","roundedHeight","ResizeObserver","observe","cancelAnimationFrame","disconnect","chartContent","useMemo","calculatedWidth","calculatedHeight","aspect","maxHeight","Children","map","children","child","cloneElement","shouldResize","styles","root","chartWrapper","chart","div","ref","style","minWidth","minHeight","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAa0C,uBAAAA,MAAMxC,KAAK,CAAC2C,MAAM,cAAlBH,2CAAAA,qBAAoBM,KAAK,EAAE1C,aAAa0C,KAAK;gBACnE;YACF;QACF;IACF,GAAG;QAACzC;QAAML,MAAMmC,MAAM;QAAEnC,MAAMoC,SAAS;QAAEpC,MAAMuC,QAAQ;KAAC;QAM3CvC,cACCA;IALd,qBACE,oBAAC+C;QACCC,KAAK/C;QACLgD,OAAO;YACLjC,OAAOhB,CAAAA,eAAAA,MAAMgB,KAAK,cAAXhB,0BAAAA,eAAe;YACtBkB,QAAQlB,CAAAA,gBAAAA,MAAMkB,MAAM,cAAZlB,2BAAAA,gBAAgB;YACxBkD,UAAUlD,MAAMkD,QAAQ;YACxBC,WAAWnD,MAAMmD,SAAS;YAC1Bf,WAAWpC,MAAMoC,SAAS;QAC5B;OAECL;AAGP,EAAE;AACFhC,oBAAoBqD,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ResponsiveContainer.types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Responsive Child props\n * {@docCategory ResponsiveContainer}\n */\nexport interface ResponsiveChildProps {\n width?: number;\n height?: number;\n shouldResize?: number;\n}\n\n/**\n * Responsive Container props\n * {@docCategory ResponsiveContainer}\n */\nexport interface ResponsiveContainerProps {\n /**\n * Aspect ratio (width / height) of the container. If specified, the height will be calculated by width / aspect.\n */\n aspect?: number;\n\n /**\n * Width of the container\n */\n width?: number | string;\n\n /**\n * Height of the container\n */\n height?: number | string;\n\n /**\n * Minimum width of the container\n */\n minWidth?: number | string;\n\n /**\n * Minimum height of the container\n */\n minHeight?: number | string;\n\n /**\n * Maximum height of the container\n */\n maxHeight?: number;\n\n /**\n * Callback providing the updated chart width and height values when the container is resized\n */\n onResize?: (width: number, height: number) => void;\n\n /**\n * Child component to be rendered within the container\n */\n children: React.ReactElement<ResponsiveChildProps>;\n}\n"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["ResponsiveContainer.types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Responsive Child styles\n * {@docCategory ResponsiveContainer}\n */\nexport interface ResponsiveChildStyles {\n root?: string;\n chartWrapper?: string;\n chart?: string;\n}\n\n/**\n * Responsive Child props\n * {@docCategory ResponsiveContainer}\n */\nexport interface ResponsiveChildProps {\n width?: number;\n height?: number;\n shouldResize?: number;\n styles?: ResponsiveChildStyles;\n}\n\n/**\n * Responsive Container props\n * {@docCategory ResponsiveContainer}\n */\nexport interface ResponsiveContainerProps {\n /**\n * Aspect ratio (width / height) of the container. If specified, the height will be calculated by width / aspect.\n */\n aspect?: number;\n\n /**\n * Width of the container\n */\n width?: number | string;\n\n /**\n * Height of the container\n */\n height?: number | string;\n\n /**\n * Minimum width of the container\n */\n minWidth?: number | string;\n\n /**\n * Minimum height of the container\n */\n minHeight?: number | string;\n\n /**\n * Maximum height of the container\n */\n maxHeight?: number;\n\n /**\n * Callback providing the updated chart width and height values when the container is resized\n */\n onResize?: (width: number, height: number) => void;\n\n /**\n * Child component to be rendered within the container\n */\n children: React.ReactElement<ResponsiveChildProps>;\n}\n"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -0,0 +1,29 @@
1
+ import { __styles, mergeClasses } from '@griffel/react';
2
+ export const responsiveChildClassNames = {
3
+ root: 'fui-charts-resp-child__root',
4
+ chartWrapper: 'fui-charts-resp-child__chartWrapper',
5
+ chart: 'fui-charts-resp-child__chart'
6
+ };
7
+ const useStyles = /*#__PURE__*/__styles({
8
+ root: {
9
+ a9b677: "fly5x3f",
10
+ Bqenvij: "f1l02sjl"
11
+ },
12
+ chartWrapper: {
13
+ a9b677: "fly5x3f"
14
+ },
15
+ chart: {
16
+ a9b677: "fly5x3f"
17
+ }
18
+ }, {
19
+ d: [".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}"]
20
+ });
21
+ export const useResponsiveChildStyles = () => {
22
+ const baseStyles = useStyles();
23
+ return {
24
+ root: mergeClasses(responsiveChildClassNames.root, baseStyles.root),
25
+ chartWrapper: mergeClasses(responsiveChildClassNames.chartWrapper, baseStyles.chartWrapper),
26
+ chart: mergeClasses(responsiveChildClassNames.chart, baseStyles.chart)
27
+ };
28
+ };
29
+ //# sourceMappingURL=useResponsiveChildStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__styles","mergeClasses","responsiveChildClassNames","root","chartWrapper","chart","useStyles","a9b677","Bqenvij","d","useResponsiveChildStyles","baseStyles"],"sources":["useResponsiveChildStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nexport const responsiveChildClassNames = {\n root: 'fui-charts-resp-child__root',\n chartWrapper: 'fui-charts-resp-child__chartWrapper',\n chart: 'fui-charts-resp-child__chart'\n};\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%'\n },\n chartWrapper: {\n width: '100%'\n },\n chart: {\n // This overrides the pixel width of svg allowing it to resize properly within a flexbox or grid layout.\n // Note: height is not set to 100% because that causes the charts to resize vertically in an infinite loop.\n width: '100%'\n }\n});\nexport const useResponsiveChildStyles = ()=>{\n const baseStyles = useStyles();\n return {\n root: mergeClasses(responsiveChildClassNames.root, baseStyles.root),\n chartWrapper: mergeClasses(responsiveChildClassNames.chartWrapper, baseStyles.chartWrapper),\n chart: mergeClasses(responsiveChildClassNames.chart, baseStyles.chart)\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,OAAO,MAAMC,yBAAyB,GAAG;EACrCC,IAAI,EAAE,6BAA6B;EACnCC,YAAY,EAAE,qCAAqC;EACnDC,KAAK,EAAE;AACX,CAAC;AACD,MAAMC,SAAS,gBAAGN,QAAA;EAAAG,IAAA;IAAAI,MAAA;IAAAC,OAAA;EAAA;EAAAJ,YAAA;IAAAG,MAAA;EAAA;EAAAF,KAAA;IAAAE,MAAA;EAAA;AAAA;EAAAE,CAAA;AAAA,CAajB,CAAC;AACF,OAAO,MAAMC,wBAAwB,GAAGA,CAAA,KAAI;EACxC,MAAMC,UAAU,GAAGL,SAAS,CAAC,CAAC;EAC9B,OAAO;IACHH,IAAI,EAAEF,YAAY,CAACC,yBAAyB,CAACC,IAAI,EAAEQ,UAAU,CAACR,IAAI,CAAC;IACnEC,YAAY,EAAEH,YAAY,CAACC,yBAAyB,CAACE,YAAY,EAAEO,UAAU,CAACP,YAAY,CAAC;IAC3FC,KAAK,EAAEJ,YAAY,CAACC,yBAAyB,CAACG,KAAK,EAAEM,UAAU,CAACN,KAAK;EACzE,CAAC;AACL,CAAC","ignoreList":[]}
@@ -286,22 +286,20 @@ function linkValue(originalLinks, link) {
286
286
  // This is exported for unit tests.
287
287
  export function preRenderLayout(margins, containerWidth, containerHeight, isRtl) {
288
288
  const { left, right, top, bottom } = margins;
289
- const width = containerWidth - right;
290
- const height = containerHeight - bottom > 0 ? containerHeight - bottom : 0;
291
289
  const sankey = d3Sankey().nodeWidth(NODE_WIDTH).extent([
292
290
  [
293
291
  left,
294
292
  top
295
293
  ],
296
294
  [
297
- width - 1,
298
- height - 6
295
+ containerWidth - right,
296
+ containerHeight - bottom
299
297
  ]
300
298
  ]).nodeAlign(isRtl ? sankeyRight : sankeyJustify);
301
299
  return {
302
300
  sankey,
303
- height,
304
- width
301
+ height: containerHeight,
302
+ width: containerWidth
305
303
  };
306
304
  }
307
305
  const elipsis = '...';
@@ -428,6 +426,7 @@ function nodeTextColor(state, singleNode) {
428
426
  return !(!state.selectedState || state.selectedNodes.has(singleNode.index) && state.selectedNode || !state.selectedNode) ? DEFAULT_TEXT_COLOR : NON_SELECTED_TEXT_COLOR;
429
427
  }
430
428
  export const SankeyChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
429
+ var _props_reflowProps;
431
430
  const classes = useSankeyChartStyles(props);
432
431
  const chartContainer = React.useRef(null);
433
432
  const _reqID = React.useRef();
@@ -474,7 +473,8 @@ export const SankeyChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
474
473
  // NOTE: Calls to this method trigger a re-render.
475
474
  const container = props.parentRef ? props.parentRef : chartContainer.current;
476
475
  if (container) {
477
- const currentContainerWidth = props.enableReflow ? Math.max(container.getBoundingClientRect().width, _calculateChartMinWidth()) : container.getBoundingClientRect().width;
476
+ var _props_reflowProps;
477
+ const currentContainerWidth = ((_props_reflowProps = props.reflowProps) === null || _props_reflowProps === void 0 ? void 0 : _props_reflowProps.mode) === 'min-width' ? Math.max(container.getBoundingClientRect().width, _calculateChartMinWidth()) : container.getBoundingClientRect().width;
478
478
  const currentContainerHeight = container.getBoundingClientRect().height;
479
479
  setContainerWidth(currentContainerWidth);
480
480
  setContainerHeight(currentContainerHeight);
@@ -482,7 +482,7 @@ export const SankeyChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
482
482
  });
483
483
  }, [
484
484
  _window,
485
- props.enableReflow,
485
+ (_props_reflowProps = props.reflowProps) === null || _props_reflowProps === void 0 ? void 0 : _props_reflowProps.mode,
486
486
  props.parentRef
487
487
  ]);
488
488
  React.useEffect(()=>{
@@ -591,7 +591,7 @@ export const SankeyChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
591
591
  const nodeValues = valuesOfNodes(transformed.nodes);
592
592
  const linkValues = valuesOfLinks(transformed.links);
593
593
  adjustOnePercentHeightNodes(nodesInColumn, nodeValues, linkValues);
594
- adjustPadding(sankey, height - 6, nodesInColumn);
594
+ adjustPadding(sankey, containerHeight - _margins.current.top - _margins.current.bottom, nodesInColumn);
595
595
  // `sankey` is called a second time, probably to re-layout the nodes with the one-percent adjusted weights.
596
596
  // NOTE: The second call to `sankey` is required to allow links to be hoverable.
597
597
  // Without the second call, the links are not hoverable.
@@ -734,32 +734,28 @@ export const SankeyChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
734
734
  const _onHover = (singleNode, mouseEvent)=>{
735
735
  mouseEvent.persist();
736
736
  _onCloseCallout();
737
- if (!selectedState) {
738
- const _selectedLinks = getSelectedLinks(singleNode);
739
- const _selectedNodes = getSelectedNodes(_selectedLinks);
740
- _selectedNodes.push(singleNode);
741
- setSelectedState(true);
742
- setSelectedNodes(new Set(Array.from(_selectedNodes).map((node)=>node.index)));
743
- setSelectedLinks(new Set(Array.from(_selectedLinks).map((link)=>link.index)));
744
- setSelectedNode(singleNode);
745
- updatePosition(mouseEvent.clientX, mouseEvent.clientY);
746
- setCalloutVisible(singleNode.y1 - singleNode.y0 < MIN_HEIGHT_FOR_TYPE);
747
- setColor(singleNode.color);
748
- setXCalloutValue(singleNode.name);
749
- setYCalloutValue(_formatNumber(singleNode.actualValue));
750
- }
737
+ const _selectedLinks = getSelectedLinks(singleNode);
738
+ const _selectedNodes = getSelectedNodes(_selectedLinks);
739
+ _selectedNodes.push(singleNode);
740
+ setSelectedState(true);
741
+ setSelectedNodes(new Set(Array.from(_selectedNodes).map((node)=>node.index)));
742
+ setSelectedLinks(new Set(Array.from(_selectedLinks).map((link)=>link.index)));
743
+ setSelectedNode(singleNode);
744
+ updatePosition(mouseEvent.clientX, mouseEvent.clientY);
745
+ setCalloutVisible(singleNode.y1 - singleNode.y0 < MIN_HEIGHT_FOR_TYPE);
746
+ setColor(singleNode.color);
747
+ setXCalloutValue(singleNode.name);
748
+ setYCalloutValue(_formatNumber(singleNode.actualValue));
751
749
  };
752
750
  const _onStreamHover = (mouseEvent, singleLink, from)=>{
753
751
  mouseEvent.persist();
754
752
  _onCloseCallout();
755
- if (!selectedState) {
756
- const { selectedLinks: _selectedLinks, selectedNodes: _selectedNodes } = getSelectedLinksforStreamHover(singleLink);
757
- setSelectedState(true);
758
- setSelectedNodes(new Set(Array.from(_selectedNodes).map((node)=>node.index)));
759
- setSelectedLinks(new Set(Array.from(_selectedLinks).map((link)=>link.index)));
760
- updatePosition(mouseEvent.clientX, mouseEvent.clientY);
761
- _linkCalloutAttributes(singleLink, from);
762
- }
753
+ const { selectedLinks: _selectedLinks, selectedNodes: _selectedNodes } = getSelectedLinksforStreamHover(singleLink);
754
+ setSelectedState(true);
755
+ setSelectedNodes(new Set(Array.from(_selectedNodes).map((node)=>node.index)));
756
+ setSelectedLinks(new Set(Array.from(_selectedLinks).map((link)=>link.index)));
757
+ updatePosition(mouseEvent.clientX, mouseEvent.clientY);
758
+ _linkCalloutAttributes(singleLink, from);
763
759
  };
764
760
  const _onStreamLeave = (singleLink)=>{
765
761
  if (selectedState) {
@@ -984,7 +980,8 @@ export const SankeyChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
984
980
  }, /*#__PURE__*/ React.createElement("svg", {
985
981
  width: width,
986
982
  height: height,
987
- id: _chartId
983
+ id: _chartId,
984
+ className: classes.chart
988
985
  }, nodeLinkDomOrderArray.map((item)=>{
989
986
  if (item.type === 'node') {
990
987
  return /*#__PURE__*/ React.createElement("g", {
@@ -1018,6 +1015,3 @@ export const SankeyChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
1018
1015
  });
1019
1016
  });
1020
1017
  SankeyChart.displayName = 'SankeyChart';
1021
- SankeyChart.defaultProps = {
1022
- enableReflow: true
1023
- };