From b3ef90aed52f8813ab6c683da6de86beed5ce4e0 Mon Sep 17 00:00:00 2001 From: Vadim Ogievetsky Date: Wed, 15 Feb 2012 15:19:19 -0800 Subject: [PATCH] added some more slides --- index.html | 128 +++++++++++++++++++++++++++++++++++++++++-------- slide_maker.js | 6 ++- 2 files changed, 113 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index a93bd9d..03f5888 100644 --- a/index.html +++ b/index.html @@ -96,7 +96,7 @@

Data Driven Documents

slide.code(title, rect3, function() { svg.selectAll('rect') .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return i * 150 + 100; }) .attr('height', 20) .style('fill', 'steelblue') @@ -110,7 +110,7 @@

Data Driven Documents

svg.selectAll('rect') .data([64, 128, 256]) .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') @@ -125,7 +125,7 @@

Data Driven Documents

selection .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') @@ -137,7 +137,7 @@

Data Driven Documents

selection .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') @@ -156,14 +156,14 @@

Data Driven Documents

selection .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') selection.enter().append('rect') .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') // this doesn't look out of place @@ -180,7 +180,7 @@

Data Driven Documents

// is joined in to the update selection selection .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') @@ -188,10 +188,10 @@

Data Driven Documents

slide.code(title + ' // a common pattern', empty_svg, function() { svg.selectAll('rect') - .data([64, 128, 256, 71]) + .data([64, 128, 256]) .enter().append('rect') .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') @@ -207,7 +207,7 @@

Data Driven Documents

selection .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') @@ -219,7 +219,7 @@

Data Driven Documents

selection .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') @@ -238,7 +238,7 @@

Data Driven Documents

.transition() .duration(3000) // 3 seconds .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') @@ -259,7 +259,7 @@

Data Driven Documents

.transition() .duration(3000) .attr('x', 0) - .attr('y', function(d,i) { return i * 100; }) + .attr('y', function(d,i) { return i * 100 + 50; }) .attr('width', function(d,i) { return d; }) .attr('height', 20) .style('fill', 'steelblue') @@ -276,13 +276,103 @@

Data Driven Documents

.attr('opacity', 0) .remove(); }); - -
-

Putting it all together

-
+ // ------------------------------------------------- + slide.code_title(title = '.data(..., join)'); -