← Back

Recreating a
dumbbell plot

November 26, 2024

This week I recreated a dumbbell plot from the New York Times on interstate moves in the United States and their relationship to election results. Ronda Kaysen and Ethan Singer participated in its creation.

Warning: Data may be inaccurate compared to the source.

Recreation

Vt.Mass.Md.HawaiiCalif.N.Y.R.I.Conn.Wash.Del.Ill.Ore.N.J.Colo.N.M.Va.MaineN.H.Minn.Mich.Nev.Pa.Wis.Ariz.Ga.N.C.Fla.TexasOhioIowaAlaskaS.C.Kan.Mo.Ind.Miss.Mont.La.Neb.UtahTenn.Ala.Ky.S.D.Ark.IdahoOkla.N.D.W.Va.Wyo.+64 D+66 D+52 D+38 D+56 D+55 D+57 D+49 D+45 D+22 D+41 D+49 D+39 D+32 D+34 D+18 D+39 D+4 R+42 D+12 D+3 R+17 D+17 D+26 R+12 D+2 R+40 R+20 R+1 D+24 R+25 R+36 R+18 R+19 R+3 R+37 R+46 R+14 R+28 R+49 R+48 R+49 R+29 R+63 R+57 R+70 R+53 R+41 R+41 R+80 RVotersmoving in2020result+50DTied+50RVoters who moved into the 25states Biden won in 2020tended to be more Democraticthan their neighborsAnd likewise, voters who movedinto the 25 states Trump wontended to be more Republicanthan their neighbors

Highlights

This is the first time I've done a dumbbell plot with D3. When I was learning D3, a few months ago, I thought there must be a part of the code where you identify what you are going to create, something like “type=dumbbell”. I quickly realized that it's all about lines, circles, and rectangles.