Skip to content

Add colorBounds param to control colorscale range#5

Merged
etpinard merged 4 commits into
masterfrom
color-bounds
Jan 4, 2016
Merged

Add colorBounds param to control colorscale range#5
etpinard merged 4 commits into
masterfrom
color-bounds

Conversation

@etpinard
Copy link
Copy Markdown
Member

Resolves #4

More background info in: plotly/plotly.js#86

This PR adds the ability to control the colorscale range with a colorBounds parameter.

The current behavior where the surface coloring is based only on the min and the max of the field array is kept as the default.

- update module names
- update api call (coords needs to be length 3)
- use to clamp to color scale range,
  instead of always relying on z-data bounds
Comment thread surface.js
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be N_COLORS*c[3] if they are meant to always match.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think they were meant to match.

Replacing 255 with N_COLORS does change the colormap slightly.

@bpostlethwaite
Copy link
Copy Markdown
Member

Sweet, if those things are supposed to be coupled lets put that Constant to use. Otherwise 💃 !

etpinard added a commit that referenced this pull request Jan 4, 2016
Add colorBounds param to control colorscale range
@etpinard etpinard merged commit a9970f8 into master Jan 4, 2016
@etpinard etpinard deleted the color-bounds branch January 4, 2016 22:45
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.

2 participants