Skip to content

Instantly share code, notes, and snippets.

@Hypercubed
Created October 21, 2015 02:08
Show Gist options
  • Save Hypercubed/c7a952a6e121155969f5 to your computer and use it in GitHub Desktop.
Save Hypercubed/c7a952a6e121155969f5 to your computer and use it in GitHub Desktop.
Hypercubed/Project-Chi - After
<!doctype html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://cdn.rawgit.com/martine/webtreemap/a2fa353833eca1a4821ba4c93fb6a7d546aed02a/webtreemap.css">
<title>./dist/components/bundle.js - Source Map Explorer</title>
<style>
html, body {
height: 100%;
}
body {
font-family: sans-serif;
font-size: 0.8em;
margin: 0;
}
#map {
top: 10px;
bottom: 10px;
left: 10px;
right: 10px;
position: absolute;
cursor: pointer;
-webkit-user-select: none;
}
</style>
</head>
<body>
<div id='map'></div>
</body>
<script>
var tree = {
"jspm_packages/npm/[email protected]/browser.js": 1065,
"jspm_packages/npm/[email protected]": 216,
"jspm_packages/github/jspm/[email protected]/index.js": 250,
"jspm_packages/github/jspm/[email protected]": 260,
"jspm_packages/npm/[email protected]/dist/jquery.js": 84472,
"jspm_packages/npm/[email protected]": 218,
"jspm_packages/npm/[email protected]/d3.js": 151344,
"jspm_packages/npm/[email protected]": 188,
"jspm_packages/github/angular/[email protected]/angular.js": 155245,
"jspm_packages/github/angular/[email protected]": 264,
"jspm_packages/github/angular/[email protected]/angular-route.js": 4604,
"jspm_packages/github/angular/[email protected]": 294,
"jspm_packages/github/angular/[email protected]/angular-animate.js": 23959,
"jspm_packages/github/angular/[email protected]": 304,
"jspm_packages/github/angular/[email protected]/angular-cookies.js": 1616,
"jspm_packages/github/angular/[email protected]": 304,
"jspm_packages/github/angular-ui/[email protected]/ui-bootstrap-tpls.js": 75370,
"jspm_packages/github/angular-ui/[email protected]": 363,
"jspm_packages/github/chjj/[email protected]/lib/marked.js": 15874,
"jspm_packages/github/chjj/[email protected]": 105,
"jspm_packages/github/Hypercubed/[email protected]/angular-marked.js": 1175,
"jspm_packages/github/Hypercubed/[email protected]": 293,
"jspm_packages/github/angular-ui/[email protected]/ui-codemirror.js": 1807,
"jspm_packages/github/angular-ui/[email protected]": 285,
"jspm_packages/npm/[email protected]/lib/svgsaver.js": 4959,
"jspm_packages/npm/[email protected]": 226,
"jspm_packages/npm/[email protected]/lib/angular-downloadsvg-directive.js": 1024,
"jspm_packages/npm/[email protected]": 331,
"jspm_packages/npm/[email protected]/babyparse.js": 7992,
"jspm_packages/npm/[email protected]": 223,
"jspm_packages/npm/[email protected]/src/punycode.js": 2799,
"jspm_packages/npm/[email protected]/src/IPv6.js": 1108,
"jspm_packages/npm/[email protected]/src/SecondLevelDomains.js": 8360,
"jspm_packages/npm/[email protected]/src/URI.js": 27805,
"jspm_packages/npm/[email protected]": 210,
"jspm_packages/npm/[email protected]/mime-lookup.js": 1347,
"jspm_packages/npm/[email protected]": 233,
"jspm_packages/github/codemirror/[email protected]/lib/codemirror.js": 151904,
"jspm_packages/github/eligrey/FileSaver.js@master/FileSaver.js": 3011,
"jspm_packages/github/eligrey/[email protected]": 124,
"components/editor/editor.html": 4424,
"jspm_packages/npm/[email protected]/helpers/class-call-check.js": 354,
"jspm_packages/npm/[email protected]/dist/model.js": 1124,
"jspm_packages/npm/[email protected]": 93,
"jspm_packages/npm/[email protected]/index.js": 51374,
"jspm_packages/npm/[email protected]": 209,
"jspm_packages/npm/[email protected]/index.js": 3709,
"jspm_packages/npm/[email protected]": 206,
"jspm_packages/npm/[email protected]/index.js": 655,
"jspm_packages/npm/[email protected]": 236,
"jspm_packages/npm/[email protected]/src/computeLayout.js": 1194,
"jspm_packages/npm/[email protected]/src/layout.js": 1974,
"jspm_packages/npm/[email protected]/index.js": 368,
"jspm_packages/npm/[email protected]": 227,
"jspm_packages/npm/[email protected]/index.js": 938,
"jspm_packages/npm/[email protected]": 285,
"jspm_packages/github/curran/[email protected]/dist/model.js": 1062,
"jspm_packages/github/curran/[email protected]": 107,
"jspm_packages/npm/[email protected]/d3.js": 151324,
"jspm_packages/npm/[email protected]": 188,
"jspm_packages/npm/[email protected]/backbone-events-standalone.js": 3339,
"jspm_packages/npm/[email protected]/index.js": 314,
"jspm_packages/npm/[email protected]": 266,
"jspm_packages/npm/[email protected]/index.js": 435,
"jspm_packages/npm/[email protected]": 224,
"jspm_packages/npm/[email protected]/lib/expressionbar.js": 3619,
"jspm_packages/npm/[email protected]/index.js": 250,
"jspm_packages/npm/[email protected]": 230,
"components/examples/bars/bars-chart.js": 1500,
"components/examples/trains/trains-chart.js": 2669,
"components/about/about.html": 2197,
"components/error/error.html": 272,
"components/index/index.html": 866,
"common/partials/footer.html": 529,
"common/partials/intro.html": 1426,
"jspm_packages/github/chieffancypants/[email protected]/build/loading-bar.js": 3667,
"jspm_packages/github/chieffancypants/[email protected]": 437,
"common/services/datapackage/mime.js": 661,
"common/services/datapackage/dataservice.js": 2219,
"common/services/datapackage/index.js": 915,
"components/editor/svg-download-dropdown.js": 1080,
"components/editor/editor.js": 3324,
"components/examples/index.js": 546,
"components/examples/chiasm/barChart.js": 1894,
"components/examples/chiasm/chiasm.js": 870,
"components/examples/biojs/biojs.js": 530,
"components/examples/bars/bars.js": 621,
"components/examples/trains/trains.js": 481,
"components/examples/polymer/d3-bar-chart.js": 1574,
"components/examples/polymer/bar-chart-tag.js": 713,
"components/examples/polymer/barChart-controller.js": 502,
"components/examples/routes.js": 1741,
"components/index/index.js": 717,
"components/routes.js": 1205,
"components/app.js": 1619,
"components/boot.js": 130102
};
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script>
<script src="https://cdn.rawgit.com/martine/webtreemap/a2fa353833eca1a4821ba4c93fb6a7d546aed02a/webtreemap.js"></script>
<script>
function newNode(name) {
return {
name: name,
data: {
'$area': 0
},
children: []
};
}
var treeData = newNode('/');
function addNode(path, size) {
var parts = path.split('/');
var node = treeData;
node.data['$area'] += size;
parts.forEach(function(part) {
var child = _.find(node.children, function(child) { return child.name == part; });
if (!child) {
var child = newNode(part);
node.children.push(child);
}
node = child;
node.data['$area'] += size;
});
}
function addSizeToTitle(node, total) {
var size = node.data['$area'],
pct = 100.0 * size / total;
node.name += ' • ' + size.toLocaleString() + ' • ' + pct.toFixed(2) + '%';
node.children.forEach(function(x) { addSizeToTitle(x, total) });
}
for (var source in tree) {
addNode(source, tree[source]);
}
addSizeToTitle(treeData, treeData.data['$area']);
var map = document.getElementById('map');
appendTreemap(map, treeData);
window.addEventListener('resize', function() {
appendTreemap(map, treeData);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment