Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class csser
- constructor: (@style...,@selection) ->
- @json2style()
- json2style: () =>
- ###
- Apply an object of styles to a selection
- ###
- if @style
- @selection.style @style[0]
- style2json: () =>
- ###
- Requires CSSJSON
- Return an object
- ###
- CSSJSON.toJSON @selection.attr 'style'
- clear: () =>
- ###
- clear the style on the current selection
- ###
- @selection.attr 'style', null
- d3.selection.prototype.css = (style)->
- style = d3.functor style
- @.each (d,i) ->
- new csser style(d,i), d3.select(@)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement