Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dot-app does not import UTF-8 files correct #19

Open
StoltHD opened this issue Jul 25, 2020 · 8 comments
Open

dot-app does not import UTF-8 files correct #19

StoltHD opened this issue Jul 25, 2020 · 8 comments
Assignees

Comments

@StoltHD
Copy link

StoltHD commented Jul 25, 2020

Double Byte Characters like the Scandinavians do not get importert correct with dot-app ...

Can you please update the libraries/parser to someting that support to support UTF-8 ...?

@bdtfitts
Copy link
Collaborator

bdtfitts commented Aug 2, 2020

Hi there,
Thanks for reaching out about your problem. I've taken a crack at this, and before I publish it to the Cytoscape app store I wanted to run it by you. I've attached a ZIP file that contains the updated version of dot-app that should fix the problem. I made some changes so that when importing and exporting DOT files, it should read them as UTF-8.
dot-app-0.9.6.jar.zip

@bdtfitts bdtfitts self-assigned this Aug 2, 2020
bdtfitts pushed a commit that referenced this issue Aug 2, 2020
Fixed issue #18 by adding the logic to handle the tooltip attribute.
Fixed issue #19 by setting the Charset for the InputStreamReader and the
OutputStreamWriter to UTF-8. This change also means that all Graphviz
files used for import must be saved with UTF-8 encoding in order to
ensure correctness.
@StoltHD
Copy link
Author

StoltHD commented Aug 2, 2020 via email

@bdtfitts
Copy link
Collaborator

bdtfitts commented Aug 2, 2020

Regarding the newlines in the labels:
Do the files from Gramps do newlines in the labels such as
label="this is a\nmultiline label" or do they do
label="this is a
multiline label"
?
I ask because the issue seems to be a case of undefined behavior and how the developer of the parser ended up implementing the DOT Grammar. I've noticed with a few different GraphViz viewers that some allow input graphs to have linebreaks in label attributes and others do not.
On The DOT Language page they specify that HTML like strings can use newlines for formatting, but they don't specify that same ability with double quoted strings. On that page they specify that double quoted strings can physically span multiple lines by putting \ before the newlines, but that has no effect on rendering the label as multiple lines. On the escString section of the Node, Edge, Graph Attributes Page, they mention that linebreaks can be added by using \n, \l, and \r for centered, left-justified, and right-justified with no mention of being able to add breaks to labels through physical linebreaks.

@StoltHD
Copy link
Author

StoltHD commented Aug 2, 2020 via email

@StoltHD
Copy link
Author

StoltHD commented Aug 4, 2020

I have looked a little more at the problem with "unsupported" graphviz files...
I looks like the problem is graphs with "subgraphs cluster".

I created two files from a addon to Twine called dotgraph, there I can define the same network graphs with and without subgraph clusters, the file without the subgraph cluster opens without problem, the files with subgraph clusters will not open.

The files from Gramps also have subgraph cluster, so I think that is the issue here.

I don't know if it's because you use an aged library, or what it is.

But the subgraph cluster in graphviz would be something like a node group or maybe subgraph in Cytoscape.

The way its used in in the export from Twine is most like a group based on TAG's (those TAG's also set a color that are imported correctly to Cytoscape).

I don't know if its possible for you, but maybe you could create a select box:

Will you convert subgraph cluster to:
[ ] A Group
[ ] Nested network
[ ] Ignore all subgraph clusters

Or just create groups directly (Just add an infobox about it, maybe?)
The clusters in Graphviz can use the attribute "Style=Invis", I dont know whats possible with groups in Cytoscape, but it seems that if its possible to set the Group attribute "Double-Click Action" and "Visualization for group", it would be enough for most people... the rest of any settings, attributes for groups can be set manually.

But the important thing is to just be able to import subgraph cluster from any graphviz file

Only thing is, if a node belong to multiple subgrpah clusters, the FDP layout do not seem to support that, but it seems that the rest do (just for information).

Hopefully this was for some help, if you want me to create a new issue for the subgraph cluster problem, just let me know.

Thanks again for looking into this.

@StoltHD
Copy link
Author

StoltHD commented Aug 4, 2020

Here are some links to examples explaining the subgraph and subgraph cluster feature in Graphviz.
https://renenyffenegger.ch/notes/tools/Graphviz/elems/subgraph/index
https://graphviz.org/Gallery/directed/cluster.html

@StoltHD
Copy link
Author

StoltHD commented Aug 10, 2020

I hope you will be able to find a fix to the problem with files with subgraphs not being supported... Do you want me to make new issue with it?

@bdtfitts
Copy link
Collaborator

Yes, go ahead and open a separate issue for the subgraph and I'll take a look into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants