plotly / plotly/plotly.R

FR: geom_lollipop

Offen
#1,210 8 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@kcbioy arbeitet bereits daran.

Seit 12.10.2021.

ggplotly good-for-first-time-contribution
Vorherrschende Sprache
R
Sterne
2.7k
Forks
641
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I want to suggest a feature and I would be willing to give it a shot myself and opening a PR, but I would like to know if there is interest first.


I would like to see geom_lollipop implemented in plotly.

It is an alternative to geom_bar that basically combines two layers: geom_point and geom_segment.
For ggplot, geom_lollipop is implemented in the ggalt package.


Here is a minimal example:

library(ggalt)
library(plotly)

mtcars <- data.frame(car=rownames(mtcars), mtcars)

base.plot <- ggplot(mtcars, aes(car, mpg))

bar.plot <- base.plot + geom_bar(stat="identity")
bar.plot + ggtitle("static bar plot")
ggplotly(bar.plot + ggtitle("reactive bar plot"))

lollipop.plot <- base.plot + geom_lollipop()
lollipop.plot + ggtitle("static lollipop plot")
#This does not work:
#ggplotly(lollipop.plot + ggtitle("reactive lollipop plot"))

lollipop.plot <- base.plot + geom_segment(aes(xend=car), yend=0) + geom_point()
lollipop.plot + ggtitle("static lollipop plot")
# Now it works:
ggplotly(lollipop.plot + ggtitle("reactive lollipop plot"))
# But hints could be improved (also show point hints on segment hover).

Please let me know if there is any interest and maybe some hints how/where to start.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.