ember-highcharts
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -10,3 +10,2 @@ import Ember from 'ember'; | ||
set, | ||
merge, | ||
on, | ||
@@ -17,2 +16,4 @@ run, | ||
const assign = Ember.assign || Ember.merge; | ||
export default Component.extend({ | ||
@@ -37,3 +38,3 @@ classNames: ['highcharts-wrapper'], | ||
return merge(defaults, chartOptions); | ||
return assign(defaults, chartOptions); | ||
}), | ||
@@ -44,9 +45,8 @@ | ||
if (!(get(this, 'content') && get(this, 'chart'))) { | ||
const { content, chart, mode } = this.getProperties('content', 'chart', 'mode'); | ||
if (!content || !chart) { | ||
return; | ||
} | ||
let chart = get(this, 'chart'); | ||
let noData = chart.get('noData'); | ||
if (noData != null) { | ||
@@ -56,25 +56,52 @@ noData.remove(); | ||
let numToRemove = chart.series.length - get(this, 'content').length; | ||
const isStockChart = mode === 'StockChart'; | ||
for (let i = numToRemove; i > 0; i--) { | ||
let lastIndex = chart.series.length - 1; | ||
// create maps to make series data easier to work with | ||
const contentSeriesMap = content.reduce((contentSeriesMap, contentSeries) => { | ||
contentSeriesMap[contentSeries.name] = contentSeries; | ||
return contentSeriesMap; | ||
}, {}); | ||
if (chart.series[lastIndex]) { | ||
chart.series[lastIndex].remove(false); | ||
const chartSeriesMap = chart.series.reduce((chartSeriesMap, chartSeries) => { | ||
chartSeriesMap[chartSeries.name] = chartSeries; | ||
return chartSeriesMap; | ||
}, {}); | ||
// remove and update current series | ||
const chartSeriesToRemove = []; | ||
chart.series.forEach((series) => { | ||
if (isStockChart && series.name === 'Navigator') { | ||
return; | ||
} | ||
} | ||
const contentSeries = contentSeriesMap[series.name]; | ||
get(this, 'content').forEach((series, idx) => { | ||
if (!contentSeries) { | ||
return chartSeriesToRemove.push(series); | ||
} | ||
if (chart.series[idx]) { | ||
return chart.series[idx].setData(series.data, false); | ||
} else { | ||
return chart.addSeries(series, false); | ||
series.setData(contentSeries.data, false); | ||
}); | ||
chartSeriesToRemove.forEach((series) => series.remove(false)); | ||
// add new series | ||
content.forEach((contentSeries) => { | ||
if (!chartSeriesMap.hasOwnProperty(contentSeries.name)) { | ||
chart.addSeries(contentSeries, false); | ||
} | ||
}); | ||
// reset navigator data | ||
if (isStockChart && chart.xAxis.length) { | ||
chart.xAxis[0].setExtremes(); | ||
} | ||
return chart.redraw(); | ||
}, | ||
@@ -81,0 +108,0 @@ |
# Changelog | ||
## 0.4.3 | ||
- Clean up tests | ||
- Upgrade to ember-cli 2.4.2 | ||
- Add ember observer and code climate badges | ||
- Changed merge -> assign to silent deprecation warning in Ember 2.5 | ||
- Update highstock component to be interactive | ||
- Refactor logic for handling chart updates | ||
## 0.4.2 | ||
@@ -4,0 +13,0 @@ |
{ | ||
"name": "ember-highcharts", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "A Highcharts, HighStock and HighMaps component for ember cli", | ||
@@ -24,23 +24,24 @@ "directories": { | ||
"ember-cli-babel": "^5.1.5", | ||
"ember-getowner-polyfill": "1.0.0" | ||
"ember-getowner-polyfill": "1.0.1" | ||
}, | ||
"devDependencies": { | ||
"broccoli-asset-rev": "^2.2.0", | ||
"ember-cli": "1.13.15", | ||
"ember-cli": "2.4.2", | ||
"ember-cli-app-version": "^1.0.0", | ||
"ember-cli-content-security-policy": "0.4.0", | ||
"ember-cli-dependency-checker": "^1.1.0", | ||
"ember-cli-dependency-checker": "^1.2.0", | ||
"ember-cli-htmlbars": "^1.0.1", | ||
"ember-cli-htmlbars-inline-precompile": "^0.3.1", | ||
"ember-cli-ic-ajax": "0.2.4", | ||
"ember-cli-inject-live-reload": "^1.3.1", | ||
"ember-cli-qunit": "^1.0.4", | ||
"ember-cli-qunit": "^1.2.1", | ||
"ember-cli-release": "0.2.8", | ||
"ember-cli-sri": "^1.2.0", | ||
"ember-cli-sri": "^2.1.0", | ||
"ember-cli-uglify": "^1.2.0", | ||
"ember-disable-prototype-extensions": "^1.0.0", | ||
"ember-disable-prototype-extensions": "^1.1.0", | ||
"ember-disable-proxy-controllers": "^1.0.1", | ||
"ember-export-application-global": "^1.0.4", | ||
"ember-try": "~0.0.8", | ||
"highcharts": "^4.2.1" | ||
"ember-load-initializers": "^0.5.1", | ||
"ember-resolver": "^2.0.3", | ||
"ember-try": "~0.1.2", | ||
"highcharts": "^4.2.4", | ||
"loader.js": "^4.0.1" | ||
}, | ||
@@ -47,0 +48,0 @@ "keywords": [ |
@@ -1,3 +0,8 @@ | ||
# Ember-highcharts [![Build Status](https://travis-ci.org/ahmadsoe/ember-highcharts.svg)](https://travis-ci.org/ahmadsoe/ember-highcharts) [![npm version](https://badge.fury.io/js/ember-highcharts.svg)](http://badge.fury.io/js/ember-highcharts) | ||
[![Build Status](https://travis-ci.org/ahmadsoe/ember-highcharts.svg?branch=master)](https://travis-ci.org/ahmadsoe/ember-highcharts) | ||
[![Ember Observer Score](http://emberobserver.com/badges/ember-highcharts.svg)](http://emberobserver.com/addons/ember-highcharts) | ||
[![Code Climate](https://codeclimate.com/github/ahmadsoe/ember-highcharts/badges/gpa.svg)](https://codeclimate.com/github/ahmadsoe/ember-highcharts) | ||
[![npm version](https://badge.fury.io/js/ember-highcharts.svg)](https://badge.fury.io/js/ember-highcharts) | ||
# Ember-highcharts | ||
A [Highcharts](http://www.highcharts.com/products/highcharts), [Highstock](http://www.highcharts.com/products/highstock) and [Highmaps](http://www.highcharts.com/products/highmaps) component for [Ember CLI](http://www.ember-cli.com/). | ||
@@ -4,0 +9,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1021528
26
3486
156
19
4
4
2
+ Addedember-getowner-polyfill@1.0.1(transitive)
- Removedember-getowner-polyfill@1.0.0(transitive)