Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Latest commit

 

History

History
67 lines (49 loc) · 1.41 KB

README.md

File metadata and controls

67 lines (49 loc) · 1.41 KB

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