[ Launch: Use of SVG Def ] 60ee159cae663f80f0f4 by ramnathv
-
-
Save ramnathv/60ee159cae663f80f0f4 to your computer and use it in GitHub Desktop.
Use of SVG Def
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
{"description":"Use of SVG Def","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,"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
svg = d3.select("svg") | |
.attr("width", 600) | |
.attr("height", 400) | |
.append("g") | |
.attr("transform", "translate(58, 50)") | |
svg.append("def") | |
.append("rect") | |
.attr("id", "myrect") | |
.attr("width", 40) | |
.attr("height", 20) | |
.attr("fill", "none") | |
.attr("stroke", "darkred") | |
.attr("rx", 6) | |
.attr("ry", 6) | |
svg.append("use") | |
.attr("x", 20).attr("y", 72) | |
.attr("xlink:href", "#myrect") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment