本文へ移動

@eightkk/vue-weave / core / toDrawio

Function: toDrawio() ​

toDrawio(graph, options?): string

Defined in: src/core/interchangeDrawio.ts:68

Write a diagram as an uncompressed draw.io file (mxfile with one diagram page holding an mxGraphModel). Nodes become vertex cells with the node ID, the label (and a line break and the detail) as value, a style for the shape (rounded=0, rounded=1, rhombus, ellipse, shape=hexagon; other shapes as rectangles) and the tone (fill and stroke colours plus vwTone; a label with a line break also as URI-encoded vwLabel), and the geometry from positions and sizes (default 144 by 58). Nodes without a position are placed with layoutLayeredGraph in options.direction. Groups become container cells (container=1) framing their members and nested groups, whose geometry is relative to the container as draw.io expects. Edges become edge cells in the layer with endArrow/startArrow for the markers, the edge style, flowAnimation=1 for animated edges and the waypoints. Cell IDs are the item IDs; an ID used twice (for example a node and an edge) gets a suffix, and the root and layer cells take 0 and 1 unless a node uses them. Throws the Errors and RangeErrors of NetworkGraph's input checks.

Parameters ​

graph ​

GraphInterchangeInput

options? ​

DrawioOptions = {}

Returns ​

string

MIT ライセンスで公開しています。