jcberentsen/elm-wiring-diagrams/5.1.0

NOTE: the latest version is 5.4.7

Diagram.Svg.Config

Configure how to convert Layout Labels to Strings for Svg output

type alias Config a msg =
Config a msg

Preliminary way to control how labels turn into String for SVG

forStringLabels : Config String msg

Simple starting config when labels are already String

initWithLabelToString : (a -> String) -> Config a msg

Init needs a labelToString function

default : Config a msg

Simple starting config. All labels will render as a dot

Use the Config modifiers to shape your intended Config

withLabelToString : (a -> String) -> Config a msg -> Config a msg

Configure a function to label a cell holding an a

The string will be displayed in the Svg boxes

withTextAttributes : List (Attribute msg) -> Config a msg -> Config a msg

Overload attributes for all cell label texts

withTextAttributesFunction : (a -> List (Attribute msg)) -> Config a msg -> Config a msg

Overload attributes for any cell label text

You supply a function that looks at the label and decides which attributes to use

withCellAttributes : List (Attribute msg) -> Config a msg -> Config a msg

Overload attributes for all cell boxes

These are the inner boxes with labels.

Only style colors, fonts.

Avoid modifying geometry, as this will likely mess up the layout

withCellAttributesFunction : (Maybe a -> List (Attribute msg)) -> Config a msg -> Config a msg

Overload attributes for each cell

You supply a function that looks at the label and decides which attributes to use

Only style colors, fonts.

Avoid modifying geometry, as this will likely mess up the layout

withCellWrappingFunction : (Maybe a -> List (Svg msg) -> Svg msg) -> Config a msg -> Config a msg

Overload cell wrapping

Lets you configure how a list of inner Svg elements will be wrapped.

This allows you to set up onClick event attributes or using Svg.a for hyperlinking when the inner svg is clicked.