question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webcola as alternative layout for force-directed networks

See original GitHub issue

For some applications, network layouts that are different from the default force-directed layout from D3 are important. It would be good if it were possible to choose from different algorithms. Force-directed leads to very poor layout when investigating topology; the webcola algorithm is superior for this application.

As webcola provides a simple plug-in replacement for force-directed in D3, would it be possible to include this into vega as well?

From the cola.js website: replace

var force = d3.layout.force()
    .charge(-120)
    .linkDistance(30)
    .size([width, height]);

with

var force = cola.d3adaptor()
    .linkDistance(30)
    .size([width, height]);

to change the algorithm.

Thank you.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
royingcommented, Feb 25, 2020

WebCola (cola.js) offers “constraint-based” force layout functionality that is currently lacking in Vega (v5.9.1). https://ialab.it.monash.edu/webcola/

WebCola features would enable Vega to create:

  • nested grouped nodes
  • hierarchical nodes
  • alignment of nodes

The automated force-directed layout with alignment and constraints allow automated positioning of nodes and edges.

WebCola can add new capabilites to Vega and enhance existing features including:

  • diagrams and flowcharts (such as UML diagrams)
  • organization charts
  • annotations for charts and timelines

A real world example use case of WebCola: https://stackoverflow.com/questions/25856530/cola-js-d3-js-force-directed-network-constraining-nodes-during-after-force-s

Other javascript libraries and software for creating flowcharts and diagrams: https://modeling-languages.com/javascript-drawing-libraries-diagrams/

The Vega team is already very familiar with WebCola: https://github.com/uwdata/setcola http://idl.cs.washington.edu/papers/setcola/ https://idl.cs.washington.edu/files/2018-SetCoLa-EuroVis.pdf

Suggestion: Instead of replacing the current Vega “force” transform, perhaps Vega can add new transforms built on capabilities of WebCola.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Design alternatives to K-hop layout: (a) D3 force-directed ...
5c). Our K-hop layout is similar to the Group-In-aBox layout proposed by Rodrigues et al. [44] for categorybased partitions of social networks. It...
Read more >
Using WebCola and D3.js to create hierarchical layout
Force directed networks rearranges the nodes and edges in such a way that there is a minimal amount of node overlap and edge...
Read more >
Force-directed graph drawing - Wikipedia
Force -directed graph drawing algorithms are a class of algorithms for drawing graphs in an aesthetically-pleasing way. Their purpose is to position the ......
Read more >
SetCoLa: High‐Level Constraints for Graph Layout
IPSep-CoLa [DKM06 ] extends force-directed layouts to apply separation constraints on pairs of nodes to support properties such as customized ...
Read more >
position nodes in force layout graph vertically - Stack Overflow
js - How can I expand force directed graph horizontally? According to @Lars Kotthoff: "The point of the force layout is to automatically...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found