diff --git a/README.md b/README.md index 25bcd9f..19ae4be 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Intro to D3 This is the source for Square's [Intro to D3.js][intro-to-d3] tutorial, it's -a brief intro to d3.js with examples. +a brief intro to D3.js with examples. + +This tutorial is intended for D3 v5-v7. For versions of the tutorial compatible with older versions of D3, please see the releases section of the repository. [intro-to-d3]: https://square.github.io/intro-to-d3 diff --git a/_includes/examples/axes.html b/_includes/examples/axes.html index 2708289..14ece4f 100644 --- a/_includes/examples/axes.html +++ b/_includes/examples/axes.html @@ -7,13 +7,13 @@
+ src="{{ "/javascripts/d3.v5.min.js" | prepend: site.baseurl }}"> diff --git a/_includes/examples/dom-styled.html b/_includes/examples/dom-styled.html index 6afe5a2..ebffe4c 100644 --- a/_includes/examples/dom-styled.html +++ b/_includes/examples/dom-styled.html @@ -5,7 +5,7 @@ {% include examples/dom.html %} + src="{{ "/javascripts/d3.v5.min.js" | prepend: site.baseurl }}"> diff --git a/_includes/examples/dom.js b/_includes/examples/dom.js index 7c0165e..3b46eb5 100644 --- a/_includes/examples/dom.js +++ b/_includes/examples/dom.js @@ -1,19 +1,19 @@ // DOM API var clickMe = document.getElementById('click-me'); -clickMe.onclick = function() { - if (this.style.backgroundColor) { - this.style.backgroundColor = ''; - } else { - this.style.backgroundColor = 'red'; - } +clickMe.onclick = function () { + if (this.style.backgroundColor) { + this.style.backgroundColor = ''; + } else { + this.style.backgroundColor = 'red'; + } } // D3 Selection API. Note: it attaches the // callbacks to each element in the selection d3.selectAll('.hover-me') - .on('mouseover', function() { - this.style.backgroundColor = 'yellow'; - }) - .on('mouseleave', function() { - this.style.backgroundColor = ''; - }); \ No newline at end of file + .on('mouseover', function () { + this.style.backgroundColor = 'yellow'; + }) + .on('mouseleave', function () { + this.style.backgroundColor = ''; + }); \ No newline at end of file diff --git a/_includes/examples/ex0.html b/_includes/examples/ex0.html index 52d9a54..c733dd7 100644 --- a/_includes/examples/ex0.html +++ b/_includes/examples/ex0.html @@ -4,6 +4,6 @@ - +