Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

show yEd graphml with yfiles_jupyter_graphs

0 votes
Is it possible to import a graphml file made in yEd and show it in a julyter notebook with yfiles_jupyter_graphs ?

If yes can you provide and example?

Thank you
in Help by

1 Answer

0 votes

The yFiles Jupyter Widget primarily visualizes structured data originating from Python sources. It is not supposed to display yEd (or yEd Live) diagrams. 

Because the focus of the widget is on structured data, it cannot display the visual fidelity of diagrams that have been created with yEd and also does not support grouping.

That said, you can import the diagram structure from a GraphML file. As a bare minimum, you just need to provide a node and edge list (like in the Introduction example notebook).

So you can either use a GraphML parser package (I'd assume there are some on PyPI) or you can also check if another supported import format of yFiles Jupyter Graphs  (e.g. NetworkX, igraph, ...) can import GraphML.

For example, NetworkX can read GraphML files and therefore, you can load it with NetworkX and use that graph in the yFiles Jupyter Graphs widget:

from networkx import read_graphml
from yfiles_jupyter_graphs import GraphWidget
GraphWidget(graph = read_graphml('./circular1.graphml'))

Keep in mind, that it just imports the structure (and the label text, at least when utilizing the NetworkX approach).

Feel free to create an issue on GitHub for yFiles Jupyter Graphs to better support your use case in the future.

by [yWorks] (1.4k points)
edited by
Legal Disclosure | Privacy Policy
...