diff --git a/tests/examples_methods_syntax/multiple_interactions.py b/tests/examples_methods_syntax/multiple_interactions.py index 1248eca38..0d0ff0ef9 100644 --- a/tests/examples_methods_syntax/multiple_interactions.py +++ b/tests/examples_methods_syntax/multiple_interactions.py @@ -5,9 +5,8 @@ * Dropdown: Filters the movies by genre * Radio Buttons: Highlights certain films by Worldwide Gross -* Mouse Drag and Scroll: Zooms the x and y scales to allow for panning. - - +* Mouse Drag and Scroll: Zooms the x and y scales to allow for panning +* Checkbox: Scales the marker size of big budget films """ # category: interactive charts @@ -27,8 +26,8 @@ base = alt.Chart(movies, width=200, height=200).mark_point(filled=True).transform_calculate( Rounded_IMDB_Rating = "floor(datum.IMDB_Rating)", - Hundred_Million_Production = "datum.Production_Budget > 100000000.0 ? 100 : 10", - Release_Year = "year(datum.Release_Date)" + Big_Budget_Film = "datum.Production_Budget > 100000000 ? 'Yes' : 'No'", + Release_Year = "year(datum.Release_Date)", ).transform_filter( alt.datum.IMDB_Rating > 0 ).transform_filter( @@ -59,7 +58,7 @@ genre_select ).properties(title="Dropdown Filtering") -#color changing marks +# Color changing marks rating_radio = alt.binding_radio(options=ratings, name="Rating") rating_select = alt.selection_point(fields=['MPAA_Rating'], bind=rating_radio) @@ -81,7 +80,7 @@ size_checkbox_condition = alt.condition( checkbox_selection, - alt.Size('Hundred_Million_Production:Q'), + alt.Size('Big_Budget_Film:N').scale(range=[25, 150]), alt.SizeValue(25) ) @@ -91,4 +90,4 @@ size=size_checkbox_condition ).properties(title="Checkbox Formatting") -(filter_year | filter_genres) & (highlight_ratings | budget_sizing) +(filter_year | budget_sizing) & (highlight_ratings | filter_genres)