graphviz MRecord 跨越多行 – 无法复现?

huangapple go评论55阅读模式
英文:

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.

graphviz MRecord 跨越多行 – 无法复现?

... 但是,如果我使用Kroki https://kroki.io/#try 进行绘图 - 那么它却可以正常工作?!

graphviz MRecord 跨越多行 – 无法复现?

所以,我的问题是:

  • 在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=&quot;A.11 Access Control|&quot;+
&quot;aa&quot;];
}

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 &quot;,&quot;, &quot;;&quot;, &quot;&lt;&quot;, &quot;\&quot;&quot;, &quot;]&quot;, NUMBER or UNICODE_STRING but &quot;+&quot; found.:

graphviz MRecord 跨越多行 – 无法复现?

... however, if I plot using Kroki https://kroki.io/#try - then it works?!

graphviz MRecord 跨越多行 – 无法复现?

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&#178;. 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"];
}

Giving:
graphviz MRecord 跨越多行 – 无法复现?

英文:

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&#178;. In addition, double-quoted  
strings can be concatenated using a &#39;+&#39; 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 (&quot;)
B11[ shape = Mrecord, label=&quot;B.11 Access Control|\
BBB&quot;];
}

Giving:
graphviz MRecord 跨越多行 – 无法复现?

huangapple
  • 本文由 发表于 2023年6月5日 18:32:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76405563.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定