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 7474 "gl-select-box" : " ^1.0.1" ,
7575 "gl-shader" : " 4.2.0" ,
7676 "gl-spikes2d" : " ^1.0.1" ,
77- "gl-surface3d" : " ^1.2.3 " ,
77+ "gl-surface3d" : " ^1.3.0 " ,
7878 "mapbox-gl" : " ^0.22.0" ,
7979 "mouse-change" : " ^1.1.1" ,
8080 "mouse-wheel" : " ^1.0.2" ,
Original file line number Diff line number Diff line change @@ -97,6 +97,18 @@ function parseColorScale(colorscale, alpha) {
9797 } ) ;
9898}
9999
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+
100112// Pad coords by +1
101113function padField ( field ) {
102114 var shape = field . shape ;
@@ -317,6 +329,11 @@ proto.update = function(data) {
317329 }
318330 }
319331
332+ // see https://github.com/plotly/plotly.js/issues/940
333+ if ( isColormapCircular ( colormap ) ) {
334+ params . vertexColor = true ;
335+ }
336+
320337 params . coords = coords ;
321338
322339 surface . update ( params ) ;
@@ -343,7 +360,6 @@ proto.update = function(data) {
343360 }
344361} ;
345362
346-
347363proto . dispose = function ( ) {
348364 this . scene . glplot . remove ( this . surface ) ;
349365 this . surface . dispose ( ) ;
You can’t perform that action at this time.
0 commit comments