Treemap Visualization
A visualization of the highest-grossing movies using D3.js to generate an SVG graphic.
I built this little website for freeCodeCamp’s third Responsive Web Design Projects.
I had the pleasure of banging this visualization out over the course of two days (12 hours), and chose to not use any tooltip or legend librairies in order to challenge myself to learn more.
User Stories
The brief for the Visualize Data with a Treemap Diagram project was as follows:
- My tree map should have a title with a corresponding id=“title”.
- My tree map should have a description with a corresponding id=“description”.
- My tree map should have rect elements with a corresponding class=“tile” that represent the data.
- There should be at least 2 different fill colors used for the tiles.
- Each tile should have the properties data-name, data-category, and data-value containing their corresponding name, category, and value.
- The area of each tile should correspond to the data-value amount: tiles with a larger data-value should have a bigger area.
- My tree map should have a legend with corresponding id=“legend”.
- My legend should have rect elements with a corresponding class=“legend-item”.
- The rect elements in the legend should use at least 2 different fill colors.
- I can mouse over an area and see a tooltip with a corresponding id=“tooltip” which displays more information about the area.
- My tooltip should have a data-value property that corresponds to the data-value of the active area.