import { getDataSeriesFromSpecs , XYChartSeriesIdentifier } from '../../chart_types/xy_chart/utils/series' ; import { BasicSeriesSpec } from '../../specs' ; import { mergePartial } from '../../utils/common' ; internal export class MockSeriesIdentifier { private static readonly base : XYChartSeriesIdentifier = { specId : 'bars' , yAccessor : 'y' , seriesKeys : [ 'a' ] , splitAccessors : new Map ( ) . set ( 'g' , 'a' ) , key : 'spec{bars}yAccessor{y}splitAccessors{g-a}' , smHorizontalAccessorValue : undefined , smVerticalAccessorValue : undefined , } ; static default ( partial ? ) { return mergePartial < XYChartSeriesIdentifier > ( MockSeriesIdentifier . base , partial ) ; } static fromSpecs ( specs ) { const { dataSeries } = getDataSeriesFromSpecs ( specs ) ; return dataSeries . map ( ( { groupId , seriesType , data , isStacked , stackMode , spec , insertIndex , isFiltered , ... rest } ) => rest ) ; } static fromSpec ( specs ) { return MockSeriesIdentifier . fromSpecs ( [ specs ] ) [ 0 ] ; } }