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

Surface colorscale error for colorscales of length >=256 #3699

Closed
jonmmease opened this issue Mar 29, 2019 · 2 comments · Fixed by bpostlethwaite/colormap#22
Closed

Surface colorscale error for colorscales of length >=256 #3699

jonmmease opened this issue Mar 29, 2019 · 2 comments · Fixed by bpostlethwaite/colormap#22
Assignees
Labels
bug something broken

Comments

@jonmmease
Copy link
Contributor

It seems that there is a breakdown in the colorscale handling for the surface trace when the colorscale definition has length >= 256.

CodePen: https://codepen.io/jonmmease/pen/OGLOYK

For colorscale of length 255, things work as expected:
newplot(8)

For colorscale of length 256, the colorbar is displayed properly but the surface is not rendered and there is a console error:

Screenshot_20190329_191102

Error: ... map requires nshades to be at least size 256

If there is a hardware need for a colorscale length limit it would be great if this could be increased from 255 to 256 because that's a relatively common length for colorscales specified in libraries like matplotlib and colorcet.

@archmoj archmoj added the bug something broken label Mar 30, 2019
@archmoj archmoj self-assigned this Mar 30, 2019
jonmmease added a commit to holoviz/holoviews that referenced this issue Mar 30, 2019
plotly/plotly.js#3699. Plotly.js performs
colorscale interpolation internally so reducing the number of colors
here makes very little difference to the displayed colorscale.
philippjfr pushed a commit to holoviz/holoviews that referenced this issue Mar 31, 2019
plotly/plotly.js#3699. Plotly.js performs
colorscale interpolation internally so reducing the number of colors
here makes very little difference to the displayed colorscale.
philippjfr pushed a commit to holoviz/holoviews that referenced this issue Mar 31, 2019
* For plotly backend reduce colorscale length to <= 255 to work around
plotly/plotly.js#3699. Plotly.js performs
colorscale interpolation internally so reducing the number of colors
here makes very little difference to the displayed colorscale.

* When falling back to a plotly.py colorscale, return scale as-is

previously an invalid colorscale was being constructed because the
colorscale list of pairs was treated as if it were a list of colors

* Fix edges_color and colorbar options for Plotly trisurf element

* Add colorbar/colorscale configuration to plotly bivariate element

* Add colorbar plotly tests
@archmoj archmoj reopened this Apr 2, 2019
@jonmmease
Copy link
Contributor Author

Thanks!

@archmoj
Copy link
Contributor

archmoj commented Apr 2, 2019

Thanks!

No problem. First we wanted to include that in 1.46.0.
But it would be fixed in 1.46.1.

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.

2 participants