highcharts-ng
Advanced tools
Comparing version 1.0.1 to 1.1.0
/** | ||
* highcharts-ng | ||
* @version v1.0.1 - 2017-02-20 | ||
* @version v1.1.0 - 2017-03-27 | ||
* @link https://github.com/pablojim/highcharts-ng | ||
@@ -15,5 +15,12 @@ * @author Barry Fitzgerald <> | ||
'use strict'; | ||
/*global angular: false, Highcharts: false */ | ||
/*global angular: false*/ | ||
var Highcharts = null; | ||
if (window && window.Highcharts) { | ||
Highcharts = window.Highcharts; | ||
} else if (module && module.exports === 'highcharts-ng') { | ||
Highcharts = require('highcharts'); | ||
} | ||
angular.module('highcharts-ng', []) | ||
@@ -43,2 +50,12 @@ .component('highchart', { | ||
ctrl.chart = new Highcharts[getChartType(mergedConfig)](mergedConfig); | ||
// Fix resizing bug | ||
// https://github.com/pablojim/highcharts-ng/issues/550 | ||
var originalWidth = $element[0].clientWidth; | ||
var originalHeight = $element[0].clientHeight; | ||
$timeout(function() { | ||
if ($element[0].clientWidth !== originalWidth || $element[0].clientHeight !== originalHeight) { | ||
ctrl.chart.reflow(); | ||
} | ||
}, 0, false); | ||
}; | ||
@@ -45,0 +62,0 @@ |
/** | ||
* highcharts-ng | ||
* @version v1.0.1 - 2017-02-20 | ||
* @version v1.1.0 - 2017-03-27 | ||
* @link https://github.com/pablojim/highcharts-ng | ||
@@ -8,2 +8,2 @@ * @author Barry Fitzgerald <> | ||
*/ | ||
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="highcharts-ng"),function(){"use strict";function a(a,e){var f=0,g=this,h={},i={},j=g.changeDetection||angular.equals;this.$onInit=function(){g.config.getChartObj=function(){return g.chart},h=angular.merge({},g.config),i=b(a,g.config,f),g.chart=new(Highcharts[c(i)])(i)},this.$doCheck=function(){if(!j(g.config,h)){h=angular.merge({},g.config),i=b(a,g.config,f);var c=d(i.series,f);if(i.series){for(var e=g.chart.series.length-1;e>=0;e--){var k=g.chart.series[e];"highcharts-navigator-series"!==k.options.id&&c.indexOf(k.options.id)<0&&k.remove(!1)}angular.forEach(g.config.series,function(a){g.chart.get(a.id)||g.chart.addSeries(a)})}g.chart.update(i,!0)}},this.$onDestroy=function(){if(g.chart){try{g.chart.destroy()}catch(b){}e(function(){a.remove()},0)}}}function b(a,b,c){var e={},f={chart:{events:{}},title:{},subtitle:{},series:[],credits:{},plotOptions:{},navigator:{}};return b?(b.series&&d(b.series,c),e=angular.merge(f,b)):e=f,e.chart.renderTo=a[0],e}function c(a){return void 0===a||void 0===a.chartType?"Chart":e[(""+a.chartType).toLowerCase()]}function d(a,b){var c=[];return angular.forEach(a,function(a){angular.isDefined(a.id)||(a.id="series-"+b++),c.push(a.id)}),c}angular.module("highcharts-ng",[]).component("highchart",{bindings:{config:"<",changeDetection:"<"},controller:a}),a.$inject=["$element","$timeout"];var e={stock:"StockChart",map:"Map",chart:"Chart"}}(); | ||
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="highcharts-ng"),function(){"use strict";function a(a,f){var g=0,h=this,i={},j={},k=h.changeDetection||angular.equals;this.$onInit=function(){h.config.getChartObj=function(){return h.chart},i=angular.merge({},h.config),j=b(a,h.config,g),h.chart=new(e[c(j)])(j);var d=a[0].clientWidth,k=a[0].clientHeight;f(function(){a[0].clientWidth===d&&a[0].clientHeight===k||h.chart.reflow()},0,!1)},this.$doCheck=function(){if(!k(h.config,i)){i=angular.merge({},h.config),j=b(a,h.config,g);var c=d(j.series,g);if(j.series){for(var e=h.chart.series.length-1;e>=0;e--){var f=h.chart.series[e];"highcharts-navigator-series"!==f.options.id&&c.indexOf(f.options.id)<0&&f.remove(!1)}angular.forEach(h.config.series,function(a){h.chart.get(a.id)||h.chart.addSeries(a)})}h.chart.update(j,!0)}},this.$onDestroy=function(){if(h.chart){try{h.chart.destroy()}catch(b){}f(function(){a.remove()},0)}}}function b(a,b,c){var e={},f={chart:{events:{}},title:{},subtitle:{},series:[],credits:{},plotOptions:{},navigator:{}};return b?(b.series&&d(b.series,c),e=angular.merge(f,b)):e=f,e.chart.renderTo=a[0],e}function c(a){return void 0===a||void 0===a.chartType?"Chart":f[(""+a.chartType).toLowerCase()]}function d(a,b){var c=[];return angular.forEach(a,function(a){angular.isDefined(a.id)||(a.id="series-"+b++),c.push(a.id)}),c}var e=null;window&&window.Highcharts?e=window.Highcharts:module&&"highcharts-ng"===module.exports&&(e=require("highcharts")),angular.module("highcharts-ng",[]).component("highchart",{bindings:{config:"<",changeDetection:"<"},controller:a}),a.$inject=["$element","$timeout"];var f={stock:"StockChart",map:"Map",chart:"Chart"}}(); |
<!--- Provide a general summary of the issue in the Title above --> | ||
## Link to jsfiddle showing the issue. | ||
<!--- This is by far the most important bit! --> | ||
<!--- Fork this http://jsfiddle.net/gh/get/jquery/3.1.1/pablojim/highcharts-ng/tree/master/jsfiddles/basic/ ? --> | ||
@@ -11,22 +14,7 @@ ## Expected Behaviour | ||
## Possible Solution | ||
<!--- Not obligatory, but suggest a fix/reason for the bug, --> | ||
<!--- or ideas how to implement the addition or change --> | ||
## Steps to Reproduce & Link to Example | ||
<!--- PLEASE include a link to jsfiddle/codepen/etc!!! --> | ||
1. | ||
2. | ||
3. | ||
4. | ||
## Context | ||
<!--- How has this issue affected you? What are you trying to accomplish? --> | ||
<!--- Providing context helps us come up with a solution that is most useful in the real world --> | ||
## Your Environment | ||
<!--- Include as many relevant details about the environment you experienced the bug in --> | ||
* Version used: | ||
* Version of highcharts-ng used: | ||
* Browser Name and version: | ||
* Operating System and version (desktop or mobile): | ||
* Link to your project: |
{ | ||
"name": "highcharts-ng", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "highcharts-ng", | ||
@@ -50,3 +50,5 @@ "keywords": [ | ||
"main": "./dist/highcharts-ng", | ||
"dependencies": {} | ||
"dependencies": { | ||
"highcharts": "^5.0.9" | ||
} | ||
} |
@@ -19,6 +19,6 @@ highcharts-ng | ||
- Multi Axis: http://jsfiddle.net/gh/get/jquery/3.1.1/pablojim/highcharts-ng/tree/master/jsfiddles/multi_axis/ | ||
- Resizing to screen size: http://jsfiddle.net/gh/get/jquery/3.1.1/pablojim/highcharts-ng/tree/master/jsfiddles/resizing/ | ||
Current Version (1.0.0) | ||
----------------------- | ||
Current Version | ||
--------------- | ||
**Note Needs Highcharts/Highstock >= 5.0.0** | ||
@@ -62,2 +62,8 @@ **Only supports AngularJS >= 1.5.8 | ||
(optional) if you have some problems with resizing the chart to screen size, include the highcharts-ng css file | ||
```html | ||
<link href="dist/highcharts-ng.css" rel="stylesheet"> | ||
``` | ||
Make a chart! | ||
@@ -99,3 +105,3 @@ | ||
- Whole Chart/Series is often redrawn where a simple update of data would suffice | ||
- If you don't assign ids to your series - incremental ids will be added. This may mean extra redraws. | ||
- If you don't assign ids to your series - incremental ids will be added. This may mean extra redraws. | ||
- Needs more tests! | ||
@@ -109,3 +115,3 @@ | ||
This version is much much simpler and should be more stable. Some features however are still to be implemented | ||
This version is much much simpler and should be more stable. Some features however are still to be implemented | ||
e.g. 2-way binding to axes and loading functionality | ||
@@ -128,2 +134,12 @@ | ||
Version 1.1.0 | ||
------------- | ||
Now has explicit dependency on highcharts.js. | ||
- Fix for resizing https://github.com/pablojim/highcharts-ng/issues/550 | ||
- Added module loader support https://github.com/pablojim/highcharts-ng/commit/508df111886c4be8b26e82cb6d3e2303f17efed8 | ||
Version 1.0.1 | ||
@@ -170,3 +186,3 @@ ------------- | ||
---------------- | ||
- added config.getHighcharts - thanks @ValentinH | ||
- added config.getHighcharts - thanks @ValentinH | ||
- Lots of bug fixes - thanks to all contributors | ||
@@ -173,0 +189,0 @@ - Now with support for Highmaps - see: http://rawgit.com/pablojim/highcharts-ng/master/example/maps/example.html |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
90976
35
1210
228
1
1
+ Addedhighcharts@^5.0.9
+ Addedhighcharts@5.0.15(transitive)