Skip to content

Instantly share code, notes, and snippets.

@pachadotdev
Created December 26, 2016 04:30
Show Gist options
  • Save pachadotdev/5e7f830503d2d34830f8edfff865f8e4 to your computer and use it in GitHub Desktop.
Save pachadotdev/5e7f830503d2d34830f8edfff865f8e4 to your computer and use it in GitHub Desktop.
Grupo 5 - Groserías no consideradas en Reservoir Dogs
<!doctype html>
<meta charset='utf-8'>
<script src="//d3plus.org/js/d3.js"></script>
<script src="//d3plus.org/js/d3plus.js"></script>
<div id='tree_map'></div>
<script>
var swearwords = [
{
"word": "apeshit",
"freq": 1,
"color": "#999999"
},
{
"word": "bullshit*",
"freq": 19,
"color": "#E69F00"
},
{
"word": "pissed",
"freq": 17,
"color": "#56B4E9"
},
{
"word": "cunt",
"freq": 1,
"color": "#009E73"
},
{
"word": "bastards",
"freq": 9,
"color": "#F0E442"
},
{
"word": "dick",
"freq": 29,
"color": "#0072B2"
},
{
"word": "cooze",
"freq": 2,
"color": "#8CC55C"
},
{
"word": "ass",
"freq": 31,
"color": "#3E302F"
},
{
"word": "asshole",
"freq": 17,
"color": "#041148"
},
{
"word": "pussy",
"freq": 7,
"color": "#427588"
},
{
"word": "prick",
"freq": 2,
"color": "#40A4DF"
},
{
"word": "cocksmen",
"freq": 1,
"color": "#E17457"
}
]
var visualization = d3plus.viz()
.container('#tree_map')
.data(swearwords)
.type('tree_map')
.width(1000)
.height(600)
.resize(true)
.id(['word'])
.size('freq')
.font({'family': 'Lato'})
.labels({'align': 'left', 'valign': 'top'})
.depth(1)
.color('color')
.title('Garabatos no considerados en el conteo de Reservoir Dogs')
.title({
'sub': 'Source: FiveThirtyEight'
})
.title({
'total': {
'font': {'size': 12},
'value': true
},
'sub': {'font': {'size': 12}}
})
<!-- .legend({'order': {'sort': 'desc', 'value': 'size'}}) -->
.legend(false)
.icon({'style': 'knockout', 'value': 'image'})
.draw()
</script>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment