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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.70latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.70
1.1.60
1.1.50
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.90
1.0.80
1.0.70
1.0.60
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

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