-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
35 lines (29 loc) · 830 Bytes
/
main.js
File metadata and controls
35 lines (29 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//TO-DO: custom font, custom connector height, custom node gap,custorm margin
//TO-DO: export to json
import './modules/draw.js';
import { renderTarget,
renderSVG,
genId,
exportToSVG,
exportToPNG,
clearEverything} from './modules/draw.js';
let newSize = genId(renderTarget);
renderSVG(renderTarget, newSize);
console.log("now ./")
//UI:
function alertPNG() {
$('#alertPNG').modal('show');
}
function showHelp() {
$('#help').modal('show');
}
d3.select("#trash").on('click', () => {
d3.select("#trashCan")
.classed("trash-open", !d3.select("#trashCan").classed("trash-open"))
});
$('#PNGfalse').click(()=>exportToPNG(false))
$('#PNGtrue').click(()=>exportToPNG(true))
$('#click').click(clearEverything)
$('#svg').click(exportToSVG)
$('#png').click(alertPNG)
$('#showHelp').click(showHelp)