11< div >
22 < div id ="{{ plot_div_id }} " class ="plotly-graph-div " style ="height:100%; width:100%; "> </ div >
33 < script type ="text/javascript ">
4- require ( [ 'https://cdn.plot.ly/plotly-2.12 .1.min.js' ] , function ( Plotly ) {
4+ require ( [ 'https://cdn.plot.ly/plotly-3.0 .1.min.js' ] , function ( Plotly ) {
55 Plotly . newPlot (
66 "{{ plot_div_id }}" ,
7- { { plot | tojson | safe } }
8- ) . then ( function ( ) {
9- var gd = document . getElementById ( '{{ plot_div_id }}' ) ;
7+ { { plot | tojson | safe } }
8+ ) . then ( function ( ) {
9+ var gd = document . getElementById ( '{{ plot_div_id }}' ) ;
1010 var x = new MutationObserver ( function ( mutations , observer ) { {
11- var display = window . getComputedStyle ( gd ) . display ;
11+ var display = window . getComputedStyle ( gd ) . display ;
1212 if ( ! display || display === 'none' ) { {
1313 Plotly . purge ( gd ) ;
1414 observer . disconnect ( ) ;
1515 } }
1616 } } ) ;
1717
18- // Listen for the removal of the full notebook cells
19- var notebookContainer = gd . closest ( '#notebook-container' ) ;
18+ // Listen for the removal of the full notebook cells
19+ var notebookContainer = gd . closest ( '#notebook-container' ) ;
2020 if ( notebookContainer ) { {
21- x . observe ( notebookContainer , { childList : true } ) ;
21+ x . observe ( notebookContainer , { childList : true } ) ;
2222 } }
2323
24- // Listen for the clearing of the current output cell
25- var outputEl = gd . closest ( '.output' ) ;
24+ // Listen for the clearing of the current output cell
25+ var outputEl = gd . closest ( '.output' ) ;
2626 if ( outputEl ) { {
27- x . observe ( outputEl , { childList : true } ) ;
27+ x . observe ( outputEl , { childList : true } ) ;
2828 } }
29- } )
29+ } )
3030 } ) ;
3131 </ script >
32- </ div >
32+ </ div >
0 commit comments