@@ -11,13 +11,14 @@ import {getColValidator} from './ColumnOrExpression.jsx';
11
11
import { getColValStats } from '../TableStatsCntlr.js' ;
12
12
13
13
function getToolbarStates ( chartId ) {
14
- const { selection, selected, activeTrace= 0 , tablesources, layout, data= { } } = getChartData ( chartId ) ;
14
+ const { selection, selected, activeTrace= 0 , tablesources, layout, data= [ ] } = getChartData ( chartId ) ;
15
15
const { tbl_id} = get ( tablesources , [ activeTrace ] , { } ) ;
16
16
const { columns} = get ( getTblById ( tbl_id ) , [ 'tableData' ] ) || { } ;
17
17
const hasFilter = tbl_id && ! isEmpty ( get ( getTblById ( tbl_id ) , 'request.filters' ) ) ;
18
18
const hasSelection = ! isEmpty ( selection ) ;
19
19
const traceNames = data . map ( ( t ) => t . name ) . toString ( ) ;
20
- return { hasSelection, hasFilter, activeTrace, tbl_id, hasSelected : ! ! selected ,
20
+ const activeTraceType = get ( data , `${ activeTrace } .type` ) ;
21
+ return { hasSelection, hasFilter, activeTrace, activeTraceType, tbl_id, hasSelected : ! ! selected ,
21
22
dragmode : get ( layout , 'dragmode' ) , traceNames, columns} ;
22
23
}
23
24
0 commit comments