diff --git a/nutils/__init__.py b/nutils/__init__.py index 4dbefc297..6d02bbef6 100644 --- a/nutils/__init__.py +++ b/nutils/__init__.py @@ -1,4 +1,4 @@ 'Numerical Utilities for Finite Element Analysis' -__version__ = version = '9a16' +__version__ = version = '9a17' version_name = 'jook-sing' diff --git a/nutils/_graph.py b/nutils/_graph.py index 939308c58..f91c7912f 100644 --- a/nutils/_graph.py +++ b/nutils/_graph.py @@ -5,6 +5,7 @@ import subprocess import abc import html +import re Metadata = TypeVar('Metadata') GraphvizColorCallback = Callable[['Node'], Optional[str]] @@ -68,7 +69,35 @@ def export_graphviz(self, *, fill_color: Optional[GraphvizColorCallback] = None, for i, line in enumerate(src.split('\n'), 1): print('{:04d} {}'.format(i, line)) treelog.warning('graphviz failed for error code', status.returncode) - img.write(status.stdout) + graph = status.stdout + if image_type == 'svg': + graph = re.sub(b'') + graph = graph[:i] + clickHandler + graph[i:] + img.write(graph) + +clickHandler = b''' + +''' class RegularNode(Node[Metadata]):