Comments (11)
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.
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\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):
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\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:
from scala-graph.
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.
I think we should alter toID to quote only if required explicitely. Would you agree?
from scala-graph.
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.
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.
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.
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.
Thanks for you support @peter-empen 🎄 The fix works. Waiting for the next official version.
from scala-graph.
See Release Notes 1.10.0. I'd appreciate your feedback since several other things changed...
from scala-graph.
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)
- Insertions are not in constant time HOT 5
- Does scalagraph have the notion of a sourced graph? HOT 3
- Adding code for graph layout HOT 6
- Scala.js 1.1.0 support HOT 1
- Problem when trying to convert JSON to a Graph HOT 7
- Weird behaviour for diSuccessors, diPredecessors and isDirectPredecessorOf when node is connected to himself. HOT 3
- Constrained User Guide example is not reproducible HOT 3
- Wrong Operations in EqSetFacade HOT 1
- Finding all paths in a graph from node A to node B HOT 2
- Open issues for 2.x HOT 7
- Switch from Travis CI to Github Actions HOT 4
- Enable Scala-Steward on this project HOT 2
- Double (1.0) node is unexpectedly considered as self-successor HOT 9
- type inference not working for .toOuter; Scala 3, scala-graph 1.13.2 HOT 3
- Traversing mutable graphs in multi-thread HOT 4
- Topological sort may not return a node in a cycle when it fails HOT 1
- No potential Scala-Native release? HOT 2
- Documentation issue HOT 1
- persistent data structure HOT 1
- Can't extend Edges in case class in scala 3 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala-graph.