import type { CSSProperties, Ref } from 'react'; import { bboxContext } from '../../contexts/bboxContext.js'; import type { PlotChildren } from '../../utils/splitChildren.js'; import TransparentRect from '../TransparentRect.js'; interface MainLayerProps { width: number; height: number; svgStyle: CSSProperties; svgId?: string; svgClassName?: string; plotViewportStyle?: CSSProperties; seriesViewportStyle?: CSSProperties; topOffset: number; leftOffset: number; plotWidth: number; plotHeight: number; plotId: string; series: PlotChildren['series']; topAxisRef: Ref; topAxis: PlotChildren['topAxis']; rightAxisRef: Ref; rightAxis: PlotChildren['rightAxis']; bottomAxisRef: Ref; bottomAxis: PlotChildren['bottomAxis']; leftAxisRef: Ref; leftAxis: PlotChildren['leftAxis']; headingRef: Ref; heading: PlotChildren['heading']; } export default function MainLayer(props: MainLayerProps) { const { width, height, svgStyle, svgId, svgClassName, plotViewportStyle, seriesViewportStyle, topOffset, leftOffset, plotWidth, plotHeight, plotId, series, topAxisRef, topAxis, rightAxisRef, rightAxis, bottomAxisRef, bottomAxis, leftAxisRef, leftAxis, headingRef, heading, } = props; return ( {/* Plot viewport */} {/* Series viewport */} {/* Prevents the chart from being drawn outside of the viewport */} {series} {topAxis} {rightAxis} {bottomAxis} {leftAxis} {heading} ); }