@@ -262,28 +262,29 @@ export class DiagramComponent {
262262
263263 if ( this . wasCleared ) {
264264 this . diagram . delayInitialization ( ( ) => {
265- this . mergeAppDataWithModel ( this , nodeDiffs , linkDiffs , true ) ;
265+ this . mergeAppDataWithModel ( this , true ) ;
266266 this . wasCleared = false ;
267267 } ) ;
268268 } else {
269- this . mergeAppDataWithModel ( this , nodeDiffs , linkDiffs , false ) ;
269+ this . mergeAppDataWithModel ( this , false ) ;
270270 }
271271
272272 } // end ngDoCheck
273273
274- private mergeAppDataWithModel ( component : DiagramComponent , nodeDiffs , linkDiffs , isInit ?: boolean ) {
274+ private mergeAppDataWithModel ( component : DiagramComponent , isInit ?: boolean ) {
275+
275276 // don't need model change listener while performing known data updates
276277 if ( component . modelChangedListener !== null ) this . diagram . model . removeChangedListener ( this . modelChangedListener ) ;
277278
278- component . diagram . model . startTransaction ( 'update data' ) ;
279- // update modelData first, in case bindings on nodes / links depend on model data
280- component . diagram . model . assignAllDataProperties ( this . diagram . model . modelData , this . modelData ) ;
281- // merge node / link data
282- this . diagram . model . mergeNodeDataArray ( this . nodeDataArray ) ;
283- if ( component . linkDataArray && component . diagram . model instanceof go . GraphLinksModel ) {
284- component . diagram . model . mergeLinkDataArray ( this . linkDataArray ) ;
285- }
286- component . diagram . model . commitTransaction ( 'update data') ;
279+ component . diagram . model . commit ( ( m : go . Model ) => {
280+ // update modelData first, in case bindings on nodes / links depend on model data
281+ component . diagram . model . assignAllDataProperties ( this . diagram . model . modelData , this . modelData ) ;
282+ // merge node / link data
283+ this . diagram . model . mergeNodeDataArray ( this . nodeDataArray ) ;
284+ if ( component . linkDataArray && component . diagram . model instanceof go . GraphLinksModel ) {
285+ component . diagram . model . mergeLinkDataArray ( this . linkDataArray ) ;
286+ }
287+ } , isInit ? null : 'merge data') ;
287288
288289 // reset the model change listener
289290 if ( component . modelChangedListener !== null ) component . diagram . model . addChangedListener ( this . modelChangedListener ) ;
0 commit comments