Skip to content

Commit

Permalink
misc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vogievetsky committed Oct 16, 2012
1 parent 8a8aea7 commit ea9a0c0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
D3 slides in D3 that I put together after becoming frustrated with explaining D3 using PowerPoint.

Questions, comments, contributions, feedback, etc.

```javascript
// base64 email for fun.
sendEmailTo(atob("dmFkaW1Ab2dpZXZldHNreS5jb20="))
```
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>D3</h1>
<h2>Data Driven Documents</h2>
<a href="http://github.com/vogievetsky/IntroD3">http://github.com/vogievetsky/IntroD3</a>
<div class="name">Vadim Ogievetsky</div>
<div class="date">Slides last updated: May 22, 2012</div>
<div class="date">Slides last updated: Oct 16, 2012</div>
</section>

<script src="slides.js"></script>
Expand Down
19 changes: 16 additions & 3 deletions slides.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,36 @@ slide.title "First, some JavaScript"
slide.code "JavaScript", null, """
// In JS functions are first class citizens.
// This is a very powerful concept!
var squared = function(x) {
function sq1(x) {
return x * x
}
console.log("squared(7) ==", squared(7))
var sq2 = function(x) {
return x * x
}
console.log("sq1(4) ==", sq1(4)) // == 16
console.log("sq2(4) ==", sq2(4)) // == 16
sq1.foo = 8
sq2.bar = 3
console.log("Wow dude:", sq1(sq1.foo + sq2.bar))
"""

slide.code "JavaScript", null, """
// D3 has many helper methods
// d3.scale.linear() returns a function that
// will map the given domain to the given
// range linearly.
var w = 640, h = 320
// x is a function!
var x = d3.scale.linear()
.domain([-1, 1])
.range([0, w])
// y is also a function!
var y = d3.scale.linear()
.domain([0, 1])
.range([0, h])
Expand Down Expand Up @@ -414,7 +427,7 @@ selection.exit()
"""

# -----------------------------------------------
slide.title "Educational Examples"
slide.title "Useful Examples"

slide.code "Shuffle", empty_svg, """
var cards = [
Expand Down
6 changes: 4 additions & 2 deletions slides.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ea9a0c0

Please sign in to comment.