Skip to content

Scattergl marker color behaves unexpectedly when specified as TypedArray #2591

Description

@jonmmease

Last one for today I promise!

When I set the marker.color property of a scatter trace to a numeric TypedArray, the color is computed based on the numeric values in the array and the marker's colorscale.

TESTER=document.getElementById('tester');Plotly.plot(TESTER,[{"type": "scatter","mode": "markers","y": [1,2,3],"marker": {"size": 20,"colorscale": [[0,'gray'],[1,'red']],"cmin": 0,"cmax": 1,"showscale": true,"color": newFloat32Array([0,0.5,1.0])}}],{"width": 500});

screen shot 2018-04-27 at 7 51 13 pm

But, when I do the same thing using a scattergl trace, a color is chosen that's not in the specified colorscale

TESTER=document.getElementById('tester');Plotly.plot(TESTER,[{"type": "scattergl",// <--- Change here"mode": "markers","y": [1,2,3],"marker": {"size": 20,"colorscale": [[0,'gray'],[1,'red']],"cmin": 0,"cmax": 1,"showscale": true,"color": newFloat32Array([0,0.5,1.0])}}],{"width": 500});

screen shot 2018-04-27 at 7 51 24 pm

Codepen:https://codepen.io/anon/pen/LmbQdv

Note: The colors for the scattergl trace display propery if the marker.color propery is set to a standard (non-typed) array.

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions