Skip to content

Instantly share code, notes, and snippets.

@N0taN3rd
Last active February 3, 2016 01:22
Show Gist options
  • Save N0taN3rd/310db22ad265bdb973dc to your computer and use it in GitHub Desktop.
Save N0taN3rd/310db22ad265bdb973dc to your computer and use it in GitHub Desktop.
VI2

Built with blockbuilder.org

John Berlin

Tableu:

  • Bar chart of passing yards per player (best displayed as a horizontal bar chart), with conference mapped to color

    • passing chart
    • Incite: The passing chart did not show much to me other than football players can throw ball for alot of yards. Sry not a big sports fan
  • Scatterplot of 2 interesting variables, with conference mapped to color

    • scatter plot
    • Incite: The scatter plot showed an incite to see where each conference stands to one another.
  • One other interesting graph that uses a derived variable

    • derived variable
    • Incite: The derived variable Completions/Interceptions using tree map showed me how simular completions to intercepetions for each player in the conferences are to each other conference
  • Tableau

    • It is very hidden about what you can do with it
    • Wish there was a list of all functions or easy way to find a function list
  • D3

    1. Its really powerful.
    2. The tutorial is really great for tip of the ice burge showing. I read the docs immediatly
    3. It was a great wet your whistle tutorial really wanted to do more with the bar charts
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
svg { width:100%; height: 100% }
</style>
</head>
<body>
<script>
var dataset = [ 5, 10, 13, 19, 21, 25, 22, 18, 15, 13,
11, 12, 15, 20, 18, 17, 16, 18, 23, 25 ];
// Feel free to change or delete any of the code you see!
var w = 500;
var h = 150;
var barPadding = 1;
var svg = d3.select("body")
.append("svg")
.attr("width", w) // <-- Here
.attr("height", h);
svg.selectAll("rect")
.data(dataset)
.enter()
.append("rect")
.attr("x", function(d, i) {
return i * (w / dataset.length);
})
.attr("y", function(d){ return h - (d * 4);})
.attr("width", w / dataset.length - barPadding)
.attr("height", function(d) {
return d * 4;
})
.attr("fill",function(d) {
return "rgb(0, 0, " + (d * 10) + ")";
});
svg.selectAll("text")
.data(dataset)
.enter()
.append("text")
.text(function(d) {
return d;
})
.attr("text-anchor", "middle")
.attr("x", function(d, i) {
return i * (w / dataset.length) + (w / dataset.length - barPadding) / 2;
})
.attr("y", function(d) {
return h - (d * 4) + 14;
})
.attr("font-family", "sans-serif")
.attr("font-size", "11px")
.attr("fill", "white");
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment