shapviz sv_importance plot breaks in plotly

So I have been trying out the new shapviz package with good results so far:

But strangely, the ggplotly utility function cannot render the bars correctly.:

Seeing how there are three levels here:

  1. ggplot2 itself
  2. plotly
  3. and shapviz

I decided to ask here on RStudio before raising an issue on any of the specific packages. What could be the problem?

1 Like

Turns out the culprit was plotly.R:

#...
shp <- shapviz(predictor, X_pred = data.matrix(X_full), X = X_full)
sv_wf <- sv_waterfall(shp, row_id = 1)
ggplotly(sv_wf)

As it turns out, shapviz' waterfall plot isn't a true waterfall plot, a la plotly or ggplot2. It's built on geom_gene_arrow from GitHub - wilkox/gggenes: ➡️️➡️️⬅️️➡️️ Draw gene arrow maps in ggplot2

Warning message in geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): “geom_GeomGeneArrow() 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
Warning message in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): “geom_GeomGeneArrow() 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
Warning message in geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): “geom_GeomFitText() 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
Warning message in geom2trace.default(dots[[1L]][[2L]], dots[[2L]][[1L]], dots[[3L]][[1L]]): “geom_GeomFitText() 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

So until someone PRs in an implementation, plotly doesn't know how to render it. Go figure :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.