A web app to dynamically generate graphs for DSA practicals
- Clone this repo and open
index.html
- Alternatively, use the online version
- Specify the number of nodes and edges
- Hit generate
- Hit it again if you don't like what you see
- Drag any nodes to manually adjust (careful, this a fidgety feature)
- Press download to save an image of the graph
The project is essentially a webpage running web workers in the background. While running a local web server would be ideal. The project uses a local (frozen) version of sigma.js to display graphs. So directly opening index.html
works fine too. Which means offline use is possible
- Generate graphs with a prerequisite number of nodes and edges.
- Automatically and aesthetically arrange nodes
- Drag and drop nodes for manual adjustment
- Save the graph as an image file for further use
- The program pseudorandomly generates nodes and edges based on parameters given to it and information it already knows.
- These nodes and edges are then passed to a Sigma instance which handles visualisation.
- A physics simulation is then run to achieve an aesthetic layout.
- Change label type (display each node as an encircled number)
- Modify layout algorithm so that graphs are arranged on a grid (easier for humans to copy)
- Let common algorithms (BFS, DFS...) be run on the generated graph