observablehq / plot

A concise API for exploratory data visualization implementing a layered grammar of graphics
https://observablehq.com/plot/
ISC License
4.25k stars 173 forks source link

Legend not showing when values are `var(...)` #2012

Closed vincent-octo closed 6 months ago

vincent-octo commented 6 months ago

Hello,

When using color: {legend: true} and values are "var(--something)" then the legend does not appear. Additionally, I could not see any warning or error message that could help in understanding why the legend doesn't show.

Here is an notebook that reproduces the bug: https://observablehq.com/d/fbd79535abd8788a Changing fill: "test" with fill: "sex" will display the legend again, so I am assuming that the "var(...)" content of test is to blame here.