VWorkflows icon indicating copy to clipboard operation
VWorkflows copied to clipboard

Enable auto-layout

Open aalmiray opened this issue 9 years ago • 13 comments

Related to #33. Would be great if the canvas had an auto-layout feature. Perhaps http://jung.sourceforge.net/ and https://github.com/prefuse/Prefuse can serve as inspiration; even better, their layouting algorithms could be reused "as is".

aalmiray avatar Feb 19 '16 19:02 aalmiray

One of our students is already working on it...

miho avatar Feb 19 '16 23:02 miho

Prototype layouting functionality added to branch "layouting". Still work in progress.

TCMBoby avatar Apr 28 '16 10:04 TCMBoby

The current implementation uses the VisualizationViewer component to compute the JUNG layout. It is probably better to work with VisualizationModel instead.

Example:

VisualizationModel visModel= new DefaultVisualizationModel(myLayout, new Dimension(800, 600));

This will also solve potential multithreading problems with the Swing EDT and JavaFX.

miho avatar May 17 '16 15:05 miho

Great news! Very much looking forward to testing the new codebase 😄

aalmiray avatar May 17 '16 17:05 aalmiray

Fixed the bug with multiplying edges and switched from using VisualizationViewer to DefaultVisualizationModel. VisualizationViewer is only instantiated once "testvis()" is run.

TCMBoby avatar May 17 '16 17:05 TCMBoby

Great news! Just tried the new implementation. Worked well!

Some ideas for improving the current layout generators:

  • use simple grid-alignment after layout to prevent "almost-aligned" nodes:

vworkflows-layout-grid-01 vworkflows-layout-grid-02

  • naive layout could be highly improved if max-width was chosen per row instead of globally:

vworkflows-layout-naive-space01

miho avatar Jun 06 '16 14:06 miho

Newest implementation adresses both problems. node-alignment is done pairwise for all nodepairs with a distance smaller than a certain threshold. This threshold is given by the size of the concerned nodes and the scaling parameter.

TCMBoby avatar Jun 07 '16 13:06 TCMBoby

Looks much better now. Thanks!

miho avatar Jun 12 '16 12:06 miho

Current implementation will be published in next maven release. Since it is still an incubating feature, LayoutGenerator* classes will be moved to the incubating package.

miho avatar Jul 05 '16 17:07 miho

@TCMBoby are we ready for maven/bintray publication?

miho avatar Jul 05 '16 17:07 miho

Yes.

TCMBoby avatar Jul 05 '16 21:07 TCMBoby

We have a new release which includes automatic layout as incubating feature: https://bintray.com/miho/VWorkflows/vworkflows-fx/0.2.3

miho avatar Jul 07 '16 20:07 miho

Hey, just a heads-up: the getters for boolean values are called "is..." instead of "get..." as per Java convention. I think this should get fixed.

zilti avatar Dec 11 '17 22:12 zilti