-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 2 new examples, documented api, added new dataOpacity api
- Loading branch information
1 parent
f8375bf
commit 6ea1c50
Showing
6 changed files
with
316 additions
and
5 deletions.
There are no files selected for viewing
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
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>dc.js - Box-Plot Example</title> | ||
<meta charset="UTF-8"> | ||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"> | ||
<link rel="stylesheet" type="text/css" href="../css/dc.css"/> | ||
</head> | ||
<body> | ||
|
||
<div class="container"> | ||
<script type="text/javascript" src="header.js"></script> | ||
<div id="box-test"></div> | ||
<div id="pie-chart"></div> | ||
|
||
<script type="text/javascript" src="../js/d3.js"></script> | ||
<script type="text/javascript" src="../js/crossfilter.js"></script> | ||
<script type="text/javascript" src="../js/dc.js"></script> | ||
<script type="text/javascript"> | ||
|
||
var chart = dc.boxPlot("#box-test"), | ||
pie = dc.pieChart("#pie-chart"); | ||
d3.csv("morley.csv", function(error, experiments) { | ||
|
||
experiments.forEach(function(x) { | ||
x.Speed = +x.Speed; | ||
}); | ||
|
||
var ndx = crossfilter(experiments), | ||
runDimension = ndx.dimension(function(d) {return +d.Run;}), | ||
runGroup = runDimension.group(), | ||
experimentDimension = ndx.dimension(function(d) {return "exp-" + d.Expt;}), | ||
speedArrayGroup = experimentDimension.group().reduce( | ||
function(p,v) { | ||
p.push(v.Speed); | ||
return p; | ||
}, | ||
function(p,v) { | ||
p.splice(p.indexOf(v.Speed), 1); | ||
return p; | ||
}, | ||
function() { | ||
return []; | ||
} | ||
); | ||
|
||
chart | ||
.width(768) | ||
.height(480) | ||
.margins({top: 10, right: 50, bottom: 30, left: 50}) | ||
.dimension(experimentDimension) | ||
.group(speedArrayGroup) | ||
.elasticY(true) | ||
.elasticX(true); | ||
|
||
pie | ||
.width(140) | ||
.height(140) | ||
.radius(70) | ||
.dimension(runDimension) | ||
.group(runGroup); | ||
|
||
dc.renderAll(); | ||
/* | ||
var i=0; | ||
setInterval(function() { | ||
runDimension.filterAll(); | ||
runDimension.filter([i++,21]); | ||
dc.renderAll(); | ||
}, 2000); | ||
*/ | ||
}); | ||
|
||
</script> | ||
|
||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.