import { XDomain , YDomain } from '../../chart_types/xy_chart/domains/types' ; import { getXNiceFromSpec , getXScaleTypeFromSpec , getYNiceFromSpec , getYScaleTypeFromSpec , } from '../../chart_types/xy_chart/scales/get_api_scales' ; import { X_SCALE_DEFAULT , Y_SCALE_DEFAULT } from '../../chart_types/xy_chart/scales/scale_defaults' ; import { DEFAULT_GLOBAL_ID , XScaleType } from '../../chart_types/xy_chart/utils/specs' ; import { ScaleContinuousType } from '../../scales' ; import { ScaleType } from '../../scales/constants' ; import { mergePartial , RecursivePartial } from '../../utils/common' ; internal export class MockXDomain { private static readonly base : XDomain = { ... X_SCALE_DEFAULT , isBandScale : X_SCALE_DEFAULT . type !== ScaleType . Ordinal , minInterval : 0 , timeZone : 'local' , domain : [ 0 , 1 ] , } ; static default ( partial ? ) { return mergePartial < XDomain > ( MockXDomain . base , partial ) ; } static fromScaleType ( scaleType , partial ? ) { return mergePartial < XDomain > ( MockXDomain . base , partial , { } , [ { type : getXScaleTypeFromSpec ( scaleType ) , nice : getXNiceFromSpec ( ) } , ] ) ; } } internal export class MockYDomain { private static readonly base : YDomain = { ... Y_SCALE_DEFAULT , isBandScale : false , groupId : DEFAULT_GLOBAL_ID , domain : [ 0 , 1 ] , } ; static default ( partial ? ) { return mergePartial < YDomain > ( MockYDomain . base , partial ) ; } static fromScaleType ( scaleType , partial ? ) { return mergePartial < YDomain > ( MockYDomain . base , partial , { } , [ { type : getYScaleTypeFromSpec ( scaleType ) , nice : getYNiceFromSpec ( ) } , ] ) ; } }