How to grab a plotly object in Shiny to be used with plotly_build()?

When using plotly in Shiny, the standard way to obtain a reference to the plotly plot and modify it is using plotlyProxy() and then using plotlyProxyInvoke() to call methods on it.

But what if I want a reference to the plotly object itself so that I can pass it to plotly_build() in order to get information about the plot? I tried passing the output of plotlyProxy() to the build function but it won’t accept it.

1 Like

Did you figure out how to do this?