Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interactivity for geom_pcp #2391

Open
dicook opened this issue Sep 8, 2024 · 0 comments
Open

Add interactivity for geom_pcp #2391

dicook opened this issue Sep 8, 2024 · 0 comments

Comments

@dicook
Copy link

dicook commented Sep 8, 2024

It would be elegant to be able to create interactive parallel coordinate plots with plotly layered on the ggpcp library. Users should be able to select a line (or lines) and the entire line would highlight.

library(ggplot2)
data(mtcars)
mtcars_pcp <- mtcars |>
  dplyr::mutate(
    cyl = factor(cyl),
    vs = factor(vs),
    am = factor(am),
    gear = factor(gear),
    carb = factor(carb)
  ) |>
  pcp_select(1:11) |>  # select everything
  pcp_scale() |>
  pcp_arrange()

 base <- mtcars_pcp |> ggplot(aes_pcp())


 # Just the base plot:
 base + geom_pcp()

# Ideally this would allow lines to be selected 
ggplotly() 

# Or something like:
highlight_key(mtcars) |> ... (ggplot2 code) |> ggplotly()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant