如何使用点创建依赖树
尝试创建依赖树。尽管我已经设法将盒子连接在一起,但我未能以更具代表性的方式使其看起来像一棵树。
digraph G{
m1[shape=box, color=grey, style=filled]
m2[shape=box, color=grey, style=filled]
m3[shape=box, color=grey, style=filled]
m4[shape=box, color=grey, style=filled]
m5[shape=box, color=grey, style=filled]
p1[shape=diamond,color=lightblue, style=filled]
p2[shape=diamond, color=lightblue, style=filled]
p3[shape=diamond, color=lightblue, style=filled]
p4[shape=diamond, color=lightblue, style=filled]
{rank=sink;x1;x2;x3;x4;}
{rank=source;y1;}
{rank=same;m3;p3;x11;x5;x6;x7;x8;}
node[shape=circle]
y1 -> x9
y1 -> m5
x10 -> m4
x10 -> p4
x9-> m3
x9-> p3
x6 ->m1
x6 ->p1
x5 ->m1
x5 ->p1
x8 -> m2
x8 -> p2
x7 -> m2
x7 -> p2
y1 -> x10
y1 -> x12
x5 -> x1
x5 -> x2
x6 -> x1
x6 -> x2
x7 -> x3
x7 -> x4
x8 -> x3
x8 -> x4
x9 -> x6
x9 -> x5
x9 -> x11
x10 -> x8
x10 -> x7
}
我没能创造出类似的东西
trying to create a dependency tree. although i have managed to get the boxes connect together, i have failed to make it looks like a tree in a more representable way.
digraph G{
m1[shape=box, color=grey, style=filled]
m2[shape=box, color=grey, style=filled]
m3[shape=box, color=grey, style=filled]
m4[shape=box, color=grey, style=filled]
m5[shape=box, color=grey, style=filled]
p1[shape=diamond,color=lightblue, style=filled]
p2[shape=diamond, color=lightblue, style=filled]
p3[shape=diamond, color=lightblue, style=filled]
p4[shape=diamond, color=lightblue, style=filled]
{rank=sink;x1;x2;x3;x4;}
{rank=source;y1;}
{rank=same;m3;p3;x11;x5;x6;x7;x8;}
node[shape=circle]
y1 -> x9
y1 -> m5
x10 -> m4
x10 -> p4
x9-> m3
x9-> p3
x6 ->m1
x6 ->p1
x5 ->m1
x5 ->p1
x8 -> m2
x8 -> p2
x7 -> m2
x7 -> p2
y1 -> x10
y1 -> x12
x5 -> x1
x5 -> x2
x6 -> x1
x6 -> x2
x7 -> x3
x7 -> x4
x8 -> x3
x8 -> x4
x9 -> x6
x9 -> x5
x9 -> x11
x10 -> x8
x10 -> x7
}
i have failed to create something like
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的图表对我来说看起来并没有那么糟糕。要更接近您的模型图片,可以执行以下操作:
splines=false
)ranksep=1
)edge[tailport=s]
)这是修改后的图:
可能还有更多事情可以做,具体取决于您到底想要什么。
Your graph didn't look that bad to me. To get a little closer to your mockup picture, here's what could be done:
splines=false
)ranksep=1
)edge[tailport=s]
)Here's the modified graph:
There's probably more that could be done, depending on what exactly you're after.