Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

Commit c42cabd

Browse files
authored
Merge pull request #67 from ts-graphviz/update-readme
update README
2 parents 8d5ed2e + bdfe471 commit c42cabd

File tree

4 files changed

+70
-6
lines changed

4 files changed

+70
-6
lines changed

README.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ $ yarn add @ts-graphviz/react
1515
$ npm install @ts-graphviz/react
1616
```
1717

18+
### Peer Dependencies
19+
20+
- [React](https://github.com/facebook/react/)(>=16.8)
21+
- [ts-graphviz](https://github.com/ts-graphviz/ts-graphviz)
22+
23+
```bash
24+
$ yarn add react ts-graphviz
25+
```
26+
1827
## Usage
1928

2029
### Example
@@ -26,7 +35,16 @@ import React, { FC } from 'react';
2635
import { Digraph, Node, Subgraph, renderToDot, Edge, DOT } from '@ts-graphviz/react';
2736

2837
const Example: FC = () => (
29-
<Digraph dpi={150}>
38+
<Digraph
39+
rankdir="TB"
40+
edge={{
41+
color: 'blue',
42+
fontcolor: 'blue',
43+
}}
44+
node={{
45+
shape: 'none',
46+
}}
47+
>
3048
<Node
3149
id="nodeA"
3250
shape="none"
@@ -57,10 +75,17 @@ console.log(dot);
5775

5876
```dot
5977
digraph {
60-
dpi = 150;
78+
rankdir = "TB";
79+
edge [
80+
color = "blue",
81+
fontcolor = "blue",
82+
];
83+
node [
84+
shape = "none",
85+
];
6186
"nodeA" [
6287
shape = "none",
63-
label = <<table BORDER="0" CELLBORDER="1" CELLSPACING="0"><tr><td>left</td><td PORT="m">middle</td><td PORT="r">right</td></tr></table>>,
88+
label = <<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"><TR><TD>left</TD><TD PORT="m">middle</TD><TD PORT="r">right</TD></TR></TABLE>>,
6489
];
6590
"nodeB";
6691
subgraph "cluster" {
@@ -72,12 +97,12 @@ digraph {
7297
}
7398
// Edge from node A to B
7499
"nodeB" -> "nodeA":"m" [
75-
label = <<b>A to B</b>>,
100+
label = <<B>A to B</B>>,
76101
];
77102
}
78103
```
79104

80-
![dot](./example/example.png)
105+
![dot](./example/example.svg)
81106

82107
## See Also
83108

example/example.png

-22.5 KB
Binary file not shown.

example/example.svg

Lines changed: 40 additions & 0 deletions
Loading

example/example.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Digraph, Node, Subgraph, renderToDot, Edge, DOT } from '../src';
33

44
const Example: FC = () => (
55
<Digraph
6-
dpi={150}
76
rankdir="TB"
87
edge={{
98
color: 'blue',

0 commit comments

Comments
 (0)