Description
I tried to create a ggplotly() using ggimage::ggmap() function and got the following warning:
_Warning messages:
1: In geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
geom_GeomImage() 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
2: 'bar' objects don't have these attributes: 'mode'
Valid attributes include:
'type', 'visible', 'showlegend', 'legendgroup', 'opacity', 'name', 'uid', 'ids', 'customdata', 'selectedpoints', 'hoverinfo', 'hoverlabel', 'stream', 'transforms', 'x', 'x0', 'dx', 'y', 'y0', 'dy', 'text', 'hovertext', 'textposition', 'textfont', 'insidetextfont', 'outsidetextfont', 'constraintext', 'cliponaxis', 'orientation', 'base', 'offset', 'width', 'marker', 'selected', 'unselected', 'r', 't', '_deprecated', 'error_x', 'error_y', 'xcalendar', 'ycalendar', 'xaxis', 'yaxis', 'idssrc', 'customdatasrc', 'hoverinfosrc', 'xsrc', 'ysrc', 'textsrc', 'hovertextsrc', 'textpositionsrc', 'basesrc', 'offsetsrc', 'widthsrc', 'rsrc', 'tsrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', 'bbox'
So I'd like to see geom_GeomImage() implemented.
Take a look at my example:
_library(plotly)
library(ggimage)
library(htmlwidgets)
COUNTRY <- c('Belgium','Brazil', 'France')
MVDuration <- c(1,20,9)
CODE2 <- c('BE','BR','FR')
world <- data.frame(COUNTRY, MVDuration, CODE2)
p <- ggplot(world, aes(COUNTRY, MVDuration)) +
geom_bar(stat = 'identity', fill = '#E69F00') + ggimage::geom_flag(y = -2, aes(image = CODE2)) + coord_flip() +
expand_limits(y = -2) + theme_minimal()
ggplotly(p)_