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