ABSTRACT

Version 2.0.0 of ggplot2 introduced a way for other R packages to implement custom geoms. Although the ggplotly() function translates most of the geoms bundled with the ggplot2 package, it has no way of knowing about the rendering rules for custom geoms. To date, the ggmosaic and ggalt packages have taken advantage of this infrastructure to provide translations of their custom geoms to plotly. If the readers have implemented a custom geom, say GeomCustom, rest assured that the data passed to to_basic() will be of class GeomCustom when ggplotly() is called on a plot with their geom. In more complicated cases, where their custom geom cannot be converted to a lower level geom, a custom method for the geom2trace() generic is required. The plotly package does, however, provide generic functions based on the S3 scheme that can be leveraged to inform ggplotly() about these rules.