allo-media/koivu

Koivu


Install
elm-package install allo-media/koivu 1.0.1

Documentation

koivu

An interactive tree representation of AlloMedia's Customer Path (demo).

This repository holds code for:

  • An Elm package containing the logic of the component
  • A npm package containing the SASS styles for the component

Note: while open sourced, these packages are most likely to be addressing the sole own needs of Allo-Media.

Minimal program

module Main exposing (..)

import Koivu
import Koivu.Tree as Tree
import Koivu.Settings exposing (Settings)
import Html

settings : Settings
settings =
    { autoNormalize = False
    , globalQty = 100000
    , minNodeQty = 3000
    , maxChildren = 4
    , maxGlobalQty = 200000
    , maxLevels = 3
    , nodeWidth = 140
    , nodeHeight = 80
    , nodePadding = 10
    }

main : Program Never Koivu.Model Koivu.Msg
main =
    Tree.demoTree
        |> Koivu.setup settings
        |> Html.program

You'll find a more elaborate integration example in the example subfolder.

Running the demo locally

A demo is available from the example folder:

$ cd example
$ npm i
$ npm start

Then head to localhost:3000.

License

MIT