Skip to content

Instantly share code, notes, and snippets.

@pachadotdev
Last active December 26, 2016 04:28
Show Gist options
  • Save pachadotdev/d1014dfc199532284cbb4d75460101be to your computer and use it in GitHub Desktop.
Save pachadotdev/d1014dfc199532284cbb4d75460101be to your computer and use it in GitHub Desktop.
Otro ejemplo de Treemap con D3Plus

license: gpl-3.0

este es un ejemplo de como ejecutar D3Plus directamente desde un gist

<!doctype html>
<meta charset="utf-8">
<script src="//d3plus.org/js/d3.js"></script>
<script src="//d3plus.org/js/d3plus.js"></script>
<div id="exports"></div>
<script>
// sample data array
var trade_data = [
{"usd": 34590873460, "product": "Oil"},
{"usd": 12897429187, "product": "Cars"},
{"usd": 8974520985, "product": "Airplanes"},
{"usd": 9872342, "product": "Apples"},
{"usd": 6897234098, "product": "Shoes"},
{"usd": 590834587, "product": "Glass"},
{"usd": 987234261, "product": "Horses"}
]
// instantiate d3plus
var visualization = d3plus.viz()
.container("#exports")
.data(trade_data)
.type("tree_map")
.id("product")
.size("usd")
.labels({"align": "left", "valign": "top"})
.draw()
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment