dosarf/elm-tree-view/2.0.0

NOTE: the latest version is 3.0.0

Elm Tree View

Tree view library (elm-tree-view) for Elm 0.19.

You give the tree of nodes with your data embedded in them, along with with some configuration, and this will take care of some usual UI interaction, such as

  • navigate between visible nodes with up/down arrow keys,
  • expand / collapse non-leaf nodes with right/left arrow keys,
  • expand / collapse non-leaf nodes with mouse clicks.

Demo

Check out

Overview

To take it into use

  • define a data type for the values you'll put into the tree nodes,
    • define a function to calculate the text representation of a node,
  • decide on a comparable type for the uids of the nodes of the tree,
    • define another function to calculate the uid of a node,
  • build a tree of nodes, putting your data into them,
  • initialize the TreeView model, and otherwise interact with your tree view in the usual TEA manner

Test

  • Install elm-test (with npm)
  • Run elm-test.