From 38f7e1a438feae9a49090237d3ee2afe3f5f836c Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Sun, 24 Nov 2024 12:56:51 +0000 Subject: [PATCH] revert: Change encodings back to temporal https://github.com/vega/altair/pull/3702#issuecomment-2495984841 --- tests/examples_arguments_syntax/falkensee.py | 6 +++--- tests/examples_arguments_syntax/natural_disasters.py | 4 ++-- tests/examples_methods_syntax/falkensee.py | 6 +++--- tests/examples_methods_syntax/natural_disasters.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/examples_arguments_syntax/falkensee.py b/tests/examples_arguments_syntax/falkensee.py index f44e11618..3744dff19 100644 --- a/tests/examples_arguments_syntax/falkensee.py +++ b/tests/examples_arguments_syntax/falkensee.py @@ -59,15 +59,15 @@ line = alt.Chart(source_df).mark_line(color="#333").encode( - x=alt.X("year:Q", axis=alt.Axis(format="%Y"), title="Year"), + x=alt.X("year:T", axis=alt.Axis(format="%Y"), title="Year"), y=alt.Y("population", title="Population"), ) point = line.mark_point(color="#333") rect = alt.Chart(source2_df).mark_rect().encode( - x="start:Q", - x2="end:Q", + x="start:T", + x2="end:T", color=alt.Color("event:N", title="Event") ) diff --git a/tests/examples_arguments_syntax/natural_disasters.py b/tests/examples_arguments_syntax/natural_disasters.py index e94194765..890580a6a 100644 --- a/tests/examples_arguments_syntax/natural_disasters.py +++ b/tests/examples_arguments_syntax/natural_disasters.py @@ -17,7 +17,7 @@ strokeWidth=1, strokeOpacity=0.4 ).encode( - x=alt.X('Year:Q', title=None, scale=alt.Scale(domain=['1899','2018'])), + x=alt.X('Year:T', title=None, scale=alt.Scale(domain=['1899','2018'])), y=alt.Y( 'Entity:N', sort=alt.EncodingSortField(field="Deaths", op="sum", order='descending'), @@ -30,7 +30,7 @@ color=alt.Color('Entity:N', legend=None), tooltip=[ "Entity:N", - alt.Tooltip("Year:Q", format='%Y'), + alt.Tooltip("Year:T", format='%Y'), alt.Tooltip("Deaths:Q", format='~s') ], ).properties( diff --git a/tests/examples_methods_syntax/falkensee.py b/tests/examples_methods_syntax/falkensee.py index 79dc01b40..ffceeed0a 100644 --- a/tests/examples_methods_syntax/falkensee.py +++ b/tests/examples_methods_syntax/falkensee.py @@ -59,15 +59,15 @@ line = alt.Chart(source_df).mark_line(color="#333").encode( - alt.X("year:Q").axis(format="%Y").title("Year"), + alt.X("year:T").axis(format="%Y").title("Year"), alt.Y("population").title("Population"), ) point = line.mark_point(color="#333") rect = alt.Chart(source2_df).mark_rect().encode( - x="start:Q", - x2="end:Q", + x="start:T", + x2="end:T", color=alt.Color("event:N").title("Event") ) diff --git a/tests/examples_methods_syntax/natural_disasters.py b/tests/examples_methods_syntax/natural_disasters.py index 03c331d53..cbc5a0d68 100644 --- a/tests/examples_methods_syntax/natural_disasters.py +++ b/tests/examples_methods_syntax/natural_disasters.py @@ -17,7 +17,7 @@ strokeWidth=1, strokeOpacity=0.4 ).encode( - alt.X('Year:Q') + alt.X('Year:T') .title(None) .scale(domain=['1899','2018']), alt.Y('Entity:N') @@ -30,7 +30,7 @@ alt.Color('Entity:N').legend(None), tooltip=[ "Entity:N", - alt.Tooltip("Year:Q", format='%Y'), + alt.Tooltip("Year:T", format='%Y'), alt.Tooltip("Deaths:Q", format='~s') ], ).properties(