@kitsuyui/react-treemap
v0.2.2
Published
A react treemap component.
Readme
@kitsuyui/react-treemap
Treemap is a component that displays boxes like a tree mapping chart.
Design role
This package is a treemap layout primitive plus an auto-measuring default wrapper.
SizedTreemap calculates positioned regions for a known width and height, while AutoTreemap measures the parent and feeds that primitive.
Demo
Storybook: https://react-playground.docs.kitsuyui.com/storybook/
Installation
npm
npm install @kitsuyui/react-treemapyarn
yarn add @kitsuyui/react-treemappnpm
pnpm add @kitsuyui/react-treemapUsage
import { AutoTreemap, SizedTreemap, TreemapContext } from '@kitsuyui/react-treemap'Use AutoTreemap when the component should measure its parent automatically.
Use SizedTreemap when layout bounds are already known.
Use TreemapContext when each cell needs access to its computed rectangle metadata.
License
MIT
