Skip to content

Commit

Permalink
revert: Change encodings back to temporal
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned committed Nov 24, 2024
1 parent 2e05ec2 commit 38f7e1a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tests/examples_arguments_syntax/falkensee.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)

Expand Down
4 changes: 2 additions & 2 deletions tests/examples_arguments_syntax/natural_disasters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions tests/examples_methods_syntax/falkensee.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)

Expand Down
4 changes: 2 additions & 2 deletions tests/examples_methods_syntax/natural_disasters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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(
Expand Down

0 comments on commit 38f7e1a

Please sign in to comment.