Visualization of an array using pure Elm. This package utilizes the elm-dagre package to generate the rendered output.
It uses the ArrayView module to display the required output, in accordance with the attribute values set by the user.
There are two attribute modules with which the user can configure the rendered output :
Example code utilizing this package can be viewed in the \examples folder.
import Array
import ArrayView as AV
import Html exposing (Html)
import Render.Attributes as A exposing (elemDrawer, svgDrawNode)
main : Html msg
main =
AV.draw
[]
[ elemDrawer
(svgDrawNode
[ A.label (\n -> String.fromInt n.label)
, A.xLabel (\n -> String.fromInt n.id)
, A.xLabelPos (\_ _ _ -> ( 0, 65 ))
]
)
]
(Array.fromList [ 0, 1, 2, -1, 5 ])
Add visualizations for more datastructures like
Add an attribute which allows the user to add multiple indices, for now the xlabel attribute is utilized to do the same, which only adds one label to the visualization.
This package is essentially an extension of elm-dagre. Many thanks to the contributors of the package.