Skip to main content

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;
}