Open fkling opened 9 years ago
I decided to make this a lower priority. Over the last one/two years, many libraries for drawing graphs emerged. I think the main value of JSNetworkX is now to provide a comprehensive set of graph analysis methods.
Graph visualization is still going to be important if the library is used in the browser, but what exists now works well enough I think.
Does it mean that you will not work on WebGL migration for awhile? =/ I was hoping that, because I work with around 2k nodes =/
@beyssac: I actually have a WebGL implementation that works OK. The issue is that wasn't able yet to port all of the SVG functionality to the new style.
But because I only have limited time, I don't not currently plan make changes to the drawing system. However, I could create a separate branch with the changes I have so far for everyone to try who's interested. If someone wants to work on it so it can be merged into master, that would be great!
Sorry for my delay, what do you mean saying that you don't plan to make changes to the drawing system? As it is now, could I draw graphs in WebGL mode? I mean, when you say that you actually have a WebGL implementation that works ok, you are saying that you can draw with it, can't you?
If yes, I really would like to try it! Unfortunatelly I can not help in programming this part of the API for now =/
There currently is only the
draw
function which is like a one-of black box. It's not possible to make changes to the drawing config (without completely redrawing the graph), to extend it to support different kinds of visualization or different layouts.I already started working on rewriting this part a long time ago and think that it's a good opportunity to introduce it with the next release.
The drawing API will be evolve around an abstract
Visualization
class which exposes an API that allows easily update an existing visualization. This class can be subclassed to provide different implements. I already have one for SVG output (with D3) and WebGL (experimental, with Three.js). The configuration options will mostly stay the same, but the API is richer.Usage will look something like this:
An implementation might not support every method. E.g. the WebGL implementation currently doesn't support labels, so calling
v.labels()
will just do nothing. On the other hand, implementations might offer additional methods, e.g. the WebGL implementation providesv.camera
to the set the camera to be used.