Skip to content

How can I set width to be "container" in config? #3352

Answered by joelostblom
pinkfrog9 asked this question in Q&A
Discussion options

You must be logged in to vote

You can set 'container' at the top-level rather than inside the config.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):

def black_marks():
    return {
        'height': 200,
        'width': 200,
        'config': {
            'mark': {
                'color': 'black',
                'fill': 'black'
            }
        }
    }

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mattijn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants