d3-react-container

1.1.7 • Public • Published

d3-react-container

NPM version npm download

Maintainer

Muhammad Usman

Installation

npm install d3-react-container

Usage

Using NPM

1 . Require d3-react-container after installation

import D3Container from 'd3-react-container'

2 . Add parent element = "html element" to D3Container component

<D3Container element="div" />

3 . Include d3 implementation in D3Callback props

<D3Container element="div"
        d3Callback={selection => {
          //d3 code
        }/>

Options

props Type Description Default Value
element String HTML element 'div'
D3Callback Function D3 Implementation (selection)=> {}

Example of using d3-react-container:

import D3Container from 'd3-react-container'
 
<D3Container
        element="div"
        d3Callback={selection => {
 
          const div = selection.attr('class', 'App')
          .style('width', '500px')
          .style('height', '500px')
 
          const header = div.append('header').attr('class', 'App-header')}/>

Contributing

We welcome your contribution! Fork the repo, make some changes, submit a pull-request!.

License

none

Readme

Keywords

none

Package Sidebar

Install

npm i d3-react-container

Weekly Downloads

0

Version

1.1.7

License

none

Unpacked Size

274 kB

Total Files

3

Last publish

Collaborators

  • usman17