-
-
Notifications
You must be signed in to change notification settings - Fork 668
Open
Labels
Description
Motivation
For continuous (linear) scales on a color encoding, the gradientLength config can be used to control legend length.
| Standard | With custom config |
|---|---|
![]() |
![]() |
Unfortunately, this property has no effect when using discrete color scales, like quantile or quantize . As far as I could tell, the symbol config options don't control height either.
This can lead to legends that are much taller than their graph (see below: the gradientLength param is set, but it appears to have no effect.)
| Quantize | Quantile |
|---|---|
![]() |
![]() |
Proposed solution
- Add at least 1 configuration option for
discrete color scales, perhaps setting the overall legend height (since the quantile mode won't have even tick sizes), in the direction ofdiscreteColorLegendLength. - If this property is added for Vega first, it will have to be propagated up to Vega-Lite separately.
Related PRs
- While searching for past
legendissues, I found- Correctly Support Quantile, Quantize, Threshold Scales #1092 marked the introduction of quantile/quantize/threshold scales
- vega/vega@ddd2bbf introduced
discrete gradient legend



