import { getAnnotationLinePropsId } from '../../chart_types/xy_chart/annotations/line/dimensions' ; import { AnnotationLineProps } from '../../chart_types/xy_chart/annotations/line/types' ; import { AnnotationRectProps } from '../../chart_types/xy_chart/annotations/rect/types' ; import { mergePartial , RecursivePartial } from '../../utils/common' ; internal export class MockAnnotationLineProps { private static readonly base : AnnotationLineProps = { id : getAnnotationLinePropsId ( 'spec1' , { dataValue : 0 } , 0 ) , specId : 'spec1' , linePathPoints : { x1 : 0 , y1 : 0 , x2 : 0 , y2 : 0 } , panel : { top : 0 , left : 0 , width : 100 , height : 100 } , datum : { dataValue : 0 } , markers : [ ] , } ; static default ( partial ? , smVerticalValue ? , smHorizontalValue ? ) { const id = getAnnotationLinePropsId ( partial ?. specId ?? MockAnnotationLineProps . base . specId , { ... MockAnnotationLineProps . base . datum , ... partial ?. datum , } , 0 , smVerticalValue , smHorizontalValue ) ; return mergePartial < AnnotationLineProps > ( MockAnnotationLineProps . base , { id , ... partial } ) ; } static fromPoints ( x1 = 0 , y1 = 0 , x2 = 0 , y2 = 0 ) { return MockAnnotationLineProps . default ( { linePathPoints : { x1 , y1 , x2 , y2 } , } ) ; } static fromPartialAndId ( partial ? ) { return mergePartial < AnnotationLineProps > ( MockAnnotationLineProps . base , partial ) ; } } internal export class MockAnnotationRectProps { private static readonly base : AnnotationRectProps = { datum : { coordinates : { x0 : 0 , x1 : 1 , y0 : 0 , y1 : 1 } } , rect : { x : 0 , y : 0 , width : 0 , height : 0 } , panel : { width : 100 , height : 100 , top : 0 , left : 0 } , } ; static default ( partial ? ) { return mergePartial < AnnotationRectProps > ( MockAnnotationRectProps . base , partial ) ; } static fromValues ( x = 0 , y = 0 , width = 0 , height = 0 ) { return MockAnnotationRectProps . default ( { rect : { x , y , width , height } } ) ; } }