Skip to content

Muhammad-Usman17/react-d3

Repository files navigation

d3-react-container

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"
        element="div"
        d3Callback={selection => {
          //d3 code
        }/>

Options

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

Show specific tooltip manually, for example:

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

About

D3 container for React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published