1.2.1 • Published 5 years ago

@times-visuals/treemap v1.2.1

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
5 years ago

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
}
1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago