Live screencast on my tech blog (fr speaking):
http://www.mathieu-elie.net/screencast-video-d3-js-sinatra-elasticsearch-capucine/
other tech slides at my blog: http://www.mathieu-elie.net
4. d3.js
• data([4, 8, 15, 16, 23, 42])
• array of document elements (<p>)
• data[i] <=> elements[i] -> each element of
the data array is binded to an element of
the document
5. d3.js
• #repeat : each element of the data array is
binded to an element of the document
• foreach item of my data array:
• .enter().append("p").text(function(d)
{ return "I'm number " + d + "!"; });
• i build a <p> el and set a text with the data
value
6. d3.js
• circle.exit().remove();
• when data element is removed, i just the
remove the same index element from the
dom
• if data data value is updated ? transition +
svg!
• rect.transition().duration(1000).attr("x",
function(d, i) { return x(i) - .5; });
9. sinatra
• quick web application without persistence
and so on (but you can too ;))
• data viz with static js / css / html
• proxy to api (here we have a proxy to the
elastic search api)
• make call to facebook / oauth api and get
token for debug....
• etc....
11. elasticsearch
• put json on the index
• search index
• response times are indcrebly fast
• super easy clustering (sharding +
replication)
• and requested by REST / json api
13. the app
js
d3.js sinatra elasticsearch
ajax
javascript
sinatra really
contain main elasticsearch
handy for
part of app accessed via
proxying with
vizualiation and http
REST api
http querying