【发布时间】:2020-09-13 19:42:59
【问题描述】:
我在节点上有一些长标签。因为节点是相互连接的(当然),因此完全相同的标签出现在几个地方,每次我需要编辑其中一个时,我都必须手动更改它们多次,这是时间-消耗和容易出错(或复制一次,然后查找+替换;这只是稍微不那么烦人)。
所以,不要像这样:
digraph {
"Some very long label" -> "Another label with elaborate text"
"Some very long label" -> "Red blue green yellow"
"Another label with elaborate text" -> "Blah bleh bleh blah"
"Blah bleh bleh blah" -> "Sooo annoying! Really!"
}
我想做一些这样的事情(编造的语法):
digraph {
// Structure:
#A -> #B
#A -> #C
#B -> #C
#B -> #D
#D -> #E
// Label definitions:
#A: "Some very long label"
#B: "Another label with elaborate text"
#C: "Red blue green yellow"
#D: "Blah bleh bleh blah"
#E: "Sooo annoying! Really!"
}
这可能吗?
【问题讨论】: