[ Launch: horiz bars ] 9331013 by DeBraid
-
-
Save DeBraid/9331013 to your computer and use it in GitHub Desktop.
horiz bars
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
{"description":"horiz bars","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data.tsv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data2.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"nw.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/VlCtAeJ.png"} |
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
name | value | |
---|---|---|
Locke | 4 | |
Reyes | 1 | |
Ford | 3 | |
Jarrah | 6 | |
Shephard | 5 | |
Kwon | 2 | |
Locke | 3 | |
Reyes | 1 | |
Ford | 3 | |
Jarrah | 6 | |
Shephard | 5 |
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
name | value | |
---|---|---|
Locke | 4 | |
Reyes | 1 | |
Ford | 3 | |
Reyes | 1 | |
Ford | 3 | |
Jarrah | 6 | |
Shephard | 5 | |
Jarrah | 6 | |
Shephard | 5 | |
Kwon | 2 | |
Locke | 3 |
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 data = tributary.nw; | |
//console.log(data); | |
var years = new Array("1999","2005", "2012"); | |
//console.log(years); | |
var pcYears = new Array("pc2005","pc2012"); | |
var layers = d3.layout.stack()(years.map(function(value){ | |
return data.map(function(d){ | |
return {x: d.Type, y: +d[value]}; | |
}) | |
})); | |
var bricks = years.map(function(value){ | |
return data.map(function(d){ | |
return {y: d.Type, x: +d[value]}; | |
}) | |
}); | |
var pcData = pcYears.map(function(value){ | |
return data.map(function(d){ | |
return {y: d.Type, x: +d[value] }; | |
}) | |
}); | |
var yGroupMax = d3.max(layers, function(layer) { return d3.max(layer, function(d) { return d.y; }); }); | |
console.log(yGroupMax); | |
console.log("check pcData") | |
console.log(pcData); | |
/* | |
var width = 376, | |
barHeight = 30; | |
var x = d3.scale.linear() | |
.range([10, width]); | |
var chart = d3.select("svg") | |
.attr("width", width); | |
var xMax = d3.max(data, function(d) { return d.value; }); | |
var xMax2 = d3.max(layers, function(d) { return d.value; }); | |
console.log(xMax); | |
console.log("break 234"); | |
console.log(xMax2); | |
/* | |
x.domain([0, xMax]); | |
var draw = function () { | |
chart.attr("height", barHeight * data.length); | |
var bar = chart.selectAll("g") | |
.data(data) | |
.enter().append("g") | |
.attr("class", "bars") | |
.attr("transform", function(d, i) { return "translate(0," + i * barHeight + ")"; }); | |
bar.append("rect") | |
.attr("width", function(d) { return x(d.value); }) | |
.attr("height", barHeight - 2); | |
bar.append("text") | |
.attr("x", function(d) { return x(d.value) - 3; }) | |
.attr("y", barHeight / 2) | |
.attr("dy", ".35em") | |
.text(function(d) { return d.value; }); | |
}; | |
draw(data); | |
*/ |
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
Type | 1999 | 2005 | 2012 | pc2005 | pc2012 | |
---|---|---|---|---|---|---|
Net Worth | 3903014 | 5530509 | 8073585 | 41.7 | 46.0 | |
Total assets | 4489109 | 6395134 | 9410656 | 42.5 | 47.2 | |
Total debts | 586095 | 864625 | 1337071 | 47.5 | 54.6 |
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
.bars { | |
fill: steelblue; | |
} | |
.bars text { | |
fill: white; | |
font: 10px sans-serif; | |
text-anchor: end; | |
} | |
svg .tributary_svg { | |
stroke: black; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment