From affce4cbd9e2df14175c79da27408ccce57a74e9 Mon Sep 17 00:00:00 2001 From: aliabid94 Date: Tue, 25 Jun 2024 08:09:38 -0700 Subject: [PATCH] Fix resizer on altair (#8603) * changes * add changeset * add changeset * changes --------- Co-authored-by: Ali Abid Co-authored-by: gradio-pr-bot --- .changeset/few-camels-swim.md | 6 ++++++ js/plot/shared/plot_types/AltairPlot.svelte | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/few-camels-swim.md diff --git a/.changeset/few-camels-swim.md b/.changeset/few-camels-swim.md new file mode 100644 index 0000000000..cd1fb81185 --- /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 e30cb0b20f..9966a98fb1 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) {