🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

d3-stacked-rect

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-stacked-rect

Draw d3 stacked rect SVG based on their weights

latest
Source
npmnpm
Version
1.3.1
Version published
Maintainers
1
Created
Source

d3-stacked-rect

Draw d3 stacked rect SVG based on their weights

d3 stacked rect

Installation

npm

$ npm install --save d3-stacked-react

Usage

Below is the example of custom components:

<D3StackedRect data={data} height={700} color="#96cc66" />

Options

data: PropTypes.object.isRequired

const data = {
  titles: {
    P3: 10,
    P4: 12,
    P5: 13,
    P6: 8,
    P7: 3,
    P8: 3,
    P9: 2,
  },
  subTitles: {
    P3: 'Junior Engineer',
    P4: 'Engineer',
    P5: 'Senior Engineer',
    P6: '',
    P7: 'Senior Principle Engineer',
    P8: 'Lead Principle Engineer',
    P9: 'Distinguised Engineer',
  },
};

Note: if associated title field in subTitles is empty, it won't render the subTitles. Otherwise, it will add '-' to the subTitles.

height

height: PropTypes.number.isRequired

Set the height of of the SVG.

color (optional)

color: PropTypes.string

Set the color of of the SVG, should be a hash string like '#96cc66', if not given, will use random color

Development

This project use Parcel. If you hasn't install it, you might need install Parcel first.

npm install -g parcel-bundler

or

yarn global add parcel-bundler

$ git clone git@github.com:cthroo/d3-stacked-rect.git
$ cd d3-stacked-rect
$ npm install
$ npm run dev

Then

open http://localhost:1234

## License

MIT

Keywords

d3

FAQs

Package last updated on 05 Aug 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