Published
Edited
May 2, 2022
1 star
Insert cell
Insert cell
## Changes in follower count

Following Musk's announcement on 2022-04-25, tectonic shifts occurred in the follower landscape. Compare the daily change in follower count for 50 liberal and 50 conservative Twitter celebrities.
Insert cell
liberal_follower_change = splitgraph`SELECT
"date",
avg("change") as avg_change
FROM
"neumark/theverge-post-elon-twitter-follows:latest"."file_4"
WHERE "change" is not NULL
GROUP BY date`
Insert cell
conservative_follower_change = splitgraph`SELECT
"date",
avg("change") as avg_change
FROM
"neumark/theverge-post-elon-twitter-follows:latest"."file_3"
WHERE "change" is not NULL
GROUP BY date`
Insert cell
Plot.plot({
y: {
grid: true
},
marks: [
Plot.line(liberal_follower_change, {x: "date", y: "avg_change", stroke: "#4e79a7"}),
Plot.line(conservative_follower_change, {x: "date", y: "avg_change", stroke: "#e15759"})
]
})
Insert cell
## Is Twitter leaning conservative?

The rate of change plot above is clearly demonstrates that Musk's bid favored the conservative celebrities as opposed to those on the liberal list. That said, the 50 liberal celebrities still have a _lot_ more followers than their conservative counterparts.

Insert cell
liberal_followers = splitgraph`SELECT
"date",
avg("followers") as average_followers
FROM
"neumark/theverge-post-elon-twitter-follows:latest"."file_4"
GROUP BY date`
Insert cell
conservative_followers = splitgraph`SELECT
"date",
avg("followers") as average_followers
FROM
"neumark/theverge-post-elon-twitter-follows:latest"."file_3"
GROUP BY date`;
Insert cell
Plot.plot({
y: {
grid: true
},
marks: [
Plot.line(liberal_followers, {x: "date", y: "average_followers", stroke: "#4e79a7"}),
Plot.line(conservative_followers, {x: "date", y: "average_followers", stroke: "#e15759"})
]
})
Insert cell
all_follows = (await splitgraph`
SELECT * FROM (
SELECT
display_name,
date,
followers,
'liberal' as affiliation
FROM "neumark/theverge-post-elon-twitter-follows:latest"."file_4"
WHERE date > '2022-03-28'::date AND display_name <> 'Barack Obama'
UNION
SELECT
display_name,
date,
followers,
'conservative' as affiliation
FROM "neumark/theverge-post-elon-twitter-follows:latest"."file_3"
WHERE date > '2022-03-28'::date
) a ORDER by display_name, date
`).reduce((acc, {display_name, date, followers, affiliation}) => {
acc[affiliation].push({display_name, date, followers});
return acc;
}, {conservative: [], liberal: []})
Insert cell
Insert cell
The above plot doesn't even include Barack Obama, who skews the data with his massive 113M followers.
Insert cell
## Appendix
Insert cell
import { splitgraph } from "@splitgraph/ddn"

Insert cell
import {Plot} from "@mkfreeman/plot-tooltip"

Insert cell
import {addTooltips} from "@mkfreeman/plot-tooltip"

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more