Skip to content

Commit e1f60bd

Browse files
committed
Show modebar if no hover available
1 parent 092890f commit e1f60bd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"gl-shader": "4.2.0",
8484
"gl-spikes2d": "^1.0.1",
8585
"gl-surface3d": "^1.3.0",
86+
"has-hover": "^1.0.0",
8687
"mapbox-gl": "^0.22.0",
8788
"matrix-camera-controller": "^2.1.3",
8889
"mouse-change": "^1.4.0",

src/plot_api/plot_api.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
var d3 = require('d3');
1414
var isNumeric = require('fast-isnumeric');
15+
var hasHover = require('has-hover');
1516

1617
var Plotly = require('../plotly');
1718
var Lib = require('../lib');
@@ -423,6 +424,11 @@ function setPlotContext(gd, config) {
423424
context.showLink = false;
424425
context.displayModeBar = false;
425426
}
427+
428+
// make sure hover-only devices have mode bar visible
429+
if(context.displayModeBar === 'hover' && !hasHover) {
430+
context.displayModeBar = true;
431+
}
426432
}
427433

428434
function plotPolar(gd, data, layout) {

0 commit comments

Comments
 (0)