How to make graph out of seqential data - elasticsearch

I am new to whole elastic stack so pardon me if this is basic. But looking into docs I can't find way how to make following graph.
I am feeding elasticsearch with data that looks like this. [{place:'a', time:0, user:1}, {place: 'b', time:1, user:1}, {place:'c', time:2, user:1}, {place:'a', time: 3, user:1}] It is describing path which user went. So for this one a->b->c->a, and some other one could go c->d->a->d->c.
Is is possible to make graph with vertices made out of places and edges describing where users went?

You can't create this visualisation, but its open issue in github

Related

How to do data modelling for a flowchart?

I've a requirement to persist a flowchart built by users into database. Until now, I've been using BLOBs to store the flowchart image. But I want to serialize the flow chart and persist them as a structured data.
For example, a flow chart will have start and end, process box, input/output box, decision flow etc. All these elements will be connected by arrows. I'm blanking out on how to model data structure that will store this information. Any tips would be appreciated?
Sorry, but this question is too vague.
Perhaps the best question to start off asking yourself:
Q: Do I really want to invent my own format, or find an existing "flowchart"
format that does what I need?
If you want to invent your own, I'd strongly suggest:
Using JSON or XML (instead of something completely ad-hoc), and
Finding JSON or XML examples for storing "graphs" (nodes, edges, etc).
Here is one such example: http://jsongraphformat.info/
But then your next challenge would be how to DISPLAY your flowchat, after you've read it from the database.
ANOTHER SUGGESTION:
Assume, for example, you're using Visio. I'd just store the .vsd in your database!

Custom node position in dagree-d3

I have a directed acylic graph done with dagre-d3. Is there any possibility to put a node in a different level and change the position of a node with some code? This library has some 'rank constraints' but it looks like in the latest version it's not working. My current suggestion is adding some links and hide them after that, but it's the last possible option and I really want to avoid it.
Currently, my graph looks as follow and my goal is put one cluster under other

GraphViz Node Organization

I am trying to organize the nodes to be in a specific way but no matter what I try, I just cannot do it. I am trying to get close to this:
I have many variations but here is what I have so far: https://gist.github.com/wpsmithtwc/3f82433d11b2e99cc65382bf231aa04c
(see GraphViz fiddle).
Any suggestions?

Arango single tree response using AQL only

I have found several questions that are similar but no solution worked as needed, or used internal functions. This is the most relevant one:
Getting data for d3 from ArangoDB using AQL (or arangojs)
I'm unable to understand how to return a single response with a tree structure of parent + children. Something that D3 can understand. Whatever I do, beyond the first iteration, everything is a mess. I have tried MERGE and MERGE_RECURSIVE but it just did not work as I thought of.
I'm clueless to how I can make it to work. I'm used to Neo4J and for some reason this one is just hard for me to understand.
Any help will do,
Thanks,
DD.
I found a simple solution. I'm just using AQL to get a flat list of results and their edges. After that, I just sort it as I need on my code

Neo4j visualisation-manipulate the graph

I am currently using Neo4j Python rest client and I would like to visualise the graph and be able to amend it, add new nodes relationships etc. Also I would like the changes in the neo4j database as well. Is that possible? Also can self-loops be visualised? I have read about D3.js and Neoclipse and Gephi in http://www.neo4j.org/develop/visualize but I am not sure which one to use.
Thanks in advance.
You can manipulate the graph in Neo4J using Cypher, in particular using a the REST API.
Any kind of tool that allows you to interface with Cypher is potentially able to do what you are asking: it is a matter to combine some Cypher queries with the GUI.
Said that, create the right visualization for what you are doing might be tricky and general approach might no satisfy your needs: while Neoclipse can let you manipulate nodes and links in Neo4J (for free) you might want to do in a particular way (for example restricting the choice of editing or the field/properties to be changed).
Linkurious offers a solution to do that as well, but it's a commercial license.
Other solutions such KeyLines, d3.js, sigmaJS let you personalize that experience: note that they will require to create the interface yourself, but the result will be much better in case of a specific product IMHO.
So value your time and requirements and go with the proper solution.
For more tools have a look at the Neo4J visualization page: http://www.neo4j.org/develop/visualize
About self loops:
that's a tricky bit and there is not a right way to do those - imagine a scenario with hunders of multi-selfloops.
Personally I would recommend to NOT draw them on the chart as link/edges, while representing them in some other ways: es. glyphs, notes, bubbles on the node...
I believe the only tool that allows this today is Neoclipse, but I don't think it's updated to use the Labels and Indexing features released in 2.0.
As such, your best bet will be using the Neo4j Browser to visualize and Cypher to mutate your graph. If you want richer functionality and want a fun project to hack on, it shouldn't be super hard to build a basic visualization for Neo that allows mutating the graph. I would have a look at sigma.js: http://linkurio.us/sigma-js-1-0-next-gen-graph-drawing-lib-web/

Resources