How can I set width to be "container" in config? #3352
-
It seems to me I can only set width as "container" in the toplevel, but not in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Another related question is, in the doc: https://altair-viz.github.io/user_guide/customization.html#defining-a-custom-theme However, in vega-lite documentation: https://vega.github.io/vega-lite/docs/spec.html#config. There is no "width" attribute, the only thing is "continuousWidth" and "discreteWidth". |
Beta Was this translation helpful? Give feedback.
-
You can set You're right that the example in the altair docs is using an unsupported spec (although it still works), it should look like this (feel free to submit a PR to the docs): def black_marks():
return {
'height': 200,
'width': 200,
'config': {
'mark': {
'color': 'black',
'fill': 'black'
}
}
} |
Beta Was this translation helpful? Give feedback.
You can set
'container'
at the top-level rather than inside theconfig.view
key as per https://vega.github.io/vega-lite/docs/size.html#specifying-responsive-width-and-height.You're right that the example in the altair docs is using an unsupported spec (although it still works), it should look like this (feel free to submit a PR to the docs):