SvgNode instances are diagram nodes that can render SVG drawings.
Namespace: MindFusion.Diagramming
Package: SvgNode.js
JavaScript Copy Code |
---|
// class |
An SvgNode instance represents nodes that can display SVG drawings in addition to the rendering provided by the base ShapeNode class. The SVG drawing of a node is specified through its content property. The SVG graphics are loaded and associated with the node through an SvgContent object, which should be initialized and then assigned to content. Note that the MIME type of .svg files on server should be set to image/svg+xml.
The following code illustrates how to load SVG graphics from a server file and associate it with a new SvgNode:
JavaScript Copy Code |
---|
var node = diagram.factory.createSvgNode(bounds); node.transparent = true; // hide ShapeNode geometry var svg = new SvgContent(); svg.parse("image.svg"); node.content = svg; |
MindFusion.Diagramming.DiagramItem
MindFusion.Diagramming.DiagramNode
MindFusion.Diagramming.ShapeNode
MindFusion.Diagramming.SvgNode