[ Launch: RangePoints test ] 6500672 by roundrobin
-
-
Save roundrobin/6500672 to your computer and use it in GitHub Desktop.
RangePoints 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":"RangePoints test","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":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/XwMhVzl.png"} |
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 height = 225; | |
var width = 315; | |
g.append("rect") | |
.attr({ | |
width: width, | |
height: height, | |
fill: "#ddd" | |
}); | |
var range = d3.range(5); | |
var scaleOrdinal = d3.scale.ordinal().domain(range).rangePoints([0, height], 0.7); | |
var color = "#133E8C"; | |
var strokeColor = "#C88100"; | |
var strokeWidth = 6; | |
g.selectAll('.circle') | |
.data(range) | |
.enter() | |
.append("circle") | |
.attr({ | |
r: scaleOrdinal(0), | |
cx: function(d,i){ | |
return scaleOrdinal(1)+scaleOrdinal(1); | |
}, | |
cy: function(d,i){ | |
return scaleOrdinal(i); | |
}, | |
fill: color, | |
stroke: strokeColor, | |
"stroke-width": strokeWidth | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment