箭頭形狀
箭頭形狀可以使用以下簡單的語法來指定和命名。終端符號以粗體字顯示,非終端符號以斜體字顯示。文字字元以單引號括起來。方括號 [
和 ]
括住可選項目。垂直條 |
分隔替代方案。
語法
arrowname | : | aname [ aname [ aname [ aname ] ] ] |
aname | : | [ modifiers ] shape |
modifiers | : | [ 'o' ] [ side ] |
side | : | 'l' |
| | 'r' | |
shape | : | box |
| | crow | |
| | curve | |
| | icurve | |
| | diamond | |
| | dot | |
| | inv | |
| | none | |
| | normal | |
| | tee | |
| | vee |
基本形狀
形狀 | 影像 |
---|---|
box |
![]() |
crow |
![]() |
curve |
![]() |
diamond |
![]() |
dot |
![]() |
icurve |
![]() |
inv |
![]() |
none |
![]() |
normal |
![]() |
tee |
![]() |
vee |
![]() |
形狀修飾符
至於修飾符
'l'
- 剪裁形狀,只留下邊緣左側的部分。
'r'
- 剪裁形狀,只留下邊緣右側的部分。
'o'
- 使用形狀的開放(未填充)版本。
左邊和右邊的定義是從邊緣看向箭頭「接觸」節點的位置所決定的方向。
舉例來說,箭頭形狀 lteeoldiamond
會被解析為 'l' 'tee' 'o' 'l' 'diamond'
,並且對應到以下形狀

請注意,指定的第一個箭頭形狀最接近節點。後續的箭頭形狀(如果指定)則會距離節點更遠。此外,none
形狀會使用空間,因此,例如,箭頭形狀 nonenormal
與 normal
不同。
並非所有語法上合法的修飾符組合都具有意義或語義有效。例如,沒有任何修飾符對 none
有任何意義。下表指出哪些修飾符允許用於哪些形狀。
修飾符 | 'l'/'r' |
o |
---|---|---|
box |
✅ | ✅ |
crow |
✅ | |
curve |
✅ | |
diamond |
✅ | ✅ |
dot |
✅ | |
icurve |
✅ | |
inv |
✅ | ✅ |
none |
||
normal |
✅ | ✅ |
tee |
✅ | |
vee |
✅ |
這產生 42 種不同的箭頭形狀。可選的第二、第三、第四個形狀可以獨立地是 42 種中的任何一種,但最後一個不能是 none
,因為這樣會產生多餘的形狀。因此,有 41 × 42³ + 41 × 42² + 41 × 42 + 42 = 3,111,696 種不同的組合。
以下顯示包含單個箭頭形狀的 42 種可能組合。附加到箭頭的節點不會繪製,但會出現在邊緣的右側。
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
box | lbox | rbox | obox | olbox | orbox |
![]() |
![]() |
![]() |
|||
crow | lcrow | rcrow | |||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
diamond | ldiamond | rdiamond | odiamond | oldiamond | ordiamond |
![]() |
![]() |
||||
dot | odot | ||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
inv | linv | rinv | oinv | olinv | orinv |
![]() |
|||||
none | |||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
normal | lnormal | rnormal | onormal | olnormal | ornormal |
![]() |
![]() |
![]() |
|||
tee | ltee | rtee | |||
![]() |
![]() |
![]() |
|||
vee | lvee | rvee | |||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
curve | lcurve | rcurve | icurve | licurve | ricurve |