Using Google Sheets API to compute the winner of a Ranked Choice Voting Election, then makes a Sankey Chart to show the calculations.
Change the two variables at the top of the script (SpreadSheetID
and OAuthClientSecretJSON
) these are crucial for the script to get the correct spreadsheet and permissions respectively. Also the INSERT_PLOTLY_USERNAME
and INSERT_PLOTLY_API_KEY
values are generated from https://plot.ly/settings/api
.
This is generated for you by google :) just log in at https://console.developers.google.com/apis/credentials
and set up a project with permissions and download the json file.
The script will output a url for where the graph is located. A Sample output can be seen below.