Rendering mxGraph from XML doesn't render shapes from flowchart.xml

223 Views Asked by At

I'm trying to convert the XML of a mxGraphModel into a svg image using mxUtils and mxCodec like so:

   var doc = mxUtils.parseXml(xml);
   var codec = new mxCodec(doc);
   codec.decode(doc.documentElement, graph.getModel());

However, when a mxCell's shape is of the form, shape=mxgraph.flowchart.<some shape>, the shape shows up as a rectangle regardless of the flowchart shape.

For example, the XML for a mxCell is:

<mxCell id="81" value="Do Site&amp;nbsp;&lt;div&gt;Notes&lt;div&gt;Apply?&lt;/div&gt;&lt;/div&gt;" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.decision;whiteSpace=wrap;fillColor=#ffe6cc;strokeColor=#d79b00;fontStyle=1" parent="1" vertex="1">
      <mxGeometry x="672.9999999999999" y="-930.5" width="100" height="100" as="geometry"/>
</mxCell>

but it shows up as a rectangle when it should be a diamond shape.

I'm using mxgraph-3.7.2 and it has a flowchart.xml file located at mxgraph-3.7.2\javascript\examples\grapheditor\www\stencils\flowchart.xml.

Has anyone ever had the same issue? Am I missing something? Any help is appreciated.

0

There are 0 best solutions below