Skip to content

Commit e65bf6e

Browse files
authored
Update export to image docstring (#343)
docs: update export to image docstring
1 parent aa86906 commit e65bf6e

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

assets/tree_pillow.jpg

1.6 KB
Loading

assets/tree_pillow.png

1.15 KB
Loading

bigtree/tree/export/images.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def tree_to_dot(
4343
node_attr: Callable[[T], Dict[str, Any]] | str = "",
4444
edge_attr: Callable[[T], Dict[str, Any]] | str = "",
4545
) -> pydot.Dot:
46-
r"""Export tree or list of trees to image.
46+
r"""Export tree or list of trees to pydot.Dot object. Object can be
47+
converted to other format, such as png, dot file or dot string. Dot
48+
string can be imported to work with networkx.
49+
4750
Possible node attributes include style, fillcolor, shape.
4851
4952
Examples:
@@ -216,8 +219,10 @@ def tree_to_pillow(
216219
bg_colour: Union[Tuple[int, int, int], str] = "white",
217220
**kwargs: Any,
218221
) -> Image.Image:
219-
"""Export tree to image (JPG, PNG).
220-
Image will be similar format as `print_tree`, accepts additional keyword arguments as input to `yield_tree`.
222+
"""Export tree to PIL.Image.Image object. Object can be
223+
converted to other format, such as jpg, or png. Image will be
224+
similar format as `print_tree`, accepts additional keyword arguments
225+
as input to `yield_tree`.
221226
222227
Examples:
223228
>>> from bigtree import Node, tree_to_pillow
@@ -230,8 +235,10 @@ def tree_to_pillow(
230235
231236
Export to image (PNG, JPG) file, etc.
232237
233-
>>> pillow_image.save("assets/docstr/tree_pillow.png")
234-
>>> pillow_image.save("assets/docstr/tree_pillow.jpg")
238+
>>> pillow_image.save("assets/tree_pillow.png")
239+
>>> pillow_image.save("assets/tree_pillow.jpg")
240+
241+
![Export to pillow](https://github.com/kayjan/bigtree/raw/master/assets/tree_pillow.png)
235242
236243
Args:
237244
tree (Node): tree to be exported

0 commit comments

Comments
 (0)