Using Plotly's orca to generate static plots in Binder-served sessions

I wanted to point this out in case it helps someone else, too…
mathieuboudreau and jonmmease worked out the complex issues involved in using Plotly’s orca to generate static versions of Plotly plots in Binder-served sessions here. This is an example where a Dockerfile (or perhaps postBuild) is needed. The misleading part is that it might seem using conda/environment.yml would be sufficient; however, what gets installed via conda cannot work headless. With the repo mathieuboudreau has made, the demos at Plotly’s Static Image Export in Python page work in sessions served from MyBinder.org and produce image files.

Nice work.

Do you know if they tried using a postBuild file. From a quick look at the Dockerfile it seems like they install apt packages, python packages and then use RUN to execute a few commands. This is what postBuild was made for. So it would be interesting to hear why it doesn’t work/how it fails.

I will try that myself since it is just a matter of placing the commands at the end in the postBuild, I think.

2 Likes

It does indeed work without a Dockerfile. It wasn’t as easy as directly porting each line; however, it now works. The result worked out is here.

2 Likes