Try using refreshData = instead of refreshData: here.
d3Graph: =>
refreshData = ->
console.log "refresh data called"
someButton.click ->
refreshData()
If that doesn't work, you'll have to provide more complete code.
If you run into problems like this, it's always helpful to see what the output JavaScript is.
For instance, in this case, your original code outputs:
var _this = this;
({
d3Graph: function() {
({
refreshData: function() {
return console.log("refresh data called");
}
});
return someButton.click(function() {
return refreshData();
});
}
});
So it should be apparent that there is no variable/function called refreshData!