There are just too many chains
in the JavaScript
world.
# jquery
$(document.createElement 'div')
.appendTo('body')
.css(
width: 100
height: 50
)
.text('haha')
# d3
circle = d3.select('svg').selectAll("circle")
.data(data)
circle.enter()
.append("circle")
.attr("r", 2.5)
circle
.attr("cx", (d)-> d.x)
.attr("cy", (d)-> d.y)
circle.exit().remove()
# jquery
unchain $, (document.createElement div), ->
@$ @appendTo, 'body', ->
@css
width: 100
height: 50
@text 'haha'
# d3
unchain d3.select, 'svg', ->
@$ @selectAll, 'circle', ->
@$ @data, data, ->
@$ @enter, ->
@$ @append, circle, ->
@attr r: 2.5
@attr
cx: (d)-> d.x
cy: (d)-> d.y
@$ @exit, ->
@remove()
- see some examples