forked from vega/altair
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -698,6 +698,27 @@ def test_when_condition_parity( | |
assert chart_condition == chart_when | ||
|
||
|
||
def test_when_then_interactive() -> None: | ||
"""Copy-related regression found in https://github.com/vega/altair/pull/3394#issuecomment-2302995453.""" | ||
source = "https://cdn.jsdelivr.net/npm/[email protected]/data/movies.json" | ||
predicate = (alt.datum.IMDB_Rating == None) | ( # noqa: E711 | ||
alt.datum.Rotten_Tomatoes_Rating == None # noqa: E711 | ||
) | ||
|
||
chart = ( | ||
alt.Chart(source) | ||
.mark_point(invalid=None) | ||
.encode( | ||
x="IMDB_Rating:Q", | ||
y="Rotten_Tomatoes_Rating:Q", | ||
color=alt.when(predicate).then(alt.value("grey")), # type: ignore[arg-type] | ||
) | ||
) | ||
assert chart.interactive() | ||
assert chart.copy() | ||
assert chart.to_dict() | ||
|
||
|
||
def test_selection_to_dict(): | ||
brush = alt.selection_interval() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters