jcbridwe jcbridwe - 8 months ago 63
CoffeeScript Question

Inserting labeled javascript/json into a coffee format

I am trying to use Flot tooltip in a coffee file, but I am having trouble inserting the necessary labelled javascript/json code into the coffee code. I've tried the js2coffee converter tool, but it doesn't seem to work. Here's the code, I am trying to translate into coffee; any suggestions?

grid: { hoverable: true },
tooltip: {
show: true,
content: "y: %y"


The object can be written in CoffeeScript as follows:

somevar =
    hoverable: true
    show: true
    content: 'y: %y'

You can see the conversion to JavaScript live on