nesticot commited on
Commit
8de4cbc
·
verified ·
1 Parent(s): 8f993d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -470,12 +470,18 @@ app_ui = ui.page_fluid(
470
  useCORS: true,
471
  backgroundColor: '#ffffff',
472
  windowWidth: document.getElementById('capture-div').scrollWidth,
473
- windowHeight: document.getElementById('capture-div').scrollHeight
 
 
474
  }).then(function(canvas) {
475
  var link = document.createElement('a');
476
  link.download = 'nhl-streamers.png';
477
- link.href = canvas.toDataURL('image/png');
 
478
  link.click();
 
 
 
479
  });
480
  """},
481
  {"style": "margin: 10px 0;"}
 
470
  useCORS: true,
471
  backgroundColor: '#ffffff',
472
  windowWidth: document.getElementById('capture-div').scrollWidth,
473
+ windowHeight: document.getElementById('capture-div').scrollHeight,
474
+ imageTimeout: 0,
475
+ removeContainer: true
476
  }).then(function(canvas) {
477
  var link = document.createElement('a');
478
  link.download = 'nhl-streamers.png';
479
+ link.href = canvas.toDataURL('image/png', 1.0);
480
+ document.body.appendChild(link);
481
  link.click();
482
+ document.body.removeChild(link);
483
+ }).catch(function(err) {
484
+ console.error('Error:', err);
485
  });
486
  """},
487
  {"style": "margin: 10px 0;"}