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

Color gradients? #185

Open
mbostock opened this issue Mar 3, 2021 · 4 comments · May be fixed by #1731
Open

Color gradients? #185

mbostock opened this issue Mar 3, 2021 · 4 comments · May be fixed by #1731
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

mbostock commented Mar 3, 2021

It’d be nice to have a way to specify a color gradient, presumably spanning the chart area in either x or y, with some given color stops.

@mbostock mbostock added the enhancement New feature or request label Mar 3, 2021
@mbostock
Copy link
Member Author

mbostock commented Jan 8, 2022

Gradients on links, bars, and rects would also be lovely to indicate direction, as here:

Screen Shot 2022-01-07 at 4 19 30 PM

@Fil
Copy link
Contributor

Fil commented Jan 11, 2022

related: #362

@Fil
Copy link
Contributor

Fil commented Jan 25, 2022

may be fixed by #700 (it doesn't allow the gradients to be based on the data, but we can't realistically cover every use case: if one needs to compute gradients from data, there is still room to do it with vanilla JS or D3 (?))

@mbostock
Copy link
Member Author

Pretty close, but it would be much nicer if you could express inline syntax for a gradient rather than having to create the linearGradient element in SVG. I think we could do this by writing a CSS parser for the linear-gradient function. This would create a linearGradient element under the hood with a dynamic id.

https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient()

@mbostock mbostock linked a pull request Jun 29, 2023 that will close this issue
10 tasks
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

Successfully merging a pull request may close this issue.

2 participants