Skip to content

Commit 6ff7b7d

Browse files
committed
Hide Maps tab based on presense of traces
1 parent a44a349 commit 6ff7b7d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/DefaultEditor.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from './default_panels';
2020
import {traceHasColorbar} from './default_panels/StyleColorbarsPanel';
2121
import Logo from './components/widgets/Logo';
22-
import {TRANSFORMABLE_TRACES} from './lib/constants';
22+
import {TRANSFORMABLE_TRACES, TRACE_TO_AXIS} from './lib/constants';
2323

2424
class DefaultEditor extends Component {
2525
constructor(props, context) {
@@ -71,11 +71,9 @@ class DefaultEditor extends Component {
7171
}
7272

7373
hasMaps() {
74-
const {
75-
layout: {geo, mapbox},
76-
} = this.context;
77-
78-
return Boolean(geo) || Boolean(mapbox);
74+
return this.context.fullData.some(d =>
75+
[...TRACE_TO_AXIS.geo, ...TRACE_TO_AXIS.mapbox].includes(d.type)
76+
);
7977
}
8078

8179
render() {

0 commit comments

Comments
 (0)