Closed jowens closed 11 months ago
The first point is by design: specifying a domain and range is how you make the legend represent points that are not in the data (for example, when dynamically filtering).
The second point is a known issue; see #1785
OK. Other than filtering the domain and range Scale arrays once I see the data, any other way to make it reflect the actual contents of the data? (Might be potentially interesting to make this an option to Scale, legendOnlyReflectsDataBool
, that sort of thing.)
(The reason I'm using a domain/range is to get the colors consistent between different plots for the same labels. If there's another way to do this, I'm all ears.)
Thanks.
I don't know of any way to make an explicit domain/range respond to the contents of the data. You might ask on the vega-lite lists.
@jakevdp, @kanitw has a vega-lite hack (using "signal") that you might want to peek at, https://github.com/vega/vega-lite/issues/6310#issuecomment-612121376
Since this is tracked in https://github.com/vega/vega/issues/2535 and https://github.com/altair-viz/altair/issues/1785, and it needs to be implemented in VL for it to become available in altair I'm closing this issue.
If every label is represented:
I would prefer that
Thanks for lookin'!