Skip to content

Commit 20cfee5

Browse files
authored
Update export docstring for dag (#344)
* docs: update export to image docstring * docs: update export to image docstring
1 parent e65bf6e commit 20cfee5

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### Added:
99
- Docs: Tips for setting custom coordinates for plots.
1010
### Changed:
11+
- Docs: Add more elaboration for exporting to image for tree and dag.
1112
- Misc: Split tree/construct and tree/export into multiple files.
1213

1314
## [0.23.1] - 2025-01-22

assets/tree_dag.dot

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
strict digraph G {
2+
graph [bb="0,0,126,252",
3+
rankdir=TB
4+
];
5+
node [label="\N"];
6+
c [height=0.5,
7+
label=c,
8+
pos="44,162",
9+
width=0.75];
10+
d [height=0.5,
11+
label=d,
12+
pos="71,90",
13+
width=0.75];
14+
c -> d [pos="e,64.524,107.79 50.536,144.05 53.521,136.32 57.131,126.96 60.483,118.27"];
15+
a [height=0.5,
16+
label=a,
17+
pos="99,234",
18+
width=0.75];
19+
a -> c [pos="e,56.172,178.49 86.794,217.46 79.887,208.67 71.092,197.48 63.275,187.53"];
20+
a -> d [pos="e,74.389,108.19 95.623,215.87 90.893,191.88 82.238,147.99 76.552,119.16"];
21+
e [height=0.5,
22+
label=e,
23+
pos="71,18",
24+
width=0.75];
25+
d -> e [pos="e,71,36.104 71,71.697 71,64.407 71,55.726 71,47.536"];
26+
b [height=0.5,
27+
label=b,
28+
pos="27,234",
29+
width=0.75];
30+
b -> c [pos="e,39.805,180.28 31.115,216.05 32.926,208.6 35.102,199.64 37.146,191.22"];
31+
}

assets/tree_dag.png

14.3 KB
Loading

bigtree/dag/export.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ def dag_to_dot(
214214
215215
Export to image, dot file, etc.
216216
217-
>>> dag_graph.write_png("assets/docstr/tree_dag.png")
218-
>>> dag_graph.write_dot("assets/docstr/tree_dag.dot")
217+
>>> dag_graph.write_png("assets/tree_dag.png")
218+
>>> dag_graph.write_dot("assets/tree_dag.dot")
219+
220+
![Export to Dot](https://github.com/kayjan/bigtree/raw/master/assets/tree_dag.png)
219221
220222
Export to string
221223

0 commit comments

Comments
 (0)