Update readme and build script

This commit is contained in:
Pitchaya Boonsarngsuk
2018-02-02 10:48:48 +00:00
parent 2f8b6cfdec
commit dd0456cd2b
2 changed files with 18 additions and 5 deletions

View File

@@ -38,6 +38,21 @@ var simulation = d3.forceSimulation(nodes);
</script>
```
## File structure
- [index.js](index.js) Export list of the module
- [src/](src) Source code of the module
- [package.json](package.json) Node.js moudle descriptor with build scripts
- [img](img) Images for this readme file
- [examples](examples) An example page running all the algorithms implemented
## Building
```bash
npm run build
npm run minify
npm run zip
```
See package.json for more details.
## API Reference
#### Spring Model

View File

@@ -12,14 +12,12 @@
"main": "build/d3-spring-model.js",
"jsnext:main": "index",
"scripts": {
"pretest": "rm -rf build && mkdir build && rollup -g d3-force:d3,d3-dispatch:d3,d3-quadtree:d3,d3-collection:d3 -f umd -n d3 -o build/d3-spring-model.js -- index.js",
"test": "tape 'test/**/*-test.js'",
"prepublish": "npm run test && node_modules/uglify-es/bin/uglifyjs build/d3-spring-model.js -c -m -o build/d3-spring-model.min.js",
"postpublish": "zip -j build/d3-spring-model.zip -- LICENSE README.md build/d3-spring-model.js build/d3-spring-model.min.js"
"build": "rimraf build && mkdir build && rollup -g d3-force:d3,d3-dispatch:d3,d3-quadtree:d3,d3-collection:d3 -f umd -n d3 -o build/d3-spring-model.js -- index.js",
"minify": "node_modules/uglify-es/bin/uglifyjs build/d3-spring-model.js -c -m -o build/d3-spring-model.min.js",
"zip": "zip -j build/d3-spring-model.zip -- LICENSE README.md build/d3-spring-model.js build/d3-spring-model.min.js"
},
"devDependencies": {
"rollup": "0.36",
"tape": "4",
"uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony"
},
"dependencies": {