Created
January 5, 2026 10:31
-
-
Save charliejhadley/3aefbd70544d5c98d7a56cf9a877474b to your computer and use it in GitHub Desktop.
ggiraph-legend.R
This file contains hidden or 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
| library(tidyverse) | |
| library(ggiraph) | |
| library(fivethirtyeight) | |
| p_bechdel <- ggplot(bechdel) + | |
| aes(x = budget_2013, | |
| y = domgross_2013, | |
| data_id = clean_test, | |
| colour = clean_test) + | |
| geom_point_interactive(aes(`data-id` = clean_test), extra_interactive_params = "data-id") + | |
| scale_color_discrete_interactive(extra_interactive_params = "data-id", | |
| `data-id` = unique(bechdel$clean_test), | |
| palette = 'Set1', | |
| data_id = function(breaks) as.character(breaks)) | |
| girafe(ggobj = p_bechdel, | |
| options = list(opts_hover(girafe_css("stroke:black;fill:black;")), | |
| opts_hover_key(girafe_css("stroke:black;fill:black")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment