I'm looking for a way to plot or visualize a graph made in Erlang using the digraph module. In the manual pages I can't find any function for doing this.
How do I plot or visualize a graph?
For desktop application, pure wx is one choice.
[wx graph] [1]https://www.erlang.org/doc/man/wxgraphicspath
I think you have to write many program for developing your necessary api because wx's api not enough.
I have used wx just before, erlang's wx is not active. It's document's and Q&A is not enough, Time cost is high.
Another choice may be to use wx + webview, send the data to javascript to show graph by it.
It save your save to develop above mentioned necessary api.
Third choice may be to use dart/flutter as client, erlang as server to send data. In this choice, no need wx.
Related
I watched Laszlo's talk about time travel debugging in Elm (https://youtu.be/lK0vph1zR8s) and in his presentation he used the signal graph to visualize the effects of the time traveling. Now you can use the debugger with the elm-reactor, but I see no option to turn on the signal graph visualization. There was a discussion about this: https://groups.google.com/forum/#!msg/elm-discuss/24jTnaChA6g/9WipFs9PBwAJ
Are there any news about it?
In general, is there a possibility to generate the signal graph for an Elm program?
Thanks in advance.
The talk by Laszlo is already quite old, considering the rapid development of the Elm language. At that talk he showed a hacked up prototype based on a slightly adapted Elm runtime. The time traveling debugger (elm-reactor) was the tool that resulted from expanding on his work.
The discussion you link to on the mailing list is the last one that I'm aware of about adding signal graphs to the Reactor.
At the time (IIRC), Laszlo generated the graph using an adapted runtime implementation of Signals. Every Signal node in the graph had a string identifying the kind of node. By running the Elm program, the graph was set up. Then the graph was traversed and recorded in a simple data structure. The string was used to identify the kind of each node. This was then sent to the server, which employed graphviz to render the graph.
So it's certainly possible to generate the graph like that. Although one observation was that it lost some of the more high-level information available in your program because some Signal functions are defined in terms of others.
Is there a free tool out there that would allow me to generate a directed/undirected weighted graph?
I'm thinking about something that I can draw the graph on some sort of canvas and then save it in a file in adjacency list format or egde list format, or any other common format.
Have you hear about Neo4j? Check it out maybe it's what you need:
http://www.neo4j.org/
This is Wikipedias definition:
Neo4j is an open-source graph database, implemented in Java. The developers describe Neo4j as "embedded, disk-based, fully transactional Java persistence engine that stores data structured in graphs rather than in tables".
If you're using Java (or Jython or other Java-compatible language) and want a Swing graphical component, JGraphX is a decent library, though this may be higher-level than what you want (since the adjacency list/matrix is a detail internal to the library).
JGraph is also available in .NET, PHP, and JS.
Code: https://github.com/jgraph/jgraphx
Documentation: http://jgraph.github.io/mxgraph/
I find something: Gephi.
I can draw a graph and save/export it in multiple formats.
Hope this answer helps others.
http://gephi.github.io/
Although asking for tools is off-topic at Stack Overflow, I can recommend Bandage for visualization of sequence assemblies.
Recently I explored some libraries where I can visualize graphs from Neo4j, but didn't get a clear view wich one to choose, so I have a couple thought I'd like to share.
My requirements and wishes - after search throught REST API with cypher query visualize graphs with all relationships, nodes. And result make interactive - able to drag/drop... opportunity to reveal other nodes/rels on click. Import nodes throught json data and be able to show quickly up to at least 400 elements.
So I more or less explored further libraries:
Three.js - mostly for 3D. (If I don't need 3D then better not to choose this one)
Arbor.js - drawing leaves up to you, mostly layout library
VivaGraphJS - easy to use, but almost no documentation :(
D3.js - Looks fine, but uses SVG
Cytoscape.js - looks fine, but I read that I can't use it with Neo4j. Is D3.js the right choice for real-time visualization of Neo4j Graph DB data why?
Processing.js - have it's own language similar to Java. I'm not so much in Java-like language (yet).
And I have a couple questions:
1) Whats your experience - benefits, weakneses of libraries?
2) I suppose I want to use canvas insted of SVG? (a lot of small elements on the screen).
3) Arbor is special library for layout, but others don't have layout algorithms or what?
I'll appreciate any opinion! :-)
I pondered a similar situation. I chose sigma.js.
1) Whats your experience - benefits, weakneses of libraries?
sigma.js is specific to graph rendering. d3 is a full on toolbox for visualization. Since I only want to draw graphs, the concise sigma.js interface was easier to work with. I think this is the video where the creator talks about how sigma.js is able to do incremental rendering and thus perform better and handle more vertices/edges smoothly.
2) I suppose I want to use canvas insted of SVG? (a lot of small
elements on the screen).
sigma.js renders to the canvas.
Here are the sigma.js examples. The "hide nodes" example shows mouse interactions. Additionaly, here is a blog post showing how one can easily integrate neo4j w/ sigma using a very minimal amount of data massaging code written in node.js. It would be easy to port this to any server language.
I don't see sigma.js in that list which you might want to take a look at as it is very useful (example)
You will have to somehow handle the rendering of the received data (i.e. go from a data structure to its visual representation) and this depends on what are you trying to show / say with that visualisation, how you want to do it and how you want it to look like.
As a starting point, i would go with D3 and Sigma.
I note that Gephi is not on your list. As a standalone visualiser/editor, its the best that I have used (you just get the neo4j plugin, and it will import the source files of the database and let you view it). Its also Open Source, so you can include it as part of a project.
Also missing from your list is the yFiles family of graph visualization libraries.
The JavaScript variant of if uses both Canvas, WebGL, and SVG. This can give very good performance and high-quality visualizations at the same time. For hair-ball-like graphs (thousands of dots and lines, but probably no text) you can use WebGL and Canvas and when you zoom in to actually make sense of the data, you can use SVG to get detailed high-quality visualizations with labels, icons, data-bound visualizations, etc. You can use both techniques in the same visualization, even at the same time, benefiting from the best of both worlds (demo).
Connecting yFiles to Neo4j is easy using the JavaScript Bolt driver.
Aiming at 400 elements in the view is a good idea. While larger graphs tend to look really nice, most of the time you won't gain a lot of insights by looking at "hair-balls". These almost artistic visualizations all look very similar and as such carry little to no information. Often you could just as well display a static image showing the first google image search hit for a "hairball graph" query :-)
In order to better support the user during exploration, filtering, grouping, nesting, and dynamic interaction should be added to the viewer application. How this can be implemented, very much depends on the business domain in the visualization, though and there are only very few generic approaches that work for generic graphs.
Disclaimer: I work for the company that creates the above mentioned visualization library. I do not represent it on SO, though.
This is a fairly advanced topic related to directed graphs. I am looking into NOSQL technology for a project. In particular, using graph databases. It's a perfect fit in supporting the rich model I want to save relationships for and the problem domain is a graph itself (vertices and edges). Now obviously this made me look at Neo4j and other vendors in this space. Now I believe they def have solved or closed the gap with persisting data in a graph data structure way...which is perfect.
However my requirement goes further where there is a need to understand a specification of a directed graph to create an actual instance of a 'directed graph', such that particular rules and constraints are adhered to when actually creating the graph. The graph database doesn't concern itself with this which is correct and wouldnt want it too (happy that it's agnostic of this). The problem is this leaves it a little open ended as what ensures that the graph complies with your graph rules (ie that certain nodes can have certain relationships or even have relationships to other nodes). What should I be using that will allow me to specify the specification/metadata of the directed graph such that when creating an instance of it at runtime it adheres correctly to it's
specification.
Any help or suggestions on what is available or what is the standard way to approach this would be appreciated
I think you should take a look at Spring Data Graph, http://www.springsource.org/spring-data/neo4j that is as close as you get in having a powerful mapping layer that can project rules etc, much like JPA or Hibernate.
WDYT?
/peter
In working on a shortest path algorithm across a network I would like to generate a picture of the network. I'd like to represent nodes (circles), links (lines), cost to traverse the link (number in the middle of the link line), and capacity of the link (number on the link line next to the node it represents) in the picture. Is there any library/software out there that would help to automate creating this picture?
I can do this manually in Visio or with some drawing application but I'd like to generate them from code as I change/tweak the network.
Sounds like a job for GraphViz , it generates graphs from a short text description file. I've used it to produce connected node graphs and I believe it should be possible to add link labels, as you require.
If you're using python, Nodebox draws pretty graphs.
One of the big problems in displaying networks like this is figuring out where to put the nodes on the display screen. If arranging nodes is logically simple given your network, then an off-the-shelf product is likely to suit your needs.
If the arrangements are much more complicated, you may have to accept a certain amount of manual intervention to get this to work with off-the-shelf stuff, or byte the bullet and program the whole thing yourself.
.NET is one choice, and once you've mastered the Graphics class it's easy to use and plenty fast for something like this. However, there are probably better languages/platforms than .NET for something graphics-oriented like this.
Update: .NET is much better for 2D graphics than I knew. The key is finding a fast workaround to the pitifully slow GetPixel() and SetPixel() methods in the Bitmap class. Once you can read and write individual pixels easily and quickly, you can do whatever you want as a programmer.
Did you by chance check out the R programming language? I'm not positive but I believe that you can make images and such out of graphs. r-project.org
There are a bunch of visualizations of various algorithms here: Algorithmics Animation Workshop