-
Notifications
You must be signed in to change notification settings - Fork 233
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
adding function to enable custom color assignment algorithm #9
base: computed_values
Are you sure you want to change the base?
Conversation
First of all, please accept my apology for the delayed reply and letting this get buried. Thanks so much for putting together this pull request. I'm eager to help resolve your use case in the best way. The approach you outlined looks sound, though before merging, would you mind helping me understand the use case a little better? Based on my understanding, it sounds like what we need is a way to override If you could post example usage that would be great. Ultimately we can add an example to the repo once the feature's implemented (and a test but I'm happy to help with that). |
Hi tim, Does this make sense? I couldn’t see a way to achieve this without the addition of the new method. thanks, adam
|
Hi Adam, thanks for breaking it down for me - yes now I quite understand. Cool site by the way! I assume you've already explored the 3 options that chroma.js provides: quantile, k-means, and equidistant. I would have thought that the use case you described is what quantile was for, but to be honest I always forget the differences. If that's not the case, what do you think of the resolution being to allow overriding of limit calculation? |
I'm still looking into this btw -- sorry for the delay. On Sat, Jul 16, 2016, at 01:12 PM, Tim Wisniewski wrote:
Links:
|
here's the source data in the simplest form too (TAB format) |
I think what abrin wants is a way to specify the steps manually (and I would also benefit from a way of doing this). So instead doing, steps: 5, you could specify the 5 steps that you want the data to break at, like so, steps: "10", "20", "30", "50", "70". And then the data would be separated at those specific points, instead of whatever mode you select ("e", "q", or "k") decides automatically. A use case for this is a project that I am working on. I had a data scientist figure out the specific breaks/steps that would look best for a map with my data, and I have the legends being created with those specific breaks/steps. But my choropleth does not reflect that legend because I can't specify the actually breaks/steps that I want. http://bdadam.xyz/eduviz-dev/ |
We have a non-standard color scale that doesn't really fit well within the chroma.js model mostly because the distribution of data across the scale doesn't follow a linear or logarithmic pattern. To this end, I'd like to propose the ability to apply a custom function in the pattern of "valueProperty" that when passed a numeric value will return the hex-code of the color. You can see an example of the color scale we're using in the world-map here (http://core.tdar.org/).