a) To test and use ogdf.js directly
1) Clone this repository.
2) Go to src/ogdf.js
3) bindings.cpp is the file which contains bindings for some OGDF functions.
4) Read main.html to know how to use ogdf.js and how to call functions.
b) To get it running so that you can add bindings for more functions
1) Clone this repository.
2) Get emscripten from this link - https://github.com/kripken/emscripten
3) Add emscripten to PATH variable. export PATH=/path/to/emscripten:$PATH
4) Now you can use emcc to compile cpp files.
5) EMSCRIPTEN Bindings needs to be created for the functions we want to use.
6) For more details related to embind functions - https://github.com/kripken/emscripten/wiki/embind
7) To compile and get your bindings in ogdf.js - ./build-bindings.sh
8) Your new ogdf.js will be present in src/ogdf.js
Embind Code for bindings can be found at src/ogdf.js/bindings.cpp
List of function which can be tried are:
Graph::Graph() Graph::numberOfNodes() Graph::numberOfEdges() Graph::maxNodeIndex() Graph::maxEdgeIndex() Graph::firstNode() Graph::lastNode() Graph::firstEdge() Graph::lastEdge() Graph::chooseNode() Graph::chooseEdge() Graph::empty() Graph::newNode() Graph::newNode(int) Graph::newEdge(node,node) Graph::newEdge(node,node,int)
GraphAttributes() GraphAttributes(Graph&,long) GraphAttributes::x GraphAttributes::y GraphAttributes::width GraphAttributes::height GraphAttributes::bends GraphAttributes::strokeColor GraphAttributes::fillColor setX setY setWidth setHeight setEdgeColor setEdgeColor
List() List::size List::empty
List() List::size List::empty
GraphList() GraphList::size GraphList::empty
GraphList() GraphList::size GraphList::empty
Color::Color() Color::Color(Color::Name) Color::toString()
enum_ Color::Name::Red Color::Name::Blue Color::Name::Green) DPolyline::DPolyline()
randomGraph randomSimpleGraph completeGraph completeBipartiteGraph planarConnectedGraph
DfsAcyclicSubgraph() DfsAcyclicSubgraph::call