diff --git a/packages/sunburst/src/Sunburst.tsx b/packages/sunburst/src/Sunburst.tsx index 57332e5fc..e672e456c 100644 --- a/packages/sunburst/src/Sunburst.tsx +++ b/packages/sunburst/src/Sunburst.tsx @@ -46,13 +46,13 @@ const InnerSunburst = (props: SvgProps) => { onMouseLeave, } = { ...defaultProps, ...props } - const { margin } = useDimensions(width, height, partialMargin) + const { innerWidth, innerHeight, margin } = useDimensions(width, height, partialMargin) const { centerX, centerY, radius } = useMemo(() => { - const radius = Math.min(width, height) / 2 + const radius = Math.min(innerWidth, innerHeight) / 2 - return { radius, centerX: width / 2, centerY: height / 2 } - }, [height, width]) + return { radius, centerX: innerWidth / 2, centerY: innerHeight / 2 } + }, [innerHeight, innerWidth]) const { arcGenerator, nodes } = useSunburst({ childColor,