package flare.vis.operator.layout {
import flare.animate.Transitioner;
import flare.util.Shapes;
import flare.util.Vectors;
import flare.vis.data.DataSprite;
import flare.vis.data.EdgeSprite;
import flare.vis.data.NodeSprite;
import flare.vis.operator.Operator;
/**
* Layout that routes edges in a graph so that they form groups, reducing
* clutter. This operator requires that a tree structure (for example, a
* computed spanning tree) be defined over the graph. The class also sets
* all edges' shape
property to Shapes.BSPLINE
* and can optionally compute alpha
values to improve edge
* visibility.
*
*
The algorithm uses the tree path between two nodes to define control * points for routing a b-spline curve. The technique is adapted from * Danny Holten's work on * * Hierarchical Edge Bundles, InfoVis 2006.
*/ public class BundledEdgeRouter extends Operator { /** Determines how "tight" the edges are bundled. At 0, all edges are * unbundled straight lines. At 1, the edges bundle together tightly. * The default is 0.85. */ public var bundling:Number = 0.85; /** Removes the shared ancestor along a node path. */ public var removeSharedAncestor:Boolean = false; /** * Creates a new BundledEdgeRouter * @param bundling the tightness of edge bundles */ public function BundledEdgeRouter(bundling:Number=0.85, removeSharedAncestor:Boolean=false) { this.bundling = bundling; this.removeSharedAncestor = removeSharedAncestor; } /** @inheritDoc */ public override function operate(t:Transitioner=null):void { t = (t==null ? Transitioner.DEFAULT : t); var u:NodeSprite, v:NodeSprite, pu:NodeSprite, pv:NodeSprite; var p1:Vector.