File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 74
74
"gl-select-box" : " ^1.0.1" ,
75
75
"gl-shader" : " 4.2.0" ,
76
76
"gl-spikes2d" : " ^1.0.1" ,
77
- "gl-surface3d" : " ^1.2.3 " ,
77
+ "gl-surface3d" : " ^1.3.0 " ,
78
78
"mapbox-gl" : " ^0.22.0" ,
79
79
"mouse-change" : " ^1.1.1" ,
80
80
"mouse-wheel" : " ^1.0.2" ,
Original file line number Diff line number Diff line change @@ -97,6 +97,18 @@ function parseColorScale(colorscale, alpha) {
97
97
} ) ;
98
98
}
99
99
100
+ function isColormapCircular ( colormap ) {
101
+ var first = colormap [ 0 ] . rgb ,
102
+ last = colormap [ colormap . length - 1 ] . rgb ;
103
+
104
+ return (
105
+ first [ 0 ] === last [ 0 ] &&
106
+ first [ 1 ] === last [ 1 ] &&
107
+ first [ 2 ] === last [ 2 ] &&
108
+ first [ 3 ] === last [ 3 ]
109
+ ) ;
110
+ }
111
+
100
112
// Pad coords by +1
101
113
function padField ( field ) {
102
114
var shape = field . shape ;
@@ -317,6 +329,11 @@ proto.update = function(data) {
317
329
}
318
330
}
319
331
332
+ // see https://github.com/plotly/plotly.js/issues/940
333
+ if ( isColormapCircular ( colormap ) ) {
334
+ params . vertexColor = true ;
335
+ }
336
+
320
337
params . coords = coords ;
321
338
322
339
surface . update ( params ) ;
@@ -343,7 +360,6 @@ proto.update = function(data) {
343
360
}
344
361
} ;
345
362
346
-
347
363
proto . dispose = function ( ) {
348
364
this . scene . glplot . remove ( this . surface ) ;
349
365
this . surface . dispose ( ) ;
You can’t perform that action at this time.
0 commit comments