项目作者: csicar

项目描述 :
DotLang datatypes for purescript
高级语言: PureScript
项目地址: git://github.com/csicar/purescript-dotlang.git
创建时间: 2018-01-16T02:29:21Z
项目社区:https://github.com/csicar/purescript-dotlang

开源协议:MIT License

下载


Dot-Lang

documentation can be found on pursuit

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

  1. let additions =
  2. { dotlang =
  3. { dependencies =
  4. [ "colors"
  5. , "console"
  6. , "effect"
  7. , "generics-rep"
  8. , "prelude"
  9. , "psci-support"
  10. , "strings"
  11. , "test-unit"
  12. ]
  13. , repo = "https://github.com/csicar/purescript-dotlang.git"
  14. , version = "v2.0.0"
  15. }
  16. }
  1. spago install dotlang

Bower

  1. 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