import React from 'react'; import { ChartProps } from './types'; import { Plot, PlotArea } from '../plot'; import { XAxis, YAxis } from '../axes'; const Chart: React.ForwardRefRenderFunction = ({ innerSize, scatterData, lineData, domain, plotProps, plotAreaProps, xAxisProps, yAxisProps, marginFraction, children }, ref: React.Ref | null) => { const fraction = marginFraction && marginFraction > 0 && marginFraction < 1 ? marginFraction : 0.2; const axisMarginSize = Math.floor(Math.min(innerSize.width) * fraction); const paddingMarginSize = Math.floor(Math.min(innerSize.width) * fraction / 2); plotProps = plotProps || {}; plotAreaProps = plotAreaProps || {}; xAxisProps = xAxisProps || {}; yAxisProps = yAxisProps || {}; return ( {children} ); }; export default React.forwardRef(Chart);