coffeescript - Convert javascript code into coffescript -
im working dashing , need convert javascript code coffescript in order create utilize of rickshaw graph library. (according source code on website http://code.shutterstock.com/rickshaw/examples/x_axis.html)
i'm trying have customized x axis on graph.
default coffescript code= x_axis = new rickshaw.graph.axis.x(graph: @graph)
js code converted
var format = function(n) { var map = { 0: 'zero', 1: 'first', 2: 'second', 3: 'third', 4: 'fourth' }; homecoming map[n]; } var x_ticks = new rickshaw.graph.axis.x( { graph: graph, tickformat: format } );
into coffescript
var format = function(n) { var map = { 0: 'zero', 1: 'first', 2: 'second', 3: 'third', 4: 'fourth' }; homecoming map[n]; } x_axis = new rickshaw.graph.axis.x(graph: @graph,tickformat: format)//make utilize of format
format = (n)-> map = 0: 'zero', 1: 'first', 2: 'second', 3: 'third', 4: 'fourth' map[n]
javascript coffeescript rickshaw
No comments:
Post a Comment