From 5c2fe296d2e29eb060248123905023de4969f6fb Mon Sep 17 00:00:00 2001 From: Thomas Wolfe Date: Sun, 12 Jun 2016 17:15:35 -0700 Subject: [PATCH 1/2] minor typos fixed --- z03-data-binding.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/z03-data-binding.md b/z03-data-binding.md index a11eeb4..b061e86 100644 --- a/z03-data-binding.md +++ b/z03-data-binding.md @@ -54,7 +54,7 @@ var sales = [ And we want to map these to points on a scatterplot. We know we want each object -in this array into of these to turn into `` tag, inside of our `` +in this array to turn into a `` tag, inside of our `` below:
@@ -106,7 +106,7 @@ none and we have 4 new data points, so obviously the right thing to do is to add a new `` for each data point. The way D3 looks at this is a more subtle: we want to add a `` -per data point, *but only for the new points the last data join*. Since this +per data point, *but only for the new points since the last data join*. Since this is the first data binding (there are no rects currently), everything is new, it's straightforward to add new points. It's important to keep in mind that for the next selection, things will be more complex since there will already be @@ -115,8 +115,7 @@ rects. The part of a D3 selection that represents these element-less data-points is `selection.enter()`; -
-
+
{% highlight javascript %} var newRects = rects.enter(); {% endhighlight %} @@ -309,7 +308,7 @@ nextrects.enter().append('rect'); // adds one element ## Transitions `selection.transition()` -The key function also important in case parts of our objects change -- if we +The key function also important in case parts of our objects change -- if we change a count, then we can update the appropriate element without having to delete and re-add the element, we can update it in place. From 28141278f63b5d1e96e00fc0cfb591557a7470f6 Mon Sep 17 00:00:00 2001 From: Thomas Wolfe Date: Mon, 13 Jun 2016 10:13:10 -0700 Subject: [PATCH 2/2] Update z03-data-binding.md --- z03-data-binding.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/z03-data-binding.md b/z03-data-binding.md index b061e86..4056da3 100644 --- a/z03-data-binding.md +++ b/z03-data-binding.md @@ -308,7 +308,7 @@ nextrects.enter().append('rect'); // adds one element ## Transitions `selection.transition()` -The key function also important in case parts of our objects change -- if we +The key function is also important in case parts of our objects change -- if we change a count, then we can update the appropriate element without having to delete and re-add the element, we can update it in place. @@ -477,4 +477,4 @@ mostly build on what we've already shown. - \ No newline at end of file +