-
-
Notifications
You must be signed in to change notification settings - Fork 668
fix: preserve gradientLength when generating discrete gradient color legend #9400
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: main
Are you sure you want to change the base?
fix: preserve gradientLength when generating discrete gradient color legend #9400
Conversation
c6fd282 to
c158c80
Compare
Deploying vega-lite with
|
| Latest commit: |
b9d4f17
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://53a88098.vega-lite.pages.dev |
| Branch Preview URL: | https://cameron-yick-check-vega-lite.vega-lite.pages.dev |
| if ( | ||
| // Continuous and discrete gradients ignore symbol properties | ||
| (legendType === 'gradient' && property.startsWith('symbol')) || | ||
| (legendType === 'discrete' && property.startsWith('symbol')) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before I add any tests or open PRs in vega, I want to check if this is the behavior (a third legendType called discrete) we want as a public API, or if this was supposed to be a private/internal API.
The discrete legend type was added by @jheer in vega/vega@ddd2bbf , so I'll bring it up as a separate issue in the vega repo vega/vega#3954 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the new type in vega/vega#3957 . We'll need a new release of vega to happen in order for vega-lite to be able to reference it.
9fe4a63 to
f13f69f
Compare
…to avoid dropping gradientLength
…erty at compile time
79784bc to
70e0e7e
Compare
Motivation
quantileandquantizecolor scales #9399Testing
gradientLengthproperty should be respected for a color legend that uses quantile, quantize, or threshold scales.300, and the legend should get taller.{ "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": {"url": "data/cars.json"}, "mark": "rect", "encoding": { "y": {"field": "Origin", "type": "nominal"}, "x": {"field": "Cylinders", "type": "ordinal"}, "color": { "aggregate": "mean", "field": "Horsepower", "scale": {"type": "quantile"}, "legend": {"gradientLength": 30} } }, "config": {"axis": {"grid": true, "tickBand": "extent"}} }Notes
vega-liteso this PR can be reviewed. We can make the diff in Vega-Lite smaller if we instead push a change to theLegendTypetype ofvega( fix(legend): add third mode,discrete, toLegendTypevega#3957 )