import { LegendItem } from '../../../../common/legend' ; import { SeriesKey } from '../../../../common/series_id' ; import { Rect } from '../../../../geoms/types' ; import { withContext } from '../../../../renderers/canvas' ; import { Rotation } from '../../../../utils/common' ; import { Dimensions } from '../../../../utils/dimensions' ; import { BubbleGeometry , PerPanel } from '../../../../utils/geometry' ; import { SharedGeometryStateStyle , GeometryStateStyle } from '../../../../utils/themes/theme' ; import { getGeometryStateStyle } from '../../rendering/utils' ; import { renderPointGroup } from './points' ; interface BubbleGeometriesDataProps { animated ? : boolean ; bubbles : Array < PerPanel < BubbleGeometry > > ; sharedStyle : SharedGeometryStateStyle ; highlightedLegendItem ? : LegendItem ; clippings : Rect ; rotation : Rotation ; renderingArea : Dimensions ; } internal export function renderBubbles ( ctx , props ) { withContext ( ctx , ( ) => { const { bubbles , sharedStyle , highlightedLegendItem , clippings , rotation , renderingArea } = props ; const styles = { } ; const allPoints = bubbles . flatMap ( ( { value : { seriesIdentifier , points } } ) => { styles [ seriesIdentifier . key ] = getGeometryStateStyle ( seriesIdentifier , sharedStyle , highlightedLegendItem ) ; return points ; } ) ; const shouldClip = allPoints [ 0 ] ?. value . mark !== null ; renderPointGroup ( ctx , allPoints , styles , rotation , renderingArea , clippings , shouldClip ) ; } ) ; }