Skip to content

Commit 8f251e0

Browse files
committed
toolbar depends on the type of active chart (fixed select box not showing for scatter and heatmap)
1 parent b2a2a39 commit 8f251e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/firefly/js/charts/ui/PlotlyToolbar.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ import {getColValidator} from './ColumnOrExpression.jsx';
1111
import {getColValStats} from '../TableStatsCntlr.js';
1212

1313
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);
1515
const {tbl_id} = get(tablesources, [activeTrace], {});
1616
const {columns} = get(getTblById(tbl_id), ['tableData']) || {};
1717
const hasFilter = tbl_id && !isEmpty(get(getTblById(tbl_id), 'request.filters'));
1818
const hasSelection = !isEmpty(selection);
1919
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,
2122
dragmode: get(layout, 'dragmode'), traceNames, columns};
2223
}
2324

0 commit comments

Comments
 (0)