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

The density mark could support the density keyword for fillOpacity and strokeOpacity, too #1399

Open
mbostock opened this issue Mar 27, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

It’s currently only supported for stroke and fill:

// If fill or stroke is specified as “density”, then temporarily treat these
// as a literal color when computing defaults and maybeZ; below, we’ll unset
// these constant colors back to undefined since they will instead be
// populated by a channel generated by the initializer.
const fillDensity = isDensity(fill) && ((fill = "currentColor"), true);
const strokeDensity = isDensity(stroke) && ((stroke = "currentColor"), true);

@mbostock mbostock added the enhancement New feature or request label Mar 27, 2023
@Fil
Copy link
Contributor

Fil commented Apr 1, 2023

For fillOpacity the tricky thing is that the polygons are layered (as opposed to what we would have with isobands), so the opacities will be compounded. d3/d3-contour#71

@mbostock
Copy link
Member Author

mbostock commented Apr 1, 2023

Agreed. I think we should switch to generating isobands by default.

@Fil
Copy link
Contributor

Fil commented Apr 3, 2023

Generalized as #1420.

@mbostock
Copy link
Member Author

And strokeWidth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants