[ Launch: path test ] 5061490 by jonahx
[ Launch: geometry daily #129 ] 5056075 by jonahx
[ Launch: geometry daily #129 ] 4942307 by enjalot
-
-
Save jonahx/5061490 to your computer and use it in GitHub Desktop.
arc path test
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":"arc path test","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"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":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("svg")//.width(600).height(600) | |
var pi = Math.PI; | |
var arcData = d3.svg.arc() | |
.innerRadius(37) | |
.outerRadius(52) | |
.startAngle(0) //converting from degs to radians | |
.endAngle(function(t) {return t}) //just radians | |
function arcTween(b) { | |
var i = d3.interpolate(0, b); | |
return function(t) { | |
return arcData(i(t)); | |
}; | |
} | |
svg.append("path") | |
.data([3]) | |
.attr("transform", "translate(200,200)") | |
.transition() | |
.duration(3000) | |
.attrTween("d", arcTween) |
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
circle { | |
fill: none; | |
stroke: #1FB41F; | |
stroke-width: 2; | |
opacity: 0.4 | |
} | |
path { | |
fill: none; | |
stroke: #1FB41F; | |
stroke-width: 2; | |
opacity: 0.3 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment