Skip to content

Instantly share code, notes, and snippets.

@joshkh
Created July 18, 2017 11:50
Show Gist options
  • Save joshkh/c86297e796cc1585fec6e58a5d5d5c08 to your computer and use it in GitHub Desktop.
Save joshkh/c86297e796cc1585fec6e58a5d5d5c08 to your computer and use it in GitHub Desktop.
scaling
reduced = _.reduce withlength, ((total, next, memo) ->
previousLengths = _.reduce total, ((count, p) -> count + p.get("interactor").get("length")), 0
ban = {
startAngle: scale.val(previousLengths),
endAngle: scale.val(next.get("interactor").get("length") + previousLengths)
}
console.log "ban", ban
return total.concat [next]), []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment