Skip to content
Snippets Groups Projects
Commit 21724a06 authored by Wade Fagen-Ulmschneider (waf)'s avatar Wade Fagen-Ulmschneider (waf)
Browse files

project_uiuc

parent c65dc1bf
No related branches found
No related tags found
No related merge requests found
{
"title": "Project #1: UIUC Datasets",
"index": 20170307,
"type": "Project"
}
import csv
import json
# There's no need for any Python here.
{% extends "static/templates/projectBase.html" %}
{% block projectContent %}
<h2>Project #1</h2>
<div id="chart"></div>
<script src="web/vis.js"></script>
{% endblock %}
"use strict";
/* Boilerplate jQuery */
$(function() {
$.get("res/fileName.csv")
.done(function (csvData) {
var data = d3.parseCsv(csvData);
visualize(data);
})
.fail(function(e) {
alert("Failed to load CSV file!");
});
});
/* Visualize the data in the visualize function */
var visualize = function(data) {
console.log(data);
// == BOILERPLATE ==
var margin = { top: 50, right: 50, bottom: 50, left: 50 },
width = 800 - margin.left - margin.right,
height = (data.length * 20);
var svg = d3.select("#chart")
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.style("width", width + margin.left + margin.right)
.style("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
// == Your code! :) ==
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment