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

query dplyr groups from data only if the relevant trace has a notion … #1386

Merged
merged 5 commits into from Nov 9, 2018

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Nov 1, 2018

Closes #1351

TESTING NOTES

Run the following and make sure it produces the image below. Make sure the point labelled "1" (not "3") is black.

# devtools::install_github("ropensci/plotly#1386")
library(plotly)

mtcars %>%
    mutate(id = seq_len(nrow(.))) %>%
    group_by(cyl) %>%
    plot_ly(
      x = ~mpg, y = ~wt, text = ~id,
      marker = list(color = ~ifelse(id == 1, "black", "red")),
      mode = "marker+text", textposition = "right"
    )

screen shot 2018-11-06 at 10 23 01 am

trace <- verify_type(trace)
# verify orientation of boxes/bars
trace <- verify_orientation(trace)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chunk was moved here from lines 150-154, so we can be sure we know the trace type before applying has_groups(trace)

@cpsievert cpsievert merged commit e2a817e into master Nov 9, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants