Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b289b67
Intial website setup
FluffyPenguin Nov 9, 2020
ae0b929
Get datafiles from JS
FluffyPenguin Nov 9, 2020
8e35b02
Change http to https
FluffyPenguin Nov 9, 2020
6ff4d29
Fix scoping
FluffyPenguin Nov 9, 2020
7790bf3
Add charts.js
FluffyPenguin Nov 9, 2020
4125ca8
Fix file paths
FluffyPenguin Nov 9, 2020
5012346
Add index
FluffyPenguin Nov 9, 2020
8da62d4
Charts
FluffyPenguin Nov 9, 2020
f5763d2
Fix typo
FluffyPenguin Nov 9, 2020
88cff72
Added adults model
Nov 9, 2020
e71982d
cars mpg chart
FluffyPenguin Nov 9, 2020
5db2b70
Create separate page for auto mpg vis
FluffyPenguin Nov 9, 2020
6327ad1
rename website folder to docs
FluffyPenguin Nov 9, 2020
42bf93e
move data into docs
FluffyPenguin Nov 9, 2020
1bdba90
Dynamic charts
FluffyPenguin Nov 9, 2020
1f7796f
Fix typo
FluffyPenguin Nov 9, 2020
affcc0d
Fix more typos
FluffyPenguin Nov 9, 2020
1d8073f
added dictionary for one hot encoding
Nov 9, 2020
c29177d
Dynamic chart rendering and gui updates
FluffyPenguin Nov 9, 2020
ef3ff55
Fix typo
FluffyPenguin Nov 9, 2020
70b1764
bug fixes and new pages
FluffyPenguin Nov 9, 2020
ec8a70b
Add updating
FluffyPenguin Nov 9, 2020
99552e3
Bug fix
FluffyPenguin Nov 9, 2020
0c53e9e
Typo
FluffyPenguin Nov 9, 2020
6aa937a
Add in new files
FluffyPenguin Nov 9, 2020
1b1df48
Test
FluffyPenguin Nov 9, 2020
16a57b4
Final
FluffyPenguin Nov 9, 2020
9a00d2b
Remove defaults
FluffyPenguin Nov 9, 2020
635c230
Remove chart
FluffyPenguin Nov 9, 2020
cba5af2
bug fix
FluffyPenguin Nov 9, 2020
0b4f2ce
Final
FluffyPenguin Nov 9, 2020
a99f1fe
Add in other pages
FluffyPenguin Nov 9, 2020
3b566e6
Remove java files
FluffyPenguin Nov 9, 2020
4654e24
Merge remote-tracking branch 'origin/supervised_learning' into website
FluffyPenguin Nov 9, 2020
b8f4934
Add text to home page
FluffyPenguin Nov 9, 2020
b2c7784
add feedback
FluffyPenguin Nov 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
79 changes: 79 additions & 0 deletions docs/adults.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@

<!DOCTYPE html>
<html>

<head>
<title> State Farm Coding Competition </title>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/1.0.11/jquery.csv.js"></script>




</head>

<body>
<link rel="stylesheet" href="topnav.css"/>
<div id="topnav" class = "topnav" w3-include-html="topnav.html" >
<a id="logoBox" href= "index.html#home">
<img
id ="logo"
src= "https://cdn6.f-cdn.com/contestentries/363431/6597075/56d7ded7655e2_thumb900.jpg"
alt = "Logo"

/>
</a>
<a id="index.html" href="index.html#home">Home</a>
<a id="adults.html" href="adults.html">Adults</a>
<a id="autoMpg.html" href="autoMpg.html">Auto-MPG</a>
<a id="autos.html" href="autos.html">Autos</a>
<a id="cars.html" href="cars.html">Cars</a>
<a id="forestFires.html" href="forestFires.html">Forest Fires</a>
<a id="seoulBikes.html" href="seoulBikes.html">Seoul Bikes</a>
</div id="topnav">


<div id="home" class="main">
<h1 id="mainTitle"> 2020 StateFarm Coding Competition</h1>
<h2> Alex Kim and Ethan Xie </h2>
<div class="divider"></div>

<canvas id="chart" width="400" height="400"></canvas>

<div id="options">
<div class="colFlexBox">
<label for="chartType">Chart Type</label>
<select id="chartType" onchange="updateChart()">
<option value="line">Line</option>
<option value="bar">Bar</option>
<option value="scatter" selected>Scatter</option>
</select>
</div>
<div class="colFlexBox">
<label for="xAxisSelect">X-Axis</label>
<select id="xAxisSelect" onchange="updateChart()"></select>
</div>
<div class="colFlexBox">
<label for="yAxisSelect">Y-Axis</label>
<select id="yAxisSelect" onchange="updateChart()"></select>
</div>
</div>







</div id ="main">


<script src="adults.js"> </script>
<!-- link at the bottom to reduce load time -->
<!--<script>
includeHTML();
</script>
-->
</body>
</html>
121 changes: 121 additions & 0 deletions docs/adults.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@

const chartType = document.getElementById('chartType');
const xAxisSelect = document.getElementById('xAxisSelect');
const yAxisSelect = document.getElementById('yAxisSelect');

var dataset;
$.get('./data/adults.csv', function(data) {
dataset = $.csv.toObjects(data);
// add keys to both x and y axis select
var keys = Object.keys(dataset[0])
keys.forEach(element => {
var option = document.createElement("option");
option.value = element;
option.text = element;
xAxisSelect.add(option);

option = document.createElement("option");
option.value = element;
option.text = element;
yAxisSelect.add(option);
});
// set the default
xAxisSelect.value = keys[0];
yAxisSelect.value = keys[1];
updateChart();

});


// for dumym
var myChart;
//Load auto mpg chart
function updateChart() {
var filteredDataset = [];
dataset.forEach(obj => {
var newObj = {x: obj[xAxisSelect.value], y: obj[yAxisSelect.value]};
filteredDataset.push(newObj);
});
console.log(filteredDataset);
if (!(myChart === undefined)) {
myChart.destroy();
}
var ctx = document.getElementById('chart').getContext('2d');
myChart = new Chart(ctx, {
type: chartType.value,
data: {
datasets: [{
label: "Data",
data: filteredDataset,
backgroundColor: 'rgba(255, 99, 132, 0.2)',
}]
},
options: {
// parsing: {
// xAxisKey: "mpg",
// yAxisKey: "cylinders"
// },
title: {
display: true,
text: "Adults Dataset"
},

scales: {
yAxes: [{
scaleLabel: {
display: true,
labelString: yAxisSelect.value
},
}],
xAxes: [{
scaleLabel: {
display: true,
labelString: xAxisSelect.value
}
}]
}
}
});
}




function testChart() {
dataset = [{mpg:"10", cylinders:"5"}, {mpg:"12", cylinders:"6"}];
xAxisSelect.value = "mpg";
yAxisSelect.value = "cylinders";

var ctx = document.getElementById('chart').getContext('2d');
myChart = new Chart(ctx, {
type: 'scatter',
data: {
datasets: [{
label: 'Scatter Dataset',
data: [{
a: "-10",
y: "0"
}, {
a: "0",
y: "10"
}, {
a: "10",
y: "5"
}],
backgroundColor: 'rgba(255, 99, 132, 0.5)',

}]
},
options: {
parsing: {
xAxisKey: "a"
},
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}]
}
}
});
}
80 changes: 80 additions & 0 deletions docs/autoMpg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@

<!DOCTYPE html>
<html>

<head>
<title> State Farm Coding Competition </title>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/1.0.11/jquery.csv.js"></script>




</head>

<body>
<link rel="stylesheet" href="topnav.css"/>
<div id="topnav" class = "topnav" w3-include-html="topnav.html" >
<a id="logoBox" href= "index.html#home">
<img
id ="logo"
src= "https://cdn6.f-cdn.com/contestentries/363431/6597075/56d7ded7655e2_thumb900.jpg"
alt = "Logo"

/>
</a>
<a id="index.html" href="index.html#home">Home</a>
<a id="adults.html" href="adults.html">Adults</a>
<a id="autoMpg.html" href="autoMpg.html">Auto-MPG</a>
<a id="autos.html" href="autos.html">Autos</a>
<a id="cars.html" href="cars.html">Cars</a>
<a id="forestFires.html" href="forestFires.html">Forest Fires</a>
<a id="seoulBikes.html" href="seoulBikes.html">Seoul Bikes</a>
</div id="topnav">


<div id="home" class="main">
<h1 id="mainTitle"> 2020 StateFarm Coding Competition</h1>
<h2> Alex Kim and Ethan Xie </h2>
<div class="divider"></div>

<canvas id="chart" width="400" height="400"></canvas>

<div id="options">
<div class="colFlexBox">
<label for="chartType">Chart Type</label>
<select id="chartType" onchange="updateChart()">
<option value="line">Line</option>
<option value="bar">Bar</option>
<option value="scatter" selected>Scatter</option>
</select>
</div>
<div class="colFlexBox">
<label for="xAxisSelect">X-Axis</label>
<select id="xAxisSelect" onchange="updateChart()">
</select>
</div>
<div class="colFlexBox">
<label for="yAxisSelect">Y-Axis</label>
<select id="yAxisSelect" onchange="updateChart()">
</div>
</div>







</div id ="main">


<script src="autoMpg.js"> </script>
<!-- link at the bottom to reduce load time -->
<!--<script>
includeHTML();
</script>
-->
</body>
</html>
Loading