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

Fix geom2trace.geompoint incorrect filling (closes #2298) #2299

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

zeehio
Copy link
Contributor

@zeehio zeehio commented Oct 5, 2023

I'm unable right now to paste images here. However the plot p below gives a red and a green dot with ggplot2 and two green dots with plotly.

  df <- data.frame(x = c(1,2), y = c(0,0), color = rep("yellow", 2), fill = 1:2)
  p <- ggplot(df) +
    geom_point(aes(x = x, y = y, fill = fill, color = color), size = 5, shape = 21) +
    scale_fill_gradient(low = "green", high = "red")
  ggplotly(p)

ggplotly(p) gives the following warning as well:

Warning message:
In L$marker$color[idx] <- aes2plotly(data, params, "fill")[idx] :
number of items to replace is not a multiple of replacement length

This PR addresses the warning and fixes the issue. It's fairly simple.

@zeehio zeehio force-pushed the fix-geom2trace.geompoint-shape branch from 54b6dbc to eeca9ab Compare October 5, 2023 20:32
@zeehio
Copy link
Contributor Author

zeehio commented Oct 5, 2023

Rebased conflict on NEWS entry

Thanks for your time and thanks for plotly!

@cpsievert
Copy link
Collaborator

Thank you @zeehio, great work!

BTW, if you're looking to contribute more to plotly, it seems some recent changes in the development version of ggplot2 have caused a lot of test failures...it'd be super awesome if you wanted to help surface what changes have lead to those issues (and, ideally, propose fixes for them)!

@cpsievert cpsievert merged commit 270d20e into plotly:master Oct 5, 2023
0 of 10 checks passed
@zeehio
Copy link
Contributor Author

zeehio commented Oct 6, 2023

I'd love to help. These fixes were part of my work and going beyond this would probably be out of scope for my employer.

But if I find some free personal time I may try to submit some test fixes... Thanks!

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