import type { Panel } from '../../../../common/types' ; import { PANEL_TYPES } from '../../../../common/enums' ; import { limitOfSeries } from '../../../../common/ui_restrictions' ; export const getActiveSeries = ( panel ) => { let visibleSeries = panel . series || [ ] ; if ( panel . type in limitOfSeries ) { visibleSeries = visibleSeries . slice ( 0 , limitOfSeries [ panel . type ] ) ; } const shouldNotApplyFilter = PANEL_TYPES . GAUGE === panel . type || PANEL_TYPES . MARKDOWN === panel . type ; return visibleSeries . filter ( ( series ) => ! series . hidden || shouldNotApplyFilter ) ; } ;