First time here? Check out the FAQ!
1

Let wing render the graphviz graph.

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

hongyi-zhao's avatar
412
hongyi-zhao
asked 2020-04-08 20:44:08 -0600
Wingware Support's avatar
4k
Wingware Support
updated 2020-04-10 09:16:09 -0600
edit flag offensive 0 remove flag 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's avatar Wingware Support (2020-04-09 09:51:21 -0600) 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's avatar hongyi-zhao (2020-04-09 23:41:28 -0600) edit
add a comment see more comments

1 Answer

0

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

Wingware Support's avatar
4k
Wingware Support
answered 2020-04-09 10:05:25 -0600
edit flag offensive 0 remove flag delete link

Comments

Yes, this is the method I use now.

hongyi-zhao's avatar hongyi-zhao (2020-04-09 19:38:38 -0600) 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's avatar Wingware Support (2020-04-10 09:19:28 -0600) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer