Monday, 24 March 2014

Watching d3 videos on Youtube...

A nice break from books and websites just for a change I have checked out some Youtube videos.

The are made by d3Vienno and have quite a nice style.

I have just looked at the second video and learned the following:


Looking at the d3 code:

Some really core concepts:

D3 object
Functions or methods
Arguments

Method chaining – methods separated by dots.


<script>

            d3.select(“body”).append(“p”).text(“Hi, what’s up?”);

</script>




d3 is the object - Calling the d3 object
select, append, text are all methods or functions.
Brackets denote the arguments.

Another function
Append – so adding something to the body – in this case paragraph – this is an argument


Then we have the text method specifying the


method and object separated by a dot.
This is method chaining.

Connect selections and the methods we want to perform on that.


Basic methods in d3
select – selecting elements
append – add elements



A comment about the consol – in Chrome.




No comments:

Post a Comment