plot icon indicating copy to clipboard operation
plot copied to clipboard

Color gradients?

Open mbostock opened this issue 4 years ago • 4 comments

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 avatar Mar 03 '21 17:03 mbostock

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

mbostock avatar Jan 08 '22 00:01 mbostock

related: #362

Fil avatar Jan 11 '22 14:01 Fil

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 (?))

Fil avatar Jan 25 '22 14:01 Fil

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 avatar Feb 17 '22 23:02 mbostock