Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading