Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PPAAS(Pet Project As A Startup) using Data visu...

Makoto Inoue
October 12, 2013
100

PPAAS(Pet Project As A Startup) using Data visualisation as an interface

At Rupy 2013

Makoto Inoue

October 12, 2013
Tweet

Transcript

  1. YCombinator 2012: 2 women / over 80 teams BGV 2013:

    9 women / 10 teams Diversified
  2. What is d3.js ? D3.js is a JavaScript library for

    manipulating documents based on data.
  3. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Transforming Data with d3.js
  4. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Transforming Data with d3.js
  5. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Selector
  6. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Dynamic Property
  7. <ul class="bin"> <li class="appeared" style="width: 24px; left: 240px; background-color: rgb(44,

    160, 44);">ɹ </li> <li class="appeared" style="width: 160px; left: 640px; background-color: rgb(31, 119, 180);">ɹ </li> </ul> Result
  8. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Binding Data
  9. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Binding Data
  10. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Scaling Size
  11. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Scaling Size http://www.jeromecukier.net/blog/2011/08/11/d3-scales-and-color/
  12. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Scaling Color
  13. var data = [{start:30, duration:3},{start:80, duration:20}] var ul = d3.select('ul.bin')

    var bar = ul.selectAll("li") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('li') .attr('class', 'appeared') .style({ width:function(d){return x(d.duration) + 'px'}, left:function(d){return x(d.start) + 'px'}, 'background-color': function(d, i){return color(i)} }) .text("ɹ") Dynamic Property
  14. SVG? var data = [{start:30, duration:3}, {start:80, duration:20}] var svg

    = d3.select('body').append('svg') var bar = svg.selectAll("rect") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('rect') .attr('class', 'appeared') .attr({ width:function(d){return x(d.duration) + 'px'}, x:function(d){return x(d.start) + 'px'}, height:'10px', }) .style('fill',function(d, i){return color(i)})
  15. var data = [{start:30, duration:3}, {start:80, duration:20}] var svg =

    d3.select('body').append('svg') var bar = svg.selectAll("rect") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('rect') .attr('class', 'appeared') .attr({ width:function(d){return x(d.duration) + 'px'}, x:function(d){return x(d.start) + 'px'}, height:'10px', }) .style('fill',function(d, i){return color(i)}) Difference
  16. var data = [{start:30, duration:3}, {start:80, duration:20}] var svg =

    d3.select('body').append('svg') var bar = svg.selectAll("rect") .data(data); var x = d3.scale.linear() .domain([0, 100]) .range([0, 800]); var color = d3.scale.category10().domain([1,2]) bar.enter().append('rect') .attr('class', 'appeared') .attr({ width:function(d){return x(d.duration) + 'px'}, x:function(d){return x(d.start) + 'px'}, height:'10px', }) .style('fill',function(d, i){return color(i)}) Same
  17. for( var i=0; i < frame.hands.length; i++ ){ var hand

    = frame.hands[i]; var handPos = hand.palmPosition ; for( var j=0; j < hand.fingers.length;j++){ var finger = hand.fingers[j]; // Do something } } Getting Positions
  18. var gesture = frame.gestures[0]; var type = gesture.type; switch( type

    ){ case "circle": break; case "swipe": break; case "screenTap": break; case "keyTap": break; } Gestures
  19. Lessons learnt • No comic sans on editor • Hacking

    cool stuff for good could get you funded • Every input needs visualisation