[ Launch: Third Iteration ] 1ff40b27c9f431ca3f01d08b171b1ccb by pathiggins13
[ Launch: Second Iteration ] 25acfca1b8fe378771d2fb3d199772ba by pathiggins13
[ Launch: Dartboard ] 8957096ee14b1cc864c5b294d72533dd by pathiggins13
[ Launch: Dartboard ] 9bc89344a07ed622faa473fa1be9a421 by pathiggins13
-
-
Save higgyCodes/1ff40b27c9f431ca3f01d08b171b1ccb to your computer and use it in GitHub Desktop.
Bar Chart
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":"Bar Chart","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"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},"babel.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data.tsv":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"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,"ajax-caching":true,"thumbnail":"http://i.imgur.com/V8XYWiB.png"} |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2 in line 1.
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
| data.tsv# | |
| letter frequency | |
| A .08167 | |
| B .01492 | |
| C .02782 | |
| D .04253 | |
| E .12702 | |
| F .02288 | |
| G .02015 | |
| H .06094 | |
| I .06966 | |
| J .00153 | |
| K .00772 | |
| L .04025 | |
| M .02406 | |
| N .06749 | |
| O .07507 | |
| P .01929 | |
| Q .00095 | |
| R .05987 | |
| S .06327 | |
| T .09056 | |
| U .02758 | |
| V .00978 | |
| W .02360 | |
| X .00150 | |
| Y .01974 | |
| Z .00074 |
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 dataset = [ 5, 10, 13, 19, 21, 25, 22, 18, 15, 13, 11, 12, 15, 20, 18, 17, 16, 18, 23, 25 ]; | |
| var w = 500; | |
| var h = 100; | |
| var barPadding = 0.3 | |
| svg = d3.select("svg") | |
| .attr("width", w) | |
| .attr("height", h); | |
| svg.selectAll("rect") | |
| .data(dataset) | |
| .enter() | |
| .append("rect") | |
| .attr ("x", function (d, i) { | |
| return i * (w/ dataset.length - barPadding) | |
| }) | |
| .attr("y", function(d) {return h - d}) | |
| .attr("width", 20) | |
| .attr("height", function(d){ | |
| return d | |
| }) | |
| .append("rect") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment