Rollup smaller d3 version

This commit is contained in:
Ruben van de Ven 2018-10-30 11:14:36 +01:00
parent ab57409cd2
commit 49889172a9
6 changed files with 34 additions and 2 deletions

View file

@ -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]' 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 # TODO
- minify D3.js with selective components - minify D3.js with selective components

View file

@ -18,7 +18,7 @@ var paths = {
"dest": "./assets/css/" "dest": "./assets/css/"
}, },
"scripts": { "scripts": {
"src": "./src/js/*.js", "src": "./src/js/portfolio.js",
"dest": "./assets/js/" "dest": "./assets/js/"
}, },
"data": { "data": {

View file

@ -69,7 +69,7 @@
<!-- <ul id='relLinks'></ul> --> <!-- <ul id='relLinks'></ul> -->
</div> </div>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jsonld@0.5.21/dist/jsonld.js"></script> --> <!-- <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> <script type="text/javascript" src="/assets/js/portfolio.js"></script>
</body> </body>
</html> </html>

View file

@ -21,6 +21,14 @@
"gulp-uglify": "^3.0.1" "gulp-uglify": "^3.0.1"
}, },
"dependencies": { "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" "jsonld": "^1.0.4"
} }
} }

9
rollup.config.js Normal file
View 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
View 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";