Confused with using DOT importer in the latest version

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Confused with using DOT importer in the latest version

ניב פגיר
Hi All,

first time using jgrapht, and I can't seem to use the newer DOTImporter, nor do I find proper documentation for it.

my dot string is simple (for now):
digraph graphname {
1->2
2->3
2->5
5->2
3->5}

I would like to have the vertices names be the ids from the dot string, however the DOTImporter
only receives a string supplier as an argument, which can't know the id of the input dot string,
I found the `addVertexAttributeConsumer` but I can't seem to remove the vertices created by the
supplier, moreover, creating new vertices doesn't create the edges (although that might be
possible to do with the `addEdgeConsumer` function, but I haven't got there yet).

I would appreciate some clarification or guidance to what I have missed and what is or isn't possible with DOTImporter.

Thanks,
Niv


_______________________________________________
jgrapht-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users
Reply | Threaded
Open this post in threaded view
|

Re: Confused with using DOT importer in the latest version

d-michail
This feature is missing in the new importers. It will be back in the next release. You have 
two options: 
  - either use the old importer from the 1.4.0 release, 
  - use the new importer from the 1.4.1-SNAPSHOT. This is available from maven, see our webpage on 
    how to use snapshot versions.  The new importer has a `VertexProvider` which you can set and bypass 
    the automatic vertex creation. You provide a function which receives the id from file as an argument and 
    creates the new vertex.

We will be releasing 1.4.1 soon.


Best, 
D.

‪On Sun, Jun 7, 2020 at 12:38 AM ‫ניב פגיר‬‎ <[hidden email]> wrote:‬
Hi All,

first time using jgrapht, and I can't seem to use the newer DOTImporter, nor do I find proper documentation for it.

my dot string is simple (for now):
digraph graphname {
1->2
2->3
2->5
5->2
3->5}

I would like to have the vertices names be the ids from the dot string, however the DOTImporter
only receives a string supplier as an argument, which can't know the id of the input dot string,
I found the `addVertexAttributeConsumer` but I can't seem to remove the vertices created by the
supplier, moreover, creating new vertices doesn't create the edges (although that might be
possible to do with the `addEdgeConsumer` function, but I haven't got there yet).

I would appreciate some clarification or guidance to what I have missed and what is or isn't possible with DOTImporter.

Thanks,
Niv
_______________________________________________
jgrapht-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users


_______________________________________________
jgrapht-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users