Skip to content

Commit 85fd46c

Browse files
authored
Feature/npm dependencies (#3)
* Lock dependencies versions. Separate devDepdencencies from dependencies * Lock dependencies versions. Separate devDepdencencies from dependencies
1 parent 7d53d10 commit 85fd46c

File tree

6 files changed

+524
-528
lines changed

6 files changed

+524
-528
lines changed

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# react-d3-graph
22
Interactive and configurable graphs with react and d3 effortlessly
33

4-
## Tips
4+
## Compatibility
5+
- Node version >= 4.7.0
6+
- npm3
7+
8+
## Notes
59
- Obtain a cool node when set the fill property as white a other color for the border. It will seem like the node is more like a ring.
10+
- Default configuration:
11+
```javascript
12+
export default {
13+
automaticRearrangeAfterDropNode: false, // Very expensive for dense graph
14+
height: 450,
15+
highlightBehavior: false,
16+
highlightOpacity: 1, // For all elements: nodes, text and links
17+
maxZoom: 8,
18+
minZoom: 0.5,
19+
staticGraph: false,
20+
width: 800,
21+
node: {
22+
color: '#d3d3d3',
23+
fontSize: 10, // in px
24+
fontWeight: 'normal',
25+
highlightColor: 'SAME',
26+
highlightFontSize: 10,
27+
highlightFontWeight: 'normal',
28+
highlightStrokeColor: 'none',
29+
highlightStrokeWidth: 1.5,
30+
labelProperty: 'id',
31+
mouseCursor: 'pointer',
32+
opacity: 1,
33+
renderLabel: true,
34+
size: 200,
35+
strokeColor: 'none',
36+
strokeWidth: 1.5,
37+
symbolType: 'circle'
38+
},
39+
link: {
40+
color: '#d3d3d3',
41+
highlightColor: '#d3d3d3',
42+
opacity: 1,
43+
strokeWidth: 1.5
44+
}
45+
};
46+
```

package.json

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,52 @@
11
{
22
"name": "react-d3-graph",
33
"version": "0.0.0",
4-
"description": "React component to build interactive and configurable graphs with d3 effortlessly\"",
5-
"main": "index.js",
4+
"description": "React component to build interactive and configurable graphs with d3 effortlessly",
65
"author": "Daniel Caldas",
76
"license": "MIT",
87
"dependencies": {
9-
"babel-core": "latest",
10-
"babel-loader": "latest",
11-
"babel-plugin-add-module-exports": "latest",
12-
"babel-plugin-react-html-attrs": "latest",
13-
"babel-plugin-transform-class-properties": "latest",
14-
"babel-plugin-transform-decorators-legacy": "latest",
15-
"babel-preset-es2015": "latest",
16-
"babel-preset-react": "latest",
17-
"babel-preset-stage-0": "latest",
18-
"d3": "^4.7.4",
19-
"documentation": "^4.0.0-beta.18",
20-
"eslint": "^3.18.0",
21-
"eslint-config-recommended": "^1.5.0",
22-
"eslint-plugin-promise": "^3.5.0",
23-
"eslint-plugin-standard": "^2.1.1",
24-
"html-webpack-plugin": "^2.28.0",
25-
"react": "latest",
26-
"react-dom": "latest",
27-
"react-router-dom": "^4.0.0",
28-
"react-spinkit": "^2.1.1",
29-
"redux": "latest",
30-
"redux-logger": "latest",
31-
"redux-promise": "latest",
32-
"redux-promise-middleware": "latest",
33-
"redux-thunk": "latest",
34-
"style-loader": "^0.14.1",
35-
"webpack": "latest",
36-
"webpack-dev-server": "latest"
8+
"d3": "4.7.4",
9+
"react": "15.4.2"
3710
},
38-
"devDependencies": {},
11+
"devDependencies": {
12+
"babel-core": "6.24.0",
13+
"babel-loader": "6.4.1",
14+
"babel-plugin-add-module-exports": "0.2.1",
15+
"babel-plugin-react-html-attrs": "2.0.0",
16+
"babel-plugin-transform-class-properties": "6.22.0",
17+
"babel-plugin-transform-decorators-legacy": "1.3.4",
18+
"babel-preset-es2015": "6.16.0",
19+
"babel-preset-react": "6.16.0",
20+
"babel-preset-stage-0": "6.16.0",
21+
"documentation": "4.0.0-beta.18",
22+
"eslint-config-recommended": "1.5.0",
23+
"eslint-plugin-promise": "3.5.0",
24+
"eslint-plugin-standard": "2.1.1",
25+
"eslint": "3.18.0",
26+
"html-webpack-plugin": "2.28.0",
27+
"react-dom": "15.4.2",
28+
"react-router-dom": "4.0.0",
29+
"webpack": "2.3.2",
30+
"webpack-dev-server": "2.4.2"
31+
},
32+
"repository": {
33+
"type": "git",
34+
"url": "git+https://github.com/danielcaldas/react-d3-graph.git"
35+
},
36+
"keywords": [
37+
"d3-visualization",
38+
"d3js",
39+
"graphs",
40+
"javascript",
41+
"networks",
42+
"react",
43+
"social-network-analysis",
44+
"social-network-graph",
45+
"visualization"
46+
],
3947
"scripts": {
40-
"dev": "./node_modules/.bin/webpack-dev-server -d --content-base src --inline --hot --port 3002",
48+
"dev": "node_modules/.bin/webpack-dev-server -d --content-base src --inline --hot --port 3002",
49+
"dist": "webpack -p",
4150
"docs": "node_modules/documentation/bin/documentation.js build src/**/*.js -f html -o docs && node_modules/documentation/bin/documentation.js build src/**/*.js -f md > DOCUMENTATION.md",
4251
"lint": "node_modules/eslint/bin/eslint.js --config=.eslintrc.js \"src/**/*.js\"",
4352
"test": "echo \"Error: no test specified\" && exit 1"

src/js/components/Graph/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
export default {
2-
automaticRearrangeAfterDropNode: false, // Very expensive for dense graphs, this will start a new force ...
2+
automaticRearrangeAfterDropNode: false,
33
height: 450,
44
highlightBehavior: false,
5-
highlightOpacity: 1, // For all elements: nodes, text and links
5+
highlightOpacity: 1,
66
maxZoom: 8,
77
minZoom: 0.5,
88
staticGraph: false,
99
width: 800,
1010
node: {
1111
color: '#d3d3d3',
12-
fontSize: 10, // in px
12+
fontSize: 10,
1313
fontWeight: 'normal',
1414
highlightColor: 'SAME',
1515
highlightFontSize: 10,

src/js/components/Graph/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import ERRORS from '../../err';
99
import GraphHelper from './helper';
1010
import Utils from '../../utils';
1111

12-
// @TODO: When node dragged out of bouds the graph gets repainted
1312
export default class Graph extends React.Component {
1413
constructor(props) {
1514
super(props);

webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var debug = process.env.NODE_ENV !== 'production';
1+
var dev = process.env.NODE_ENV !== 'production';
22
var webpack = require('webpack');
33
var path = require('path');
44

@@ -7,7 +7,7 @@ var path = require('path');
77

88
module.exports = {
99
context: path.join(__dirname, 'src'),
10-
devtool: debug ? 'source-map' : null,
10+
devtool: dev ? 'source-map' : null,
1111
entry: './js/app.js',
1212
output: {
1313
path: __dirname + '/dist/',
@@ -26,7 +26,7 @@ module.exports = {
2626
}
2727
]
2828
},
29-
plugins: debug ? [] : [
29+
plugins: dev ? [] : [
3030
new webpack.optimize.OccurrenceOrderPlugin(),
3131
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
3232
],

0 commit comments

Comments
 (0)