# d3-react-container

> D3 container for React.js

Latest version **1.1.7** (published 2019-12-30) · none license · 0 weekly downloads

## Install

```sh
npm install d3-react-container
pnpm add d3-react-container
yarn add d3-react-container
bun add d3-react-container
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.7 |
| Published | 2019-12-30 |
| First published | 2019-11-04 |
| Weekly downloads | 0 |
| License | none |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 267.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Muhammad Usman |
| Maintainers | usman17 |

## Links

- npm: https://www.npmjs.com/package/d3-react-container
- Repository: https://github.com/Muhammad-Usman17/react-d3
- Homepage: https://github.com/Muhammad-Usman17/react-d3#readme
- Issues: https://github.com/Muhammad-Usman17/react-d3/issues
- npm.io page: https://npm.io/package/d3-react-container

## Dependencies (2)

- [d3](https://npm.io/package/d3.md) ^5.12.0
- [react](https://npm.io/package/react.md) ^16.11.0

## Recent versions

- 1.1.7 (latest) — 2019-12-30
- 1.1.6 — 2019-12-30
- 1.1.5 — 2019-11-13
- 1.1.4 — 2019-11-12
- 1.1.3 — 2019-11-08
- 1.1.2 — 2019-11-08
- 1.1.1 — 2019-11-08
- 1.1.0 — 2019-11-08
- 1.0.9 — 2019-11-08
- 1.0.8 — 2019-11-08
- 1.0.7 — 2019-11-06
- 1.0.6 — 2019-11-06
- 1.0.4 — 2019-11-06
- 1.0.3 — 2019-11-05
- 1.0.2 — 2019-11-05
- … 2 more at https://npm.io/package/d3-react-container/versions

## README

# d3-react-container

[![NPM version](https://img.shields.io/npm/v/d3-react-container)][download-url]
[![npm download](https://img.shields.io/npm/dm/d3-react-container)][download-url]

[download-image]: https://img.shields.io/npm/dm/react-tooltip.svg?style=flat-square
[download-url]: https://npmjs.org/package/d3-react-container

## Maintainer

[Muhammad Usman](https://github.com/Muhammad-Usman17)

## Installation

```sh
npm install d3-react-container
```

## Usage

**Using NPM**

1 . Require d3-react-container after installation

```js
import D3Container from 'd3-react-container'
```

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

```jsx
<D3Container element="div" />
```

3 . Include d3 implementation in D3Callback props

```jsx
<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:

```jsx
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

---
_Source: https://npm.io/package/d3-react-container · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
