diff --git a/.changeset/few-camels-swim.md b/.changeset/few-camels-swim.md new file mode 100644 index 0000000000000..cd1fb811858a6 --- /dev/null +++ b/.changeset/few-camels-swim.md @@ -0,0 +1,6 @@ +--- +"@gradio/plot": patch +"gradio": patch +--- + +feat:Fix resizer on altair diff --git a/js/plot/shared/plot_types/AltairPlot.svelte b/js/plot/shared/plot_types/AltairPlot.svelte index e30cb0b20f9d2..9966a98fb1b4f 100644 --- a/js/plot/shared/plot_types/AltairPlot.svelte +++ b/js/plot/shared/plot_types/AltairPlot.svelte @@ -28,7 +28,11 @@ spec = set_config(spec, computed_style, value.chart as string, colors); } $: fit_width_to_parent = - spec.encoding?.column?.field || spec.encoding?.row?.field ? false : true; // vega seems to glitch with width when orientation is set + spec.encoding?.column?.field || + spec.encoding?.row?.field || + value.chart === undefined + ? false + : true; // vega seems to glitch with width when orientation is set const renderPlot = (): void => { if (fit_width_to_parent) {