Last active
December 14, 2015 21:08
-
-
Save johan/5148748 to your computer and use it in GitHub Desktop.
Electroencephalogram
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
[-1,1,-2,-5,-3,-1,-2,6,5,-6,-2,5,1,-3,-4,3,1,5,-6,2,3,-3,-5,-3,3,3,7,0,-1,-8,-2,5,3,-6,-3,6,5,-5,0,4,-5,2,-1,-1,2,-4,5,1,-3,3,-2,-1,-7,8,0,-1,1,-4,1,-4,5,1,2,2,-6,-2,5,0,0,-5,-1,5,0,2,1,-4,-7,3,7,2,-3,-3,-2,2,1,2,-1,-3,2,-2,1,7,-2,1,-5,-4,-2,7,1,1,1,-1,-4,1,2,0,1,-3,-1,2,2,0,-5,4,-5,5,4,-3,1,-5,-6,4,0,8,3,4,-4,-7,-1,-3,2,3,-1,7,-1,-1,-7,2,4,-4,-1,2,2,-1,2,0,0,2,-4,-9,1,5,0,7,0,2,-1,-3,-20,-40,-17,24,64,64,34,-12,-33,-42,-45,-27,-3,-19,-33,-9,26,58,71,86,61,-1,-73,-124,-116,-67,-11,57,109,121,74,13,-61,-113,-119,-54,29,126,165,115,-18,-157,-220,-169,-35,105,200,196,137,20,-119,-201,-189,-70,46,122,114,85,37,-29,-47,-58,-63,-38,-5,31,56,53,11,-21,-17,-5,-28,-15,9,20,0,-9,2,14,5,6,5,-12,-19,-3,8,8,8,-11,-16,-9,10,20,9,1,-6,-1,-14,-4,-6,12,3,-6,11,0,-3,-4,-3,1,-5,6,7,-1,-2,-4,-2,-4,5,10,0,-4,-1,-7,-2,-1,1,15,3,-6,-9,-1,3,2,1,5,-2,0,-5,0,-4,2,10,5,-2,-7,-7,-5,0,7,3,-2,2,3,2,-6,2,-2,-6,-2,2,7,7,-2,-8,4,-9,0,2,2,6,3,-1,-5,-5,1,-3,-2,10,4,-3,-1,1,-2,-8,4,1,3,1,-3,-3,3,7,0,-4,-3,1,-7,-3,5,3,7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2,1,0,4,-2,-6,3,4,4,-1,-3,-7,-1,7,0,2,0,6,-9,-7,5,4,0,0,0] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="vis.js"></script> | |
</body> | |
</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
path { | |
stroke: steelblue; | |
stroke-width: 1; | |
fill: none; | |
} | |
.axis { | |
shape-rendering: crispEdges; | |
} | |
.x.axis line { | |
stroke: lightgrey; | |
} | |
.x.axis .minor { | |
stroke-opacity: .5; | |
} | |
.x.axis path { | |
display: none; | |
} | |
.y.axis line, .y.axis path { | |
fill: none; | |
stroke: #000; | |
} |
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 m = [80, 80, 80, 80]; // margins | |
var w = 960 - m[1] - m[3]; // width | |
var h = 500 - m[0] - m[2]; // height | |
d3.json('eeg.json', function(error, data) { | |
var min = d3.min(data), max = d3.max(data); | |
var x = d3.scale.linear().domain([0, data.length]).range([0, w]); | |
var y = d3.scale.linear().domain([min, max]).range([h, 0]); | |
var line = d3.svg.line() | |
.x(function(d,i) { | |
return x(i); | |
}) | |
.y(function(d) { | |
return y(d); | |
}); | |
var graph = d3.select("body").append("svg") | |
.attr("width", w + m[1] + m[3]) | |
.attr("height", h + m[0] + m[2]) | |
.append("svg:g") | |
.attr("transform", "translate(" + m[3] + "," + m[0] + ")"); | |
graph.append("svg:path").attr("d", line(data)); | |
var xAxis = d3.svg.axis().scale(x).tickSize(-h).tickSubdivide(true); | |
graph.append("svg:g") | |
.attr("class", "x axis") | |
.attr("transform", "translate(0," + h + ")") | |
.call(xAxis); | |
var yAxisLeft = d3.svg.axis().scale(y).ticks(4).orient("left"); | |
graph.append("svg:g") | |
.attr("class", "y axis") | |
.call(yAxisLeft); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment