Skip to content

Instantly share code, notes, and snippets.

@asavin
Created February 26, 2014 14:11
Show Gist options
  • Select an option

  • Save asavin/9230094 to your computer and use it in GitHub Desktop.

Select an option

Save asavin/9230094 to your computer and use it in GitHub Desktop.
buildTreeChart = (tags) ->
tags
|> group-by (-> it)
|> obj-to-pairs
|> map (-> [it[0], it[1].length])
|> sort-by (.1)
|> reverse
|> take 10
|> map (-> {name: it[0], size: it[1]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment