-
Notifications
You must be signed in to change notification settings - Fork 7
Plotting Improvements - Series color scale and color picker options #7247
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
Conversation
… with a valueMap for specific values
…suresOptions for series color and shape value mapping
labkey-alan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
|
|
||
| // copied from d3.scale.ordinal | ||
| scale.domain = function(_) { | ||
| if (!arguments.length) return domain.slice(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The no-arguments case for domain, and range, are probably incorrect, since they are not including the values from the valueMap. However, I am not sure how much this matters, I'm not sure if we rely on the domain/range getters for discrete scales at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though it's hard to say if they're definitely incorrect, since I suppose those are the domain and range for the "fallback" scales used by ValueMapDiscrete. One could argue they could be implemented as such:
domain = Array.from(Object.keys()).concat(domain)
range = Array.from(Object.values).concat(range)
However there would then be no way to tell what part of the domain or range are part of the "fallback" scale.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I went back and forth on these implementation for scale.domain and scale.range. It is possible that the valueMap includes keys that aren't in the actual data being plotted, so I went this route.
Rationale
The next round of plotting improvements focus on the color options. For most chart types, this PR adds color pickers for things like line color, fill color, and point color. For line charts that have a series measure selected, this adds to the chart builder modal options to be able to select a specific series value and set the color and shape for that series. These settings are all then stored with the chart config object and used on render.
Related Pull Requests
Changes