Creating Network Graphs

Hi all,

Does anyone have any tips on creating a network graph of interactions across a Discourse instance? For example, to be able to gauge the relative size of groups, how they relate to each other, who are the “most connected” people (by likes etc), all visualised in a network graph?

I’m guessing the requires a third-party service like flourish so if anyone has any expertise in creating graphs that would be useful too!

Thanks in advance!

3 Likes

If I were going to do this I would

  1. Pull down a backup of the site and load it into a PostgreSQL database; PostgreSQL is the database backing Discourse. (ref)

  2. Create a NoSQL database, specifically Neo4j, from the PostgreSQL data. (ref)

  3. Use the Neo4j query language Cypher to find the realtionships.

Neo4j has a sandbox, you might find the Panama Papers example of interest.


EDIT

Once the Neo4j database is up an working to keep the Neo4j database in sync with the Discourse PostgreSQL database I would use either

a. PostgreSQL triggers
b. Discourse webhooks

6 Likes

I did one on Flourish last week. It’s based on this example that no longer works because Google discontinued their network fusion chart.

It’s showing

  • likes between users in both directions
  • colours to highlight groups
  • thickness of lines to show the number of likes
  • bubble size to show the like ratio for each user (posts/likes)

My example has so many data points it’s difficult to read but I was just experimenting with it anyway. Reducing the number of users or the time period etc would make it cleaner.

Screenshot of selected user below:

6 Likes