Files
cs5890_data_visualization/hw6/public/js/script.js
2019-10-29 11:19:51 -06:00

21 lines
652 B
JavaScript

let tooltip = new Tooltip();
let votePercentageChart = new VotePercentageChart(tooltip);
let tileChart = new TileChart(tooltip);
let shiftChart = new ShiftChart();
let electoralVoteChart = new ElectoralVoteChart(shiftChart);
// Load the data corresponding to all the election years.
// Pass this data and instances of all the charts that update on year
// selection to yearChart's constructor.
d3.csv("data/yearwiseWinner.csv").then(electionWinners => {
console.log(electionWinners);
let yearChart = new YearChart(electoralVoteChart, tileChart,
votePercentageChart, electionWinners);
yearChart.update();
});