Skip to content

Commit 7832388

Browse files
committed
fix download
1 parent 8b69dff commit 7832388

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/js/download.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function exportPDF({ width=1920, height=1080}={}){
5151
<body><img/></body>
5252
</html>`);
5353
Plotly.toImage(figurecontainer, {format: 'svg', width, height}).then(imgdata => {
54-
var win = new remote.BrowserWindow({width, height, show: false})
54+
var win = new BrowserWindow({width, height, show: false})
5555
win.on('closed', () => {win = null})
5656
win.loadURL(`data:text/html,${html}`);
5757

@@ -72,8 +72,3 @@ function exportPDF({ width=1920, height=1080}={}){
7272
})
7373
})
7474
}
75-
76-
77-
// module.exports = {
78-
// downloadImage : downloadImage
79-
// }

src/js/functions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ Plotly.newPlot(figurecontainer, [clone(iniPointsD)], clone(layout), {
2727
modeBarButtonsToAdd: [[{
2828
name: 'Save the image',
2929
icon: Plotly.Icons.camera,
30-
click() { $('#popupEx').show() }
30+
click() { document.getElementById('imRes').value = `${window.innerWidth}x${window.innerHeight}`;
31+
$('#popupEx').show()
32+
}
3133
}]]
3234
});
3335
var points = figurecontainer.querySelector(".scatterlayer .trace:first-of-type .points").getElementsByTagName("path");

src/js/keyIpcTrigger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ for (let elem of document.getElementsByClassName('sWheel')) {
407407
})
408408

409409

410-
document.getElementById('imRes').value = `${window.innerWidth}x${window.innerHeight}`
410+
411411

412412
$('.closbtn').on('click', () => { $('.popup').hide() })
413413

0 commit comments

Comments
 (0)