Ask Your Question
1

Let wing render the graphviz graph.

asked 2020-04-08 20:44:08 -0500

hongyi-zhao gravatar image

updated 2020-04-10 09:16:09 -0500

Hi,

I try to use graphviz within wing. The code example is from here: https://aiida.readthedocs.io/projects...

from aiida.common import LinkType
from aiida.orm.utils.links import LinkPair
from aiida.tools.visualization import Graph, pstate_node_styles

dict1_uuid = '0ea79a16-501f-408a-8c84-a2704a778e4b'
calc1_uuid = 'b23e692e-4e01-48dd-b515-4c63877d73a4'

graph = Graph()
graph.add_node(dict1_uuid)
graph.add_node(calc1_uuid)
graph.graphviz

But wing failed to display the rendered grahpviz graph which jupyter can do smoothly.

Any hints for this problem?

Regards

edit retag flag offensive close merge delete

Comments

What version of Python do you have and on which OS? I can't seem to get aiida working at all (even outside of Wing) due to apparently installation problems. My initial guess is that it contains an event loop that is not based on matplotlib and thus plots won't show except if free-running in Wing's debugger.

Wingware Support gravatar imageWingware Support ( 2020-04-09 09:51:21 -0500 )edit

See following:

 $ python --version
     Python 3.7.6

 $ lsb_release -a
 No LSB modules are available.
 Distributor ID:    Ubuntu
Description:    Ubuntu 19.10
Release:    19.10
Codename:   eoan

Add the following codes at the top of your python script for running it within wing:

from aiida import load_profile
load_profile()

See here for more info: https://aiida.readthedocs.io/projects...

hongyi-zhao gravatar imagehongyi-zhao ( 2020-04-09 23:41:28 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-04-09 10:05:25 -0500

Wing does not have the ability to render inline images like the Jupyter notebook does. It seems that it's possible to use an external viewer via the render() method with view=True. The graphvis python module documentation is at https://graphviz.readthedocs.io

edit flag offensive delete link more

Comments

Yes, this is the method I use now.

hongyi-zhao gravatar imagehongyi-zhao ( 2020-04-09 19:38:38 -0500 )edit

I've tagged this as a feature request, although I don't know when we'll get to the general goal of having inline notebooks within Wing's UI rather than in a separate window.

Wingware Support gravatar imageWingware Support ( 2020-04-10 09:19:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-04-08 20:44:08 -0500

Seen: 67 times

Last updated: Apr 09