@@ -168,12 +168,12 @@ export class FigureModel {
168168
169169 // Data and Layout
170170 // ---------------
171- // The _data and _layout properties are synchronized with the
171+ // The _widget_data and _widget_layout properties are synchronized with the
172172 // Python side on initialization only. After initialization, these
173173 // properties are kept in sync through the use of the _py2js_*
174174 // messages
175- _data : [ ] ,
176- _layout : { } ,
175+ _widget_data : [ ] ,
176+ _widget_layout : { } ,
177177 _config : { } ,
178178
179179 // Python -> JS messages
@@ -315,7 +315,7 @@ export class FigureModel {
315315 * @property {Array.<Array.<String|Number>> } remove_props
316316 * Array of property paths to remove. Each propery path is an
317317 * array of property names or array indexes that locate a property
318- * inside the _layout object
318+ * inside the _widget_layout object
319319 */
320320 _py2js_removeLayoutProps : null ,
321321
@@ -326,7 +326,7 @@ export class FigureModel {
326326 * @property {Array.<Array.<String|Number>> } remove_props
327327 * Array of property paths to remove. Each propery path is an
328328 * array of property names or array indexes that locate a property
329- * inside the _data [remove_trace] object
329+ * inside the _widget_data [remove_trace] object
330330 */
331331 _py2js_removeTraceProps : null ,
332332
@@ -389,7 +389,7 @@ export class FigureModel {
389389 * @property {Object } layout_delta
390390 * The layout delta object that contains all of the properties of
391391 * _fullLayout that are not identical to those in the
392- * FigureModel's _layout property
392+ * FigureModel's _widget_layout property
393393 * @property {Number } layout_edit_id
394394 * Edit ID of message that triggered the creation of layout delta
395395 */
@@ -400,7 +400,7 @@ export class FigureModel {
400400 * @property {Array.<Object> } trace_deltas
401401 * Array of trace delta objects. Each trace delta contains the
402402 * trace's uid along with all of the properties of _fullData that
403- * are not identical to those in the FigureModel's _data property
403+ * are not identical to those in the FigureModel's _widget_data property
404404 * @property {Number } trace_edit_id
405405 * Edit ID of message that triggered the creation of trace deltas
406406 */
@@ -528,8 +528,8 @@ export class FigureModel {
528528 * constructed
529529 */
530530 initialize ( ) {
531- this . model . on ( "change:_data " , ( ) => this . do_data ( ) ) ;
532- this . model . on ( "change:_layout " , ( ) => this . do_layout ( ) ) ;
531+ this . model . on ( "change:_widget_data " , ( ) => this . do_data ( ) ) ;
532+ this . model . on ( "change:_widget_layout " , ( ) => this . do_layout ( ) ) ;
533533 this . model . on ( "change:_py2js_addTraces" , ( ) => this . do_addTraces ( ) ) ;
534534 this . model . on ( "change:_py2js_deleteTraces" , ( ) => this . do_deleteTraces ( ) ) ;
535535 this . model . on ( "change:_py2js_moveTraces" , ( ) => this . do_moveTraces ( ) ) ;
@@ -556,7 +556,7 @@ export class FigureModel {
556556 */
557557 _normalize_trace_indexes ( trace_indexes ?: null | number | number [ ] ) : number [ ] {
558558 if ( trace_indexes === null || trace_indexes === undefined ) {
559- var numTraces = this . model . get ( "_data " ) . length ;
559+ var numTraces = this . model . get ( "_widget_data " ) . length ;
560560 trace_indexes = _ . range ( numTraces ) ;
561561 }
562562 if ( ! Array . isArray ( trace_indexes ) ) {
@@ -567,14 +567,14 @@ export class FigureModel {
567567 }
568568
569569 /**
570- * Log changes to the _data trait
570+ * Log changes to the _widget_data trait
571571 *
572572 * This should only happed on FigureModel initialization
573573 */
574574 do_data ( ) { }
575575
576576 /**
577- * Log changes to the _layout trait
577+ * Log changes to the _widget_layout trait
578578 *
579579 * This should only happed on FigureModel initialization
580580 */
@@ -589,7 +589,7 @@ export class FigureModel {
589589 var msgData : Py2JsAddTracesMsg = this . model . get ( "_py2js_addTraces" ) ;
590590
591591 if ( msgData !== null ) {
592- var currentTraces = this . model . get ( "_data " ) ;
592+ var currentTraces = this . model . get ( "_widget_data " ) ;
593593 var newTraces = msgData . trace_data ;
594594 _ . forEach ( newTraces , function ( newTrace ) {
595595 currentTraces . push ( newTrace ) ;
@@ -608,7 +608,7 @@ export class FigureModel {
608608
609609 if ( msgData !== null ) {
610610 var delete_inds = msgData . delete_inds ;
611- var tracesData = this . model . get ( "_data " ) ;
611+ var tracesData = this . model . get ( "_widget_data " ) ;
612612
613613 // Remove del inds in reverse order so indexes remain valid
614614 // throughout loop
@@ -629,7 +629,7 @@ export class FigureModel {
629629 var msgData : Py2JsMoveTracesMsg = this . model . get ( "_py2js_moveTraces" ) ;
630630
631631 if ( msgData !== null ) {
632- var tracesData = this . model . get ( "_data " ) ;
632+ var tracesData = this . model . get ( "_widget_data " ) ;
633633 var currentInds = msgData . current_trace_inds ;
634634 var newInds = msgData . new_trace_inds ;
635635
@@ -646,7 +646,7 @@ export class FigureModel {
646646 if ( msgData !== null ) {
647647 var restyleData = msgData . restyle_data ;
648648 var restyleTraces = this . _normalize_trace_indexes ( msgData . restyle_traces ) ;
649- performRestyleLike ( this . model . get ( "_data " ) , restyleData , restyleTraces ) ;
649+ performRestyleLike ( this . model . get ( "_widget_data " ) , restyleData , restyleTraces ) ;
650650 }
651651 }
652652
@@ -658,7 +658,7 @@ export class FigureModel {
658658 var msgData : Py2JsRelayoutMsg = this . model . get ( "_py2js_relayout" ) ;
659659
660660 if ( msgData !== null ) {
661- performRelayoutLike ( this . model . get ( "_layout " ) , msgData . relayout_data ) ;
661+ performRelayoutLike ( this . model . get ( "_widget_layout " ) , msgData . relayout_data ) ;
662662 }
663663 }
664664
@@ -673,8 +673,8 @@ export class FigureModel {
673673 var style = msgData . style_data ;
674674 var layout = msgData . layout_data ;
675675 var styleTraces = this . _normalize_trace_indexes ( msgData . style_traces ) ;
676- performRestyleLike ( this . model . get ( "_data " ) , style , styleTraces ) ;
677- performRelayoutLike ( this . model . get ( "_layout " ) , layout ) ;
676+ performRestyleLike ( this . model . get ( "_widget_data " ) , style , styleTraces ) ;
677+ performRelayoutLike ( this . model . get ( "_widget_layout " ) , layout ) ;
678678 }
679679 }
680680
@@ -692,11 +692,11 @@ export class FigureModel {
692692 for ( var i = 0 ; i < styles . length ; i ++ ) {
693693 var style = styles [ i ] ;
694694 var trace_index = trace_indexes [ i ] ;
695- var trace = this . model . get ( "_data " ) [ trace_index ] ;
695+ var trace = this . model . get ( "_widget_data " ) [ trace_index ] ;
696696 performRelayoutLike ( trace , style ) ;
697697 }
698698
699- performRelayoutLike ( this . model . get ( "_layout " ) , layout ) ;
699+ performRelayoutLike ( this . model . get ( "_widget_layout " ) , layout ) ;
700700 }
701701 }
702702
@@ -711,7 +711,7 @@ export class FigureModel {
711711
712712 if ( msgData !== null ) {
713713 var keyPaths = msgData . remove_props ;
714- var layout = this . model . get ( "_layout " ) ;
714+ var layout = this . model . get ( "_widget_layout " ) ;
715715 performRemoveProps ( layout , keyPaths ) ;
716716 }
717717 }
@@ -725,19 +725,19 @@ export class FigureModel {
725725 if ( msgData !== null ) {
726726 var keyPaths = msgData . remove_props ;
727727 var traceIndex = msgData . remove_trace ;
728- var trace = this . model . get ( "_data " ) [ traceIndex ] ;
728+ var trace = this . model . get ( "_widget_data " ) [ traceIndex ] ;
729729
730730 performRemoveProps ( trace , keyPaths ) ;
731731 }
732732 }
733733}
734734
735735const serializers : Record < string , Serializer > = {
736- _data : {
736+ _widget_data : {
737737 deserialize : py2js_deserializer ,
738738 serialize : js2py_serializer ,
739739 } ,
740- _layout : {
740+ _widget_layout : {
741741 deserialize : py2js_deserializer ,
742742 serialize : js2py_serializer ,
743743 } ,
@@ -864,8 +864,8 @@ export class FigureView {
864864 // ---------------------------
865865 // We must clone the model's data and layout properties so that
866866 // the model is not directly mutated by the Plotly.js library.
867- var initialTraces = _ . cloneDeep ( this . model . get ( "_data " ) ) ;
868- var initialLayout = _ . cloneDeep ( this . model . get ( "_layout " ) ) ;
867+ var initialTraces = _ . cloneDeep ( this . model . get ( "_widget_data " ) ) ;
868+ var initialLayout = _ . cloneDeep ( this . model . get ( "_widget_layout " ) ) ;
869869 if ( ! initialLayout . height ) {
870870 initialLayout . height = 360 ;
871871 }
@@ -964,7 +964,7 @@ export class FigureView {
964964
965965 autosizeFigure ( ) {
966966 var that = this ;
967- var layout = that . model . get ( "_layout " ) ;
967+ var layout = that . model . get ( "_widget_layout " ) ;
968968 if ( _ . isNil ( layout ) || _ . isNil ( layout . width ) ) {
969969 // @ts -ignore
970970 Plotly . Plots . resize ( that . el ) . then ( function ( ) {
@@ -1530,7 +1530,7 @@ export class FigureView {
15301530 // ### Handle layout delta ###
15311531 var layout_delta = createDeltaObject (
15321532 this . getFullLayout ( ) ,
1533- this . model . get ( "_layout " )
1533+ this . model . get ( "_widget_layout " )
15341534 ) ;
15351535
15361536 /** @type {Js2PyLayoutDeltaMsg } */
@@ -1539,7 +1539,7 @@ export class FigureView {
15391539 layout_edit_id : layout_edit_id ,
15401540 } ;
15411541
1542- this . model . set ( "_js2py_layoutDelta " , layoutDeltaMsg ) ;
1542+ this . model . set ( "_js2py_widget_layoutDelta " , layoutDeltaMsg ) ;
15431543 this . touch ( ) ;
15441544 }
15451545
@@ -1552,7 +1552,7 @@ export class FigureView {
15521552 * @private
15531553 */
15541554 _sendTraceDeltas ( trace_edit_id : any ) {
1555- var trace_data = this . model . get ( "_data " ) ;
1555+ var trace_data = this . model . get ( "_widget_data " ) ;
15561556 var traceIndexes = _ . range ( trace_data . length ) ;
15571557 var trace_deltas = new Array ( traceIndexes . length ) ;
15581558
0 commit comments