如何可视化 GraphML 多树?

机器算法验证 数据可视化 软件 图论
2022-04-01 13:17:40

我有一个多树,它代表育种计划中所有鱼群的谱系。它存储为带有fish_id,sire_id和的双重邻接表dam_id这意味着一个特定的鱼群只直接知道它的父母(如果有的话)并且对后代一无所知。我可以方便地将这些数据输出为GraphML文档,但我很难找到一个可以在给定简单输入的情况下显示多树的查看器。InfoVis可以,但需要对结构进行详细和冗余的描述。Cytoscape Web可以采用 GraphML 对象,但不能自动布局多树(它是最好的,但我想要分层布局)。有谁知道另一种选择?

我的 GraphML 看起来像这样:

<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns 
        http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
    <key id="currentfish" for="node" attr.name="cfish" attr.type="string">
        <default>#ffff00</default>
    </key>
    <key id="parcount" for="edge" attr.name="parcount" attr.type="int"></key>
    <key id="parenttype" for="edge" attr.name="parenttype" attr.type="string"></key>
    <key id="fish" for="node" attr.name="fish" attr.type='string'></key>
    <graph id="G" edgedefault="directed">
        <node id='f22'>
            <data key='fishname'>ZS6181</data>
        </node>
        <edge id='es_23' source='f57' target='f23'>
            <data key='parcount'>0</data>
            <data key='parenttype'>sire</data>
        </edge>
        <node id='f23'>
            <data key='fishname'>90716</data>
        </node>
        <edge id='ed_23' source='f42' target='f23'>
            <data key='parcount'>0</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f24'>
            <data key='fishname'>ZS6377</data>
        </node>
        <node id='f25'>
            <data key='fishname'>ZS6375</data>
        </node>
        <edge id='ed_26' source='f25' target='f26'>
            <data key='parcount'>10</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f26'>
            <data key='fishname'>ZS6375 F1</data>
        </node>
        <edge id='es_26' source='f25' target='f26'>
            <data key='parcount'>10</data>
            <data key='parenttype'>sire</data>
        </edge>
        <node id='f27'>
            <data key='fishname'>ZS56181 F1</data>
        </node>
        <edge id='es_27' source='f43' target='f27'>
            <data key='parcount'>9</data>
            <data key='parenttype'>sire</data>
        </edge>
        <edge id='ed_27' source='f43' target='f27'>
            <data key='parcount'>9</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f28'>
            <data key='fishname'>ZS6377 F1</data>
        </node>
        <edge id='es_28' source='f44' target='f28'>
            <data key='parcount'>7</data>
            <data key='parenttype'>sire</data>
        </edge>
        <edge id='ed_28' source='f44' target='f28'>
            <data key='parcount'>7</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f29'>
            <data key='fishname'>100128 AB</data>
        </node>
        <edge id='es_30' source='f25' target='f30'>
            <data key='parcount'>10</data>
            <data key='parenttype'>sire</data>
        </edge>
        <node id='f30'>
            <data key='fishname'>ZS6375 F1A</data>
        </node>
        <edge id='ed_30' source='f25' target='f30'>
            <data key='parcount'>10</data>
            <data key='parenttype'>dam</data>
        </edge>
        <edge id='ed_31' source='f45' target='f31'>
            <data key='parcount'>0</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f31'>
            <data key='fishname'>AB 100223</data>
        </node>
        <edge id='es_31' source='f25' target='f31'>
            <data key='parcount'>0</data>
            <data key='parenttype'>sire</data>
        </edge>
        <edge id='es_32' source='f45' target='f32'>
            <data key='parcount'>0</data>
            <data key='parenttype'>sire</data>
        </edge>
        <edge id='ed_32' source='f45' target='f32'>
            <data key='parcount'>0</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f32'>
            <data key='fishname'>AB 100319</data>
        </node>
        <edge id='es_33' source='f32' target='f33'>
            <data key='parcount'>8</data>
            <data key='parenttype'>sire</data>
        </edge>
        <edge id='ed_33' source='f31' target='f33'>
            <data key='parcount'>8</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f33'>
            <data key='fishname'>AB 100714</data>
        </node>
        <edge id='ed_34' source='f28' target='f34'>
            <data key='parcount'>10</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f34'>
            <data key='fishname'>AB 100715</data>
        </node>
        <edge id='es_34' source='f59' target='f34'>
            <data key='parcount'>10</data>
            <data key='parenttype'>sire</data>
        </edge>
        <edge id='ed_35' source='f27' target='f35'>
            <data key='parcount'>4</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f35'>
            <data key='fishname'>AB 100722</data>
        </node>
        <edge id='es_35' source='f28' target='f35'>
            <data key='parcount'>5</data>
            <data key='parenttype'>sire</data>
        </edge>
        <node id='f36'>
            <data key='fishname'>ZS6377 F2</data>
        </node>
        <edge id='es_36' source='f28' target='f36'>
            <data key='parcount'>8</data>
            <data key='parenttype'>sire</data>
        </edge>
        <edge id='ed_36' source='f28' target='f36'>
            <data key='parcount'>6</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f37'>
            <data key='fishname'>ZS6375 F2</data>
        </node>
        <node id='f38'>
            <data key='fishname'>100730 AB</data>
        </node>
        <edge id='es_39' source='f34' target='f39'>
            <data key='parcount'>6</data>
            <data key='parenttype'>sire</data>
        </edge>
        <edge id='ed_39' source='f38' target='f39'>
            <data key='parcount'>6</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f39'>
            <data key='fishname'>110208</data>
        </node>
        <node id='f40'>
            <data key='fishname'>110412</data>
        </node>
        <edge id='ed_41' source='f27' target='f41'>
            <data key='parcount'>2</data>
            <data key='parenttype'>dam</data>
        </edge>
        <node id='f41'>
            <data key='fishname'>110413</data>
        </node>
        <edge id='es_41' source='f24' target='f41'>
            <data key='parcount'>5</data>
            <data key='parenttype'>sire</data>
        </edge>
        <node id='f42'>
            <data key='fishname'>90318</data>
        </node>
        <node id='f43'>
            <data key='fishname'>ZS56181-90705</data>
        </node>
        <node id='f44'>
            <data key='fishname'>ZS6377-90913</data>
        </node>
        <node id='f45'>
            <data key='fishname'>ZS56181</data>
        </node>
        <node id='f57'>
            <data key='fishname'>90317</data>
        </node>
        <node id='f59'>
            <data key='fishname'>ZS63775 F1</data>
        </node>
    </graph>
</graphml>
1个回答

你试过GraphViz吗?这是一个使用 GraphML的教程。