Zero Truths & 117 Lies

Whigham Rachel Covington
Data Mining the City
3 min readNov 20, 2017

Numerous media sources have reported lies told by 45 since inauguration day. Each circle represents a lie which is color coded by media source. The fact which disproves the lie is listed below.


import csv
import textwrap
data = []

def setup():
size(1000, 800)

def draw():
scalar = 20
background(255)
stroke(205)
noFill()

with open("trumplies.csv")as f:
reader = csv.reader(f)
header = reader.next()

global ids
ids=[]

global publications
publications= ['NYT', 'Washington Post', 'Politifact', 'DNA Info', 'PEW Research', 'CNN', 'TIME', 'USA Today', 'NBC News', 'Buzzfeed', 'Fact Check']
# publication = "NYT"

global topics
topics=['immigration', 'economy', 'obamacare', 'obama', 'legislation', 'media', 'Russia', 'Crime', 'Elections', 'environment', 'personal spending', 'administration' ]

global dates
dates=[]

global lies
lies=[]

global explanations
explanations=[]

for row in reader:
id = int(row[0])
ids.append(id)

publication = (row[5])
publications.append(publication)

topic = (row[4])
topics.append(topic)

date = (row[1])
dates.append(date)

lie =(row[2])
lies.append(lie)

explanation =(row[3])
explanations.append(explanation)

translate(100, 100)
i = id
for row in xrange(9):
for col in xrange(13):
x = col * 60
y = row * 60
'''
fill(255)
stroke(205)
ellipse(x, y, 40, 40)'''
#for publication in publications:
publication = publications[i-116]
if publication == "NYT":
fill(22, 57, 69)
ellipse(x,y, 40, 40)
#navy
elif publication == "Washington Post":
fill(232, 68, 62)
ellipse(x,y, 40, 40)
#poppy
elif publication == "CNN":
fill(76, 111, 147)
ellipse(x, y, 40, 40)
#eletric blue
elif publication == "Politifact":
fill(199, 182, 87)
ellipse(x, y, 40, 40)
#lime
elif publication == "DNA Info":
fill(121, 175, 210)
ellipse(x, y, 40, 40)
#light blue
elif publication == "PEW Research":
fill(237, 222, 111)
ellipse(x, y, 40, 40)
#yellow
elif publication == "TIME":
fill(113, 208, 180)
ellipse(x, y, 40, 40)
#seafoam
elif publication == "USA Today":
fill(244, 115, 83)
ellipse(x, y, 40, 40)
#lighter poppy
elif publication == "NBC News":
fill(121, 175, 210)
ellipse(x, y, 40, 40)
#lighter blue
elif publication == "Buzzfeed":
fill(186, 7, 61)
ellipse(x, y, 40, 40)
#dark mauve
elif publication == "Fact Check":
fill(232, 160, 193)
ellipse(x, y, 40, 40)
#mauve/light pink
else:
fill(121, 180, 196)
ellipse(x, y, 40, 40)
i += 1
fill(200)
textSize(12)
textAlign(CENTER,CENTER)
text(i-120, x, y)

# interactivity variables
ellipseWidth = 40


textPositionX = 500
textPositionY = 500

# interactivity variables
mouseTrackerX = 2
zeroCoordinateTopic = 0
zeroCoordinateLie = 0
zeroCoordinateExplanation = 0
zeroCoordinateDate = 0
zeroCoordinatePublication = 0

#interactivity
for topic in topics:
if mouseX < zeroCoordinateTopic - ellipseWidth / mouseTrackerX or mouseX > zeroCoordinateTopic + ellipseWidth / mouseTrackerX:
fill(0)
else:
fill(0)
textSize(10)
textAlign(LEFT)
text(topic, 40, textPositionY + 30)
zeroCoordinateTopic = zeroCoordinateTopic + ellipseWidth

for lie in lies:
if mouseX < zeroCoordinateLie - ellipseWidth / mouseTrackerX or mouseX > zeroCoordinateLie + ellipseWidth / mouseTrackerX:
fill(0)
else:
fill(0)
textSize(10)
textAlign(LEFT)
text(lie, 40, textPositionY + 45)
zeroCoordinateLie = zeroCoordinateLie + ellipseWidth
lie = textwrap.wrap(lie, width=25)

for explanation in explanations:
if mouseX < zeroCoordinateExplanation- ellipseWidth / mouseTrackerX or mouseX > zeroCoordinateExplanation + ellipseWidth / mouseTrackerX:
fill(0)
else:
fill(0)
textSize(10)
textAlign(LEFT)
text(explanation, 40, textPositionY + 60)
zeroCoordinateExplanation = zeroCoordinateExplanation + ellipseWidth
textwrap.fill(explanation, width=50)

for publication in publications:
if mouseX < zeroCoordinatePublication - ellipseWidth / mouseTrackerX or mouseX > zeroCoordinatePublication + ellipseWidth / mouseTrackerX:
fill(0)
else:
fill(0)
textSize(10)
textAlign(LEFT)
text(publication, 40, textPositionY + 75)
zeroCoordinatePublication = zeroCoordinatePublication + ellipseWidth

# static text
fill(0)
textSize(12)
text("Zero Truths & 117 Lies", 325, -50)

fill(0)
textSize(10)
textAlign(RIGHT)
text("Topic:", 25, textPositionY + 30)

fill(0)
textSize(10)
textAlign(RIGHT)
text("Lie:", 25, textPositionY + 45)

fill(0)
textSize(10)
textAlign(RIGHT)
text("Explanation:", 25, textPositionY + 60)

fill(0)
textSize(10)
textAlign(RIGHT)
text("Publication:", 25, textPositionY + 75)

--

--