Code Monkey home page Code Monkey logo

Comments (11)

peter-empen avatar peter-empen commented on September 27, 2024

Christopher,
as stated in the documentationGraph for Scala produces DOT language according to http://www.graphviz.org/content/dot-language. There you can read: "An ID is just a string; the lack of quote characters in the first two forms is just for simplicity...". I cannot see any rule for id's on the side you are pointing to.

So which DOT parser are you invoking? It should process the output you blame invalid.
Aside, please update your dependency to graph-json 1.9.2.
Peter

from scala-graph.

metc avatar metc commented on September 27, 2024

Thanks for your answer.
Please fin bellow a more concrete example (from http://www.graphviz.org/doc/info/shapes.html):

digraph structs {
    node [shape=record];
    struct1 [label="<f0> left|<f1> middle|<f2> right"];
    struct2 [label="<f0> one|<f1> two"];
    struct3 [label="hello&#92;nworld |{ b |{c|<here> d|e}| f}| g | h"];
    struct1:f1 -> struct2:f0;
    struct1:f2 -> struct3:here;
}

This code produce the following output (using DOT):
1156412078_f3145366e6_o

And now the same example, with double quotes ("") around ID connections:

digraph structs {
    node [shape=record];
    struct1 [label="<f0> left|<f1> middle|<f2> right"];
    struct2 [label="<f0> one|<f1> two"];
    struct3 [label="hello&#92;nworld |{ b |{c|<here> d|e}| f}| g | h"];
    "struct1:f1" -> "struct2:f0";      # <<-- HERE
    "struct1:f2" -> "struct3:here";    # <<-- HERE
}

This last code (generated using graph-dot 1.9.0) will produce this output:
chart

from scala-graph.

metc avatar metc commented on September 27, 2024

Using record and Mrecord shapes, IDs have a ':' character to specify the node of the shape. This is valid and quotes must not be added around the ID.

IMHO, the toID function must be modified (see https://github.com/scala-graph/scala-graph/blob/master/dot/src/main/scala/scalax/collection/io/dot/Export.scala#L151).

Thanks for you help Peter, regards.

from scala-graph.

peter-empen avatar peter-empen commented on September 27, 2024

I think we should alter toID to quote only if required explicitely. Would you agree?

from scala-graph.

metc avatar metc commented on September 27, 2024

Yes, or just add || s.contains(":")) s at line 150 ?
Sorry, currently I do not have the time to create the pull request and add the test case. And I don't really know how to build the project from sources.

from scala-graph.

metc avatar metc commented on September 27, 2024

Any chance got get an update soon ?
Can you provide any help to compile and export a standalone Jar of dot using sbt ?

from scala-graph.

peter-empen avatar peter-empen commented on September 27, 2024

Hi, I was working on the implementation of a significantly better approach. According to that we'll have DOT IDs and DOT node_ids as separate case classes and syntax checks prior to creation. Unfortunately I could not finish this work in due time and right now I'm on holiday with little opportunity to get it done.
For the time being you could alter the code as suggested and build a new jar with sbt package. I could do the same passing a temporalily avalilable jar to you. Whichever you like.

from scala-graph.

peter-empen avatar peter-empen commented on September 27, 2024

You'll find a snapshot with your suggested modification at http://www.scala-graph.org/temp/.
You may use this jar in your sbt project as a so called unmanaged library by putting it into a 'lib' folder right under the root folder and removing the original dependency.

from scala-graph.

metc avatar metc commented on September 27, 2024

Thanks for you support @peter-empen 🎄 The fix works. Waiting for the next official version.

from scala-graph.

peter-empen avatar peter-empen commented on September 27, 2024

See Release Notes 1.10.0. I'd appreciate your feedback since several other things changed...

from scala-graph.

metc avatar metc commented on September 27, 2024

The dot generation of Mrecord shapes works correctly with graph-dot 1.10.0 using NodeId.
Thank you for this new official version @peter-empen !

from scala-graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.