When using a plotly graph of any sort with the Javascript API (plotly.js, not plotly-nodejs), how can I run some javascript ONLY after the graph has loaded? I'm looking for the mechanism in the plotly javascript API that, for example, does the same thing that 'addListenerOnce', in conjunction with 'tilesloaded' or 'ready', do when using the Google Maps API.
For example, let's say I want to simply display an alert immediately after rendering the example shown at https://plot.ly/~PlotBot/685, for which the html and js code can be seen at https://plot.ly/~PlotBot/685.js.
There are many reasons to do this, but the one I am faced with now is using wkhtml2pdf, which must wait for the page to be rendered before displaying (see wkhtmltopdf javascript delay) (Yes, I know I can use --javascript-delay with wkhtml2pdf, but hardcoding a fixed amount of time and hoping that your program waited long enough for its next steps to succeed is not the solution I'm looking for-- and besides, that approach is specific to wkhtml2pdf and does not answer the general question).
Prefer a browser-independent solution but at the least, need one that works on Chrome