I just wanted to add an update to this now that I'm back at my PC...
This is the data source they used: https://static01.nyt.com/elections-assets/2020/data/api/2020-11-03/race-page/pennsylvania/president.json
And this is what it looks like when you plot it out: https://i.imgur.com/nRekWRo.png
Here is the script (python 3.8+) to calculate the votes and dump the data to an excel spreadsheet so you can play with it yourself.
import pandas as pd
import requests
from dateutil.parser import parse
def main(state):
url = f'https://static01.nyt.com/elections-assets/2020/data/api/2020-11-03/race-page/{state}/president.json'
r = requests.get(url)
api_data = r.json()
timeseries = api_data['data']['races'][0]['timeseries']
curated_timeseries = []
for update in timeseries:
if (votes := int(update['votes'])) > 0:
curated_timeseries.append(dict(
timestamp=update['timestamp'],
votes=votes,
biden_share=(bshare := update['vote_shares']['bidenj']),
trump_share=(tshare := update['vote_shares']['trumpd']),
biden_votes=(votes * bshare),
trump_votes=(votes * tshare),
))
curated_timeseries.sort(key=lambda x: parse(x['timestamp']))
pd.DataFrame(curated_timeseries).to_excel('curated_data.xlsx', index=False)
if __name__ == '__main__':
main('pennsylvania')