Skip to content

Commit e4a0761

Browse files
authored
Update README.md (#191)
Add a section in `README.md` so that users are aware that react and d3 are peer dependencies that need to be installed.
1 parent 6168c28 commit e4a0761

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,20 @@ Full documentation [here](https://danielcaldas.github.io/react-d3-graph/docs/ind
3535
[![https://nodei.co/npm/YOUR-MODULE-NAME.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/react-d3-graph.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/react-d3-graph)
3636

3737
```bash
38-
npm install react-d3-graph // using npm
38+
npm install d3@^5.5.0 # if you don't have d3 already
39+
npm install react@^16.4.1 # if you don't have react already
40+
41+
npm install react-d3-graph
3942
```
4043

44+
#### About react and d3 peer dependencies
45+
46+
**Note** that `react` and `d3` are [peer-dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/), this means that the responsability to install them is delegated to the client. This will give you a bigger flexibility on what versions of `d3` and `react` you want to consume, you just need to make sure that you are compliant with the range of versions that `react-d3-graph` is compatible with. If you install `react-d3-graph` without first installing `d3` and `react` you might be propmt the following warnings:
47+
48+
> npm WARN [email protected] requires a peer of d3@^5.5.0 but none is installed. You must install peer dependencies yourself.
49+
> npm WARN [email protected] requires a peer of react@^16.4.1 but none is installed. You must install peer dependencies yourself.
50+
51+
4152
## Usage sample
4253

4354
Graph component is the main component for react-d3-graph components, its interface allows its user to build the graph once the user provides the data, configuration (optional) and callback interactions (also optional).

0 commit comments

Comments
 (0)