Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-canvas-treemap

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-canvas-treemap

Canvas based Treemap data visualization using React.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-canvas-treemap

by the Growth Lab at Harvard's Center for International Development

Canvas based Treemap data visualization using React.

This package is part of Harvard Growth Lab’s portfolio of software packages, digital products and interactive data visualizations. To browse our entire portfolio, please visit The Viz Hub at growthlab.app. To learn more about our research, please visit Harvard Growth Lab’s home page.

NPM JavaScript Style Guide

View live examples ↗

Install

npm install --save react-canvas-treemap

Usage

import React from 'react'
import TreeMap, {transformData} from 'react-canvas-treemap';

const App = () => {

  ...
  const data = transformData({
    data: fetchedData,
    width: 500,
    height: 500,
    colorMap: colorMap,
  });

  return (
    <TreeMap
      highlighted={undefined}
      cells={data.treeMapCells}
      numCellsTier={0}
      chartContainerWidth={500}
      chartContainerHeight={500}
      onCellClick={id => console.log(id)}
      onMouseOverCell={id => console.log(id)}
      onMouseLeaveChart={() => {}}
    />
  )
}

export default App

The TreeMap component takes the following props:

  • highlighted: string | undefined
  • cells: ITreeMapCell[]
  • comparisonTreeMap (optional): boolean
  • fallbackTitle (optional): string
  • numCellsTier: NumCellsTier
  • chartContainerWidth: number
  • chartContainerHeight: number
  • onCellClick: (id: string) => void
  • onMouseOverCell: (id: string) => void
  • onMouseLeaveChart: () => void

License

MIT © The President and Fellows of Harvard College

:warning: License: While this package has a MIT license, it uses Greensock, which is not an Open-Source software. All of the Greensock Code used here falls within their "No Charge" License. If you intend to use this package, make sure to familiarize yourself with the Greensock "No Charge" License.

FAQs

Package last updated on 18 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc