Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4bfba1a
Merge pull request #16 from danswick/master
danswick Mar 18, 2015
bcfc25f
Update inspiration.md
danswick Mar 18, 2015
3d69a8d
Update inspiration.md
danswick Mar 20, 2015
afb7578
Update inspiration.md
danswick Mar 21, 2015
a42057e
d3 tutorials folder
danswick Mar 30, 2015
a822ae5
rat and neighborhood data
danswick Mar 30, 2015
b079cc9
D3 transitions!
danswick Mar 30, 2015
8641afe
updating mah D3 tuts
danswick Apr 1, 2015
54d142f
finishing the aligned left d3 tuts
danswick Apr 4, 2015
d3fbad3
funishing alignedleft d3 tuts
danswick Apr 4, 2015
e76bf56
more D3 tuts - transitions
danswick Apr 8, 2015
5813ca3
landing page initial commit
danswick Apr 16, 2015
eb98cf4
landing page updates
danswick Apr 17, 2015
368c16a
updates to landing page
danswick Apr 17, 2015
251b583
Delete .editorconfig
danswick Apr 17, 2015
e5b8bea
Delete .gitattributes
danswick Apr 17, 2015
b7ac0c2
Delete .gitignore
danswick Apr 17, 2015
372accd
Delete .htaccess
danswick Apr 17, 2015
9c49445
landing page
danswick Apr 17, 2015
2fb7304
Merge remote-tracking branch 'origin/gh-pages' into gh-pages
danswick Apr 17, 2015
7cd1e86
landing page
danswick Apr 17, 2015
0a43405
testing a different index
danswick Apr 17, 2015
df2fcf5
landing page take 2
danswick Apr 17, 2015
70fab90
duplicate image slider
danswick Apr 17, 2015
e8a0608
cleaning up test files
danswick Apr 17, 2015
a74744e
move landing page to its own repo
danswick Apr 17, 2015
b37bad0
remove old site build
danswick Apr 26, 2015
51133b8
rebuild branch tests
danswick May 2, 2015
cfffd18
add, style header 'logo' for re-build
danswick May 3, 2015
c5b31da
wire everything up, fix internal linking
danswick May 3, 2015
16182e2
remove jekyll's dev _site dir
danswick May 3, 2015
a15e0d1
re-build commit
danswick May 3, 2015
f98c32d
conflict resolution
danswick May 3, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updating mah D3 tuts
  • Loading branch information
danswick committed Apr 1, 2015
commit 8641afeaa9aa769e93ad6f2188dd58e218b0da29
78 changes: 78 additions & 0 deletions D3-tuts/aligned-left/babysFirstScatterplot.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Test</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
<script type="text/javascript" src="../d3/d3.js"></script>
</head>
<body>
<script type="text/javascript">
var dataset = [
[ 5, 20 ],
[ 480, 90 ],
[ 250, 50 ],
[ 100, 33 ],
[ 330, 95 ],
[ 410, 12 ],
[ 475, 44 ],
[ 25, 67 ],
[ 85, 21 ],
[ 220, 88 ]
];

var w = 500,
h = 100;

var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);

svg.selectAll("circle")
.data(dataset)
.enter()
.append("circle")
.attr("cx", function(d) {
return d[0];
})
.attr("cy", function(d) {
return d[1];
})
.attr("r", function(d) {
return Math.sqrt(h - d[1]);
});

svg.selectAll("text")
.data(dataset)
.enter()
.append("text")
.text(function(d) {
return d[0] + ", " + d[1];
})
.attr("x", function(d) {
return d[0];
})
.attr("y", function(d) {
return d[1];
})
.attr("font-family", "sans-serif")
.attr("font-size", "11px")
.attr("fill", "red");
</script>
</body>
</html>














41 changes: 41 additions & 0 deletions D3-tuts/aligned-left/drawing-svg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Test</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
<script type="text/javascript" src="../d3/d3.js"></script>
</head>
<body>
<script type="text/javascript">
var w = 500,
h = 50;

var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);

var dataset = [ 5, 10, 15, 20, 25 ];

var circles = svg.selectAll("circle")
.data(dataset)
.enter()
.append("circle");

circles.attr("cx", function(d, i) {
return (i * 50) + 25;
})
.attr("cy", h/2)
.attr("r", function(d) {
return d;
})
.attr("fill", "yellow")
.attr("stroke", "orange")
.attr("stroke-width", function(d) {
return d/2;
});

</script>
</body>
</html>
79 changes: 79 additions & 0 deletions D3-tuts/aligned-left/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Test</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
<script type="text/javascript" src="../d3/d3.js"></script>
</head>
<body>
<script type="text/javascript">
var dataset = [
[ 5, 20 ],
[ 480, 90 ],
[ 250, 50 ],
[ 100, 33 ],
[ 330, 95 ],
[ 410, 12 ],
[ 475, 44 ],
[ 25, 67 ],
[ 85, 21 ],
[ 220, 88 ]
];

var w = 500,
h = 100;

var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);

svg.selectAll("circle")
.data(dataset)
.enter()
.append("circle")
.attr("cx", function(d) {
return d[0];
})
.attr("cy", function(d) {
return d[1];
})
.attr("r", function(d) {
return Math.sqrt(h - d[1]);
});

svg.selectAll("text")
.data(dataset)
.enter()
.append("text")
.text(function(d) {
return d[0] + ", " + d[1];
})
.attr("x", function(d) {
return d[0];
})
.attr("y", function(d) {
return d[1];
})
.attr("font-family", "sans-serif")
.attr("font-size", "11px")
.attr("fill", "red");

</script>
</body>
</html>














32 changes: 32 additions & 0 deletions D3-tuts/aligned-left/random-num-barChart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Test</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
<script type="text/javascript" src="../d3/d3.js"></script>
</head>
<body>
<script type="text/javascript">

var dataset = [];

for (var i = 0; i < 25; i++) {
var newNumber = Math.round(Math.random() * 25);
dataset.push(newNumber);
}

d3.select("body").selectAll("div")
.data(dataset)
.enter()
.append("div")
.attr("class", "bar")
.style("height", function(d){
var barHeight = d * 5;
return barHeight + "px";
});
console.log(dataset);

</script>
</body>
</html>
7 changes: 7 additions & 0 deletions D3-tuts/aligned-left/style/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
div.bar {
display: inline-block;
width: 20px;
height: 75px;
background-color: teal;
margin-right: 2px;
}
62 changes: 62 additions & 0 deletions D3-tuts/aligned-left/svgBarChart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Test</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
<script type="text/javascript" src="../d3/d3.js"></script>
</head>
<body>
<script type="text/javascript">
var w = 500,
h = 100;

var barPadding = 1;

var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);

var dataset = [ 5, 10, 13, 19, 21, 25, 22, 18, 15, 13, 11, 12, 15, 20, 18, 17, 16, 18, 23, 25 ];

svg.selectAll("rect")
.data(dataset)
.enter()
.append("rect")
.attr("x", function(d, i) {
return i * (w / dataset.length);
})
.attr("y", 0)
.attr("width", w / dataset.length - barPadding)
.attr("height", function(d) {
return d * 4;
})
.attr("y", function(d) {
return h - 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("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")
.attr("text-anchor", "middle");

</script>
</body>
</html>
26 changes: 26 additions & 0 deletions D3-tuts/d3/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2010-2015, Michael Bostock
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* The name Michael Bostock may not be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading