-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- remove gulp usage - update dev dependencies
- Loading branch information
Showing
28 changed files
with
16,252 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
dist | ||
dist copy | ||
debug | ||
coverage | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
!types/** | ||
!LICENSE | ||
!package.json | ||
!README.md | ||
!README.md | ||
dist/**/*.styles.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const path = require('path'); | ||
const resolvePath = (relativePath) => path.resolve(__dirname, relativePath); | ||
|
||
module.exports = { | ||
'canvg': resolvePath('../node_modules/canvg/canvg.js'), | ||
'rgbcolor': resolvePath('../node_modules/canvg/rgbcolor.js'), | ||
'stackblur': resolvePath('../node_modules/canvg/StackBlur.js'), | ||
'tau-tooltip': resolvePath('../node_modules/tau-tooltip/tooltip.js'), | ||
'print.style.css': resolvePath('plugins/print.style.css'), | ||
'taucharts': resolvePath('../src/tau.charts.ts'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const {BannerPlugin} = require('webpack'); | ||
const banner = () => { | ||
const package = require('../package.json'); | ||
const now = new Date(); | ||
const today = require('d3-time-format').utcFormat('%Y-%m-%d')(now); | ||
const year = now.getUTCFullYear(); | ||
return [ | ||
`/*`, | ||
`${package.name}@${package.version} (${today})`, | ||
`Copyright ${year} ${package.author.name}`, | ||
`Licensed under ${package.licenses.map(x => x.type).join(', ')}`, | ||
`*/`, | ||
`` | ||
].join('\n'); | ||
}; | ||
module.exports = new BannerPlugin({ | ||
banner: banner(), // the banner as string, it will be wrapped in a comment | ||
raw: false, // if true, banner will not be wrapped in a comment | ||
entryOnly: true, // if true, the banner will only be added to the entry chunks | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const d3Modules = [ | ||
'd3-array', | ||
'd3-axis', | ||
'd3-brush', | ||
'd3-color', | ||
'd3-format', | ||
'd3-geo', | ||
'd3-request', | ||
'd3-scale', | ||
'd3-selection', | ||
'd3-shape', | ||
'd3-time', | ||
'd3-time-format', | ||
'd3-transition', | ||
'd3-quadtree', | ||
].reduce((modules, module) => { | ||
modules[module] = { | ||
commonjs: module, | ||
amd: module, | ||
commonjs2: module, | ||
root: 'd3' | ||
}; | ||
return modules; | ||
}, {}); | ||
|
||
module.exports = { | ||
...d3Modules, | ||
'topojson-client':{ | ||
commonjs: 'topojson-client', | ||
amd: 'topojson-client', | ||
commonjs2: 'topojson-client', | ||
root: 'topojson' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const path = require('path'); | ||
const alias = require('./alias'); | ||
const resolvePath = (relativePath) => path.resolve(__dirname, relativePath); | ||
|
||
const resolve = { | ||
modules: [ | ||
resolvePath('../'), | ||
'node_modules' | ||
], | ||
alias, | ||
extensions: ['.js', '.json', '.ts'] | ||
}; | ||
|
||
module.exports = { | ||
resolve, | ||
resolvePath | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
rules: [ | ||
{ | ||
loader: 'css-loader', | ||
test: /\.css$/ | ||
}, | ||
{ | ||
loader: 'ts-loader', | ||
test: /\.(js|ts)$/, | ||
exclude: [ | ||
'node_modules', | ||
], | ||
options: { | ||
compilerOptions: { | ||
sourceMap: true | ||
}, | ||
transpileOnly: true | ||
} | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer'); | ||
const webpack = require('webpack'); | ||
const banner = require('./banner'); | ||
|
||
module.exports = [ | ||
// new BundleAnalyzerPlugin({analyzerMode: 'static'}), | ||
banner, | ||
new webpack.DefinePlugin({ | ||
VERSION: JSON.stringify(require('../package.json').version) | ||
}), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const fs = require('fs'); | ||
const plugins = require('./scripts-plugins'); | ||
const {resolvePath, resolve} = require('./resolve'); | ||
const externals = require('./externals'); | ||
const webpackModule = require('./scripts-module'); | ||
|
||
const pluginsEntry = {}; | ||
|
||
fs.readdirSync(resolvePath(`../plugins/`)).forEach((file) => { | ||
if(file.endsWith('.js') || file.endsWith('.ts')) { | ||
pluginsEntry[file.replace(/(.+)(\.js|\.ts)$/ig, '$1')] = resolvePath(`../plugins/${file}`); | ||
} | ||
}); | ||
|
||
module.exports = { | ||
output: { | ||
filename: '[name].js', | ||
path: resolvePath('../dist/plugins'), | ||
libraryTarget: 'umd', | ||
}, | ||
entry: pluginsEntry, | ||
resolve, | ||
externals: {...externals, taucharts: { | ||
commonjs: 'taucharts', | ||
commonjs2: 'taucharts', | ||
umd:'taucharts', | ||
root: 'Taucharts', | ||
} | ||
}, | ||
devtool: 'none', | ||
mode: `development`, | ||
module: webpackModule, | ||
stats: { | ||
colors: true, | ||
reasons: true | ||
}, | ||
plugins: plugins | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const plugins = require('./scripts-plugins'); | ||
const {resolvePath, resolve} = require('./resolve'); | ||
const externals = require('./externals'); | ||
const webpackModule = require('./scripts-module'); | ||
module.exports = { | ||
devServer: { | ||
publicPath: '/dist/', | ||
openPage: 'examples/', | ||
open: true, | ||
}, | ||
output: { | ||
filename: '[name].js', | ||
path: resolvePath('../dist/'), | ||
library: 'Taucharts', | ||
libraryTarget: 'umd', | ||
}, | ||
entry: { | ||
'taucharts': [resolvePath(`../src/tau.charts.ts`)], | ||
'taucharts.min': [resolvePath(`../full/taucharts.full.ts`)] | ||
}, | ||
resolve, | ||
externals, | ||
devtool: 'none', | ||
mode: `development`, | ||
module: webpackModule, | ||
stats: { | ||
colors: true, | ||
reasons: true | ||
}, | ||
plugins, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
const fs = require('fs'); | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
const {resolvePath} = require('./resolve'); | ||
const banner = require('./banner'); | ||
const stylesLoader = (lessVariables) => [ | ||
{ | ||
loader: `css-loader`, | ||
options: { | ||
importLoaders: 1, | ||
sourceMap: false, | ||
}, | ||
}, | ||
{ | ||
loader: `less-loader`, | ||
options: { | ||
sourceMap: false, | ||
paths: [resolvePath(`../less`)], | ||
modifyVars: lessVariables, | ||
}, | ||
}, | ||
]; | ||
|
||
const webpackModules = (theme) => ({ | ||
rules: [{ | ||
test: /\.(css|less)$/, | ||
include: [resolvePath('../less'), resolvePath('../full')], | ||
use: ExtractTextPlugin.extract({ | ||
fallback: `style-loader`, | ||
use: stylesLoader({theme: theme || 'default'}), | ||
}), | ||
}] | ||
}); | ||
|
||
const themes = ['', 'dark']; | ||
const pluginsEntry = {}; | ||
const plugins = [ | ||
banner, | ||
new ExtractTextPlugin({filename: `[name].css`}), | ||
]; | ||
|
||
fs.readdirSync(resolvePath(`../less/plugins/`)).forEach((file) => { | ||
pluginsEntry[file.replace(/(.+)(\.less)$/ig, '$1')] = resolvePath(`../less/plugins/${file}`); | ||
}); | ||
|
||
const getEntries = (theme) => { | ||
return Object.keys(pluginsEntry).reduce((entries, key) => { | ||
entries[`${key}${theme?`.${theme}`:''}`] = pluginsEntry[key]; | ||
return entries; | ||
} , {}); | ||
}; | ||
|
||
const tauchartsStyles = themes.map((theme) => ({ | ||
output: { | ||
filename: '[name].styles.js', | ||
path: resolvePath('../dist/'), | ||
}, | ||
entry: { | ||
[`taucharts${theme?`.${theme}`:''}`]: [resolvePath(`../less/taucharts.less`)], | ||
[`taucharts${theme?`.${theme}`:''}.min`]: [resolvePath(`../full/taucharts.full.less`)] | ||
}, | ||
devtool: 'none', | ||
mode: `development`, | ||
module: webpackModules(theme), | ||
plugins, | ||
})); | ||
|
||
const tauchartsBrewerStyles = { | ||
output: { | ||
filename: '[name].styles.js', | ||
path: resolvePath('../dist/'), | ||
}, | ||
entry: { | ||
'colorbrewer': [resolvePath(`../less/colorbrewer.less`)], | ||
}, | ||
devtool: 'none', | ||
mode: `development`, | ||
module: webpackModules(''), | ||
plugins, | ||
}; | ||
|
||
const tauchartsPluginsStyles = themes.map((theme) => ({ | ||
output: { | ||
filename: '[name].styles.js', | ||
path: resolvePath('../dist/plugins/'), | ||
}, | ||
entry: getEntries(theme), | ||
devtool: 'none', | ||
mode: `development`, | ||
module: webpackModules(theme), | ||
plugins, | ||
})); | ||
|
||
module.exports = tauchartsStyles.concat(tauchartsPluginsStyles, tauchartsBrewerStyles); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Title</title> | ||
<script src="../node_modules/d3/build/d3.js"></script> | ||
<script src="../dist/taucharts.min.js"></script> | ||
<link rel="stylesheet" href="../dist/taucharts.min.css"> | ||
</head> | ||
<body> | ||
<div style="height: 400px" id="line"></div> | ||
<script> | ||
const datasource = [{ | ||
type:'us', count:20, date:'12-2013' | ||
},{ | ||
type:'us', count:10, date:'01-2014' | ||
},{ | ||
type:'bug', count:15, date:'02-2014' | ||
},{ | ||
type:'bug', count:23, date:'05-2014' | ||
}]; | ||
const chart = new Taucharts.Chart({ | ||
data: datasource, | ||
plugins: [ | ||
Taucharts.api.plugins.get('tooltip')(), | ||
Taucharts.api.plugins.get('legend')(), | ||
Taucharts.api.plugins.get('export-to')(), | ||
], | ||
type: 'line', | ||
x: 'date', | ||
y: 'count', | ||
color: 'type' // there will be two lines with different colors on the chart | ||
}); | ||
chart.renderTo('#line'); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@import "taucharts"; | ||
@import "../less/plugins/annotations"; | ||
@import "../less/plugins/category-filter"; | ||
@import "../less/plugins/crosshair"; | ||
@import "../less/plugins/diff-tooltip"; | ||
@import "../less/plugins/export-to"; | ||
@import "../less/plugins/legend"; | ||
@import "../less/plugins/quick-filter"; | ||
@import "../less/plugins/tooltip.less"; | ||
@import "../less/plugins/trendline.less"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Taucharts from '../src/tau.charts'; | ||
|
||
const { | ||
GPL, | ||
Plot, | ||
Chart, | ||
api, | ||
version, | ||
} = Taucharts; | ||
|
||
import '../plugins/annotations'; | ||
import '../plugins/bar-as-span'; | ||
import '../plugins/box-whiskers'; | ||
import '../plugins/category-filter'; | ||
import '../plugins/crosshair'; | ||
import '../plugins/diff-tooltip'; | ||
import '../plugins/export-to'; | ||
import '../plugins/floating-axes'; | ||
import '../plugins/geomap-legend'; | ||
import '../plugins/geomap-tooltip'; | ||
import '../plugins/layers'; | ||
import '../plugins/legend'; | ||
import '../plugins/parallel-brushing'; | ||
import '../plugins/parallel-tooltip'; | ||
import '../plugins/quick-filter'; | ||
import '../plugins/settings'; | ||
import '../plugins/tooltip'; | ||
import '../plugins/trendline'; | ||
|
||
|
||
export { | ||
GPL, | ||
Plot, | ||
Chart, | ||
api, | ||
version, | ||
}; |
Oops, something went wrong.