[ Launch: Tributary inlet ] aee304a355bbf6f283d6 by k-izzo
-
-
Save k-izzo/aee304a355bbf6f283d6 to your computer and use it in GitHub Desktop.
Tributary inlet
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":"Tributary inlet","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,"ajax-caching":true,"thumbnail":"http://i.imgur.com/ipR7wKv.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 color = d3.scale.category10(); | |
var vis = d3.select('svg') | |
.append('g') | |
.attr('transform', 'translate(50,50)'); | |
var w = 400, | |
h = 300 | |
var data = d3.range(10) | |
vis | |
.append('rect') | |
.attr({ | |
x: 0, | |
y: 0, | |
width: w, | |
height: h | |
}) | |
.style({ | |
fill: 'lightblue', | |
'fill-opacity': 0.5 | |
}) | |
var rows = vis.selectAll('.row') | |
.data(data) | |
.enter() | |
.append('g') | |
.attr('transform', function (d) { return 'translate(' + [0, 30 + 30*d] + ')'; }) | |
var prod_name = rows.append('text').text('hello') | |
function line(container, d) { | |
container.append('line') | |
.attr({ | |
x1: 0, | |
y1: 0, | |
x2: 100, | |
y2: 0 | |
}) | |
.style({ | |
stroke: color(d), | |
fill: 'none' | |
}) | |
} | |
line(d3.selectAll('g'), function (d) { console.log(d); return d; }) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment