question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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"
}

Open the Chart in the Vega Editor

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
domoritzcommented, Apr 28, 2021

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.

0reactions
domoritzcommented, Apr 28, 2021

Thanks for the note. I think we can always make specific exceptions where we support objects with expressions in them.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found