goyalarchit / elm-dagre / Render.StandardDrawers

This module provides the standard Drawers for drawing a graph. These are default drawers for the draw function.

Standard Drawers

svgDrawEdge : List (Attributes.Attribute (ConfigTypes.EdgeDrawerConfig e msg)) -> Render.Types.EdgeAttributes e -> TypedSvg.Core.Svg msg

Standard Edge Drawer. It can be configured using Rander.StandardDrawers.Attributes

svgDrawNode : List (Attributes.Attribute (ConfigTypes.NodeDrawerConfig n msg)) -> Render.Types.NodeAttributes n -> TypedSvg.Core.Svg msg

Standard Node Drawer. It can be configured using Rander.StandardDrawers.Attributes

svgDrawXLabel : List (Attributes.Attribute (ConfigTypes.XLabelDrawerConfig n)) -> Render.Types.NodeAttributes n -> TypedSvg.Core.Svg msg

Standard xLabel Drawer for NodeDrawer's xLabel attribute. It can be configured using Rander.StandardDrawers.Attributes

Standard Configurations

Note: All Values are in px

Edge Drawer

  1. arrowHead = None
  2. fontSize = 16
  3. strokeColor = Color.darkGrey
  4. strokeWidth = 3px
  5. title = Edge.from → Edge.to
  6. linkStyle = Spline
  7. alpha = 0.5
  8. orientLabelAlongEdge = False

Note: All missing attributes don't have any preset values

NodeDrawer

  1. label = Node.id
  2. shape = Ellipse
  3. fontSize = 16
  4. strokeColor = Color.blue
  5. strokeWidth = 1px
  6. fill = #b2ebf2
  7. title = Node.id
  8. xLabels = []

Note: All missing attributes don't have any preset values

xLabelDrawer

  1. pos = _ w h -> ( (w / 2) + 1, (-h / 2) - 1 )
  2. shape = NoShape
  3. fontSize = 8
  4. strokeColor = _ -> Color.blue
  5. strokeWidth = _ -> 1
  6. fill = _ -> Color.white

Note:

  1. All missing attributes don't have any preset values.
  2. No shape is drawn for xLabel by default, hence no other attributes like stroke, fill are rendered.