An implementation in D3 of Figure 5-19 "Revised treemap from R to Illustrator" in "Visualize This" by Nathan Yau.
The color scale looks way more washed out than the one in the book unfortunately
xxxxxxxxxx
<body>
<style>
body {
width: 100%;
font-family: Georgia;
font-size: 14px;
color: #333;
}
#container {
width: 500px;
margin: 0 auto;
position: relative;
}
#header h1 {
text-transform: uppercase;
font-size: 18px;
}
#header {
line-height: 1.4em;
margin-bottom: 16px;
}
.category-text {
font-family: Arial;
fill: #fff;
}
</style>
<div id="container">
<div id="header">
<h1>FlowingData map</h1>
Below are popular posts on FlowingData. Each rectangle represents a post. Size represents number of views and brigther green indicates more comments
</div>
</div>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="app.js"></script>
</body>
https://d3js.org/d3.v4.min.js