import { overrideOpacity } from '../../../../common/color_library_wrappers' ; import { SeriesKey } from '../../../../common/series_id' ; import { Circle , Fill , Rect , Stroke } from '../../../../geoms/types' ; import { Rotation } from '../../../../utils/common' ; import { Dimensions } from '../../../../utils/dimensions' ; import { PointGeometry } from '../../../../utils/geometry' ; import { GeometryStateStyle } from '../../../../utils/themes/theme' ; import { renderShape } from './primitives/shapes' ; import { withPanelTransform } from './utils/panel_transform' ; internal export function renderPoints ( ctx , points , { opacity } ) { points . slice ( ) . sort ( ( { radius : a } , { radius : b } ) => b - a ) . forEach ( ( { x , y , radius , transform , style } ) => { const coordinates = { x : x + transform . x , y : y + transform . y , radius } ; const fill = { color : overrideOpacity ( style . fill . color , ( fillOpacity ) => fillOpacity * opacity ) } ; const stroke = { ... style . stroke , color : overrideOpacity ( style . stroke . color , ( fillOpacity ) => fillOpacity * opacity ) , } ; renderShape ( ctx , style . shape , coordinates , fill , stroke ) ; } ) ; } internal export function renderPointGroup ( ctx , points , geometryStateStyles , rotation , renderingArea , clippings , shouldClip ) { points . slice ( ) . sort ( ( { radius : a } , { radius : b } ) => b - a ) . forEach ( ( { x , y , radius , transform , style , seriesIdentifier : { key } , panel } ) => { const { opacity } = geometryStateStyles [ key ] ; const fill = { color : overrideOpacity ( style . fill . color , ( fillOpacity ) => fillOpacity * opacity ) } ; const stroke = { ... style . stroke , color : overrideOpacity ( style . stroke . color , ( fillOpacity ) => fillOpacity * opacity ) , } ; const coordinates = { x : x + transform . x , y , radius } ; const renderer = ( ) => renderShape ( ctx , style . shape , coordinates , fill , stroke ) ; withPanelTransform ( ctx , panel , rotation , renderingArea , renderer , { area : clippings , shouldClip } ) ; } ) ; }