GEXF
Imports a graph represented as an XML string in the GEXF format, and makes it a JointJS graph. Learn more about the GEXF plugin.
Functionsβ
toCellsArray()β
gexf.toCellsArray(
xmlString: string,
makeElement: (opt: gexf.ElementOptions, xmlNode: Node) => dia.Element,
makeLink: (opt: gexf.LinkOptions, xmlEdge: Node) => dia.Link
): Array<dia.Cell>;
Parametersβ
xmlStringβ
An XML string representing a graph in GEXF format.
makeElement(data)β
A function that takes an object with id
and label
(and width
, height
, x
, y
, z
, color
, shape
if present
in the XML) properties, and returns a JointJS element for this node.
makeLink(data)β
A function that takes an object with source
and target
properties, and returns a JointJS link for that edge.
Typesβ
ElementOptionsβ
interface ElementOptions {
id: string | number;
label: string;
width?: number;
height?: number;
x?: number;
y?: number;
z?: number;
color?: string;
shape?: string;
}
LinkOptionsβ
interface LinkOptions {
source: string;
target: string;
}