dani herrera
dani herrera

Reputation: 51645

Vega viz truncated on grow

My web app has a vega-lite chart (from altair) with some transform_filter.

The issue is that the visualization doesn't grow when initial filters are removed. Because of this the visualization is truncated, neither don't scroll bars appear:

this is a gif of char growing when filters are removed

Char is embedded via vegaEmbed:

<div id="view"></div>
<script type="text/javascript">

    embed_opt = {"mode": "vega-lite", "actions": false}

    var chart = {
       "config": {
         "view": {
           "continuousWidth": 400,
           "continuousHeight": 300
         }
       },
       ... }

    vegaEmbed(
        '#view',
        chart,
        embed_opt
    )                   
</script>

My question is:

How can I do to allow char to grow down freely? (scrollbars can also be a solution)

Thanks in advance.

Upvotes: 0

Views: 57

Answers (1)

joelostblom
joelostblom

Reputation: 48879

In Altair, you can specify .configure(autosize=alt.AutoSizeParams(resize=True)) to dynamically resize charts (originally mentioned here).

Upvotes: 1

Related Questions