@@ -806,7 +806,7 @@ export class FigureView extends DOMWidgetView {
806
806
viewID : string ;
807
807
808
808
/**
809
- * The perform_render method is called by processPhosphorMessage
809
+ * The perform_render method is called by processLuminoMessage
810
810
* after the widget's DOM element has been attached to the notebook
811
811
* output cell. This happens after the initialize of the
812
812
* FigureModel, and it won't happen at all if the Python FigureWidget
@@ -900,10 +900,10 @@ export class FigureView extends DOMWidgetView {
900
900
}
901
901
902
902
/**
903
- * Respond to phosphorjs events
903
+ * Respond to Lumino events
904
904
*/
905
- processPhosphorMessage ( msg : any ) {
906
- super . processPhosphorMessage . apply ( this , arguments ) ;
905
+ _processLuminoMessage ( msg : any , _super : any ) {
906
+ _super . apply ( this , arguments ) ;
907
907
var that = this ;
908
908
switch ( msg . type ) {
909
909
case "before-attach" :
@@ -921,10 +921,6 @@ export class FigureView extends DOMWidgetView {
921
921
xaxis : axisHidden ,
922
922
yaxis : axisHidden ,
923
923
} ) ;
924
-
925
- window . addEventListener ( "resize" , function ( ) {
926
- that . autosizeFigure ( ) ;
927
- } ) ;
928
924
break ;
929
925
case "after-attach" :
930
926
// Rendering actual figure in the after-attach event allows
@@ -938,6 +934,21 @@ export class FigureView extends DOMWidgetView {
938
934
}
939
935
}
940
936
937
+ processPhosphorMessage ( msg : any ) {
938
+ this . _processLuminoMessage ( msg , super [ "processPhosphorMessage" ] ) ;
939
+
940
+ var that = this ;
941
+ if ( msg . type === "before-attach" ) {
942
+ window . addEventListener ( "resize" , function ( ) {
943
+ that . autosizeFigure ( ) ;
944
+ } ) ;
945
+ }
946
+ }
947
+
948
+ processLuminoMessage ( msg : any ) {
949
+ this . _processLuminoMessage ( msg , super [ "processLuminoMessage" ] ) ;
950
+ }
951
+
941
952
autosizeFigure ( ) {
942
953
var that = this ;
943
954
var layout = that . model . get ( "_layout" ) ;
0 commit comments