電子データに関するデータ(ダイアグラム)であるサードパーティアプリケーションから作成されたカスタム xml があります。mxgraph で同じデータを書き換えたいと思います。
サードパーティ アプリケーションのサンプル xml を見つけてください
<component type="Rerror" mirrored="0" typeid="57" nodematch="0" macrotype="2" position="280,260" orientation="0">
<parameter idx="0" encrypted="0">
data unrelated to drawing here
</parameter>
<image>
<hotzone points="60,-10,-60,10"/>
<shape type="line" width="1" color="#0000ff" points="60,0,40,0"/>
<shape type="line" width="1" color="#0000ff" points="40,0,30,-10"/>
<shape type="line" width="1" color="#0000ff" points="30,-10,10,10"/>
<shape type="line" width="1" color="#0000ff" points="10,10,-10,-10"/>
<shape type="line" width="1" color="#0000ff" points="-10,-10,-30,10"/>
<shape type="line" width="1" color="#0000ff" points="-30,10,-40,0"/>
<shape type="line" width="1" color="#0000ff" points="-40,0,-60,0"/>
<legend text="0.332 MOhm" position="-36,20" orientation="0" fontname="Arial" fontsize="12" bold="0" italic="0" color="#229922"/>
<pin position="-60,0" dir="0" length="0" text="6"/>
<pin position="60,0" dir="0" length="0" text="3"/>
<label text="Rerror" position="250,236" textroot=" " orientation="0" color="#228822"/>
</image>
</component>
上記の xml は、mxgraph を使用して解析および再描画する必要があります。どこ
component : 特定の単位の全体像です (多くのコンポーネントが存在する可能性があります)
パラメータ : このセクションは無視する必要があります
画像: 画像部分には、グラフに描画する必要がある x、y 座標のデータが含まれます
mxgraph ユーザー ガイドを調べていたのですが、mxgraph は初めてです。「mxUtils.parseXml('location')」を使用して、xml の通常のフレーズを確認できました。
カスタム ファイルの解析方法を教えてください。