This module is the core module that implements the sugiyama style graph drawing based on popular js library dagrejs.
This module assumes graphs are defined using elm-community/graph module.
{ width : Basics.Float
, height : Basics.Float
, coordDict : Dict Graph.NodeId Utils.Coordinates
, controlPtsDict : Dict Utils.Edge (List Graph.NodeId)
}
This type represents the record returned by the runLayout function.
runLayout : List Attributes.Attribute -> Graph n e -> GraphLayout
This is the main function that computes the layout for a graph using sugiyama style graph drawing.
This function takes a list of Dagre Attributes and a graph and outputs the layout.
-- simpleGraph = Graph from Readme (or any graph)
runLayout [] simpleGraph
All the computed coordinates lie between (0,0) and (width,height).
In simple terms, you can set viewBox 0 0 width height
in the svg.
defaultConfig : Attributes.Config
This represents the default configuration of runLayout function. For more details about configuring a layout please see Dagre.Attributes