Skip to content

Instantly share code, notes, and snippets.

@z3bbster
Forked from vitapluvia/_.md
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save z3bbster/cdd3ca0bbe0024a77d73 to your computer and use it in GitHub Desktop.

Select an option

Save z3bbster/cdd3ca0bbe0024a77d73 to your computer and use it in GitHub Desktop.

Revisions

  1. @vitapluvia vitapluvia revised this gist Oct 27, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion inlet.js
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ group.append("rect")
    y: function() { return mY + 5 },
    x: 265
    })
    d3.selectAll(".indicator").select("rect").attr({
    d3.selectAll(".indicator").selectAll("rect").attr({
    y: function() { return mY }
    })
    })
    @@ -32,3 +32,4 @@ group.append("rect")
    var g2 = group.append("g").attr("class", "indicator")
    g2.append("text")
    g2.append("rect").attr({x:220,y:50,height:2,width:33})
    //g2.append("rect").attr({x:253, y:45,height:12,width:1})
  2. @vitapluvia vitapluvia revised this gist Oct 27, 2013. 1 changed file with 14 additions and 10 deletions.
    24 changes: 14 additions & 10 deletions inlet.js
    Original file line number Diff line number Diff line change
    @@ -2,29 +2,33 @@ var svg = d3.select("svg")
    var mX = 0;
    var mY = 0;
    var group = svg.append("g")

    group.append("rect")
    .on("mousemove", function() {
    mX = d3.mouse(this)[0];
    mY = d3.mouse(this)[1];
    d3.select(this).style({
    d3.selectAll("rect").style({
    fill: function(d) {
    //return "#000FFF";
    return "hsl("+240+", 50%, "+mY*0.2+"%)"
    }
    })
    d3.selectAll(".indicator").select("text").text(function() {
    return "Value: " + mY;
    }).attr({
    y: function() { return mY },
    x: 240
    return "Value: " + Number((mY + 5).toFixed(2));
    })
    d3.selectAll(".indicator").select("text").attr({
    y: function() { return mY + 5 },
    x: 265
    })
    d3.selectAll(".indicator").select("rect").attr({
    y: function() { return mY }
    })
    })
    group.append("rect")
    .attr({y:50, width:150, height:240,
    x: function(d) {
    //return d3.mouse(this)[0];
    return 75
    }
    })
    group.append("g").attr("class", "indicator")
    .append("text")
    .append("rect")
    var g2 = group.append("g").attr("class", "indicator")
    g2.append("text")
    g2.append("rect").attr({x:220,y:50,height:2,width:33})
  3. @vitapluvia vitapluvia revised this gist Oct 27, 2013. 1 changed file with 12 additions and 6 deletions.
    18 changes: 12 additions & 6 deletions inlet.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    var svg = d3.select("svg")
    var mX = 0;
    var mY = 0;
    svg.append("g")
    var group = svg.append("g")
    .on("mousemove", function() {
    mX = d3.mouse(this)[0];
    mY = d3.mouse(this)[1];
    @@ -11,14 +11,20 @@ svg.append("g")
    return "hsl("+240+", 50%, "+mY*0.2+"%)"
    }
    })
    d3.selectAll(".indicator").select("text").text(function() {
    return "Value: " + mY;
    }).attr({
    y: function() { return mY },
    x: 240
    })
    })
    .append("rect")
    group.append("rect")
    .attr({y:50, width:150, height:240,
    x: function(d) {
    //return d3.mouse(this)[0];
    return 50
    return 75
    }
    })
    .append("svg:text").text("rrj")
    .attr({x:50, y:50, width:150, height:240}).style("fill", "#000")

    group.append("g").attr("class", "indicator")
    .append("text")
    .append("rect")
  4. @vitapluvia vitapluvia revised this gist Oct 27, 2013. 2 changed files with 7 additions and 4 deletions.
    2 changes: 1 addition & 1 deletion config.json
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    {"description":"Fader","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/AqCxARM.png"}
    {"description":"Fader","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/oDpd05H.gif"}
    9 changes: 6 additions & 3 deletions inlet.js
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,24 @@
    var svg = d3.select("svg")
    var mX = 0;
    var mY = 0;
    svg.append("rect")
    svg.append("g")
    .on("mousemove", function() {
    mX = d3.mouse(this)[0];
    mY = d3.mouse(this)[1];
    d3.select(this).style({
    fill: function(d) {
    //return "#000FFF";
    console.log(d3.mouse);
    return "hsl("+240+", 50%, "+mY*0.2+"%)"
    }
    })
    })
    .append("rect")
    .attr({y:50, width:150, height:240,
    x: function(d) {
    //return d3.mouse(this)[0];
    return 50
    }
    })
    })
    .append("svg:text").text("rrj")
    .attr({x:50, y:50, width:150, height:240}).style("fill", "#000")

  5. @vitapluvia vitapluvia revised this gist Oct 27, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions _.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    [ <a href="http://tributary.io/inlet/7179273">Launch: Fader</a> ] 7179273 by vitapluvia<br>
  6. @vitapluvia vitapluvia created this gist Oct 27, 2013.
    1 change: 1 addition & 0 deletions config.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"description":"Fader","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/AqCxARM.png"}
    21 changes: 21 additions & 0 deletions inlet.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    var svg = d3.select("svg")
    var mX = 0;
    var mY = 0;
    svg.append("rect")
    .on("mousemove", function() {
    mX = d3.mouse(this)[0];
    mY = d3.mouse(this)[1];
    d3.select(this).style({
    fill: function(d) {
    //return "#000FFF";
    console.log(d3.mouse);
    return "hsl("+240+", 50%, "+mY*0.2+"%)"
    }
    })
    })
    .attr({y:50, width:150, height:240,
    x: function(d) {
    //return d3.mouse(this)[0];
    return 50
    }
    })