Taurus: Towards a Unified Force Representation and Universal Solver for Graph Layout
Taurus is a general graph layout framework to unify popular graph layout methods. The novelty of Taurus consists of two major components: a unified quotient-based force representation to model repulsive and attractive forces of different graph drawing techniques, and a universal augmented stochastic gradient descent (SGD) solver to find the optimal graph layout results. We release this C++ graph layout library based on Taurus that facilitates convenient implementation of graph visualizations in a unified manner as well as customizing one's own graph layout techniques.
Taurus online demo for this library can be found here (or click title).
We compiled the C++ library into a WebAssembly module and load it into the JavaScript application, thus enabling the library to run on the browser side. WebAssembly is a low-level assembly-like language that can run C/C++ code on the Web at near-native speed.
windows and linux environment
gcc(8.10.0) cmake(3.19.2)
We have compiled Taurus into a static library. Here is a test file that demonstrates how to use the Taurus library. To run this test-file, run build.sh and the file will be compiled and linked to the lib.
./build.sh
./test
To use Taurus, you just need to include this library and define a graph, and then you can construct the structure of the graph by input file or customize the topology of the graph.
graph g
g.initgraph(filename)
Before drawing a graph, you can choose the initial layout of the graph. The library provides two initial layouts: random layout (default)、PivotMDS layout. Besides, You can use customized coordinates from the input file as initial coordinates.
g.initRandomPosition
g.initPivotMDSPosition
g.initPosition(filename)
Taurus implements six graph layout methods:SM, FDP, LinLog, Maxent, FMMM, BSM. You can use these methods by inputting a graph by calling the corresponding interface.
SMLayout(g)
FDPLayout(g)
...
The library also supports customizing one's own graph layout. You can set the force model and pass it to Layout interface.
Layout(g,force)
Layout results are stored in g as coordinates. The library provides an interface to draw the layout results as svg.
g.drawSVG(filename,method-name)
@ARTICLE{9904492,
author={Xue, Mingliang and Wang, Zhi and Zhong, Fahai and Wang, Yong and Xu, Mingliang and Deussen, Oliver and Wang, Yunhai},
journal={IEEE Transactions on Visualization and Computer Graphics},
title={Taurus: Towards a Unified Force Representation and Universal Solver for Graph Layout},
year={2022},
volume={},
number={},
pages={1-10},
doi={10.1109/TVCG.2022.3209371}}
The source code is licensed under LGPL v2.1. License is available here.
If you have problems, please submit an issue.