Class ForceAtlas2LayoutAlgorithm.Builder<V,T extends ForceAtlas2LayoutAlgorithm<V>,B extends ForceAtlas2LayoutAlgorithm.Builder<V,T,B>>
- java.lang.Object
-
- org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm.Builder<V,T,B>
-
- org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm.Builder<V,T,B>
-
- org.jungrapht.visualization.layout.algorithms.ForceAtlas2LayoutAlgorithm.Builder<V,T,B>
-
- All Implemented Interfaces:
LayoutAlgorithm.Builder<V,T,B>
- Enclosing class:
- ForceAtlas2LayoutAlgorithm<V>
public static class ForceAtlas2LayoutAlgorithm.Builder<V,T extends ForceAtlas2LayoutAlgorithm<V>,B extends ForceAtlas2LayoutAlgorithm.Builder<V,T,B>> extends AbstractIterativeLayoutAlgorithm.Builder<V,T,B> implements LayoutAlgorithm.Builder<V,T,B>
-
-
Field Summary
-
Fields inherited from class org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm.Builder
afterRunnable, executor, preRelaxDurationMs, random, shouldPrerelax, threaded
-
Fields inherited from class org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm.Builder
after
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description B
attractionByWeights(boolean attractionByWeights)
Set usage of Attraction by Weights concept.T
build()
B
delta(double weightsDelta)
Set weights power.B
dissuadeHubs(boolean dissuadeHubs)
Set usage of "Dissuade Hubs" model.B
gravityK(double kg)
Set gravity K.B
initializer(Function<V,Point> initializer)
Set this function if you want to use pre-computed or old layout.B
linLog(boolean useLinLog)
Set usage of LinLog model.B
maxIterations(int maxIterations)
Set number of iterations.B
nodeMasses(Map<V,Double> nodeMasses)
Set node masses.B
nodeSizes(Map<V,Double> nodeSizes)
Set node sizes.B
repulsionContractBuilder(StandardFA2Repulsion.Builder repulsionContractBuilder)
B
tolerance(double tolerance)
Tolerance to swinging.-
Methods inherited from class org.jungrapht.visualization.layout.algorithms.AbstractIterativeLayoutAlgorithm.Builder
afterRunnable, executor, prerelax, preRelaxDuration, randomSeed, self, threaded
-
Methods inherited from class org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm.Builder
after
-
-
-
-
Method Detail
-
repulsionContractBuilder
public B repulsionContractBuilder(StandardFA2Repulsion.Builder repulsionContractBuilder)
-
initializer
public B initializer(Function<V,Point> initializer)
Set this function if you want to use pre-computed or old layout.- Parameters:
initializer
-- Returns:
-
linLog
public B linLog(boolean useLinLog)
Set usage of LinLog model. Andreas Noack produced an excellent work on placement quality measures. His LinLog energy model arguably provides the most readable placements, since it results in a placement that corresponds to Newman’s modularity, a widely used measure of community structure. The LinLog mode just uses a logarithmic attraction force.Default: false
- Parameters:
useLinLog
-- Returns:
- See Also:
- "https://opus4.kobv.de/opus4-btu/files/377/ThesisNoack.pdf", "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679"
-
attractionByWeights
public B attractionByWeights(boolean attractionByWeights)
Set usage of Attraction by Weights concept.Default: false
- Parameters:
attractionByWeights
-- Returns:
- See Also:
- "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679"
-
delta
public B delta(double weightsDelta)
Set weights power. Only for AttractionByWeights mode. If the setting “Edge Weight Influence” is set to 0, the weights are ignored. If it is set to 1, then the attraction is proportional to the weight. Values above 1 emphasize the weight effects.Default: 1.0
- Parameters:
weightsDelta
-- Returns:
- See Also:
- "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679"
-
dissuadeHubs
public B dissuadeHubs(boolean dissuadeHubs)
Set usage of "Dissuade Hubs" model. "Dissuade Hubs" tends to push hubs to the periphery while keeping authorities in the center.Default: false
- Parameters:
dissuadeHubs
-- Returns:
- See Also:
- "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679", "https://dl.acm.org/doi/abs/10.1145/324133.324140"
-
maxIterations
public B maxIterations(int maxIterations)
Set number of iterations.Default: 400
- Parameters:
maxIterations
-- Returns:
-
gravityK
public B gravityK(double kg)
Set gravity K. Gravity is a common improvement of force-directed layouts. This force prevents disconnected components (islands) from drifting away. It attracts nodes to the center of the spatialization space. Recommended values 1.0-5.0Default: 5.0
- Parameters:
kg
-- Returns:
- See Also:
- "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679"
-
tolerance
public B tolerance(double tolerance)
Tolerance to swinging. Higher value of tolerance allow higher value of speed. For details see original paper about ForceAtlas2.Default: 1.0
- Parameters:
tolerance
-- Returns:
- See Also:
- "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679"
-
nodeSizes
public B nodeSizes(Map<V,Double> nodeSizes)
Set node sizes. They may have fixed size or size based on centrality measure or anything else.Default: 1.0
- Parameters:
nodeSizes
-- Returns:
- See Also:
- "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679"
-
nodeMasses
public B nodeMasses(Map<V,Double> nodeMasses)
Set node masses. This may have fixed masses or masses based on degrees or anything else.By default node degrees plus one
- Parameters:
nodeMasses
-- Returns:
- See Also:
- "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679"
-
build
public T build()
- Specified by:
build
in interfaceLayoutAlgorithm.Builder<V,T extends ForceAtlas2LayoutAlgorithm<V>,B extends ForceAtlas2LayoutAlgorithm.Builder<V,T,B>>
- Specified by:
build
in classAbstractIterativeLayoutAlgorithm.Builder<V,T extends ForceAtlas2LayoutAlgorithm<V>,B extends ForceAtlas2LayoutAlgorithm.Builder<V,T,B>>
-
-