CLEAN

graph.clean()

a planar graph is cleaned with operations that utilize x y location

Duplicate Nodes in Space

When two nodes occupy the same space they will be merged into one

 nodes,  edges
graph.cleanDuplicateNodes(epsilon)

Epsilon is the radius around a point where merging occurs. It's a fraction of the size of the canvas. A larger number will merge across a further distance.

Fragment

Fragmenting edges will chop them at their edge crossings

graph.fragment()
graph.getEdgeIntersections()

This will give you the crossing locations without fragmenting. It returns an EdgeIntersection object.

The SVG on the right has been fragmented

Collinear Planar Graph Edges

Collinear nodes can be removed, the two edges on either side merged into one.

graph.removeEdge(edge)

Removing edges will remove their nodes, and so will nodes left behind between 2 collinear lines be removed as well.

Intersection of Two Edges

Collinear lines at certain angles is a good place to test the robustness of the intersection algorithm