@@ -30,38 +30,7 @@ var createAxesOptions = require('./layout/convert');
30
30
var createSpikeOptions = require ( './layout/spikes' ) ;
31
31
var computeTickMarks = require ( './layout/tick_marks' ) ;
32
32
33
- var isMobile = require ( 'is-mobile' ) ;
34
- var tablet = isTablet ( ) ;
35
-
36
- function isTablet ( ) {
37
- if ( ! navigator ) return false ;
38
-
39
- var ua ;
40
- // same interface as applied by is-mobile module
41
- if ( ! ua && typeof navigator !== 'undefined' ) ua = navigator . userAgent ;
42
- if ( ua && ua . headers && typeof ua . headers [ 'user-agent' ] === 'string' ) {
43
- ua = ua . headers [ 'user-agent' ] ;
44
- }
45
- if ( typeof ua !== 'string' ) return false ;
46
-
47
- var result = isMobile ( {
48
- ua : ua ,
49
- tablet : true
50
- } ) ;
51
-
52
- // handle iPad pro or iPad with iOs 13 using Safari
53
- // see https://github.com/plotly/plotly.js/issues/4502
54
- if (
55
- result === false &&
56
- ua . indexOf ( 'Macintosh' ) !== - 1 &&
57
- ua . indexOf ( 'Safari' ) !== - 1 &&
58
- navigator . maxTouchPoints > 1
59
- ) {
60
- result = true ;
61
- }
62
-
63
- return result ;
64
- }
33
+ var isMobile = require ( 'is-mobile' ) ( { tablet : true , featureDetect : true } ) ;
65
34
66
35
67
36
var STATIC_CANVAS , STATIC_CONTEXT ;
@@ -128,7 +97,7 @@ proto.tryCreatePlot = function() {
128
97
canvas : scene . canvas ,
129
98
gl : scene . gl ,
130
99
glOptions : {
131
- preserveDrawingBuffer : tablet ,
100
+ preserveDrawingBuffer : isMobile ,
132
101
premultipliedAlpha : true ,
133
102
antialias : true
134
103
} ,
0 commit comments