Rollup smaller d3 version
This commit is contained in:
parent
ab57409cd2
commit
49889172a9
6 changed files with 34 additions and 2 deletions
|
@ -8,6 +8,13 @@ Generate thumbnails: (TODO: gulpify this)
|
|||
convert -define jpeg:size=200x200 assets/image/* -thumbnail 100x100^ -gravity center -extent 100x100 -set filename:f 'assets/thumb/%t.%e' +adjoin '%[filename:f]'
|
||||
```
|
||||
|
||||
|
||||
After edit of src/js/d3.bundle.js run:
|
||||
|
||||
``` bash
|
||||
rollup -c
|
||||
```
|
||||
|
||||
# TODO
|
||||
|
||||
- minify D3.js with selective components
|
||||
|
|
|
@ -18,7 +18,7 @@ var paths = {
|
|||
"dest": "./assets/css/"
|
||||
},
|
||||
"scripts": {
|
||||
"src": "./src/js/*.js",
|
||||
"src": "./src/js/portfolio.js",
|
||||
"dest": "./assets/js/"
|
||||
},
|
||||
"data": {
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<!-- <ul id='relLinks'></ul> -->
|
||||
</div>
|
||||
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jsonld@0.5.21/dist/jsonld.js"></script> -->
|
||||
<!-- <script type="text/javascript" src="/assets/js/d3.min.js"></script> -->
|
||||
<script type="text/javascript" src="/assets/js/d3.bundle.js"></script>
|
||||
<script type="text/javascript" src="/assets/js/portfolio.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -21,6 +21,14 @@
|
|||
"gulp-uglify": "^3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"d3-color": "^1.2.3",
|
||||
"d3-dispatch": "^1.0.5",
|
||||
"d3-drag": "^1.2.3",
|
||||
"d3-ease": "^1.0.5",
|
||||
"d3-force": "^1.1.2",
|
||||
"d3-selection": "^1.3.2",
|
||||
"d3-transition": "^1.1.3",
|
||||
"d3-zoom": "^1.7.3",
|
||||
"jsonld": "^1.0.4"
|
||||
}
|
||||
}
|
||||
|
|
9
rollup.config.js
Normal file
9
rollup.config.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
import npm from 'rollup-plugin-node-resolve';
|
||||
|
||||
export default {
|
||||
entry: './src/js/d3.bundle.js',
|
||||
format: 'iife', //umd or iife
|
||||
moduleName: 'd3',
|
||||
plugins: [npm({jsnext: true})],
|
||||
dest: './assets/js/d3.bundle.js'
|
||||
};
|
8
src/js/d3.bundle.js
Normal file
8
src/js/d3.bundle.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
export {drag} from "d3-drag";
|
||||
export * from "d3-selection";
|
||||
export * from "d3-zoom";
|
||||
// export * from "d3-scale";
|
||||
export * from "d3-force";
|
||||
export * from "d3-transition";
|
||||
export {easeLinear} from "d3-ease";
|
||||
// export * from "d3-axis";
|
Loading…
Reference in a new issue