algodynamics-iiith/elm-dsview/1.0.0

Render.Attributes

This module provides attributes for configuring draw, svgDrawNode and elemDrawer

Type

type Shape
= Circle
| Ellipse
| Box
| RoundedBox Float

Used to configure the shape of array container

elemDrawer : NodeDrawer n msg -> DrawConfig n e msg -> DrawConfig n e msg

Used to draw the array elements with given configurations

List (Attribute (NodeDrawerConfig n msg))
-> NodeAttributes n
-> Svg msg

Used to generate SVG for each individual array element

type alias DrawConfig n e msg =
{ edgeDrawer : EdgeDrawer e msg
, nodeDrawer : NodeDrawer n msg
, style : String
, id : String
}

Configuration for array drawer

elemDrawer Attributes

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

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.

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

To add fill color to Node

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)

Set the position of xLabel of a node