-
Notifications
You must be signed in to change notification settings - Fork 261
fix: extend d3-interpolateRgb() to process CSS vars #1270
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
base: dev
Are you sure you want to change the base?
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.