Skip to content

Conversation

@cnathe
Copy link
Contributor

@cnathe cnathe commented Dec 5, 2025

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

  • LABKEY.vis.Scale.ValueMapDiscrete to support an D3 like ordinal scale with a valueMap for specific values
  • GenericChartHelper.generatePlotConfig() update to use chartConfig measuresOptions for series color and shape value mapping
  • Box plot points layer to be added last, after the box layer

Copy link
Contributor

@labkey-alan labkey-alan left a 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();
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@cnathe cnathe merged commit 5e865e6 into develop Dec 9, 2025
9 of 10 checks passed
@cnathe cnathe deleted the fb_chartColorScale branch December 9, 2025 20:52
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