With the JSON files at my disposal for the force directed graph, I want to be able to select which one to use dynamically. Instead of manually changing the file name in the HTML code like this:
<script type="text/javascript" src="networkA.json"></script>
I am looking for a way to choose the data source when loading the SVG so that I can decide on the JSON file to base the graph on. Additionally, I would like to have the option to switch between different JSON files while the graph is already running.
This interactive demo showcases how to change data dynamically: , but I specifically want to implement this functionality in a force directed graph.