File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -712,12 +712,13 @@ var FigureModel = widgets.DOMWidgetModel.extend({
712
712
var FigureView = widgets . DOMWidgetView . extend ( {
713
713
714
714
/**
715
- * The render method is called when a view is first displayed to a
716
- * notebook output cell. This happens after the initialize of the
715
+ * The perform_render method is called by processPhosphorMessage
716
+ * after the widget's DOM element has been attached to the notebook
717
+ * output cell. This happens after the initialize of the
717
718
* FigureModel, and it won't happen at all if the Python FigureWidget
718
719
* is never displayed in a notebook output cell
719
720
*/
720
- render : function ( ) {
721
+ perform_render : function ( ) {
721
722
722
723
var that = this ;
723
724
@@ -809,6 +810,19 @@ var FigureView = widgets.DOMWidgetView.extend({
809
810
} ) ;
810
811
} ) ;
811
812
} ,
813
+
814
+ /**
815
+ * Respond to phosphorjs events
816
+ */
817
+ processPhosphorMessage : function ( msg ) {
818
+ FigureView . __super__ . processPhosphorMessage . apply ( this , arguments ) ;
819
+ switch ( msg . type ) {
820
+ case 'after-attach' :
821
+ this . perform_render ( ) ;
822
+ break ;
823
+ }
824
+ } ,
825
+
812
826
/**
813
827
* Purge Plotly.js data structures from the notebook output display
814
828
* element when the view is destroyed
You can’t perform that action at this time.
0 commit comments