Skip to content

Replace Graphviz/DOT with a Java implementation#7557

Open
labkey-adam wants to merge 12 commits intodevelopfrom
fb_graphviz
Open

Replace Graphviz/DOT with a Java implementation#7557
labkey-adam wants to merge 12 commits intodevelopfrom
fb_graphviz

Conversation

@labkey-adam
Copy link
Copy Markdown
Contributor

@labkey-adam labkey-adam commented Apr 7, 2026

Rationale

A native Java implementation is much simpler and cleaner than shelling out to an executable. Switching to https://github.com/jamisonjiang/graph-support

Related Pull Requests

Tasks

  • Dev
  • Code Review
  • Manual Testing - @labkey-jeckels
    • Pipeline diagrams: Admin Console -> Pipelines and Tasks -> clicking some of the pipelines and tasks will show a diagram
    • Group diagrams: go to any permissions page, for example, Site Permissions -> click the Group Diagrams tab
    • Module dependency diagrams require a code change: uncomment the graphModuleDependencies(dependencies, "all") line in ModuleDependencySorter.java (line 84) and compile. Start up the server and examine the file in the temp directory that gets logged.
    • Experiment diagrams. Easily accessed from flow, MS2, and other assays. You'll notice that I'm rendering the new diagrams somewhat larger than the old ones, but monitors are much higher resolution now vs. when we chose the old image-based implementation scaling factor. Current scale factor is arbitrary; we can easily scale it up or down, if desired.
  • User education handoff
  • Needs Automation
  • TeamCity Review and Merge
  • Stop copying executables in the build and distributions
  • Stop installing executables (graphviz) during deployment
  • Report minor discrepancies to graph-support project. 1) No support for \L and \R for text alignment. 2) Large margins even when specifying margin="0,0". 3) No support for transparent background.

User Education

  • Add one "Distribution Changes and Upgrade Notes" release note bullet that dot and other graphviz executables are no longer used by LabKey, are no longer provided in the distributions, and can be uninstalled from existing deployments
  • Add another "Community Edition" bullet that experiment diagrams have been enlarged and rendering has been improved
  • Purge all installation/configuration docs that reference graphviz/dot executables

@labkey-adam labkey-adam self-assigned this Apr 11, 2026
@labkey-adam labkey-adam added this to the 26.05 milestone Apr 11, 2026
@labkey-jeckels
Copy link
Copy Markdown
Contributor

Initial testing pass looks OK. Biggest discrepancy is that the new output is significantly taller than the old. That's especially noticeable on the hexagons (which seems fine), but there's also quite a bit more empty space above and below the graph. Maybe that's what you called out in terms of margins.

image

@labkey-jeckels
Copy link
Copy Markdown
Contributor

Tested all the scenarios listed here. The Java implementation often chose different left-to-right orders for elements or other subtle layout variations, but they were all equivalent.

@labkey-adam
Copy link
Copy Markdown
Contributor Author

Initial testing pass looks OK. Biggest discrepancy is that the new output is significantly taller than the old. That's especially noticeable on the hexagons (which seems fine), but there's also quite a bit more empty space above and below the graph. Maybe that's what you called out in terms of margins.

image

Yes, the margins are bigger, as noted. I'll likely file an issue with the maintainer of this library, but it's certainly not a blocker. Shapes, such as the hexagons, are no longer squished like they were before. I prefer the current diagrams.

@labkey-adam
Copy link
Copy Markdown
Contributor Author

Claude is happy with this PR. Only two low findings: missing license header (like many of our files) and it's unsure if grapher.save() writes over an existing file (it does).

…of (deprecated and not supported) setlinewidth
}
catch (ExecuteException e)
{
html = "Error while attempting to produce the group diagram: " + e.getMessage();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be encoded?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants