3
我用這點代碼爲我的測試:格拉帕的Graphviz點可視化問題和問題
digraph G { edge [dir=none];
p1 [shape=circle,style=filled,label="",height="0.01",width="0.01"];
q1 [shape=circle,style=filled,label="",height="0.01",width="0.01"];
q2 [shape=circle,style=filled,label="",height="0.01",width="0.01"];
q3 [shape=circle,style=filled,label="",height="0.01",width="0.01"];
{rank=same; father->p1; mother->p1};
{rank=same; q1->q2->q3};
{rank=same; son1; daughter1; daughter2};
p1->q2;
q1->son1;
q2->daughter1;
q3->daughter2;
}
我的Java代碼來創建圖形如下:
Graph graph = null;
graph = program.getGraph();
JScrollPane jsp = new JScrollPane();
jsp.getViewport().setBackingStoreEnabled(true);
GrappaPanel gp = new GrappaPanel(graph);
gp.addGrappaListener(new GrappaAdapter());
gp.setScaleToFit(false);
jsp.setViewportView(gp);
的輸出這個:Link
爲什麼Tree格式錯了?是否有可能讓樹顯示從左到右?