https://github.com/csicar/purescript-dotlang
DotLang datatypes for purescript
https://github.com/csicar/purescript-dotlang
dotlang graphviz graphviz-dot purescript
Last synced: 4 months ago
JSON representation
DotLang datatypes for purescript
- Host: GitHub
- URL: https://github.com/csicar/purescript-dotlang
- Owner: csicar
- License: mit
- Created: 2018-01-16T02:29:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T03:52:06.000Z (over 3 years ago)
- Last Synced: 2026-01-24T06:25:36.405Z (5 months ago)
- Topics: dotlang, graphviz, graphviz-dot, purescript
- Language: PureScript
- Size: 367 KB
- Stars: 13
- Watchers: 3
- Forks: 7
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Dot-Lang
========
documentation can be found on [pursuit](https://pursuit.purescript.org/packages/purescript-dotlang/1.1.0/docs/Data.DotLang#t:DotLang)
define your model like this:
```purescript run
> import Data.DotLang
> import Data.DotLang.Attr (FillStyle(..))
> import Data.DotLang.Attr.Node as Node
> import Data.DotLang.Attr.Edge as Edge
> import Color.Scheme.HTML (red)
> exampleGraph = DiGraph [
node "a" [ Node.Shape Node.Diamond, Node.Style Filled, Node.FillColor red ],
node "b" [],
"a" ==> "b",
"a" =*> "d" $ [ Edge.FillColor red ],
Subgraph [
node "d" []
]
]
> -- can be turned into a dotlang using `toText`
> import Data.DotLang.Class (toText)
> toText exampleGraph
"digraph {a [shape=diamond, style=filled, fillcolor=\"#ff0000\"]; b []; a -> b; a -> d [fillcolor=\"#ff0000\"]; subgraph { d []; }}"
```
### Installation
#### Spago
```dhall
let additions =
{ dotlang =
{ dependencies =
[ "colors"
, "console"
, "effect"
, "generics-rep"
, "prelude"
, "psci-support"
, "strings"
, "test-unit"
]
, repo = "https://github.com/csicar/purescript-dotlang.git"
, version = "v2.0.0"
}
}
```
```bash
spago install dotlang
```
#### Bower
```bash
bower i purescript-dotlang
```
Changelog
=========
v3.0.0
------
Breaking Changes:
- `Label` of `Edge` and `Node` now support HTML and no formatting: To **migrate** replace old calls to `Label` with calls to `label`