This mod computes an octilinear representation of a graph if the vertex degree is at most 8.
Octilinear means that the edges are restricted to horizontals, verticals, and diagonals at 45 degrees.
Such a schematic drawing helps to ease navigation in e.g. metro maps. It could also be considered for other transportation networks or graphs in general.
This OptiMod can be used alone. However, it also provides a nice add-on for the line optimization OptiMod.
What will the API be?
This OptiMod requires the networkx package.
The input is
a graph with node attributes 'pos' for the original node positions (x-, and y- coordinates)
a set of lines, given as pandas data frame (this parameter is optional)
The output is
a graph with node attributes 'pos_oct' for the octilinear node position
a dictionary of edge-direction assignment (needed when plotting as metromap)
Below is an example of a graph with original node positions (left) and computed octilinear positions (right)
This mod computes an octilinear representation of a graph if the vertex degree is at most 8. Octilinear means that the edges are restricted to horizontals, verticals, and diagonals at 45 degrees. Such a schematic drawing helps to ease navigation in e.g. metro maps. It could also be considered for other transportation networks or graphs in general. This OptiMod can be used alone. However, it also provides a nice add-on for the line optimization OptiMod.
What will the API be?
This OptiMod requires the networkx package. The input is
The output is
Below is an example of a graph with original node positions (left) and computed octilinear positions (right)