Giter Club home page Giter Club logo

jungrapht-visualization's Introduction

JUNGRAPHT-VISUALIZATION: The JUNG visualization and sample code modernized and ported to use JGraphT graphs and algorithms

build workflow Maven Central Snapshot License Language

JUNGRAPHT-VISUALIZATION Website

JUNGRAPHT-VISUALIZATION can be used to render any of the following:

  • org.jgrapht.Graph
  • com.google.common.graph.Network
  • com.google.common.graph.Graph

JUNGRAPHT-VISUALIZATION includes performance enhancements for visualization of large networks, including R*Tree for visualization, Barnes-Hut Quad Tree for force-directed layouts, and a lightweight rendering layer that can swap in while graphs are being animated or when they are zoomed out to a point where details are very small. In the ShowLayoutsWithJGraptIO demonstration program, the lightweight rendering layer allows fast enough rendering that the performance impact of the Barnes Hut Quad Tree for the force directed layout becomes obvious.

Many rendering features may be set via java properties (see sample.jungrapht.properties for keys and default values).

JUNGRAPHT-VISUALIZATION includes the jungrapht-layout module, which is independent of any java.awt imports (so that it may be more easily used by JavaFX or other rendering systems). Jungrapht-layout includes improved layout algorithms for directed graphs and Trees, including the TidierTreeLayoutAlgorithm and the SugiyamaLayoutAlgorithm. All TreeLayoutAlgorithms will make a best attempt to draw any directed graph (by ignoring cycles and reversing feedback edges) for which one or more Root vertices can be determined. Any TreeLayoutAlgorithm, when given an undirected graph, will create a SpanningTree in order to use the TreeLayoutAlgorithm. There are Vertex/Edge Predicates and Vertex/Edge Comparators that are used to coerce out the desired tree structure based on a user-defined procedure to find roots and follow the desired path. All TreeLayoutAlgorithms, including the TidierTreeLayoutAlgorithm, will draw either single or multiple rooted 'forest' graphs. CircleLayout has been improved with an option to reduce edge crossing.

JUNGRAPHT-VISUALIZATION Design and Features:

LayoutAlgorithm and LayoutModel

MouseGestures

Graph using TidierTreeLayoutAlgorithm

Image TidierTree

Graph using SugiyamaLayoutAlgorithm

Image SugiyamaLayout

Graph using Eiglsperger Optimization of SugiyamaLayoutAlgorithm

Image SugiyamaLayout

Graph using CircleLayoutAlgorithm

Image CircleLayout

Same graph using CircleLayoutAlgorithm with reduced edge crossing

Image ReducedEdgeCrossing

Latest Release

The most recent version of JUNGRAPHT-VISUALIZATION is version 1.4, released 20 March 2023.

To add a dependency on this release of JUNGRAPHT-VISUALIZATION using Maven, use the following:

<dependency>
  <groupId>com.github.tomnelson</groupId>
  <artifactId>jungrapht-visualization</artifactId>
  <version>1.4</version>
</dependency>

Snapshots

Snapshots of JUNGRAPHT-VISUALIZATION built from the master branch are available through Maven using version 1.5-SNAPSHOT.

Links

jungrapht-visualization's People

Contributors

dependabot[bot] avatar semyonsinchenko avatar syoon2 avatar tomnelson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jungrapht-visualization's Issues

Releases frequency

Hello!
Can you explain please how frequent are releases?
When'll be the next one with ForceAtlas2?

Thank You!

Longest Path layering

Improve testing and integration of Longest Path algorithm (in GraphLayers.longestPath).
Ensure that implementation is correct and that it creates correct-looking graph layouts

Is it possible to get a deterministic calculation of the locations when running e.g. Sugiyama layout algorithm

Hi,
Thumbs up for your library, it's a great piece of work!
Something I notice is that everytime I run the Sugiyama algorithm on exactly the same graph, the layout is different (or can be different) on each run compared to the previous run.
I assume it has to do something with the fact that the vertices in JGraphT are stored in a Set and not in a List, so retrieval of graph nodes is always in an undeterministic order.
Is there a way or would it be possible to provide functionality to calculate the layout in a deterministic way, so that every run the location of each vertex is exactly the same?
Best regards, Kristof

Orthogonal Layout

Develop an Orthogonal layout algorithm. Get rid of the legacy orthogonal edge drawing code, replacing it with articulated edges drawn using the same approach as the Sugiyama layout.

Create rectangular shaped magnification view lens

View Lenses are all elliptical, however a rectangular shape may be a better effect for the magnification view lens. An approach would be to make the lens shape settable and have all view related code respond to the actual lens shape instead of assuming a radius of an elliptical lens.

Single Axis Scaling should not scale the 'view' transform

Normal scaling affects the layout positions only when scale is > 1.0 and affects the view (telescope effect) when scale is < 1.0.
When single axis scaling is enabled (CTRL or ALT button with mouse wheel) the view will do the same and squish the vertices.
Perhaps single axis scaling should apply only to the layout transform.

Compaction Graph integration

Currently, there are two approaches to horizontal coordinate assignment, one using the graph layers array and pre-calculated 'position' values, the other using a DAG with edges along each layer (compaction graph). If the compaction graph approach is determined to be 'correct' and efficient, replace the graph layers array approach with it and remove the extra metadata (pos) from the delegate vertices (LV).

Sugiyama layout algorithm only seems to work when the application is running with headlessmode = false

Hi,

First off all : great library, love it!

If I apply the TidierTree algorithm (layoutAlgorithm = TidierTreeLayoutAlgorithm), following piece of code works fine, and all locations are calculated

      LayoutModel<AbstractPlaceholder> layoutModel = LayoutModel.<AbstractPlaceholder>builder().size(1590, 1590).graph(placeholderGraph).build();
      layoutAlgorithm.visit(layoutModel);
      Map<AbstractPlaceholder, Point> locations = layoutModel.getLocations();

But if I use the same code for Sugiyama ((layoutAlgorithm = SugiyamaLayoutAlgorithm) or some other layout algorithms, then the locations list is empty, no locations are calculated

Based on the sample code, I managed to fix this by changing the code into

      VisualizationViewer<AbstractPlaceholder, DefaultEdge> vv = VisualizationViewer.builder(placeholderComputationGraph).viewSize(new Dimension(900, 900)).build();
      LayoutAlgorithmTransition.apply(vv, layoutAlgorithm, after);
      locations = vv.getVisualizationModel().getLayoutModel().getLocations();

So in theory this works fine now, but the annoying thing is that VisualizationViewer requires to run with headless mode = false (even if there is no interaction with UI, keyboard, etc)

The reason why the VisualizationViewer cannot run in headless mode, is that

  • VisualisationViewer instantiates a DefaultGraphMouse on construction
  • DefaultGraphMouse makes use of Modifiers.masks
  • Modifiers.masks makes a call to Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx();
  • getMenuShortcutKeyMaskEx trows an exception if the application is running in headless mode

Maybe I overlook something, but it would be great if the Sugiyama algorithm would just work without using VisualizationViewer, or if VisualizationViewer or DefaultGraphMouse would work in a non-headless mode.

Thanks for your reaction and keep up the good work!

Add better Graph Vertex Clustering support

Current Graph Vertex Clustering support depends on unfortunate manipulation of the generic vertex types. Add support that is more flexible and usable for any type graph without changing the vertex generic type.
Replace the current demo.

Vertex-rendering

Hi, and congrats to this repo, which fits a much needed space imho.. and it seems to work very so far.

I have a hard time finding any examples showing how to render vertices as shapes (rounded rect, rect, ...) with a line of text centered on that shape.

Could you point me to one or even provide one ?

SugiyamaLayoutAlgorithm performance and visual improvements

Improve the performance and the visual effect of the SugiyamaLayoutAlgorithm using the techniques defined here:

An Efficient Implementation of Sugiyama’s Algorithm for Layered Graph Drawing
Markus Eiglsperge, Martin Siebenhaller, and Michael Kaufmann

This would be a new LayoutAlgorithm, not a replacement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.