Thanks to the Data Explorer Plugin and the query that @riking created, we have a great visualization of the interaction in our
instance.
![]()
You can also play with it.
It's easy to do it:
1 - Install Data Explorer plugin
2 - Run the riking query or an modified version of it.
We use a version that only extracts from a specific group
WITH pairs AS (
SELECT p.user_id liked, pa.user_id liker
FROM post_actions pa
LEFT JOIN posts p ON p.id = pa.post_id
WHERE post_action_type_id = 2
)
SELECT liker liker_user_id, liked liked_user_id, count(*)
FROM pairs, group_users AS a, groups AS b
where ( liker = a.user_id
and a.group_id = b.id
and b.name ilike 'group1' )
and
liked in (select c.user_id from group_users AS c, groups AS d
where
c.group_id = d.id
and d.name ilike 'group1' )
GROUP BY liked, liker
ORDER BY count DESC
You could do it another modified version of the SQL query that filter by period
WITH pairs AS (
SELECT p.user_id liked, pa.user_id liker
FROM post_actions pa
LEFT JOIN posts p ON p.id = pa.post_id
WHERE post_action_type_id = 2 AND
p.created_at >= CURRENT_DATE - INTERVAL '1 month'
)
SELECT liker liker_user_id, liked liked_user_id, count(*)
FROM pairs, group_users AS a, groups AS b
where ( liker = a.user_id
and a.group_id = b.id
and b.name ilike 'group1' )
and
liked in (select c.user_id from group_users AS c, groups AS d
where
c.group_id = d.id
and d.name ilike 'group1' )
GROUP BY liked, liker
ORDER BY count DESC
3 - Download the .csv
5 - Upload the .csv
6 - Add a network chart
![]()
![]()
Options: check "link is directional" to see who gives or receives likes from who and "color by columns" to see who receives more than gives or vice versa.
![]()
7 - Visualization!
In order to visualize names instead of ids, you only have to change the query to show usernames too, but be careful with data privacy! ![:smile: :smile:]()