This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Create SVG images for graphs
version 1.0.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2018-02-13 22:05:00 UTC
jxxcarlson/geometry 1.0.1 <= v < 2.0.0 1.0.2
elm-lang/svg 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1
elm-community/list-extra 7.1.0 <= v < 8.0.0 7.1.0

Modules

README

GraphDisplay

This package creates SVG images of graphs. It makes use of the package jxxcarlson/geometry.

Example

First, make define a graph:

import DisplayGraph

vertices =
    [ Vertex 1 "A", Vertex 2 "B", Vertex 3 "C", Vertex 4 "D", Vertex 5 "E" ]

edges =
    [ ( 1, 2 ), ( 1, 3 ), ( 2, 3 ), ( 2, 4 ), ( 2, 5 ), ( 3, 4 ), ( 4, 5 ) ]

    testGraph =
        Graph vertices edges

Second, create an SVG representation of it:

svgImage = graphDisplay 100 testGraph

The 100 is a scale factor. For a demo that displays the above graph, run

$ elm make GraphDemo.elm

in the examples folder.