Renamed to skit-ai/elm-flow-chart. That is where the repository lives now. It has not been published as a package under the new name.
Versions published as vernacular-ai/elm-flow-chart still install under that name. 4 versions of 4 come from the new location (see their notes).
Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/skit-ai/elm-flow-chart.
What we checked: The repo moved to github.com/skit-ai/elm-flow-chart and tag 2.1.0 is there; its commit 1e6c9e35153c is from 2019-05-22 14:01 UTC, before the version was published (2019-05-22 14:03 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.
The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.
Details · package.elm-lang.org's zip: https://github.com/vernacular-ai/elm-flow-chart/zipball/2.1.0/
FlowChart builder in elm.
elm install vernacular-ai/elm-flow-chartIts an easy to use library to build flow charts or state diagrams in elm.
1. Import this library
import FlowChart
import FlowChart.Types as FCTypes2. Define Model
type alias Model =
{ canvasModel : FlowChart.Model }3. Some Initialization
type Msg
= CanvasMsg FlowChart.Msg
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.map CanvasMsg (FlowChart.subscriptions model.canvasModel)
init : () -> ( Model, Cmd Msg )
init _ =
( { canvasModel =
FlowChart.init
{ nodes =
[ createNode "node-0" (FCTypes.Vector2 10 10)
, createNode "node-1" (FCTypes.Vector2 100 200)
]
, position = FCTypes.Vector2 0 0
, links = []
, portConfig = FlowChart.defaultPortConfig
, linkConfig = FlowChart.defaultLinkConfig
}
nodeToHtml
}
, Cmd.none
)
{-| Defines how a node should look. Map a string node type to html.
-}
nodeToHtml : String -> Html FlowChart.Msg
nodeToHtml nodeType =
div
[ A.style "width" "100%"
, A.style "height" "100%"
, A.style "background-color" "white"
, A.style "box-sizing" "border-box"
]
[ text nodeType ]FlowChart init takes nodes, position, links and some configs for initial state. See FCTypes to understand types used in the library.
4. Update
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
CanvasMsg cMsg ->
let
( canvasModel, canvasCmd ) =
FlowChart.update flowChartEvent cMsg model.canvasModel
in
( { model | canvasModel = canvasModel }, canvasCmd )5. View
view : Model -> Html Msg
view mod =
div []
[ FlowChart.view mod.canvasModel
nodeToHtml
[ A.style "height" "600px"
, A.style "width" "85%"
]
]See examples to better understand all the features and how to use them.
Visit here for docs and more information.