Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naoty/tinydot
Tiny language alternative to DOT.
https://github.com/naoty/tinydot
Last synced: 2 months ago
JSON representation
Tiny language alternative to DOT.
- Host: GitHub
- URL: https://github.com/naoty/tinydot
- Owner: naoty
- License: mit
- Created: 2014-01-22T06:37:10.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-24T04:09:44.000Z (almost 11 years ago)
- Last Synced: 2024-10-06T04:40:10.257Z (3 months ago)
- Language: Ruby
- Size: 199 KB
- Stars: 14
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Tinydot
Tiny language alternative to DOT.
## Installation
```sh
$ gem install tinydot
```[Graphviz](http://www.graphviz.org/) is required to convert files written by tinydot into images.
## Usage
```sh
$ tinydot convert sample.tinydot
````tinydot` command converts `*.tinydot` or `*.tdot` into `*.dot` and converts the converted files into graph images using Graphviz.
## Examples
### Nodes, Edges
```rb
digraph "sample" do
a >> b >> c
a <=> d
b <=> d
end
```is equivalent to
```dot
digraph sample {
a -> b;
b -> c;
a -> d [dir = both];
b -> d [dir = both];
}
```and converted into a following graph.
![sample](examples/sample.png "sample")
### Attributes
```rb
digraph "sample2", rankdir: "LR" do
node shape: "record", style: "filled", fontname: "Osaka", fillcolor: "#ECF0F1"a "Label 1"
b "Label 2"
c "Label 3", fillcolor: "#27AE60"
d "Label 4", fillcolor: "#F1C40F"
e "Label 5", fillcolor: "#E74C3C"a <=> b
a <=> c
b >> d
d <=> e
d >> a
end
```is equivalent to
```dot
digraph sample2 {
graph [rankdir = LR];
node [shape = record, style = filled, fontname = "Osaka", fillcolor = "#ECF0F1"];a [label = "Label 1"];
b [label = "Label 2"];
c [label = "Label 3", fillcolor = "#27AE60"];
d [label = "Label 4", fillcolor = "#F1C40F"];
e [label = "Label 5", fillcolor = "#E74C3C"];a -> b [dir = both];
a -> c [dir = both];
b -> d;
d -> e [dir = both];
d -> a;
}
```and converted into a following graph.
![sample2](examples/sample2.png "sample2")