Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"gl-mat4": "^1.2.0",
"gl-mesh3d": "^2.3.0",
"gl-plot2d": "^1.4.3",
"gl-plot3d": "^2.4.2",
"gl-plot3d": "^2.4.3",
"gl-pointcloud2d": "^1.0.2",
"gl-scatter3d": "^1.2.2",
"gl-select-box": "^1.0.3",
Expand All @@ -93,7 +93,7 @@
"glslify": "^7.0.0",
"has-hover": "^1.0.1",
"has-passive-events": "^1.0.0",
"is-mobile": "^2.1.0",
"is-mobile": "^2.2.0",
"mapbox-gl": "1.3.2",
"matrix-camera-controller": "^2.1.3",
"mouse-change": "^1.4.0",
Expand Down
35 changes: 2 additions & 33 deletions src/plots/gl3d/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,7 @@ var createAxesOptions = require('./layout/convert');
var createSpikeOptions = require('./layout/spikes');
var computeTickMarks = require('./layout/tick_marks');

var isMobile = require('is-mobile');
var tablet = isTablet();

function isTablet() {
if(!navigator) return false;

var ua;
// same interface as applied by is-mobile module
if(!ua && typeof navigator !== 'undefined') ua = navigator.userAgent;
if(ua && ua.headers && typeof ua.headers['user-agent'] === 'string') {
ua = ua.headers['user-agent'];
}
if(typeof ua !== 'string') return false;

var result = isMobile({
ua: ua,
tablet: true
});

// handle iPad pro or iPad with iOs 13 using Safari
// see https://github.com/plotly/plotly.js/issues/4502
if(
result === false &&
ua.indexOf('Macintosh') !== -1 &&
ua.indexOf('Safari') !== -1 &&
navigator.maxTouchPoints > 1
) {
result = true;
}

return result;
}
var isMobile = require('is-mobile')({ tablet: true, featureDetect: true });


var STATIC_CANVAS, STATIC_CONTEXT;
Expand Down Expand Up @@ -128,7 +97,7 @@ proto.tryCreatePlot = function() {
canvas: scene.canvas,
gl: scene.gl,
glOptions: {
preserveDrawingBuffer: tablet,
preserveDrawingBuffer: isMobile,
premultipliedAlpha: true,
antialias: true
},
Expand Down