Skip to content

Commit

Permalink
Fix resizer on altair (#8603)
Browse files Browse the repository at this point in the history
* changes

* add changeset

* add changeset

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 25, 2024
1 parent 8aad678 commit affce4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/few-camels-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/plot": patch
"gradio": patch
---

feat:Fix resizer on altair
6 changes: 5 additions & 1 deletion js/plot/shared/plot_types/AltairPlot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit affce4c

Please sign in to comment.