Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-chartjs

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-chartjs - npm Package Compare versions

Comparing version 2.3.4 to 2.3.5

2

package.json
{
"name": "vue-chartjs",
"version": "2.3.4",
"version": "2.3.5",
"description": "vue.js wrapper for chart.js",

@@ -5,0 +5,0 @@ "author": "Jakub Juszczak <jakub@nextindex.de>",

@@ -13,14 +13,26 @@ module.exports = {

let newDataLabels = newData.datasets.map((dataset) => {
// Get new and old DataSet Labels
let newDatasetLabels = newData.datasets.map((dataset) => {
return dataset.label
})
let oldDataLabels = oldData.datasets.map((dataset) => {
let oldDatasetLabels = oldData.datasets.map((dataset) => {
return dataset.label
})
if (JSON.stringify(newDataLabels) === JSON.stringify(oldDataLabels)) {
this.forceUpdate(newData, chart)
// Stringify 'em for easier compare
const oldLabels = JSON.stringify(oldDatasetLabels)
const newLabels = JSON.stringify(newDatasetLabels)
// Check if Labels are equal and if dataset length is equal
if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) {
newData.datasets.forEach((dataset, i) => {
chart.data.datasets[i].data = dataset.data
})
chart.data.labels = newData.labels
chart.update()
} else {
this.forceRender()
chart.destroy()
this.renderChart(this.chartData, this.options)
}

@@ -30,17 +42,3 @@ }

}
},
methods: {
forceUpdate (newData, chart) {
newData.datasets.forEach((dataset, i) => {
chart.data.datasets[i].data = dataset.data
})
chart.data.labels = newData.labels
chart.update()
},
forceRender () {
this.renderChart(this.chartData, this.options)
}
}
}

@@ -14,17 +14,25 @@ module.exports = {

let newDataLabels = newData.datasets.map((dataset) => {
// Get new and old DataSet Labels
let newDatasetLabels = newData.datasets.map((dataset) => {
return dataset.label
})
let oldDataLabels = oldData.datasets.map((dataset) => {
let oldDatasetLabels = oldData.datasets.map((dataset) => {
return dataset.label
})
if (JSON.stringify(newDataLabels) === JSON.stringify(oldDataLabels)) {
// Stringify 'em for easier compare
const oldLabels = JSON.stringify(oldDatasetLabels)
const newLabels = JSON.stringify(newDatasetLabels)
// Check if Labels are equal and if dataset length is equal
if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) {
newData.datasets.forEach((dataset, i) => {
chart.data.datasets[i].data = dataset.data
})
chart.data.labels = newData.labels
chart.update()
} else {
chart.destroy()
this.renderChart(this.chartData, this.options)

@@ -31,0 +39,0 @@ }

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc