This file contains 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 w = 800, | |
h = 600, | |
color = d3.scale.category20c(), | |
x = d3.scale.linear().domain([0, 10]).range([0, w]), | |
y = d3.scale.ordinal().domain(d3.range(lineData.length)).rangeBands([0, h], .4); | |
var viz = d3.select("#chart").append("div") | |
.attr("width", w) | |
.attr("height", h); |
This file contains 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 w = 800, | |
h = 600, | |
color = d3.scale.category20c(), | |
x = d3.scale.linear().domain([0, 10]).range([0, w]), | |
y = d3.scale.ordinal().domain(d3.range(lineData.length)).rangeBands([0, h], .4); | |
var viz = d3.select("#chart").append("svg:svg") | |
.attr("width", w) | |
.attr("height", h); |
This file contains 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
date | close | |
---|---|---|
1-May-12 | 582.13 | |
30-Apr-12 | 583.98 | |
27-Apr-12 | 603.00 | |
26-Apr-12 | 607.70 | |
25-Apr-12 | 610.00 | |
24-Apr-12 | 560.28 | |
23-Apr-12 | 571.70 | |
20-Apr-12 | 572.98 | |
19-Apr-12 | 587.44 |
This file contains 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
//Practically all this code comes from https://github.com/alangrafu/radar-chart-d3 | |
//I only made some additions and aesthetic adjustments to make the chart look better | |
//(of course, that is only my point of view) | |
//Such as a better placement of the titles at each line end, | |
//adding numbers that reflect what each circular level stands for | |
//Not placing the last level and slight differences in color | |
// | |
//For a bit of extra information check the blog about it: | |
//http://nbremer.blogspot.nl/2013/09/making-d3-radar-chart-look-bit-better.html |
This file contains 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
gistup |
This file contains 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
_ticking = false; | |
function onResize() { | |
requestTick(); | |
} | |
/** | |
* Calls rAF if it's not already | |
* been done already | |
*/ |
This file contains 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 fs = require('fs'); | |
var data_dir = '/data/', | |
read_dir = __dirname + data_dir; | |
var readFilesThenDoSomething = function(files, callback){ | |
var completed_files = []; //could error check here | |
files.map(function(file_name){ |
This file contains 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 mongo = require('mongoskin'); | |
var db = mongo.db("mongodb://localhost/learnmongo"); | |
db.bind('sample'); | |
var test1 = { | |
first: 'Jane', | |
last: 'Doe', | |
sex: 'female' | |
} |
This file contains 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
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | |
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; | |
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] | |
|| window[vendors[x]+'CancelRequestAnimationFrame']; | |
} | |
if (!window.requestAnimationFrame) |
This file contains 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
[{"anger":[{"timestamp":12396.243000002869,"value":0.017879068851470947},{"timestamp":12546.30900000484,"value":0.01998201757669449},{"timestamp":12729.723000004014,"value":0.002832104219123721},{"timestamp":12779.74499999982,"value":0.0025018546730279922},{"timestamp":12829.767000002903,"value":0.0021786449942737818},{"timestamp":12879.789000005985,"value":0.0026767903473228216},{"timestamp":12929.811000001791,"value":0.0068109482526779175},{"timestamp":12979.833000004874,"value":0.002155900001525879},{"timestamp":13029.85500000068,"value":0.0020600836724042892},{"timestamp":13079.877000003762,"value":0.002028809394687414},{"timestamp":13129.898999999568,"value":0.002040538936853409},{"timestamp":13179.92100000265,"value":0.00252713356167078},{"timestamp":13229.943000005733,"value":0.0023436446208506823},{"timestamp":13279.965000001539,"value":0.002009635791182518},{"timestamp":13363.335000001825,"value":0.0021777956280857325},{"timestamp":13413.357000004908,"value":0.0021448649931699038},{"timestamp":13463. |
OlderNewer