英文:
graphviz MRecord spanning multiple lines - cannot reproduce?
问题
所以,我看到了https://stackoverflow.com/questions/3838717/records-spanning-over-multiple-lines-in-graphviz,然后我试图创建一个更简单的测试 - 最终变成了这样:
graph G{
A11[ shape = Mrecord, label="A.11 Access Control|"+
"aa"];
}
所以,我试图在线测试这个 - 具有讽刺意味的是,https://graphviz.org 推荐的绘图工具http://magjac.com/graphviz-visual-editor/ 在这个示例上失败,显示Expected "," , ";" , "<" , "\"", "]" , NUMBER or UNICODE_STRING but "+" found.
:
... 但是,如果我使用Kroki https://kroki.io/#try 进行绘图 - 那么它却可以正常工作?!
所以,我的问题是:
-
在Graphviz的某些版本中,是否支持这种"分割行"的方式,而在其他版本中不支持?或者我可能犯了什么其他错误?
-
如果版本是问题,我如何知道哪些
graphviz
版本支持这种"分割行"的方式 - 以及我如何知道,这个或那个在线绘图工具是否支持这种行分割方式(除了粘贴示例并让它通过或失败)?
英文:
So, I've seen https://stackoverflow.com/questions/3838717/records-spanning-over-multiple-lines-in-graphviz and I tried to come up with a simpler test - which ended up being this:
graph G{
A11[ shape = Mrecord, label="A.11 Access Control|"+
"aa"];
}
So, I tried to test this online - ironically, the plotter recommended by https://graphviz.org themselves, which is http://magjac.com/graphviz-visual-editor/, fails on this example with Expected ",", ";", "<", "\"", "]", NUMBER or UNICODE_STRING but "+" found.
:
... however, if I plot using Kroki https://kroki.io/#try - then it works?!
So, my questions are:
-
Is this way of "splitting lines" in graphviz supported for some versions, and not for others? Or what other mistake could I have made?
-
If versioning is the problem, how do I get to know which
graphviz
versions support this kind of "line splitting" - and how do I get to know, if this or that online plotter, supports this kind of line splitting (aside from pasting the example and letting it pass or fail)?
答案1
得分: 1
以下是您要翻译的内容:
"The bug is in "Graphviz Visual Editor" (provided by a Graphviz developer, but not part of the Graphviz package).
Using the command line dot, both versions of the concatenation syntax work.
From the language spec (https://graphviz.org/doc/info/lang.html):
As another aid for readability, dot allows double-quoted strings to span
multiple physical lines using the standard C convention of a backslash
immediately preceding a newline character². In addition, double-quoted
strings can be concatenated using a '+' operator.
If you want/need to use the "Graphviz Visual Editor", this works:
graph G{
// use backslash (\) at end-of-line
// note, no internal double-quotes (")
B11[ shape = Mrecord, label="B.11 Access Control|\
BBB"];
}
英文:
The bug is in "Graphviz Visual Editor" (provided by a Graphviz developer, but not part of the Graphviz package).
Using the command line dot, both versions of the concatenation syntax work.
From the language spec (https://graphviz.org/doc/info/lang.html):
As another aid for readability, dot allows double-quoted strings to span
multiple physical lines using the standard C convention of a backslash
immediately preceding a newline character². In addition, double-quoted
strings can be concatenated using a '+' operator.
If you want/need to use the "Graphviz Visual Editor", this works:
graph G{
// use backslash (\) at end-of-line
// note, no internal double-quotes (")
B11[ shape = Mrecord, label="B.11 Access Control|\
BBB"];
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论