This module provides a minimalistic general graph renderer for some use cases. There are many possible ways of using the this package
Note : This module uses elm-community/typed-svg, so don't confuse Svg as elm/svg.
draw : List Dagre.Attributes.Attribute -> List (StandardDrawers.Attributes.Attribute (DrawConfig n e msg)) -> Graph n e -> Html msg
This function is draws a graph as a SVG using the Elm-Dagre module. The first argument takes a list of Dagre attributes, and the second argument sets the drawers and styles. The StandardDrawers are used as the default drawers.
-- The simplest usage is
draw [] [] sampleGraph
You can configure the standard drawers. Please see Render.StandardDrawers for more information.
You can also use a custom drawer by setting draw function attributes. See the next subsection for more information.
-- Example of custom Drawer
This type represents a function that translates NodeAttributes / EdgeAttributes to Svg. If the standard drawers are not fulfilling your usecase, you can use these types to define custom drawers. For more details you can look at Render.Types .
edgeDrawer : Types.EdgeDrawer e msg -> StandardDrawers.Attributes.Attribute (DrawConfig n e msg)
This attribute sets the edge drawer for draw function Update the standard drawer configs using this attribute
nodeDrawer : Types.NodeDrawer n msg -> StandardDrawers.Attributes.Attribute (DrawConfig n e msg)
This attribute sets the node drawer for draw function Update the drawer config using this attribute
id : String -> StandardDrawers.Attributes.Attribute (DrawConfig n e msg)
Set id attribute for the svg graph
style : String -> StandardDrawers.Attributes.Attribute (DrawConfig n e msg)
To set inline css style for the generated graph SVG