// Tree
main = {
const svg = d3.select('#mySVG');
const height = 800 // document.body.clientHeight;
//const width = document.body.clientWidth;
const treeLayout = d3.tree().nodeSize([160, 260]);
const zoomG = svg
.attr('width', width)
.attr('height', height)
.append('g');
svg.call(d3.zoom().on('zoom', () => { zoomG.attr('transform', d3.event.transform); }));
const root = d3.hierarchy(jsonData);
const links = treeLayout(root).links();
const treeHeight = d3.max(root.descendants(), d => d.y)
const treeWidth = d3.max(root.descendants(), d => d.x)
const translations = getTranslations(height, width, treeHeight, treeWidth)
const g = zoomG.append('g').attr('transform', `translate(${translations[0]},${translations[1]}) scale(${getScale(height, treeHeight)})`);
makeLines(g, links);
makeCircle(g, root.descendants());
makeText(g, root.descendants());
makeIcons(g, root.descendants());
}