import { forwardRef, Ref, ReactElement } from 'react' import { ResponsiveWrapper, ResponsiveProps, WithChartRef } from '@nivo/core' import { SwarmPlotSvgProps } from './types' import { SwarmPlot } from './SwarmPlot' type ResponsiveSwarmPlotProps = ResponsiveProps< Partial, 'data' | 'groups' | 'width' | 'height'>> & Pick, 'data' | 'groups'> > export const ResponsiveSwarmPlot = forwardRef( ( { defaultWidth, defaultHeight, onResize, debounceResize, ...props }: ResponsiveSwarmPlotProps, ref: Ref ) => ( {({ width, height }) => ( {...props} width={width} height={height} ref={ref} /> )} ) ) as ( props: WithChartRef, SVGSVGElement> ) => ReactElement