<div dir="ltr"><div dir="ltr">The data structures here are all opaque, which is why their representations in the terminal don't see very useful. To get the label, you use the digraph:vertex/2 or digraph:edge/2 functions. You can discover this by reading the documentation and search for label, these are the only functions that have a label anywhere in their return types. You can traverse the whole graph by using digraph:vertices/1 and then get the label and edges for each vertex from there (and get the label of each edge along the way).</div><div dir="ltr"><br><div>Usage of digraph would look something like:</div><div><br></div><div><div>1> Scene10 = digraph:new().</div><div>{digraph,#Ref<0.1177877097.1300365313.19691>,</div><div>         #Ref<0.1177877097.1300365313.19692>,</div><div>         #Ref<0.1177877097.1300365313.19693>,true}</div><div>2> digraph:add_vertex(Scene10, "Franco", "Old and fat").</div><div>"Franco"</div><div>3> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").</div><div>"Sophia"</div><div>4> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").</div><div>['$e'|0]</div><div>5> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").</div><div>['$e'|1]</div><div>6> digraph:vertex(Scene10, "Franco").</div><div>{"Franco","Old and fat"}</div><div>7> digraph:edges(Scene10, "Franco").</div><div>[['$e'|1],['$e'|0]]</div><div>8> [digraph:edge(Scene10, E) || E <- digraph:edges(Scene10, "Franco")].</div><div>[{['$e'|1],"Sophia","Franco","hates"},</div><div> {['$e'|0],"Franco","Sophia","loves"}]</div></div><div><br></div><div>Using digraph in the shell is probably not an ideal user experience because it uses ets tables behind the scene, and they'll be destroyed when your shell process crashes (e.g. the first time you make a mistake!).</div><div><br></div><div>Searching for "erlang digraph graphviz" comes up with a few projects that seem relevant to your visualization needs.</div><div><br></div><div>-bob</div><div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 8, 2019 at 8:33 PM Lloyd R. Prentice <<a href="mailto:lloyd@writersglen.com">lloyd@writersglen.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Many thanks, Richard. I’ll definitively follow up.<div><br></div><div>Can you tell me how to return the labels?</div><div><br></div><div>All the best,</div><div><br></div><div>Lloyd<br><br><div id="gmail-m_-4242166328077720425AppleMailSignature" dir="ltr">Sent from my iPad</div><div dir="ltr"><br>On Apr 8, 2019, at 8:46 PM, Richard O'Keefe <<a href="mailto:raoknz@gmail.com" target="_blank">raoknz@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">The obvious way to visualise a graph would be to drive</div><div class="gmail_default" style="font-family:monospace,monospace">something like GraphViz or Gephi or, ideally, UbiGraph</div><div class="gmail_default" style="font-family:monospace,monospace">(<a href="https://github.com/alan86alves/ubigraph_server" target="_blank">https://github.com/alan86alves/ubigraph_server</a> has a</div><div class="gmail_default" style="font-family:monospace,monospace">copy of the Linux x86-64 version; the official source</div><div class="gmail_default" style="font-family:monospace,monospace">is currently unreachable).  There is an erlubi. But</div><div class="gmail_default" style="font-family:monospace,monospace">perhaps the thing you might want to look at first is</div><div class="gmail_default" style="font-family:monospace,monospace"><a href="https://github.com/aol/erlgraph" target="_blank">https://github.com/aol/erlgraph</a></div><div class="gmail_default" style="font-family:monospace,monospace">It will take a bit of patching to get up to date with</div><div class="gmail_default" style="font-family:monospace,monospace">current versions of Erlang and Cowboy.<br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 9 Apr 2019 at 11:29, <<a href="mailto:lloyd@writersglen.com" target="_blank">lloyd@writersglen.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="2" face="arial"><p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">1> Scene10 = digraph:new().</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Imagine:</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Setting:"park"</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Character1:"Franco"</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Character2:"Sophia"</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">2> digraph:add_vertex(Scene10, "Park", "Night").</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">3> digraph:add_vertex(Scene10, "Franco", "Old and fat").</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">OK to here EXCEPT command 5 returns:</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">['$e'|0]</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">OK to here EXCEPT command 5 returns:</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">['$e'|0]</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">['$e'|1]</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Wah!</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Question 1: How do I see labels?</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">Many thanks,</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt">LRP</p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
<p style="margin:0px;padding:0px;font-family:arial;font-size:10pt"> </p>
</font>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>
</div></blockquote></div></div>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>