Compare commits

..

19 Commits

Author SHA1 Message Date
Jakub Juszczak
932b73a1dc 💎 Release new version 2.8.3 2017-09-06 19:57:57 +02:00
Jakub
0569a9f794 Merge pull request #187 from apertureless/feature/fix_styles
🔥 Remove default styles object as it causes problems
2017-09-02 15:28:27 +02:00
Jakub Juszczak
154e284528 🔥 Remove default styles object as it causes problems
This will fix #176

Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2017-09-02 15:11:47 +02:00
Jakub
491625b49b Merge pull request #186 from apertureless/feature/lodash-merge
remvove lodash merge
2017-09-02 14:36:55 +02:00
Jakub Juszczak
d26078f08c 🔥 Remove lodash merge
Replaced with Object.assign()

Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2017-09-02 14:27:48 +02:00
Jakub Juszczak
6de69631b3 Replace lodash with lodash.merge
Single module should be smaller

Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2017-09-02 13:40:16 +02:00
Jakub Juszczak
82712948e9 📝 Update CHANGELOG
Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2017-08-12 20:16:01 +02:00
Jakub Juszczak
9237fa538f 💎 Release new version 2.8.2
Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2017-08-12 20:13:04 +02:00
Jakub
82c502cf45 Merge pull request #166 from dsbert/patch-1
Add support for xLabels and yLabels
2017-08-09 14:17:48 +02:00
bertolds
676a60a363 fix linting errors 2017-08-07 09:49:46 -04:00
bertolds
f60f87c141 Merge branch 'develop' into patch-1 2017-08-07 09:46:37 -04:00
bertolds
b7f2bf7db2 Merge branch 'patch-1' of https://github.com/dsbert/vue-chartjs into patch-1 2017-08-07 09:46:03 -04:00
bertolds
0e419886b1 Add cross-env to all steps of build script 2017-08-07 09:42:16 -04:00
Dan
f95ea49a19 Merge pull request #1 from apertureless/develop
Bring up to date with origin
2017-08-07 09:41:47 -04:00
Dan
1e392091ea Add support for xLabels and yLabels 2017-08-07 09:41:33 -04:00
Jakub
4bf4f5736c Merge pull request #165 from mikeybeck/patch-1
Update README.md
2017-08-07 10:24:38 +02:00
Mikey Beck
703a91dafa Update README.md 2017-08-07 12:07:18 +12:00
Mikey Beck
d68af61dce Update README.md
Typo
2017-08-07 12:05:01 +12:00
Dan
a5b58c3b98 Add support for xLabels and yLabels 2017-08-04 15:06:22 -04:00
18 changed files with 115 additions and 86 deletions

View File

@@ -1,5 +1,5 @@
{ {
"presets": ["es2015", "stage-2"], "presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"], "plugins": ["transform-runtime", "transform-object-assign"],
"comments": false "comments": false
} }

View File

@@ -1,5 +1,53 @@
# Change Log # Change Log
## [v2.8.2](https://github.com/apertureless/vue-chartjs/tree/v2.8.2) (2017-08-12)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.8.1...v2.8.2)
**Closed issues:**
- UNMET PEER DEPENDENCY [\#167](https://github.com/apertureless/vue-chartjs/issues/167)
- Base Charts' height: 200% [\#164](https://github.com/apertureless/vue-chartjs/issues/164)
**Merged pull requests:**
- Add support for xLabels and yLabels [\#166](https://github.com/apertureless/vue-chartjs/pull/166) ([dsbert](https://github.com/dsbert))
- Update README.md [\#165](https://github.com/apertureless/vue-chartjs/pull/165) ([mikeybeck](https://github.com/mikeybeck))
## [v2.8.1](https://github.com/apertureless/vue-chartjs/tree/v2.8.1) (2017-08-05)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.8.0...v2.8.1)
**Merged pull requests:**
- Add Russian documentation [\#163](https://github.com/apertureless/vue-chartjs/pull/163) ([dood-](https://github.com/dood-))
## [v2.8.0](https://github.com/apertureless/vue-chartjs/tree/v2.8.0) (2017-08-04)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v1.2.0...v2.8.0)
**Closed issues:**
- Update README CDN link [\#161](https://github.com/apertureless/vue-chartjs/issues/161)
- Options being ignored [\#160](https://github.com/apertureless/vue-chartjs/issues/160)
- Fails to dynamically change height. [\#158](https://github.com/apertureless/vue-chartjs/issues/158)
- Chart doesn't load in bootstrap tab [\#157](https://github.com/apertureless/vue-chartjs/issues/157)
- Add scatter chart to vue-chatjs@legacy [\#155](https://github.com/apertureless/vue-chartjs/issues/155)
- \[Error\] Get error when $destroy is started. [\#149](https://github.com/apertureless/vue-chartjs/issues/149)
**Merged pull requests:**
- Feature/dynamic styles [\#162](https://github.com/apertureless/vue-chartjs/pull/162) ([apertureless](https://github.com/apertureless))
- Add Chinese simplified docs support. [\#159](https://github.com/apertureless/vue-chartjs/pull/159) ([Mooooooon](https://github.com/Mooooooon))
## [v1.2.0](https://github.com/apertureless/vue-chartjs/tree/v1.2.0) (2017-07-25)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.7.2...v1.2.0)
**Closed issues:**
- this.$refs doesn't seem to have expected canvas property [\#156](https://github.com/apertureless/vue-chartjs/issues/156)
**Merged pull requests:**
- Before destroy fix [\#152](https://github.com/apertureless/vue-chartjs/pull/152) ([DenisLapi](https://github.com/DenisLapi))
## [v2.7.2](https://github.com/apertureless/vue-chartjs/tree/v2.7.2) (2017-07-22) ## [v2.7.2](https://github.com/apertureless/vue-chartjs/tree/v2.7.2) (2017-07-22)
[Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.7.1...v2.7.2) [Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v2.7.1...v2.7.2)

View File

@@ -66,7 +66,7 @@ You can use `vue-chartjs` directly in the browser without any build setup. Like
If you're using Gulp, Browserify or Webpack 1 the entry is `vue-chartjs.js` which is __transpiled__ and __bundled__ UMD Module. If you're using Gulp, Browserify or Webpack 1 the entry is `vue-chartjs.js` which is __transpiled__ and __bundled__ UMD Module.
However Vue.js and Chart.js are `deerDependencies` so you have to install them seperately. In most projects you will have `Vue.js` already installed anyways. This way, you can have different versions of Vue.js and Chart.js then in this package. However Vue.js and Chart.js are `peerDependencies` so you have to install them separately. In most projects you will have `Vue.js` already installed anyways. This way, you can have different versions of Vue.js and Chart.js then in this package.
### Webpack 2 ### Webpack 2
If you're using Webpack 2 it will automatically use the `jsnext:main` / `module` entry point. Which is `es/index.js` If you're using Webpack 2 it will automatically use the `jsnext:main` / `module` entry point. Which is `es/index.js`

View File

@@ -1,6 +1,6 @@
{ {
"name": "vue-chartjs", "name": "vue-chartjs",
"version": "2.8.1", "version": "2.8.3",
"description": "vue.js wrapper for chart.js", "description": "vue.js wrapper for chart.js",
"author": "Jakub Juszczak <jakub@posteo.de>", "author": "Jakub Juszczak <jakub@posteo.de>",
"homepage": "http://vue-chartjs.org", "homepage": "http://vue-chartjs.org",
@@ -56,9 +56,7 @@
"release": "webpack --progress --hide-modules --config ./build/webpack.release.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js && webpack --progress --hide-modules --config ./build/webpack.release.full.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.full.min.js", "release": "webpack --progress --hide-modules --config ./build/webpack.release.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js && webpack --progress --hide-modules --config ./build/webpack.release.full.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.full.min.js",
"prepublish": "yarn run lint && yarn run test && yarn run build" "prepublish": "yarn run lint && yarn run test && yarn run build"
}, },
"dependencies": { "dependencies": {},
"lodash": "^4.17.4"
},
"peerDependencies": { "peerDependencies": {
"chart.js": "^2.6.0", "chart.js": "^2.6.0",
"vue": "^2.4.2" "vue": "^2.4.2"
@@ -67,6 +65,7 @@
"babel-cli": "^6.24.1", "babel-cli": "^6.24.1",
"babel-core": "^6.25.0", "babel-core": "^6.25.0",
"babel-loader": "^7.0.0", "babel-loader": "^7.0.0",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1", "babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1", "babel-preset-stage-2": "^6.24.1",

View File

@@ -41,14 +41,7 @@ export default Vue.extend({
default: '' default: ''
}, },
styles: { styles: {
type: Object, type: Object
default () {
return {
width: '100%',
height: '100%',
position: 'relative'
}
}
} }
}, },
data () { data () {

View File

@@ -42,14 +42,7 @@ export default Vue.extend({
default: '' default: ''
}, },
styles: { styles: {
type: Object, type: Object
default () {
return {
width: '100%',
height: '100%',
position: 'relative'
}
}
} }
}, },

View File

@@ -42,14 +42,7 @@ export default Vue.extend({
default: '' default: ''
}, },
styles: { styles: {
type: Object, type: Object
default () {
return {
width: '100%',
height: '100%',
position: 'relative'
}
}
} }
}, },

View File

@@ -42,14 +42,7 @@ export default Vue.extend({
default: '' default: ''
}, },
styles: { styles: {
type: Object, type: Object
default () {
return {
width: '100%',
height: '100%',
position: 'relative'
}
}
} }
}, },

View File

@@ -42,14 +42,7 @@ export default Vue.extend({
default: '' default: ''
}, },
styles: { styles: {
type: Object, type: Object
default () {
return {
width: '100%',
height: '100%',
position: 'relative'
}
}
} }
}, },

View File

@@ -42,14 +42,7 @@ export default Vue.extend({
default: '' default: ''
}, },
styles: { styles: {
type: Object, type: Object
default () {
return {
width: '100%',
height: '100%',
position: 'relative'
}
}
} }
}, },

View File

@@ -42,14 +42,7 @@ export default Vue.extend({
default: '' default: ''
}, },
styles: { styles: {
type: Object, type: Object
default () {
return {
width: '100%',
height: '100%',
position: 'relative'
}
}
} }
}, },

View File

@@ -42,14 +42,7 @@ export default Vue.extend({
default: '' default: ''
}, },
styles: { styles: {
type: Object, type: Object
default () {
return {
width: '100%',
height: '100%',
position: 'relative'
}
}
} }
}, },

View File

@@ -42,14 +42,7 @@ export default Vue.extend({
default: '' default: ''
}, },
styles: { styles: {
type: Object, type: Object
default () {
return {
width: '100%',
height: '100%',
position: 'relative'
}
}
} }
}, },

View File

@@ -1,5 +1,4 @@
import merge from 'lodash/fp/merge'
export function mergeOptions (obj, src) { export function mergeOptions (obj, src) {
return merge(obj, src) let mutableObj = Object.assign({}, obj)
return Object.assign(mutableObj, src)
} }

View File

@@ -48,7 +48,15 @@ module.exports = {
} }
}) })
chart.data.labels = newData.labels if (newData.hasOwnProperty('labels')) {
chart.data.labels = newData.labels
}
if (newData.hasOwnProperty('xLabels')) {
chart.data.xLabels = newData.xLabels
}
if (newData.hasOwnProperty('yLabels')) {
chart.data.yLabels = newData.yLabels
}
chart.update() chart.update()
} else { } else {
chart.destroy() chart.destroy()

View File

@@ -48,7 +48,15 @@ module.exports = {
} }
}) })
chart.data.labels = newData.labels if (newData.hasOwnProperty('labels')) {
chart.data.labels = newData.labels
}
if (newData.hasOwnProperty('xLabels')) {
chart.data.xLabels = newData.xLabels
}
if (newData.hasOwnProperty('yLabels')) {
chart.data.yLabels = newData.yLabels
}
chart.update() chart.update()
} else { } else {
chart.destroy() chart.destroy()

View File

@@ -15,16 +15,40 @@ describe('mergeOptions.js', () => {
c: 'c' c: 'c'
} }
const an = {
a: {
a: 'a'
},
b: {
b: 'a'
}
}
const bn = {
a: {
a: 'a'
},
b: {
b: 'b'
}
}
it('should replace old a and b if a and b are new', () => { it('should replace old a and b if a and b are new', () => {
let ab = mergeOptions(a, b) const ab = mergeOptions(a, b)
expect(ab).to.have.property('a').and.to.equal('b') expect(ab).to.have.property('a').and.to.equal('b')
expect(ab).to.have.property('b').and.to.equal('b') expect(ab).to.have.property('b').and.to.equal('b')
}) })
it('should add c if c is new', () => { it('should add c if c is new', () => {
let ac = mergeOptions(a, c) const ac = mergeOptions(a, c)
expect(ac).to.have.property('a').and.to.equal('a') expect(ac).to.have.property('a').and.to.equal('a')
expect(ac).to.have.property('b').and.to.equal('a') expect(ac).to.have.property('b').and.to.equal('a')
expect(ac).to.have.property('c').and.to.equal('c') expect(ac).to.have.property('c').and.to.equal('c')
}) })
it('should replace old a and b if a and b are new in nested objects', () => {
const ab = mergeOptions(an, bn)
expect(ab).to.have.deep.property('a.a').and.to.equal('a')
expect(ab).to.have.deep.property('b.b').and.to.equal('b')
})
}) })

View File

@@ -687,6 +687,12 @@ babel-plugin-transform-exponentiation-operator@^6.24.1:
babel-plugin-syntax-exponentiation-operator "^6.8.0" babel-plugin-syntax-exponentiation-operator "^6.8.0"
babel-runtime "^6.22.0" babel-runtime "^6.22.0"
babel-plugin-transform-object-assign@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-assign/-/babel-plugin-transform-object-assign-6.22.0.tgz#f99d2f66f1a0b0d498e346c5359684740caa20ba"
dependencies:
babel-runtime "^6.22.0"
babel-plugin-transform-object-rest-spread@^6.22.0: babel-plugin-transform-object-rest-spread@^6.22.0:
version "6.23.0" version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921"
@@ -3554,7 +3560,7 @@ lodash@^3.8.0:
version "3.10.1" version "3.10.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
lodash@^4.0.0, lodash@^4.0.1, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0: lodash@^4.0.0, lodash@^4.0.1, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0:
version "4.17.4" version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"