Working on 4w 3
This commit is contained in:
4
hw4/d3.js
vendored
4
hw4/d3.js
vendored
@@ -5390,8 +5390,8 @@ function contours() {
|
||||
// Marching squares with isolines stitched into rings.
|
||||
// Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js
|
||||
function isorings(values, value, callback) {
|
||||
var fragmentByStart = new Array,
|
||||
fragmentByEnd = new Array,
|
||||
var fragmentByStart = [],
|
||||
fragmentByEnd = [],
|
||||
x, y, t0, t1, t2, t3;
|
||||
|
||||
// Special case for the first row (y = -1, t2 = t3 = 0).
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<header>
|
||||
<img src="assets/fifa_russia_logo.png" alt="Fifa WC Russia Logo" id="logo"/>
|
||||
<h1>Exploring FIFA World Cup Statistics: CS-5630/6630 Homework 4</h1>
|
||||
<div>Name: YOURNAME; E-Mail: YOUREMAIL; A#: A12345678</div>
|
||||
<div>Name: Brady Bodily; E-Mail: brady.bodily1@aggiemail.usu.edu; A#: A00987897</div>
|
||||
</header>
|
||||
|
||||
<div id="details" class="view">
|
||||
|
||||
@@ -21,7 +21,16 @@ class BarChart {
|
||||
|
||||
// Create the x and y scales; make
|
||||
// sure to leave room for the axes
|
||||
|
||||
|
||||
let data = this.chooseData(selectedDimension);
|
||||
|
||||
let xaxisHeight = 20;
|
||||
let yaxisWidth = 20;
|
||||
|
||||
let dataNum = [];
|
||||
data.forEach(x => dataNum.push(x.data));
|
||||
let datadate = [];
|
||||
data.forEach(x => datadate.push(x.date));
|
||||
|
||||
// Create colorScale
|
||||
|
||||
@@ -51,5 +60,19 @@ class BarChart {
|
||||
// ******* TODO: PART I *******
|
||||
//Changed the selected data when a user selects a different
|
||||
// menu item from the drop down.
|
||||
let currentDataType = d3.select('#dataset')
|
||||
.node().value;
|
||||
//.property("value");
|
||||
let selectedData = [];
|
||||
this.allData.forEach(x => {
|
||||
var item = [];
|
||||
item.date = x["year"];
|
||||
item.data = x[currentDataType];
|
||||
selectedData.push(item);
|
||||
});
|
||||
|
||||
console.log(this.allData);
|
||||
console.log(selectedData);
|
||||
return selectedData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,5 +46,11 @@ function chooseData() {
|
||||
// ******* TODO: PART I *******
|
||||
// Changed the selected data when a user selects a different
|
||||
// menu item from the drop down.
|
||||
let currentDataType = d3.select('#dataset')
|
||||
.node().value;
|
||||
//.property("value");
|
||||
let selectedData = [];
|
||||
this.allData.forEach(x => selectedData.push(x[currentDataType]));
|
||||
return selectedData;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user