Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.16 KB

edge-path-templates.rst

File metadata and controls

39 lines (24 loc) · 1.16 KB

Edge Path Templates

The path of an :js:class:`Edge` can be controlled by using an :js:class:`EdgePathGenerator` together with the :js:attr:`Edge.pathType`. The :js:class:`EdgePathGenerator` must be registered in the :js:attr:`GraphEditor.edgePathGeneratorRegistry` before it can be referenced.

The curves defined by d3 can be used with the provided :js:class:`SmoothedEdgePathGenerator`. There is also the :js:class:`SteppedEdgePathGenerator`.

Examples

// standard edge path generator
new SmoothedEdgePathGenerator(curveBasis, true, 10);

screenshots/curveBasis.png

// linear edge path generator
new SmoothedEdgePathGenerator(curveLinear, false);

screenshots/curveLinear.png

// linear edge path generator with offset points
new SmoothedEdgePathGenerator(curveLinear, true, 10);

screenshots/curveLinear-with-offset-points.png

// stepped edge path generator
new SteppedEdgePathGenerator();

screenshots/stepped-edge.png