Skip to main content
100%

Interactive Visualisation

✓ Published0🌍 Public
Wwalesiam
Last edited Apr 20, 2023
Created on Apr 20, 2023

A treemap visualizes hierarchical sales data from a UK sales CSV, with regions and towns nested by country. Users hover over rectangles to see a breadcrumb showing the region, town, and total sales value. Built with React and D3 v7, the chart uses `d3.stratify`, `d3.treemap`, and `d3.scaleOrdinal` to structure and color the hierarchy, while SVG rendering and `mouseenter` events drive the interactive labels and layout.

AI-generated description

Boilerplate code for a React + D3 visualization with:

  • CDN links for React, ReactDOM, and D3
  • Basic React boilerplate
  • Variables for dimensions and margins
  • A VizContainer component that:
    • Abstracts SVG/group container elements
    • Follows the margin convention
    • Show the margins, which can be easily removed by deleting the showMargins={true} prop
MIT Licensed

Similar vizzes