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

"New Discovery" feature

parent 7bbabc00
No related branches found
No related tags found
No related merge requests found
{
"title": "{{TITLE}}",
"index": {{INDEX}},
"type": "{{TYPE}}"
}
import csv
import json
{% extends "templates/projectBase.html" %}
{% block projectContent %}
<h2></h2>
<div id="chart" style="margin: 0px auto; text-align: center;"></div>
<script src="web/vis.js"></script>
{% endblock %}
// Asks JavaScript to show more errors.
"use strict";
/*
* # Boilerplate jQuery
* This code loads the file `res/scores.json` and calls the `visualize` function
* as soon as the JSON file is loaded.
*/
$(function() {
$.getJSON("res/data.json")
.done(function (data) { visualize(data); })
.fail(function() { alert("Failed to load the JSON file!\n(Did your Python run?)"); });
});
/*
* # d3.js visualization
* All of the code to create our visualization will be contained in the `visualize` function,
* which is called once the data for the visualization has been loaded by the boilerplate
* jQuery code.
*/
var visualize = function(data) {
/*
* # Boilerplate Code for d3.js
*/
var margin = { top: 20, right: 20, bottom: 20, left: 20 },
width = 800 - margin.left - margin.right,
height = 970 - margin.top - margin.bottom;
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 + ")");
/*
* #
*/
};
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