-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- create js bundle to use as lib (need to exclude vega and vega lite, see #6) - create standalone html examples
- Loading branch information
Showing
12 changed files
with
155 additions
and
97 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,2 +1,4 @@ | ||
build/*.js | ||
config/*.js | ||
lib/ | ||
dist/ |
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,6 +1,7 @@ | ||
.DS_Store | ||
node_modules/ | ||
dist/ | ||
lib/ | ||
npm-debug.log* | ||
test/unit/coverage | ||
|
||
|
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 @@ | ||
const webpack = require('webpack') | ||
const CopyWebpackPlugin = require('copy-webpack-plugin') | ||
const base = require('./webpack.base.conf') | ||
const config = require('../config') | ||
|
||
// this is used only for umd browser bundle, | ||
// refer to .babelrc for lib configuration | ||
|
||
base.entry = { | ||
'vue-vega': './src/index.js', | ||
} | ||
|
||
base.output = { | ||
path: config.bundle.assetsRoot, | ||
publicPath: config.bundle.assetsPublicPath, | ||
filename: 'vue-vega.min.js', | ||
libraryTarget: 'umd', | ||
library: 'VueVega' | ||
} | ||
|
||
var webpackConfig = Object.assign({ | ||
devtool: '#source-map' | ||
}, base) | ||
|
||
webpackConfig.plugins = (webpackConfig.plugins || []).concat([ | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: '"production"' | ||
} | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: { warnings: false }, | ||
sourceMap: true | ||
}) | ||
]) | ||
|
||
module.exports = webpackConfig |
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
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
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,22 +1,22 @@ | ||
<script> | ||
export default { | ||
export default { | ||
data () { | ||
return { | ||
values: [ | ||
{a: 'A', b: 28}, {a: 'B', b: 55}, {a: 'C', b: 43}, | ||
{a: 'D', b: 91}, {a: 'E', b: 81}, {a: 'F', b: 53}, | ||
{a: 'G', b: 19}, {a: 'H', b: 87}, {a: 'I', b: 52} | ||
] | ||
} | ||
}, | ||
data () { | ||
return { | ||
values: [ | ||
{a: 'A', b: 28}, {a: 'B', b: 55}, {a: 'C', b: 43}, | ||
{a: 'D', b: 91}, {a: 'E', b: 81}, {a: 'F', b: 53}, | ||
{a: 'G', b: 19}, {a: 'H', b: 87}, {a: 'I', b: 52} | ||
] | ||
} | ||
}, | ||
mark: 'bar', | ||
mark: 'bar', | ||
encoding: { | ||
x: {field: 'a', type: 'ordinal'}, | ||
y: {field: 'b', type: 'quantitative'} | ||
encoding: { | ||
x: {field: 'a', type: 'ordinal'}, | ||
y: {field: 'b', type: 'quantitative'} | ||
} | ||
} | ||
} | ||
</script> | ||
|
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
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
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
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,39 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Trivial Bar Chart</title> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.2/vue.min.js"></script> | ||
<script src="../../dist/vue-vega.min.js"></script> | ||
</head> | ||
<body> | ||
<div id='app'> | ||
<bar-chart description='A simple bar chart'></bar-chart> | ||
</div> | ||
<script> | ||
/* global Vue */ | ||
Vue.use(window.VueVega.default) | ||
|
||
Vue.component('bar-chart', { | ||
data () { | ||
return { | ||
values: [ | ||
{a: 'A', b: 28}, {a: 'B', b: 55}, {a: 'C', b: 43}, | ||
{a: 'D', b: 91}, {a: 'E', b: 81}, {a: 'F', b: 53}, | ||
{a: 'G', b: 19}, {a: 'H', b: 87}, {a: 'I', b: 52} | ||
] | ||
} | ||
}, | ||
mark: 'bar', | ||
encoding: { | ||
x: {field: 'a', type: 'ordinal'}, | ||
y: {field: 'b', type: 'quantitative'} | ||
} | ||
}) | ||
|
||
new Vue({ // eslint-disable-line no-new | ||
el: '#app' | ||
}) | ||
</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,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Spec inside instance</title> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.2/vue.min.js"></script> | ||
<script src="../../dist/vue-vega.min.js"></script> | ||
</head> | ||
<body> | ||
<div id='visualization'></div> | ||
<script> | ||
/* global Vue */ | ||
Vue.use(window.VueVega.default) | ||
|
||
new Vue({ // eslint-disable-line no-new | ||
el: '#visualization', | ||
data: { | ||
values: [ | ||
{a: 'A', b: 28}, {a: 'B', b: 55}, {a: 'C', b: 43}, | ||
{a: 'D', b: 91}, {a: 'E', b: 81}, {a: 'F', b: 53}, | ||
{a: 'G', b: 19}, {a: 'H', b: 87}, {a: 'I', b: 52} | ||
] | ||
}, | ||
mark: 'line', | ||
encoding: { | ||
x: {field: 'a', type: 'ordinal'}, | ||
y: {field: 'b', type: 'quantitative'} | ||
} | ||
}) | ||
|
||
</script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.