Skip to content

Commit 46c8376

Browse files
fix: render the charts that are in hidden containers
1 parent 86a232f commit 46c8376

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

js/render-facade.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,18 @@ var vizClipboard1=null;
130130
function displayChartsOnFrontEnd() {
131131

132132
$('div.visualizer-front:not(.viz-facade-loaded):not(.visualizer-lazy):not(.visualizer-cw-error):empty').each(function(index, element){
133-
if ( $(element).is(':visible') ) {
134-
var id = $(element).addClass('viz-facade-loaded').attr('id');
135-
setTimeout(function(){
136-
// Add a short delay between each chart to avoid overloading the browser event loop.
137-
showChart(id);
138-
}, ( index + 1 ) * 100);
133+
134+
// Do not render charts that are intentionally hidden.
135+
var style = window.getComputedStyle(element);
136+
if (style.display === 'none' || style.visibility === 'hidden') {
137+
return;
139138
}
139+
140+
var id = $(element).addClass('viz-facade-loaded').attr('id');
141+
setTimeout(function(){
142+
// Add a short delay between each chart to avoid overloading the browser event loop.
143+
showChart(id);
144+
}, ( index + 1 ) * 100);
140145
});
141146

142147
// interate through all charts that are to be lazy-loaded and observe each one.

0 commit comments

Comments
 (0)