Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on March 11, 2022 3:19PM
Likes: 0
Replies: 1
Hi,
From this example,
# Create Digraph object
dot = Digraph()
# Add nodes
dot.node('1')
dot.node('3')
dot.node('2')
dot.node('5')
# Add edges
dot.edges(['12', '13', '35'])
# Visualize the graph
dot
I would like to save this graph on a folder with a svg or png extension.
Thanks
Hi @oscieux
,
Thank you for posting your sample code! To save your result to a managed folder, you can do something like this:
import dataiku # for an existing folder named 'graphviz_folder' folder = dataiku.Folder('graphviz_folder') file_path = folder.get_info()['path'] + '/graphviz_filename' dot.render(file_path, format='svg')
Then in your managed folder you'll see:
This will work for folders on your local filesystem. Let me know if you have any questions about this.
Thanks,
Sarina