Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

@times-visuals/treemap

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@times-visuals/treemap

Treemap

latest
npmnpm
Version
1.2.1
Version published
Maintainers
2
Created
Source

Treemap

A treemap chart built in d3

Installation

# Yarn
$ yarn add @times-visuals/treemap

# npm
$ npm add @times-visuals/treemap

Usage

import Treemap from '@times-visuals/treemap';

export default () => <Treemap data={data} onHover={function} />;

Data format

   [
    {
      id: "HouseOfCommons",
      children: [
        {
          category: "Commons staff",
          number: "7194",
          id: "commons"
        },
        ...
      ],
      color: "#254251",
      fontColor: "#ffffff"
    },

On hover return

If an onHover function is added, it will get passed an object in the following structure:

{
    data: Object of the square,
    depth: 2,
    height: 2,
    parent: Object of the parent,
    value: value of the square,
    x0: xx,
    x1: xx,
    y0: yy,
    y1: yy
}

FAQs

Package last updated on 11 Nov 2019

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