[ Launch: dotenter_test1 ] 5626069 by sdawson
-
-
Save sdawson/5626069 to your computer and use it in GitHub Desktop.
dotenter_test1
This file contains hidden or 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":"dotenter_test1","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":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01} |
This file contains hidden or 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 data1 = d3.range(10); | |
var rects = svg.selectAll("rect") | |
.data(data1); | |
var colourScale = d3.scale.category20(); | |
var colourScale = d3.scale.ordinal() | |
.range(["#C9A166", | |
"#B3159A", | |
"#26268B", | |
"#4BB9D5"]); | |
var colourScale = d3.scale.linear() | |
.domain([0, 10]) | |
.range(["#ff0000", "#6964D1"]); | |
rects.enter() | |
.append("rect") | |
.attr({ | |
width: 23, | |
height: 100, | |
y: 100, | |
x: function(d, i) { | |
return i * 50 + 115; | |
}, | |
fill: function(d, i) { | |
return colourScale(i); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment