[ Launch: Y-over-Y Improvements ] 6894169 by poezn
-
-
Save poezn/6894169 to your computer and use it in GitHub Desktop.
Y-over-Y Improvements
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
{"description":"Y-over-Y Improvements","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"assets.svg":{"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},"styles.css":{"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/GtBcmLe.png"} |
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 data = { | |
"domain-mastery": { | |
"before": 65, | |
"after": 82 | |
} | |
}; | |
var units = d3.range(0, 100); | |
var countPeople = g.selectAll("use.count-people") | |
.data(units); | |
var newUnits = countPeople.enter().append("use") | |
.attr({ | |
"opacity": 1 | |
}); | |
countPeople.exit().remove(); | |
countPeople.attr({ | |
"class": function(d, i) { | |
var cls = i >= data["domain-mastery"].before ? | |
(i >= data["domain-mastery"].after ? "no" : "new") : | |
"yes" | |
return "count-people " + cls; | |
}, | |
"transform": function(d, i) { | |
var tx = (i % 20) * 37, | |
ty = Math.floor(i / 20) * 74; | |
return "translate(" + [tx, ty] + ")" | |
}, | |
"xlink:href": "#man" | |
}); | |
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
.yes { | |
fill: #8CA587; | |
} | |
.no { | |
fill: #DFDFDF; | |
stroke: #198B1E; | |
} | |
.new { | |
fill: #198B1E; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment