Truncated image rendering with svgtree in swish

Hi!

I am trying to render terms with svgtree in swish. My code is:

:-use_rendering(svgtree).
x(x(margareth, mary, josh, pete, gina, richard)).

But the image looks like the one below (Image 1) with some letters truncated vertically (in Safari for mac). Zooming in the browser is set to default. Sometimes strings also overlap horizontally; see Image 2.

Also, when i save the file (or open it in another browser window all names are missing; i just get an X with a bunch of lines).

Any solution to this?

Cheers/JC

Image 1:
54

Image 2:

1 Like

Works fairly well in FF. In general I’d use the graphviz renderer. That seems more portable and powerful.

1 Like

OK, thanks. For me the granph is truncated in both firefox and safari. I saw the gvtree program on the Graphviz help page in swish but is there a module or program that can be included or imported in swish to automatically render terms with graphviz? I.e. a predicate renderTermAsGraphviz(Term)?

JCR

Not sure what you want. How would that differ from the gvtree example?

Sorry for being unclear. With gvtree i can just write :- use_rendering(svgtree). and any term is automatically rendered as a graphical tree, i.e. without additional code in the same notebook.

I was wondering if there is something with the same functionality for rendering as graphviz. I.e. without having the program that converts terms to the graphviz representation in the notebook, but instead importing the conversion program using :-include.

Thanks/JCR

As is, no. You can make loading a lot easier by saving the gvtree code into a SWISH program, including the :- use_renderer line and use :- include(myprog).

Using it for rendering any term requires writing a different server side renderer.

2 Likes

Thanks! This solves my problem.