import type { Dimensions } from '../../../../../xy/public' ; import { makeFakeXAspect } from './_fake_x_aspect' ; import { Aspects } from './point_series' ; import { Table } from '../../types' ; return { object } export function getAspects ( table , dimensions ) { const aspects = { } ; ( Object . keys ( dimensions ) as Array < keyof Dimensions > ) . forEach ( ( name ) => { const dimension = dimensions [ name ] ; const dimensionList = Array . isArray ( dimension ) ? dimension : [ dimension ] ; dimensionList . forEach ( ( d ) => { if ( ! d ) { return ; } const column = table . columns [ d . accessor ] ; if ( ! column ) { return ; } if ( ! aspects [ name ] ) { aspects [ name ] = [ ] ; } aspects [ name ] ! . push ( { accessor : column . id , column : d . accessor , title : column . name , format : d . format , params : d . params , } ) ; } ) ; } ) ; if ( ! aspects . x ) { aspects . x = [ makeFakeXAspect ( ) ] ; } return aspects as Aspects ; }