Expr does not work for padding properties
See original GitHub issue{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"params": [
{
"name": "l",
"value": 0,
"bind": { "input": "range", "name": "l", "max": 50 }
},
{
"name": "r",
"value": 0,
"bind": { "input": "range", "name": "r", "max": 50 }
}
],
"width": 300,
"height": 300,
"autosize": {"type": "fit"},
"padding": {"left": {"expr":"l"}, "right": {"expr":"r"}, "top": 5, "bottom": 5},
"data": {
"url": "https://cdn.jsdelivr.net/npm/vega-datasets@2.1/data/cars.json"
},
"encoding": {
"x": {"field": "Horsepower", "bin": true},
"y": {"aggregate": "count"}
},
"mark": "bar"
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Padding and Margin not working - Stack Overflow
Span element has display:inline by default so padding does not effect it. You have to give display:inline-block or display: block the element( ...
Read more >Padding is between plot and axes, not between points. #1339
I'm trying to plot a heatmap in Vega-Lite without any padding between marks. From the docs it sounds like padding would do the...
Read more >Expression for padding - OpenText Forums
hi there: I have a specific question on padding.... I want to know if it's possible to add expression on some textbox padding......
Read more >calc() - CSS: Cascading Style Sheets - MDN Web Docs
The calc() CSS function lets you perform calculations when specifying CSS property values. It can be used with , , , , ,...
Read more >Formatting syntax reference - Microsoft Learn
In this example, two style properties ( padding and background-color ) will be applied. The padding value is a hard-coded string value. The ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I see. I would say for now ask people to write expressions or values but not have expressions inside values. We can enforce that through the schema/types.
Thanks for the note. I think we can always make specific exceptions where we support objects with expressions in them.