Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scattergl marker color behaves unexpectedly when specified as TypedArray #2591

Closed
jonmmease opened this issue Apr 28, 2018 · 0 comments · Fixed by #2596
Closed

Scattergl marker color behaves unexpectedly when specified as TypedArray #2591

jonmmease opened this issue Apr 28, 2018 · 0 comments · Fixed by #2596
Assignees
Labels
bug something broken

Comments

@jonmmease
Copy link
Contributor

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": new Float32Array([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": new Float32Array([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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants