Skip to content

removed colorscale attribute from mesh3d #637

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

Closed
wants to merge 1 commit into from
Closed

removed colorscale attribute from mesh3d #637

wants to merge 1 commit into from

Conversation

VeraZab
Copy link

@VeraZab VeraZab commented Jun 13, 2016

that attribute shouldn't exist for that trace

@etpinard
Copy link
Contributor

Looks like a lot code downstream of mesh3d/attributes.jsrelies on colorscale. For example,

causing a few image tests to fail.

But, looks like gl-mesh3d does handle color maps here. Maybe we just got lazy and never added a test and docs for them?

@VeraZab this block here suggest that colorscale is used only when the mesh3d trace intensity is set. Could you confirm or infirm. Thanks!

@mdtusz
Copy link
Contributor

mdtusz commented Jun 14, 2016

@VeraZab @etpinard @cldougl

We'll want to update the docs to be much more clear regarding colorscale on meshes like this.

To clarify

colorscale only has an effect if intensity is set as well for the surface, where intensity is an array of normalized values for each vertex of the mesh corresponding to an interpolated color value based on the colorscale. E.g in extreme pseudocode (vertices isn't an actual plotly attribute).

vertices: [A, B, C]
intensity: [0, 0.5, 1]
colorscale: [[0, rgb(255, 0, 0)], [0.5, rgb(0, 255, 0)], [1, rgb(0, 0, 255)]]

This will create a surface where vertex A will be pure red, B will be green, and C will be blue, and a smooth gradient will be interpolated inbetween the vertices.

Here's a tetrahedron example on jsbin.

@etpinard
Copy link
Contributor

@mdtusz ... and we should add an image test for that case too.

@etpinard
Copy link
Contributor

closed in favour of #643

@etpinard etpinard closed this Jun 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants