fix: extend d3-interpolateRgb() to process CSS vars#1270
fix: extend d3-interpolateRgb() to process CSS vars#1270ildar170975 wants to merge 5 commits intokalkih:devfrom
Conversation
|
I'm not sure, if we should do this. When I added d3, using a hidden element was an option for interpolation, too. I explicitly chose to not do it. I don't fully recall the reasons. I think, it was somehow considered unstable. And even after adding the small d3 library, it was criticized for introducing a dependency. So, I think our options are:
|
|
Thanks a lot for the feedback!!! Converting to draft, will think about it later. |
This is unclear for me, will check your previous posts to understand the point.
BTW,
I introduced a separate file "interpolateRgb.js" exactly to REPLACE a dependency in some future. |
We could also set some colour property on the Or we could declare the colour of each bar not as hex directly, but as mix-in string. The first variant is the somehow unstable one I tried to avoid. The second variant might be elegant, because we could get rid of the JS interpolation altogether. |
|
PS, looking at the issue now: #1259 (comment) The graph itself does render the variables correctly, because it uses the colours in a map directly. So it basically relies on the browser for interpolating. The points, however, and bars are interpolated in JS. |
|
OK, some info to be processed... |
Seems that an external d3-interpolateRgb() does not process CSS variables like
var(--green-color).The d3-interpolateRgb() function is replaced with a proxy function which converts CSS variables to values.
Will hopefully solve #1259.