Icon

Visualizing Twitter Network with a Chord Diagram

<p><strong>Visualizing Twitter Network with a Chord Diagram</strong></p><p>In this workflow, we will:</p><ul><li><p>Use the <em>Table Reader</em> node to read the dataset listing tweets with hashtag #KNIME between end of July 2021-beginning of August 2021 (1 week).</p></li><li><p>Filter the data using the <em>Row Filter</em> node and then aggregate the data to get the number of retweets between every pair of users in both directions using the <em>GroupBy </em>node.</p></li><li><p>Apply <em>Cross Joiner</em> and <em>Pivoting </em>nodes to create a weighted adjacency matrix listing each pair of users in two different cells, one for each retweet direction.</p></li><li><p>Visualize the connections in a chord diagram created by the d3 script in the <em>Generic JavaScript View</em> node.</p></li><li><p>Visualize the connections using a <em>Network Viewer</em> node.</p></li></ul>
Visualizing Twitter Network with a Chord Diagram and a Traditional Network View

In this workflow, we will:

  • Use the Table Reader node to read the dataset listing tweets with hashtag #KNIME between end of July 2021-beginning of August 2021 (1 week).

  • Filter the data using the Row Filter node and then aggregate the data to get the number of retweets between every pair of users in both directions using the GroupBy node.

  • Apply Cross Joiner and Pivoting nodes to create a weighted adjacency matrix listing each pair of users in two different cells, one for each retweet direction.

  • Visualize the connections in a chord diagram created by the d3 script in the Generic JavaScript View node.

  • Visualize the connections using a Network Viewer node.

Visualization

Use JavaScript to create a view with the chord diagram representing the network.

Data access

For more information on how to access Twitter data check the following workflow in the Examples space:
https://hub.knime.com/s/D8z-TRJRqqYA5MCx

Transformation

Counting retweets among top 20 retweeted users and creating the weighted adjacency matrix of the Twitter network.

Visualization

Use the Network Viewer node to create a more "traditional" network view with no code.

count retweets between each pair
Compute how often users retweet each other
reading tweets data
Table Reader
plot chord diagram
Generic JavaScript View (JavaScript) (legacy)
Create Network
create adjacency matrix weighted on the number of retweets
Create matrix input matrix for chord plot
Network Viewer

Nodes

Extensions

Links