Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iosphere/elm-network-graph
Network graphs with nodes and edges written in Elm.
https://github.com/iosphere/elm-network-graph
elm
Last synced: 3 months ago
JSON representation
Network graphs with nodes and edges written in Elm.
- Host: GitHub
- URL: https://github.com/iosphere/elm-network-graph
- Owner: iosphere
- Created: 2017-03-09T23:03:19.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-30T11:38:41.000Z (over 7 years ago)
- Last Synced: 2024-10-08T19:29:32.878Z (3 months ago)
- Topics: elm
- Language: Elm
- Size: 25.4 KB
- Stars: 10
- Watchers: 8
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Network graph written in elm
![Travis.ci](https://travis-ci.org/iosphere/elm-network-graph.svg?branch=master)
A network graph consists of a list of nodes connected by edges.
## Types
### Graph
```elm
type alias Graph node =
{ edges : List Edge
, nodes : List node
}
```A network graph consists of a list of nodes connected by edges.
The node type of the Graph is abstract to allow you to use records extending the
type Node. Most functions provided by this work with Graph Node.## Output options
Two outputs are supported JSON or [DOT language](http://www.graphviz.org/content/dot-language) ([GraphViz](http://www.graphviz.org)):
```graphviz
digraph G { rankdir=TB
"a" [shape=box style="bold, filled" fillColor="#ddd" label="a"];
"b" [shape=box style="bold, filled" fillColor="#ddd" label="b"];
"c" [shape=box style="bold, filled" fillColor="#ddd" label="c"];
"a" -> "b";
"b" -> "c";
"c" -> "a";
}
```### Example screenshot of a GraphViz export as SVG
![Screenshot of a GraphViz export as SVG](https://github.com/iosphere/elm-network-graph/raw/1.0.0/graphviz.png)## Development
To install all tools and run `elm-make`: `make build`