English
@eightkk/vue-weave / core / fromGraphMl
Function: fromGraphMl()
fromGraphMl(
xml,options?):GraphInterchangeImport
Defined in: src/core/interchangeGraphMl.ts:288
Read a GraphML document into NetworkGraph nodes, edges, groups, positions and sizes. Uses the DOM-free XML reader of fromMsProjectXml: declared entities are never expanded and nothing outside the text is loaded. Values come from <data> whose <key> has the attr.name label (else name), detail, shape, tone, x, y, width and height for nodes and label, markerStart, markerEnd, edgeStyle, animated, dashed and points for edges, as toGraphMl writes them; <default> values apply. Other keys are ignored. yEd files are read as well: the first y:NodeLabel (its first line as label, the rest as detail), y:Geometry, y:Shape type or y:GenericNode configuration, and the y:EdgeLabel, y:Arrows and y:Path points of edges. A node with a nested <graph> is a group with the nodes in it as members (nested graphs nest groups). Edges get the IDs e1, e2, … when they have none; in an undirected graph (edgedefault="undirected" or directed="false") an edge without a marker has markerEnd: 'none'. Further top-level graphs, hyperedges and ports are reported as unsupported-element; see GraphInterchangeWarningCode for the rest.
Throws an Error for malformed XML (with the line and column), for a root element other than graphml and for a document without a graph, and a RangeError past maxItems.
Parameters
xml
string
options?
GraphInterchangeImportOptions = {}