-
Notifications
You must be signed in to change notification settings - Fork 7
Home
Archit Goyal edited this page Dec 23, 2024
·
2 revisions
Welcome to the elm-dagre wiki!
This elm package implements the Sugiyama framework for graph drawing, using dagrejs as a reference. The wiki only gives details about dagre. To learn more about render, please see the source files. The wiki is aimed to help people who want to implement sugiyama style drawing in any other language.
- Read about Array inversions, it will be helpful in solving the crossing count problem, No literature is available or will be suggested by google, if you do not know what to search. I learned it the hard way. I almost deciphered the idea, but was presented with the exact same solution when I thought I made a breakthrough xD.
- Revise Set theory, especially Posets and Precedence and Succeeding operators. It will be used in the research paper that assigns the coordinates.
- Lecture-5 : Layer-Based Drawing from Automatic Graph Drawing WS-19/20 course by Prof. Dr. Reinhard von Hanxleden, Christoph Daniel Schulze, Sören Domrös und Niklas Rentz (Institut Fur Informatik).
- Chapter-13 : Hierarchical drawing algorithms from Handbook of Graph Drawing and Visualization By CRC Press
The following research paper’s were referenced before implementation, most of the paper and literature is taken from the wiki page of Dagre.js.
- Gansner, et al., “A Technique for Drawing Directed Graphs” to understand the basic skeleton.
- Brandes and Köpf, “Fast and Simple Horizontal Coordinate Assignment” for Horizontal Coordinate Assignment (Phase 4)
- BaryCenter Heuristic can be understood using the following research paper
- The barycenter as well as the median heuristic give a solution without crossings if one exists from Markus et. al..
- I searched the whole dagre implementation for any code with side effects to check if I could do it using a pure functional language like Elm. I did not find any side effect causing code, like use of random Numbers, timestamps or even Http requests.
- I concluded that it is indeed possible to do it in the Elm.**
- ** : The dagrejs implementation will always be fast for large graphs since all the papers discussed above use Imperative Coding, and optimisations for Imperative Data structures, This means we can have a slower but a native version of the code, which I think can be improved if we reference the books like “Purely Functional Data Structures”
- [X] Preprocessing : Removing Cycles
- [X] Rank (Layer) Assignment
- [X] Normalize (Adding Dummy Nodes for Long Edges)
- [X] Vertex Ordering
- [X] Crossing Edges Counting
- [X] Crossing Minimisation (Median/BaryCenter)
- [X] Coordinate Assignment
- [X] Horizontal Coordinate Assignment
- [X] Preprocessing : Assigning priority to edges
- [X] Vertical Alignment
- [X] Horizontal Compaction
- [X] Balancing
- [X] Vertical Coordinate Assignment
- A Dictionary of Nodes and their coordinates, along with the coordinates for bend points (Control Points of long edges).
- A Dictionary of all the edges and their maps to the Control Points.
- Only Simple Graphs Can be processed for layout.
- i.e. No Self Loops
- No Parallel edges
-
a->b
andb->a
edges is drawn as a single edgea <-> b
.
- [ ] Add support for the following types of edges (both are useful for representing Finite State Automatons)
- [ ] Self loops (self arcs). Useful resource : Dagrejs v0.4.5.
- [ ] Bidirectional Edges as 2 separate edges .
- Add Test Suit to the package.
- [X] Improve Preprocessing Steps by adding a default cycle removal algorithm, for now only DAG (defined as AcyclicGrpah in elm-community/graphs) are assigned coordinates. All other graphs get an empty Dictionary.
- [-] Implement other Rank/Layering assignment algorithm, currently we
use Topological Sort (from elm-community/graph) for Rank
Assignment. we can implement the following algorithms
- [ ] Network-Simplex
- [-] Longest Path Layering (Need to add support for weighted edges)
- [ ] Tight Tree
- Improve Crossing Edge Count algorithm. The current implementation uses Insertion Sort for counting Edge crossing between Layers (O|E|^2). Tree accumulator based cross-count algorithm given in Barth, et al., “Simple and Efficient Bilayer Cross Counting”. It is an improvement over algorithm by Malhotra et. al. in paper An E log E Line Crossing Algorithm for Levelled Graphs.
- Improve the Horizontal Compaction Algorithm. The current implementation uses Brandes and Köpf, “Fast and Simple Horizontal Coordinate Assignment”. It has some corner cases. use the one defined in DagreJs issue update in v0.7.0.