Skip to content

Instantly share code, notes, and snippets.

@domitry
Created February 6, 2015 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domitry/cb9dbb6ca1824550291b to your computer and use it in GitHub Desktop.
Save domitry/cb9dbb6ca1824550291b to your computer and use it in GitHub Desktop.
D3.selectAll("rect")
.data([{x: 1, y: 2}, {x: 3, y: 10}])
.attr("x", lambda {|d| d[:x]})
.attr("y", lambda {|d| d[:y]})
.run
#-> <# D3::Selection>
#[
# {target: "a123-23a4-b345", name: "data", args: [{x: 1, y: 2}, {x: 3, y: 10}]},
# {target: "a123-23a4-b345", name: "attr", args: [{type: "Proc", uuid: "123-456-789"}
#]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment