From 7093ca63d2851498289199129611ecf1b6cca32a Mon Sep 17 00:00:00 2001 From: Stefan Binder Date: Fri, 30 Dec 2022 19:34:43 +0000 Subject: [PATCH] Change default chart width to 300 --- altair/vegalite/v3/tests/test_api.py | 4 ++-- altair/vegalite/v3/tests/test_theme.py | 2 +- altair/vegalite/v3/theme.py | 6 +++--- altair/vegalite/v4/tests/test_api.py | 4 ++-- altair/vegalite/v4/tests/test_theme.py | 2 +- altair/vegalite/v4/theme.py | 6 +++--- altair/vegalite/v5/tests/test_api.py | 4 ++-- altair/vegalite/v5/tests/test_theme.py | 2 +- altair/vegalite/v5/theme.py | 6 +++--- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py index 489d8cf67..3b156612b 100644 --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -630,14 +630,14 @@ def test_themes(): alt.themes.enable("default") assert chart.to_dict()["config"] == { "mark": {"tooltip": None}, - "view": {"width": 400, "height": 300}, + "view": {"width": 300, "height": 300}, } alt.themes.enable("opaque") assert chart.to_dict()["config"] == { "background": "white", "mark": {"tooltip": None}, - "view": {"width": 400, "height": 300}, + "view": {"width": 300, "height": 300}, } alt.themes.enable("none") diff --git a/altair/vegalite/v3/tests/test_theme.py b/altair/vegalite/v3/tests/test_theme.py index 430c21935..1bed75838 100644 --- a/altair/vegalite/v3/tests/test_theme.py +++ b/altair/vegalite/v3/tests/test_theme.py @@ -15,6 +15,6 @@ def test_vega_themes(chart): dct = chart.to_dict() assert dct["usermeta"] == {"embedOptions": {"theme": theme}} assert dct["config"] == { - "view": {"width": 400, "height": 300}, + "view": {"width": 300, "height": 300}, "mark": {"tooltip": None}, } diff --git a/altair/vegalite/v3/theme.py b/altair/vegalite/v3/theme.py index 91d37649b..c2ed2a58f 100644 --- a/altair/vegalite/v3/theme.py +++ b/altair/vegalite/v3/theme.py @@ -15,7 +15,7 @@ def __call__(self): return { "usermeta": {"embedOptions": {"theme": self.theme}}, "config": { - "view": {"width": 400, "height": 300}, + "view": {"width": 300, "height": 300}, "mark": {"tooltip": None}, }, } @@ -33,7 +33,7 @@ def __repr__(self): themes.register( "default", lambda: { - "config": {"view": {"width": 400, "height": 300}, "mark": {"tooltip": None}} + "config": {"view": {"width": 300, "height": 300}, "mark": {"tooltip": None}} }, ) themes.register( @@ -41,7 +41,7 @@ def __repr__(self): lambda: { "config": { "background": "white", - "view": {"width": 400, "height": 300}, + "view": {"width": 300, "height": 300}, "mark": {"tooltip": None}, } }, diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py index 450553f3c..9f68c85ec 100644 --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -659,13 +659,13 @@ def test_themes(): with alt.themes.enable("default"): assert chart.to_dict()["config"] == { - "view": {"continuousWidth": 400, "continuousHeight": 300} + "view": {"continuousWidth": 300, "continuousHeight": 300} } with alt.themes.enable("opaque"): assert chart.to_dict()["config"] == { "background": "white", - "view": {"continuousWidth": 400, "continuousHeight": 300}, + "view": {"continuousWidth": 300, "continuousHeight": 300}, } with alt.themes.enable("none"): diff --git a/altair/vegalite/v4/tests/test_theme.py b/altair/vegalite/v4/tests/test_theme.py index d159d2fa7..48a1f61ae 100644 --- a/altair/vegalite/v4/tests/test_theme.py +++ b/altair/vegalite/v4/tests/test_theme.py @@ -15,5 +15,5 @@ def test_vega_themes(chart): dct = chart.to_dict() assert dct["usermeta"] == {"embedOptions": {"theme": theme}} assert dct["config"] == { - "view": {"continuousWidth": 400, "continuousHeight": 300} + "view": {"continuousWidth": 300, "continuousHeight": 300} } diff --git a/altair/vegalite/v4/theme.py b/altair/vegalite/v4/theme.py index b1db45778..7e6a73b51 100644 --- a/altair/vegalite/v4/theme.py +++ b/altair/vegalite/v4/theme.py @@ -22,7 +22,7 @@ def __init__(self, theme): def __call__(self): return { "usermeta": {"embedOptions": {"theme": self.theme}}, - "config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}, + "config": {"view": {"continuousWidth": 300, "continuousHeight": 300}}, } def __repr__(self): @@ -37,14 +37,14 @@ def __repr__(self): themes.register( "default", - lambda: {"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}}, + lambda: {"config": {"view": {"continuousWidth": 300, "continuousHeight": 300}}}, ) themes.register( "opaque", lambda: { "config": { "background": "white", - "view": {"continuousWidth": 400, "continuousHeight": 300}, + "view": {"continuousWidth": 300, "continuousHeight": 300}, } }, ) diff --git a/altair/vegalite/v5/tests/test_api.py b/altair/vegalite/v5/tests/test_api.py index 00f1389bd..3ba2321fd 100644 --- a/altair/vegalite/v5/tests/test_api.py +++ b/altair/vegalite/v5/tests/test_api.py @@ -703,13 +703,13 @@ def test_themes(): with alt.themes.enable("default"): assert chart.to_dict()["config"] == { - "view": {"continuousWidth": 400, "continuousHeight": 300} + "view": {"continuousWidth": 300, "continuousHeight": 300} } with alt.themes.enable("opaque"): assert chart.to_dict()["config"] == { "background": "white", - "view": {"continuousWidth": 400, "continuousHeight": 300}, + "view": {"continuousWidth": 300, "continuousHeight": 300}, } with alt.themes.enable("none"): diff --git a/altair/vegalite/v5/tests/test_theme.py b/altair/vegalite/v5/tests/test_theme.py index eaa2d8898..0eab5546d 100644 --- a/altair/vegalite/v5/tests/test_theme.py +++ b/altair/vegalite/v5/tests/test_theme.py @@ -15,5 +15,5 @@ def test_vega_themes(chart): dct = chart.to_dict() assert dct["usermeta"] == {"embedOptions": {"theme": theme}} assert dct["config"] == { - "view": {"continuousWidth": 400, "continuousHeight": 300} + "view": {"continuousWidth": 300, "continuousHeight": 300} } diff --git a/altair/vegalite/v5/theme.py b/altair/vegalite/v5/theme.py index 1f88f9696..ba396cb31 100644 --- a/altair/vegalite/v5/theme.py +++ b/altair/vegalite/v5/theme.py @@ -22,7 +22,7 @@ def __init__(self, theme): def __call__(self): return { "usermeta": {"embedOptions": {"theme": self.theme}}, - "config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}, + "config": {"view": {"continuousWidth": 300, "continuousHeight": 300}}, } def __repr__(self): @@ -37,14 +37,14 @@ def __repr__(self): themes.register( "default", - lambda: {"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}}, + lambda: {"config": {"view": {"continuousWidth": 300, "continuousHeight": 300}}}, ) themes.register( "opaque", lambda: { "config": { "background": "white", - "view": {"continuousWidth": 400, "continuousHeight": 300}, + "view": {"continuousWidth": 300, "continuousHeight": 300}, } }, )