Closed
Description
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.
Metadata
Metadata
Assignees
Labels
No labels