[ Launch: draw rect then move it ] 5848b87f13ed7cb6a5c9 by rickdg
-
-
Save rickdg/5848b87f13ed7cb6a5c9 to your computer and use it in GitHub Desktop.
draw rect then move it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"endpoint":"","display":"svg","public":true,"require":[],"tab":"edit","display_percent":0.6316353887399463,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"description":"draw rect then move it","fileconfigs":{"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"ajax-caching":true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var svg = d3.select("svg"); | |
var xscale = d3.scale.linear() | |
.domain([0, 1]) | |
.range([0, 608]); | |
var yscale = d3.scale.linear() | |
.domain([0, 1]) | |
.range([0, 682]); | |
var brush = d3.svg.brush() | |
.x(xscale) | |
.y(yscale); | |
var slider = svg.append("g") | |
.attr("transform", "translate(" + [100, 100] + ")"); | |
brush.extent([0.4, 0.6]); | |
brush(slider); | |
slider.selectAll("rect.background") | |
.attr("height", 386) | |
.attr("width", 613); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.background { | |
visibility: visible !important; | |
} | |
.extent { | |
visibility: visible !important; | |
fill: #ffffff; | |
fill-opacity: 0.3; | |
} | |
.resize rect { | |
visibility: visible !important; | |
fill: #00E753; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment