Skip to content

Commit

Permalink
Change default chart width to 300
Browse files Browse the repository at this point in the history
  • Loading branch information
binste committed Dec 30, 2022
1 parent 8c04fd7 commit 7093ca6
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions altair/vegalite/v3/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion altair/vegalite/v3/tests/test_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
6 changes: 3 additions & 3 deletions altair/vegalite/v3/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
}
Expand All @@ -33,15 +33,15 @@ 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(
"opaque",
lambda: {
"config": {
"background": "white",
"view": {"width": 400, "height": 300},
"view": {"width": 300, "height": 300},
"mark": {"tooltip": None},
}
},
Expand Down
4 changes: 2 additions & 2 deletions altair/vegalite/v4/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion altair/vegalite/v4/tests/test_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
6 changes: 3 additions & 3 deletions altair/vegalite/v4/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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},
}
},
)
Expand Down
4 changes: 2 additions & 2 deletions altair/vegalite/v5/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion altair/vegalite/v5/tests/test_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
6 changes: 3 additions & 3 deletions altair/vegalite/v5/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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},
}
},
)
Expand Down

0 comments on commit 7093ca6

Please sign in to comment.