Photo by Todd Quackenbush on Unsplash

Treemaps are a great way to view hierarchical data sets using nested rectangles. In this article we’re going to create a Treemap utilizing the d3 JavaScript library in React to visualize a set of static data.

Setting up our environment

First we’ll need to create a React template which we’ll do using the create-react-app npx command found below. This will set up a React template for us and help us hit the ground running.

npx create-react-app treemap


Avid computerer, giant Celtics and Patriots fan

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store