Custom build of D3 with d3-jetpack-module and geoNaturalEarth
To modify:
add or remove packages in index.js
> npm run build
Forked from D3 Custom Bundle II
export * from "d3"
export * from "d3-jetpack"
// change default dates
import {timeFormatDefaultLocale} from "d3";
var nytLocale = {
"dateTime": "%x, %X",
"date": "%-m/%-d/%Y",
"time": "%-I:%M:%S %p",
"periods": ["AM", "PM"],
"days": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
"shortDays": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
"months": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
"shortMonths": ["Jan.", "Feb.", "March", "April", "May", "June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."]
}
timeFormatDefaultLocale(nytLocale);
export * from "graph-scroll"
// export * from "d3-contour"
// export * from "d3-scale-chromatic"
// export {
// geoNaturalEarth,
// geoSatellite
// } from "d3-geo-projection"
// export {range} from 'd3-array'
// export {line, area} from 'd3-shape'
// export {select, selectAll, event} from 'd3-selection'
// export * from 'd3-transition'
// export * from 'd3-drag'
// // export {dispatch} from 'd3-dispatch'
// export {timer} from 'd3-timer'
// export * from "d3-jetpack"
// export * from "graph-scroll"
<!DOCTYPE html>
<meta charset='utf-8'>
<body></body>
<script src='d3.js'></script>
<script>
d3.select('body').appendMany(d3.range(10), 'h1')
.text('Hello, world!')
.st({
textAlign: 'center',
lineHeight: 20,
fontSize: 20,
transform: 'rotate(-180deg) scale(0.001, 0.001)'
})
.transition()
.delay((d, i) => i*300)
.duration(1500)
.style('transform', null);
</script>
{
"name": "d3-custom-example",
"version": "0.0.1",
"scripts": {
"build": "rollup -c && uglifyjs d3.js -c -m -o d3.min.js && cat lodash.js d3.min.js > d3_.js",
"clean": "rm -rf node_modules && rm yarn.lock && yarn && yarn run build",
"copy": "yarn run build && cp d3_.js ../sloped-stroke-width/d3_.js"
},
"devDependencies": {
"d3": "4",
"d3-geo-projection": "^1.2.2",
"d3-jetpack": "2",
"rollup": "0.41",
"rollup-plugin-node-resolve": "2",
"uglify-js": "2"
},
"dependencies": {
"d3-contour": "^1.1.0",
"d3-scale-chromatic": "^1.1.1",
"graph-scroll": "^1.0.1"
}
}
import npm from "rollup-plugin-node-resolve";
export default {
entry: "index.js",
format: "umd",
moduleName: "d3",
plugins: [npm({jsnext: true})],
dest: "d3.js"
};