goyalarchit/elm-dagre/2.0.0

NOTE: the latest version is 4.0.1

Render.StandardDrawers.Attributes

This module provides attributes for configuring draw, svgNodeDrawer and svgEdgeDrawer given in Dagre.Render.

Note : This module uses elm-community/typed-svg, so don't confuse Svg as elm/svg.

Type

type alias Attribute c =
c -> c

Attribute type for Standard Drawers

Common Attributes

The following attributes can be used both on Node and Edge Drawers.

fill : (a -> Color) -> Attribute { c | fill : a -> Color }

To add fill color to Node

label : (a -> String) -> Attribute { c | label : a -> String }

The following attribute can be used to set label on both Nodes and Edges.

onClick : (a -> msg) -> Attribute { c | onClick : Maybe (a -> msg) }

To add event handlers to Nodes and Edges

strokeColor : (a -> Color) -> Attribute { c | strokeColor : a -> Color }

To set the stroke color of a node/edge

strokeWidth : (a -> Float) -> Attribute { c | strokeWidth : a -> Float }

To set the stroke width of a node/edge

strokeDashArray : (a -> String) -> Attribute { c | strokeDashArray : a -> String }

To set the stroke dash array of a node/edge

style : (a -> String) -> Attribute { c | style : a -> String }

To add any inline css to path element of the edge, or polygon of node.

title : (a -> String) -> Attribute { c | title : a -> String }

To set the title (appears as a tooltip) of a node/edge

EdgeDrawer Attributes

arrowHead : ArrowHeadShape -> Attribute (EdgeDrawerConfig e msg)

This attributes sets the shape of Node used for drawing the node. The possible values are Circle, Ellipse, Box, RoundedBox.

linkStyle : LinkStyle -> Attribute (EdgeDrawerConfig e msg)

Set the style used for drawing links. The possible values are polyline and splines

alpha : Float -> Attribute (EdgeDrawerConfig e msg)

Set alpha used for drawing the spline using Catmull-Rom

Note: alpha>=0.5 produces centripetal splines , which are useful to avoid self-intersections and overshoots. ref

orientLabelAlongEdge : Bool -> Attribute (EdgeDrawerConfig e msg)

To set the label orientation along the curvature of edge

NodeDrawer Attributes

shape : Shape -> Attribute (NodeDrawerConfig n msg)

This attributes sets the type of arrow head used for drawing the edge. The possible values are None, Triangle, Vee.

xLabel : (Node n -> String) -> Attribute (NodeDrawerConfig n msg)

Set the Extra Label for a node.

(Node n -> Float -> Float -> ( Float, Float ))
-> Attribute (NodeDrawerConfig n msg)

Used to set the position of Extra Label relative to the node.