第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

GRAPHVIZ:強(qiáng)制節(jié)點(diǎn)位于頁(yè)面頂部

GRAPHVIZ:強(qiáng)制節(jié)點(diǎn)位于頁(yè)面頂部

我正在使用 graphviz,但是我想將節(jié)點(diǎn)“This on top”強(qiáng)制到頁(yè)面頂部,而不是側(cè)面。這是圖表:這是代碼:g= Digraph('trial', filename='trial.gv')g.attr(compound='true', rankdir="TB" )with g.subgraph() as s:  s.attr(rank='max')  s.node('This on top ')  s.edge('this right under', "Fabrication")with g.subgraph(name='cluster0') as c:    c.node("This")    c.node("that")    c.node("and this on the same level")g.edge("this right under","that", lhead="cluster0" )g.edge("that","This on top ", ltail="cluster0" )g是否有命令可以確保節(jié)點(diǎn)按我希望的頂部/底部順序顯示?
查看完整描述

1 回答

?
HUH函數(shù)

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超4個(gè)贊

第一個(gè)問(wèn)題是,設(shè)置強(qiáng)制rank='max'第一個(gè)子圖中的所有內(nèi)容達(dá)到最高等級(jí),即最低等級(jí)。您可能打算設(shè)置rank='min'將子圖中的項(xiàng)目置于最高等級(jí),但這仍然無(wú)法創(chuàng)建您想要的排列。


相反,您可以通過(guò)在創(chuàng)建邊緣時(shí)進(jìn)行設(shè)置來(lái)使用不可見(jiàn)邊緣style = 'invis',以強(qiáng)制“此在頂部”位于“此在右下”之前。


from graphviz import Digraph


g= Digraph('trial', filename='trial.gv')

g.attr(compound='true', rankdir="TB" )


with g.subgraph() as s:

  # s.attr(rank='min') # you don't need this line

  s.node('This on top ')

  s.edge('This on top ', 'this right under', style='invis') # add this invisible edge

  s.edge('this right under', "Fabrication")


with g.subgraph(name='cluster0') as c:

    c.node("This")


    c.node("that")

    c.node("and this on the same level")

g.edge("this right under", "that", lhead="cluster0" )

g.edge("that", "This on top ", ltail="cluster0", constraint="false" )


g

其產(chǎn)生:

https://img1.sycdn.imooc.com/654099ab000148b306530271.jpg

查看完整回答
反對(duì) 回復(fù) 2023-10-31
  • 1 回答
  • 0 關(guān)注
  • 188 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)