Skip to content

Commit

Permalink
Revert "Handle Altair resolve_scale (streamlit#8497)" (streamlit#8845)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcgrady authored Jun 7, 2024
1 parent 72bf95e commit 6551051
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 24 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 0 additions & 17 deletions e2e_playwright/st_altair_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,3 @@
c2 = alt.Chart(df1).mark_line().encode(alt.X("x"), alt.Y("y2"))

st.altair_chart(c1 & c2, use_container_width=True)

from altair.expr import datum

results = [
[2016, 11525, 3],
[2017, 11517, 2],
[2018, 11521, 2],
[2019, 11519, 4],
]

dataframe = pd.DataFrame(results, columns=["Job Number", "Test Count", "Test Failures"])

base = alt.Chart(dataframe).encode(alt.X("Job Number:O"))
chart_test_count = base.mark_line().encode(alt.Y("Test Count:N"))
chart_test_failures = base.mark_line().encode(alt.Y("Test Failures:N"))

st.altair_chart((chart_test_count + chart_test_failures).resolve_scale(y="independent"))
5 changes: 2 additions & 3 deletions e2e_playwright/st_altair_chart_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def test_altair_chart_displays_correctly(
):
expect(
themed_app.get_by_test_id("stArrowVegaLiteChart").locator("canvas")
).to_have_count(11)
).to_have_count(10)
charts = themed_app.get_by_test_id("stArrowVegaLiteChart")
expect(charts).to_have_count(11)
expect(charts).to_have_count(10)
snapshot_names = [
"st_altair_chart-scatter_chart_default_theme",
"st_altair_chart-scatter_chart_streamlit_theme",
Expand All @@ -36,7 +36,6 @@ def test_altair_chart_displays_correctly(
"st_altair_chart-grouped_use_container_width_default_theme",
"st_altair_chart-grouped_layered_line_chart_streamlit_theme",
"st_altair_chart-vconcat_width",
"st_altair_chart-resolve-scale-independent",
]
for i, name in enumerate(snapshot_names):
# We use a higher threshold here to prevent some flakiness
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ export function applyStreamlitTheme(config: any, theme: EmotionTheme): any {
stroke: "transparent",
continuousHeight: 350,
continuousWidth: 400,
discreteHeight: 350,
discreteWidth: { step: 20 },
},
concat: {
columns: 1,
Expand Down Expand Up @@ -185,8 +183,6 @@ export function applyThemeDefaults(config: any, theme: EmotionTheme): any {
stroke: getGray30(theme),
continuousHeight: 350,
continuousWidth: 400,
discreteHeight: 350,
discreteWidth: { step: 20 },
},
mark: {
tooltip: true,
Expand Down

0 comments on commit 6551051

Please sign in to comment.