Simple sub orientation - OrgChart JS
by Serhii Matrunchyk
HTML
<script src="https://balkangraph.com/js/latest/OrgChart.js"></script>
<div id="tree"/>
CSS
html, body{
width: 100%;
height: 100%;
padding: 0;
margin:0;
overflow: hidden;
font-family: Helvetica;
}
#tree{
width:100%;
height:100%;
}
JavaScript
OrgChart.templates.hiddenTemplate = Object.assign({}, OrgChart.templates.ana);
OrgChart.templates.hiddenTemplate.size = [0, 0];
OrgChart.templates.hiddenTemplate.node = '';
OrgChart.templates.hiddenTemplate.plus = '';
OrgChart.templates.hiddenTemplate.minus = '';
var chart = new OrgChart(document.getElementById("tree"), {
enableSearch: false,
mouseScrool: OrgChart.action.none,
nodeMouseClick: OrgChart.action.none,
tags: {
"ig": {
template: "hiddenTemplate"
}
}
});
chart.load([
{id: 0, tags: ["ig"] },
{id: 1, pid: 0 },
{id: 2, pid: 0},
{id: 3, pid: 1},
{id: 4, pid: 1},
{id: 5, pid: 2}
]);