You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JSDoc generated API documentation can be found here.
Twenty second tutorial
<html><head><style>#graph {
width:500px;
height:500px;
border:1px solid grey;
}
</style></head><body><divid="graph"></div><scriptsrc="graphosaurus.min.js"></script><script>// JavaScript will go here</script></body></html>
If you open this up in your web browser, you'll see something that looks like this:
Look at that amazing square! Now let's create a graph, a couple nodes, and an edge between the nodes:
vargraph=G.graph()// Create a red node with cartesian coordinates x=0, y=0, z=0varredNode=G.node([0,0,0],{color: "red"});graph.addNode(redNode);// You can also use the addTo method to add to the graphvargreenNode=G.node([1,1,1],{color: "green"}).addTo(graph);varedge=G.edge([redNode,greenNode],{color: "blue"});graph.addEdge(edge);// or edge.addTo(graph)// Render the graph in the HTML element with id='graph'graph.renderIn("graph");
After inserting this JavaScript in the <script> block, you should see this:
While this is a very basic example, I hope I've demonstrated how simple it is to create graphs with Graphosaurus.
Build
Run git clone https://github.com/frewsxcv/graphosaurus.git to clone this repository
Graphosaurus has some third party dependencies listed in the package.json file in the devDependencies and dependencies sections. Their licenses can be found on their respective project pages.