Skip to content
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

symbol legend tests; fix symbol scale hint; symbol identity scale #680

Merged
merged 5 commits into from
Jan 19, 2022

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Jan 18, 2022

This…

  • Adds support for the identity scale type for the symbol scale, allowing channels to return symbol type names or objects.
  • Like automatic color identity scale #673, automatically chooses the identity scale type for the symbol scale if all associated values are valid symbol types. Values are pulled from the domain if present, and otherwise from channels.
  • Fixes a bug whereby if a dot’s fill and symbol channels have different definitions, the symbol hint’s fill was undefined even though the dot is filled; now the hint fill is set to currentColor such that the symbol scale will chose the appropriate default range.
  • Fixes Plot.legend to allow a combined color + symbol legend by specifying both scales.
  • Fixes Plot.legend to allow the fill and stroke option to generate a corresponding hint for the symbol scale. This ensures that the scale will have the expected default range. An appropriate hint is also generated for the combined color + symbol legend.
  • Renames the “x” symbol to “times” to avoid confusion. For example, fill: "x" means to fill using the field named “x”, but previously symbol: "x" means to use the (constant) symbol in the shape of an X.
  • Adds snapshot test for symbol legends.

We should probably rename d3.symbolX to d3.symbolTimes in d3-shape, too, (keeping the old name as a deprecated alias to avoid backwards incompatibility). But that’s not urgent.

@mbostock mbostock force-pushed the mbostock/symbol-fixes branch from fcdad98 to edaf684 Compare January 18, 2022 23:01
@mbostock mbostock marked this pull request as ready for review January 18, 2022 23:38
@mbostock mbostock requested a review from Fil January 18, 2022 23:38
@mbostock mbostock changed the title symbol legend tests; fix symbol scale hint symbol legend tests; fix symbol scale hint; symbol identity scale Jan 19, 2022
@mbostock mbostock merged commit 60a54ca into main Jan 19, 2022
@mbostock mbostock deleted the mbostock/symbol-fixes branch January 19, 2022 17:12
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