File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ const widgetDefinition = {
5858 }
5959
6060 var graphDiv = document . getElementById ( el . id ) ;
61+
62+ // Used by Displayr to determine when widget is ready to be snapshot for testing
63+ graphDiv . setAttribute ( "rhtmlwidget-status" , "loading" ) ;
6164
6265 // TODO: move the control panel injection strategy inside here...
6366 HTMLWidgets . addPostRenderHandler ( function ( ) {
@@ -551,6 +554,11 @@ const widgetDefinition = {
551554 } ) ;
552555 }
553556 } // end of selectionChange
557+
558+ graphDiv . on ( "plotly_afterplot" , function ( ) {
559+ // Used by Displayr to determine when widget is ready to be snapshot for testing
560+ graphDiv . setAttribute ( "rhtmlwidget-status" , "ready" ) ;
561+ } ) ;
554562 } // end of renderValue
555563}
556564
You can’t perform that action at this time.
0 commit comments