@@ -14,7 +14,6 @@ class Pictograph {
1414 constructor ( el ) {
1515 this . rootElement = _ . has ( el , 'length' ) ? el [ 0 ] : el
1616 d3 . select ( this . rootElement ) . attr ( `rhtmlwidget-status` , 'loading' )
17- d3 . select ( this . rootElement ) . attr ( `rhtmlPictographs-status` , 'loading' ) // to be removed once regression testing code checks for rhtmlwidget-status
1817 const actualDimensions = this . getContainerDimensions ( )
1918 log . info ( 'Pictograph() called. Container dimensions:' , actualDimensions , 'element:' , el )
2019
@@ -42,7 +41,6 @@ class Pictograph {
4241 if ( error . type === InsufficientContainerSizeError . type ) {
4342 console . log ( error . message )
4443 d3 . select ( this . rootElement ) . attr ( `rhtmlwidget-status` , 'ready' )
45- d3 . select ( this . rootElement ) . attr ( `rhtmlPictographs-status` , 'ready' ) // to be removed once regression testing code checks for rhtmlwidget-status
4644 } else {
4745 console . error ( `error in pictograph draw: ${ error . message } ` )
4846 console . error ( error . stack )
@@ -79,7 +77,6 @@ class Pictograph {
7977 if ( error . type === InsufficientContainerSizeError . type ) {
8078 console . log ( error . message )
8179 d3 . select ( this . rootElement ) . attr ( `rhtmlwidget-status` , 'ready' )
82- d3 . select ( this . rootElement ) . attr ( `rhtmlPictographs-status` , 'ready' ) // to be removed once regression testing code checks for rhtmlwidget-status
8380 } else {
8481 console . error ( `error in pictograph resize: ${ error . message } ` )
8582 console . error ( error . stack )
@@ -497,6 +494,8 @@ class Pictograph {
497494 . attr ( 'class' , 'table-cell' )
498495 . attr ( 'transform' , d => `translate(${ d . x } ,${ d . y } )` )
499496
497+ const cellDrawingPromises = [ ]
498+
500499 enteringCells . each ( function ( d ) {
501500 const instance = d . instance
502501 log . debug ( `rendering entering cell` , instance )
@@ -508,11 +507,11 @@ class Pictograph {
508507 instance . setWidth ( d . width )
509508 instance . setHeight ( d . height )
510509 instance . setDynamicMargins ( d . dynamicMargins )
511- instance . draw ( )
510+
511+ cellDrawingPromises . push ( instance . draw ( ) )
512512 } )
513513
514- d3 . select ( this . rootElement ) . attr ( `rhtmlwidget-status` , 'ready' )
515- d3 . select ( this . rootElement ) . attr ( `rhtmlPictographs-status` , 'ready' ) // to be removed once regression testing code checks for rhtmlwidget-status
514+ Promise . all ( cellDrawingPromises ) . then ( ( ) => d3 . select ( this . rootElement ) . attr ( `rhtmlwidget-status` , 'ready' ) )
516515 }
517516
518517 // TODO Duplicated code from graphicCell
0 commit comments