Skip to content

geom_curve missing #1378

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

Closed
danielsjf opened this issue Oct 26, 2018 · 2 comments
Closed

geom_curve missing #1378

danielsjf opened this issue Oct 26, 2018 · 2 comments

Comments

@danielsjf
Copy link

danielsjf commented Oct 26, 2018

geom_curve is missing from the geoms that can be automatically converted from ggplot2.
There have been issues around this in the past but those were closed: #555 .

Example:

library(tibble)
library(dplyr)
library(ggplot2)
library(ggplotly)

data_points <- tibble(Node = c(1,2,3), X = c(1,2,1.5), Y = c(4,5,6))
data_segments <- tibble(From = c(1,2,3), To = c(2,3,1), label = c('Line 1: 800', 'Line 2: 1600', 'Line 3: 400'))
data <- data_segments %>% 
  left_join(data_points %>% rename(From = Node, X_from = X, Y_from = Y)) %>% 
  left_join(data_points %>% rename(To = Node, X_to = X, Y_to = Y))

p <- ggplot(data) + 
  geom_point(aes(x = X_from, y = Y_from)) + 
  geom_curve(aes(x = X_from, y = Y_from, xend = X_to, yend = Y_to), curvature = 0.1)
p
ggplotly(p)

The function mentions to open an issue if such an uncovered geom is used.

Amongst others, I'm trying to use this geom to have tooltips for lines. Since traces show tooltips over the entire length, having a tiny curvature for a line might show the tooltips. I've also created a related Stackoverflow issue.

@cpsievert
Copy link
Collaborator

I'm using #348 to keep track of this issue.

@antoine4ucsd
Copy link

Any updates on this? I am also trying to plot curve but I get the same error

Warning in geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
  geom_GeomCurve() has yet to be implemented in plotly.
  If you'd like to see this geom implemented,
  Please open an issue with your example code at
  https://github.com/ropensci/plotly/issues

thank you

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

3 participants