Creating Network Graphs

AI-generated summary

The discussion, titled “Creating Network Graphs” under the Data & reporting category with the sql-query tag, explores methods for visualizing interactions within a Discourse instance using network graphs. Conor_McCarthy initiates the conversation, seeking advice on creating such graphs to analyze user connections, group sizes, and influence via likes, suggesting tools like flourish. EricGT proposes a technical approach involving exporting data from Discourse’s PostgreSQL database, importing it into Neo4j (a NoSQL graph database), and using Cypher to analyze relationships, with a suggestion to keep the data synchronized via PostgreSQL triggers or Discourse webhooks. thefreekick shares a practical example using Flourish, based on a deprecated Google chart, showing bidirectional likes, user group colors, line thickness for interaction frequency, and bubble size for like ratios, with a link to a live visualization. merefield adds a link to a similar community network visualization project.

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!

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

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:

I built this as an online visualisation: Community Network Visualisation