# Java version of graphviz

**URL:** <https://forum.graphviz.org/t/java-version-of-graphviz/1619>\
**Category:** Dev\
**Created:** [May 16, 2023, 7:21am UTC](https://forum.graphviz.org/t/java-version-of-graphviz/1619 "2023-05-16T07:21:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamison](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@Jamison](https://forum.graphviz.org/u/Jamison)\
**Post date:** [May 16, 2023, 7:21am UTC](https://forum.graphviz.org/t/java-version-of-graphviz/1619/1 "2023-05-16T07:21:24Z")

</div>

Hi developers, just a share. I’m a Java developer and a graphviz user, I wrote a tiny version of graphviz in Java, I’m not sure if this is interesting 😄: [GitHub - jamisonjiang/graph-support: Java re-implementation of tiny graphviz](https://github.com/jamisonjiang/graph-support)

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [May 16, 2023, 2:32pm UTC](https://forum.graphviz.org/t/java-version-of-graphviz/1619/2 "2023-05-16T14:32:03Z")

</div>

Cool.  
Can you describe (even at a high level) what parts of Graphviz you cover/reproduce (and what parts you don’t)?  
I noticed good-looking “ortho” edges. Maybe Graphviz should reverse-engineer your code.

---

<div class="post-metadata">

**Author:** ![jiangyongbing24](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@jiangyongbing24](https://forum.graphviz.org/u/jiangyongbing24)\
**Post date:** [May 16, 2023, 3:51pm UTC](https://forum.graphviz.org/t/java-version-of-graphviz/1619/3 "2023-05-16T15:51:00Z")

</div>

**Briefly describe cover and not cover:**

**Input**  
only java api, still not support dot;

**Output**  
svg and Java objects (to facilitate the program to extract some layout information)

**Layout**  
only dot;

**Graph Items**  
Node,Subgraph,Cluster,Graph;

**Node**  
Some commonly used fixed shape and dynamic shape like record | mrecord | regular\_polyline;

**Line**  
Support NONE | ROUNDED | SPLINE | LINE | POLYLINE | ORTHO

**Label**  
Support table structure;

In addition, since the api uses strongly typed Java, all the attributes that can be set represent all the features that can be supported, and the rest are not supported.

**Ortho** route In my test, I think graphviz does a better job in most cases, especially in the scene of separating line segments and avoiding bending. I compared some other projects that can perform Ortho layout. Graphviz I feel it’s the best.  
In the implementation of graph-support, I think the only thing better than graphviz is the handling of labels, because I found that grahviz ortho does not seem to support labels, and labels are not always placed next to the lines. Other than that I feel that graphviz is always the better side of the Ortho route (in my tests).

---

<div class="post-metadata">

**Author:** ![kovzol](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/kovzol/32/1095_2.png) [@kovzol](https://forum.graphviz.org/u/kovzol)\
**Post date:** [June 14, 2023, 9:48am UTC](https://forum.graphviz.org/t/java-version-of-graphviz/1619/4 "2023-06-14T09:48:56Z")

</div>

Hi Jamison, that’s great!  
We are about to add a GraphViz based visualizer in our Java project [GitHub - kovzol/Java-Geometry-Expert: Java Geometry Expert](https://github.com/kovzol/Java-Geometry-Expert).  
It would be great to try out your project as a possible use case.  
There is now a GraphViz export but we would like to show the graphical output directly in the application. Of course, the program should work on multiple platforms (Windows, Mac, Linux). So it is crucial to use a platform independent solution.  
Do you think your library could be an option?  
Thanks, Zoltan

---

<div class="post-metadata">

**Author:** ![jiangyongbing24](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@jiangyongbing24](https://forum.graphviz.org/u/jiangyongbing24)\
**Post date:** [October 7, 2023, 4:33pm UTC](https://forum.graphviz.org/t/java-version-of-graphviz/1619/6 "2023-10-07T16:33:08Z")

</div>

graph-support zero dependency and we can use batik to transform SVG to any image format, I think it’s ok for multi-platform.

---

<div class="post-metadata">

**Author:** ![kovzol](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/kovzol/32/1095_2.png) [@kovzol](https://forum.graphviz.org/u/kovzol)\
**Post date:** [November 1, 2023, 9:49pm UTC](https://forum.graphviz.org/t/java-version-of-graphviz/1619/7 "2023-11-01T21:49:29Z")

</div>

This indeed works, thanks for the idea. Now the latest version of JGEX ([Release 0.80-20231101 · kovzol/Java-Geometry-Expert · GitHub](https://github.com/kovzol/Java-Geometry-Expert/releases/tag/0.80-20231101)) uses **graph-support** and **batik** to visualize geometry proofs.

 ![image](https://global.discourse-cdn.com/graphviz/original/2X/3/3c21cea9fbcc065fb0fed660d0ef53fc25282b53.png)

---

<div class="post-metadata">

**Author:** ![jiangyongbing24](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@jiangyongbing24](https://forum.graphviz.org/u/jiangyongbing24)\
**Post date:** [December 9, 2023, 2:17pm UTC](https://forum.graphviz.org/t/java-version-of-graphviz/1619/8 "2023-12-09T14:17:56Z")

</div>

The [latest version](https://github.com/jamisonjiang/graph-support/releases/tag/graph-support_1.2.0) can draw image without batik and support multi platform, it is more simple to integrate.
