我在 draw.io 中创建了一个形状并将其导出以获取其 XML 文件,如下所示:
<mxlibrary>[{"xml":"vZTNcoIwEMefJnckXjxarF7aXvoEKawk05Blwirap+8SooLa0XbaZoaZ7H8/sssPImRW7VZe1foZC7BCPgqZeUTqd9UuA2tFmphCyIVI04QfkS6/8E6CN6mVB0f3JKR9wlbZDfRKLzS0t1EoPW5qIR88kiL1FuSE7ZgJnmA3Oj1H5yA/hB5bGHUVQmNLK8AKyO85pDUF6Rgxi2kaTKkPaTKKqonNHXNPQ/Imznl9Znkx8wsSNBeD89yugCKO22pD8FqrvPO2DIw1TRUfspjwttGqwPZgkMd3yNCiD6VkFhZ71sbagT4Lq9PR0UBfhsW6sqZ0rFlYU1eYzzeufArWYtpRgcZ8DKhUuB1YUJghsjGZJNS32M69x7aJyt2YhzjTn+H8DZrT21/wX4A8A9O9H5MrO48yYX0V1xjPObz/5rMfY7j59yXf58Xm6TYLvtFl9wk=","w":190,"h":130,"aspect":"fixed","title":"notes"}]</mxlibrary>
是否可以使用此数据插入新顶点?我什至不知道从哪里开始。
您正在查看使用以下方式压缩的 XMLDeflate https://en.wikipedia.org/wiki/DEFLATE压缩算法。显然,您需要在使用它之前将其解压缩。
JGraph https://github.com/jgraph,的创造者出色的 Draw.io https://www.draw.io/绘图/图表应用程序,提供在线解压转换工具 https://jgraph.github.io/drawio-tools/tools/convert.html。这是mxGraphModel
使用该工具解压后与压缩数据关联:
<mxGraphModel>
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="" style="group;rotatable=0;" vertex="1" connectable="0" parent="1">
<mxGeometry width="190" height="130" as="geometry"/>
</mxCell>
<mxCell id="3" value="Notes" style="rounded=0;whiteSpace=wrap;html=1;shadow=1;strokeColor=#CCCCCC;fillColor=#999999;fontColor=#FFFFFF;align=left;spacingLeft=4;resizable=0;movable=0;editable=0;connectable=0;allowArrows=0;rotatable=0;" vertex="1" parent="2">
<mxGeometry width="190" height="30" as="geometry"/>
</mxCell>
<mxCell id="4" value="" style="rounded=0;whiteSpace=wrap;html=1;shadow=1;strokeColor=#CCCCCC;align=left;verticalAlign=top;spacingLeft=4;movable=0;resizable=0;connectable=0;allowArrows=0;rotatable=0;" vertex="1" parent="2">
<mxGeometry y="30" width="190" height="100" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
也可以看看从 mxfiles 中提取 XML https://about.draw.io/extracting-the-xml-from-mxfiles/ on the Draw.io https://www.draw.io/ site.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)