[ Launch: color scales ] 223a4bfc0a6f7ee88812 by john-guerra
See Previous Inlet [ Gist ]
-
-
Save john-guerra/223a4bfc0a6f7ee88812 to your computer and use it in GitHub Desktop.
color scales
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":"color scales","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":true,"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,"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":528,"height":570,"hide":false},"thumbnail":"http://i.imgur.com/eziRLS1.gif","ajax-caching":true} |
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("sv"); | |
var data1 = d3.range(38); | |
var rects = svg.selectAll("rect") | |
.data(data1); | |
//var colorScale = d3.scale.category20(); | |
/* | |
var colorScale = d3.scale.ordinal() | |
.range(["#540069", | |
"#0033FF", | |
"#00C2FF", | |
"#831010" | |
]); | |
*/ | |
var colorScale = d3.scale.linear() | |
.domain([d3.min(data1), d3.max(data1)]) | |
//.interpolate(d3.interpolateHsl) | |
.interpolate(d3.interpolateLab) | |
//.interpolate(d3.interpolateHcl) | |
.range(["#0072ff", "#00ff0c"]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment