This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set dimensions of div container, svg and chart area(g element) | |
var margin = { | |
top: 20, | |
right: 20, | |
bottom: 80, | |
left: 20 | |
}; | |
//width of the chart, within SVG element | |
var w = 1100 - margin.left - margin.right; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set margins for div container, SVG and chart area(g element) | |
var margin = {top: 20, right: 20, bottom: 20, left: 20}; | |
//width of the chart, within SVG element | |
var w = 1100 - margin.left - margin.right; | |
//height of the chart, within SVG element | |
var h = 900 - margin.top - margin.bottom; | |
//Create SVG element and append to #chart div container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = "https://raw.githubusercontent.com/DealPete/forceDirected/master/countries.json"; | |
d3.json(url, function(json){ | |
var data = json; | |
//Set dimensions of div container, SVG and chart area(g element) | |
var margin = {top: 40, right: 40, bottom: 40, left: 40}; | |
//Width of the visualization area |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = "https://raw.githubusercontent.com/FreeCodeCamp/ProjectReferenceData/master/global-temperature.json" | |
d3.json(url, function(json){ | |
//load data from API and save in variables | |
var data = json.monthlyVariance; | |
var baseTemp = json.baseTemperature; | |
//global variable for the months to be accessed like months[i] | |
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = "https://raw.githubusercontent.com/FreeCodeCamp/ProjectReferenceData/master/cyclist-data.json"; | |
d3.json(url, function (json) { | |
var data = json; | |
//set dimensions of SVG container and chart area | |
var margin = {top: 60, right: 120, bottom: 80, left: 80}; | |
//inner width for the chart, within SVG element | |
var w = 1000 - margin.left - margin.right; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet"> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TableHeader = React.createClass({ | |
render: function() { | |
return ( | |
<thead> | |
<tr> | |
<th className="text-center">#</th> | |
<th className="text-center">Profile Pic</th> | |
<th className="text-center">Camper Name</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Storage.prototype.setObj = function(key,obj){ | |
//Extend local storage prototype so we can store objects | |
return this.setItem(key, JSON.stringify(obj)); | |
}; | |
Storage.prototype.getObj = function(key){ | |
return JSON.parse(this.getItem(key)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Button = ReactBootstrap.Button; | |
var ButtonToolbar = ReactBootstrap.ButtonToolbar; | |
var App = React.createClass({ | |
//function to generate board and set initial state | |
createBoard: function(width,height){ | |
//function to create an array with board configuration | |
var array = []; |
NewerOlder