For ggplotly: implement lineend = "square" for geom_segment
Open
Nobody has claimed this yet.
enhancement
ggplotly
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
Example code:
library(ggplot2)
b <- ggplot(mtcars, aes(wt, mpg))
df <- data.frame(x1 = c(2.62, 2.62), x2 = c(3.57,2.62), y1 = c(21,21), y2 = c(21, 16))
b + geom_segment(aes(x = x1, y = y1, xend = x2, yend = y2, colour = "segment"), data = df, size = 2, lineend = "square")
library(plotly)
ggplotly()
Here is how the corner looks in ggplots2:

And in ggplotly:

Notice the "notch" in the corner...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied R example with ggplot2 and plotly, then compare the square line end and corner rendering in ggplot2 with ggplotly. No source file or test is named in the issue; done means geom_segment with lineend = "square" renders without the reported notch and matches the reference appearance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100