File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -712,12 +712,13 @@ var FigureModel = widgets.DOMWidgetModel.extend({
712712var FigureView = widgets . DOMWidgetView . extend ( {
713713
714714 /**
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
717718 * FigureModel, and it won't happen at all if the Python FigureWidget
718719 * is never displayed in a notebook output cell
719720 */
720- render : function ( ) {
721+ perform_render : function ( ) {
721722
722723 var that = this ;
723724
@@ -809,6 +810,19 @@ var FigureView = widgets.DOMWidgetView.extend({
809810 } ) ;
810811 } ) ;
811812 } ,
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+
812826 /**
813827 * Purge Plotly.js data structures from the notebook output display
814828 * element when the view is destroyed
You can’t perform that action at this time.
0 commit comments