How to create a image file from a graph through the gremlin console?

690 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Marlon

ungelesen,
05.01.2018, 01:02:2905.01.18
an Gremlin-users
For example, given this graph:

gremlin> graph = TinkerFactory.createModern() (1) ==>tinkergraph[vertices:6 edges:6] gremlin> g = graph.traversal(standard()) (2) ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard] gremlin> g.V().has('name','marko').out('knows').values('name') (3)

How to print and save the graph into a file for visualization? I want a PNG or JPG file.

I am new to this and thanks for help.

Stephen Mallette

ungelesen,
05.01.2018, 07:05:1705.01.18
an Gremlin-users

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/062b9edc-1439-4d75-b0d3-305a7b7c8cd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kelvin Lawrence

ungelesen,
05.01.2018, 11:51:0405.01.18
an Gremlin-users
If you use Python at all, the networkx and matploitlib libraries can read a GraphML file and render it. I have used this in a Python Notebook with Gremlin Python running where I extracted a subgraph to GraphML and rendered it using Python.

The code would be along the lines of:

"import matplotlib
import matplotlib.pyplot as plt
import networkx as nx

G
= nx.parse_graphml(mygraph)

label
= nx.get_node_attributes(G, "code")
plt
.figure(figsize=(11,11))
nx
.draw(G, node_color="#ffaa00",node_size=1200,labels=label,arrows=False)


Apologies in advance if my Python is ugly I'm more of a Ruby and Groovy guy :-)

Cheers
Kelvin


On Friday, January 5, 2018 at 6:05:17 AM UTC-6, Stephen Mallette wrote:
On Fri, Jan 5, 2018 at 12:33 AM, Marlon <marl...@gmail.com> wrote:
For example, given this graph:

gremlin> graph = TinkerFactory.createModern() (1) ==>tinkergraph[vertices:6 edges:6] gremlin> g = graph.traversal(standard()) (2) ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard] gremlin> g.V().has('name','marko').out('knows').values('name') (3)

How to print and save the graph into a file for visualization? I want a PNG or JPG file.

I am new to this and thanks for help.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Marlon

ungelesen,
06.01.2018, 16:38:4206.01.18
an Gremlin-users
Hi, Stephen:

I it works. However, the default visualization looks very bad.  I imported the "tinkerpop-classic.xml"  from the TinkerPop gremlin's sample data directory and it looks very ugly. Please see the attached.

How difficult to make it looks like the "tinkerpop-modern.png" in the attachment.

Thanks.





On Friday, January 5, 2018 at 4:05:17 AM UTC-8, Stephen Mallette wrote:
On Fri, Jan 5, 2018 at 12:33 AM, Marlon <marl...@gmail.com> wrote:
For example, given this graph:

gremlin> graph = TinkerFactory.createModern() (1) ==>tinkergraph[vertices:6 edges:6] gremlin> g = graph.traversal(standard()) (2) ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard] gremlin> g.V().has('name','marko').out('knows').values('name') (3)

How to print and save the graph into a file for visualization? I want a PNG or JPG file.

I am new to this and thanks for help.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
tinkerpop-modern.png
t.png

Stephen Mallette

ungelesen,
06.01.2018, 17:47:2006.01.18
an Gremlin-users
gephi is a visualization tool. you have to apply layouts (and sometimes configure those layouts) to get it to look nice. dig into the gephi documentation a bit to find answers on how to do that. The "nice" pic you see was done by hand in omnigraffle - no special magic there.

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/8071f0f7-a68a-4c22-8450-17159180d965%40googlegroups.com.

Ling

ungelesen,
06.01.2018, 18:58:5006.01.18
an gremli...@googlegroups.com
Yes, I wanted to create a graph by hand for presentation. Gephi seems quite hard to use to make it look nice.

--
You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/g1UiOzrFE-M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/CAA-H43_2psFX5CWvozXfgTgHw5RTyvLriefV1XqzG_QWBYU2ag%40mail.gmail.com.

Stephen Mallette

ungelesen,
06.01.2018, 19:33:3906.01.18
an Gremlin-users
You can move all those vertices around manually if you like in gephi. You should be able to create presentation quality graphs with that tool. 

Zeph

ungelesen,
18.01.2018, 17:22:5618.01.18
an Gremlin-users
Is there a way to do this on larger graphs?

--
You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/g1UiOzrFE-M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gremlin-user...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Stephen Mallette

ungelesen,
18.01.2018, 17:28:5518.01.18
an Gremlin-users
I guess it depends on what you mean by "large". With Gephi and just about any visualization tool that i know of, your ability to deal with "large" is constrained by how much memory you have. Aside from memory issues, larger graphs will also take a longer time to get layouts executed and sensible for interpretation and presentation. So - I think the answer is that you can visualize just about any graph of any size provided you have the memory and time to do it.

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/8fe89d27-cb77-4e93-bd6e-64acb6e3f88d%40googlegroups.com.

Ashley E.

ungelesen,
18.01.2018, 19:49:5118.01.18
an gremli...@googlegroups.com
Yes, I am definitely running out of memory with this command. 

Stephen Mallette

ungelesen,
19.01.2018, 07:07:5119.01.18
an Gremlin-users
perhaps you've already done this but you can increase your -Xmx settings for Gephi to give it more memory if you have some available:


To unsubscribe from this group and all its topics, send an email to gremlin-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten