eCount)

            // create a network
            var container = document.getElementById('mynetwork');
            var directionInput = document.getElementById("direction").value;
            var options = {
                layout: {
                    hierarchical: {
                        direction: directionInput
                    }
                }
            };
            network = new vis.Network(container, data, options);

            // add event listeners
            network.on('select',