goyalarchit / elm-dagre / Render.Types

This module provides the type definitions used in the Render module.

Data

The nodes and edge data available for writing a drawer.


type alias NodeAttributes n =
{ node : Graph.Node n
, coord : ( Basics.Float
, Basics.Float )
, width : Basics.Float
, height : Basics.Float 
}

This type represents all data available for rendering a node


type alias EdgeAttributes e =
{ edge : Graph.Edge e
, source : ( Basics.Float
, Basics.Float )
, target : ( Basics.Float
, Basics.Float )
, controlPts : List ( Basics.Float
, Basics.Float )
, sourceDimensions : ( Basics.Float
, Basics.Float )
, targetDimensions : ( Basics.Float
, Basics.Float ) 
}

This type represents all data available for rendering an edge

Drawers

These types are used by the draw function to build the actual svg. You can use these types to write custom drawers. For inspiration you can view the source file for Render.StandardDrawers


type alias NodeDrawer n msg =
NodeAttributes n -> TypedSvg.Core.Svg msg

This type represents a function that translates NodeAttributes to Svg You can use this type definition to write custom node drawers.


type alias EdgeDrawer e msg =
EdgeAttributes e -> TypedSvg.Core.Svg msg

This type represents a function that translates EdgeAttributes to Svg You can use this type definition to write custom edge drawers.