[ Launch: b1 ] 5410199 by panamantis
See Previous Inlet [ Gist ]
-
-
Save panamantis/5410199 to your computer and use it in GitHub Desktop.
b1
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
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false},"description":"b1","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"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} |
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("body").append("svg") | |
.attr("width", 960) | |
.attr("height", 500) | |
.append("g") | |
.attr("transform", "translate(480,250)"); | |
var rect = svg.append("path") | |
.attr("d", rightRoundedRect(-240, -120, 480, 240, 20)); | |
// Returns path data for a rectangle with rounded right corners. | |
// The top-left corner is ⟨x,y⟩. | |
function rightRoundedRect(x, y, width, height, radius) { | |
return "M" + x + "," + y | |
+ "h" + (width - radius) | |
+ "a" + radius + "," + radius + " 0 0 1 " + radius + "," + radius | |
+ "v" + (height - 2 * radius) | |
+ "a" + radius + "," + radius + " 0 0 1 " + -radius + "," + radius | |
+ "h" + (radius - width) | |
+ "z"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment