Bug 508830 - Add support for EscString and LblString attributes (DOT Editor and DOT Graph View)
Summary: Add support for EscString and LblString attributes (DOT Editor and DOT Graph ...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF DOT (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 511164
Blocks: 508869 321775
  Show dependency tree
 
Reported: 2016-12-07 09:20 EST by Alexander Nyßen CLA
Modified: 2018-11-14 03:43 EST (History)
3 users (show)

See Also:


Attachments
For reference only! Patch as described in comment #5 (16.30 KB, patch)
2018-07-13 10:32 EDT, Zoey Gerrit Prigge CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Nyßen CLA 2016-12-07 09:20:57 EST
While general support for DOT attributes is covered in bug #461506, specific parsers for EscString and LblString (including HTML-labels as needed by bug #321775) is not yet supported. We should introduce respective parsers and serializers to DotLanguageSupport and use them within DotAttributes.
Comment 1 Matthias Wienand CLA 2017-01-30 11:42:32 EST
I implemented a custom grammar for HTML-like labels as well as validation checks for generating warnings when invalid tags or attributes (i.e. not supported by Graphviz) are used. We still need to define a grammar for EscString and define a top level datatype LblString that can represent either EscString or HtmlLabel. Then, we can delegate to either parser/serializer depending on the context ("<...>" vs. '"..."').
Comment 2 Matthias Wienand CLA 2017-02-13 08:03:24 EST
Pushed the following changes:
 - Ensure construction of EscString for empty strings.
 - Allow parsing of HTML tags where the opening tag does not match the closing tag, but report errors for such tags.
 - Add test cases for empty EscString, deeply nested HTML tags, and case insensitive matching of opening and closing tags.
 - Enhance validation messages for HtmlLabel.
Comment 3 Tamas Miklossy CLA 2017-02-18 09:58:56 EST
I adapted the DOT Html like labels sub-grammar to be able to parse the following inputs correctly: 

<BR ALIGN="LEFT"/> (Get rid of the ambiguous grammar elements by excluding the " symbol from the TEXT terminal rule).

<FONT POINT-SIZE="24.0">line3</FONT> (allow das in the html attribute names).
test cases based on the sample graphs found on the official Graphviz website: http://www.graphviz.org/doc/info/shapes.html
Comment 4 Tamas Miklossy CLA 2018-05-13 04:55:55 EDT
I pushed the following changes to origin/master:

[508830] Improve DOT Graph View visualization of edge EscString labels.

- Improve the Dot2ZestAttributesConverter to handle the '\n' escaped
sequences contained by the 'label', 'xlabel', 'headlabel' and
'taillabel' edge attribute values.
- Implement corresponding Dot2ZestEdgeAttributesConversionTests test
cases.
Comment 5 Zoey Gerrit Prigge CLA 2018-07-13 10:19:42 EDT
As arisen from bug #534707, Tamás and I have decided to implement \E, \N, \G, \H, \T, \L replacement support in Dot2ZestAttributesConverter at this point only.

There has been discussion, if this replacement could be implemented on a deeper level, e.g. by adding to the DotAttributes API/generation and/or implementing this in the ID class.

I had provided an experimental version on SHA 18c18da which I will, for future reference, attach as a patch.

We should discuss this option further and decide whether we should (re)move changes that are to be made in Dot2ZestAttributesConverter as part of resolving bug #534707 at a later point.
Comment 6 Zoey Gerrit Prigge CLA 2018-07-13 10:32:01 EDT
Created attachment 274975 [details]
For reference only! Patch as described in comment #5
Comment 7 Tamas Miklossy CLA 2018-07-14 09:43:35 EDT
I pushed the following changes to origin/master:

[508830] Ensure DOT Graph View properly handles '\n' in node labels.

- Modify the Dot2ZestAttributesConverter to decode the line breaks in
node labels properly. Example: graph {1[label="a\nb"]}
- Implement corresponding Dot2ZestGraphCopierTests and
Dot2ZestNodeAttributesConversionTests test cases.