import { withContext } from '../../../../renderers/canvas' ; import { Dimensions } from '../../../../utils/dimensions' ; import { AxisStyle } from '../../../../utils/themes/theme' ; import { LinesGrid } from '../../utils/grid_lines' ; import { AxisSpec } from '../../utils/specs' ; import { renderMultiLine } from './primitives/line' ; interface GridProps { sharedAxesStyle : AxisStyle ; perPanelGridLines : Array < LinesGrid > ; axesSpecs : AxisSpec [ ] ; renderingArea : Dimensions ; axesStyles : Map < string , AxisStyle | null > ; } internal export function renderGrids ( ctx , { perPanelGridLines , renderingArea : { left , top } } ) { withContext ( ctx , ( ) => { ctx . translate ( left , top ) ; perPanelGridLines . forEach ( ( { lineGroups , panelAnchor : { x , y } } ) => { withContext ( ctx , ( ) => { ctx . translate ( x , y ) ; lineGroups . forEach ( ( { lines , stroke } ) => renderMultiLine ( ctx , lines , stroke ) ) ; } ) ; } ) ; } ) ; }