gpml2pvjson
Version:
convert GPML (XML) to pvjson (json)
25 lines (24 loc) • 1.27 kB
TypeScript
import { SmartPoint } from "../geom-utils";
import { Point, PvjsonNode, PvjsonEdge } from "../gpml2pvjson";
/**
* calculateAllPoints for edges of type Elbow and Curved
*
* PathVisio-Java does not always specify all the points needed to draw edges
* of type Elbow and Curved. Unless the user drags one or more of the
* waypoints, PathVisio-Java will only specify the first and last points,
* leaving implicit one or more additional points that are required to draw
* the edge.
*
* Kaavio requires that a PvjsonEdge specifies ALL the points required for
* drawing the edge, so this function calculates any implicit points required
* to unambiguously specify an edge and returns the full set of points
* (implicit points are made explicit).
*
* @param explicitPoints {Array}
* @param [sourceEntity] {Object} entity from which the EDGE emanates
* (never an Anchor)
* @param [targetEntity] {Object} entity into which the EDGE terminates
* (never an Anchor)
* @return {Array} Full set of points required to render the edge
*/
export declare function calculateAllPoints(explicitPoints: (Point & SmartPoint)[], sourceEntity?: PvjsonNode | PvjsonEdge, targetEntity?: PvjsonNode | PvjsonEdge): Point[];