vue-highcharts
Advanced tools
Comparing version 0.0.9 to 0.0.10
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('highcharts')) : | ||
typeof define === 'function' && define.amd ? define(['highcharts'], factory) : | ||
(global.VueHighcharts = factory(global.Highcharts)); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('highcharts')) : | ||
typeof define === 'function' && define.amd ? define(['highcharts'], factory) : | ||
(global.VueHighcharts = factory(global.Highcharts)); | ||
}(this, (function (HighchartsOnly) { 'use strict'; | ||
@@ -38,6 +38,15 @@ | ||
function render(createElement) { | ||
return createElement('div'); | ||
} | ||
function create(tagName, Highcharts, Vue) { | ||
var Ctor = Highcharts[ctors[tagName]]; | ||
if (!Ctor) { | ||
return null; | ||
return Highcharts.win | ||
? null | ||
// When running in server, Highcharts will not be instanced, | ||
// so there're no constructors in Highcharts, | ||
// to avoid unmated content during SSR, it returns minimum component. | ||
: { render: render }; | ||
} | ||
@@ -91,5 +100,3 @@ var isRenderer = tagName === 'highcharts-renderer'; | ||
} else { | ||
component.render = function(createElement) { | ||
return createElement('div'); | ||
}; | ||
component.render = render; | ||
component.mounted = function() { | ||
@@ -96,0 +103,0 @@ this._initChart(); |
@@ -1,1 +0,1 @@ | ||
(function(e,r){typeof exports==="object"&&typeof module!=="undefined"?module.exports=r(require("highcharts")):typeof define==="function"&&define.amd?define(["highcharts"],r):e.VueHighcharts=r(e.Highcharts)})(this,function(e){"use strict";e="default"in e?e["default"]:e;var r={highcharts:"Chart",highstock:"StockChart",highmaps:"Map","highcharts-renderer":"Renderer"};function t(e){var r;if(e===null||typeof e!=="object"){return e}if(e instanceof Array){r=[];for(var i=e.length-1;i>=0;i--){r[i]=t(e[i])}return r}if(e instanceof Object){r={};for(var h in e){r[h]=t(e[h])}return r}}function i(e,i,h){var n=i[r[e]];if(!n){return null}var s=e==="highcharts-renderer";var o={name:e,props:s?{width:{type:Number,required:true},height:{type:Number,required:true}}:{options:{type:Object,required:true}},methods:{_initChart:function(){this._renderChart();if(s){this.$watch("width",this._renderChart);this.$watch("height",this._renderChart)}else{this.$watch("options",this._renderChart,{deep:true})}},_renderChart:function(){if(s){this.renderer&&this.$el.removeChild(this.renderer.box);this.renderer=new n(this.$el,this.width,this.height)}else{this.chart=new n(this.$el,t(this.options))}}},beforeDestroy:function(){if(s){this.$el.removeChild(this.renderer.box);for(var e in this.renderer){delete this.renderer[e]}this.renderer=null}else{this.chart.destroy()}}};var a=/^1\./.test(h.version);if(a){o.template="<div></div>";o.ready=function(){this._initChart()}}else{o.render=function(e){return e("div")};o.mounted=function(){this._initChart()}}return o}function h(t,h){var n=h&&h.Highcharts||e;t.prototype.Highcharts=n;for(var s in r){var o=i(s,n,t);o&&t.component(s,o)}}return h}); | ||
(function(e,r){typeof exports==="object"&&typeof module!=="undefined"?module.exports=r(require("highcharts")):typeof define==="function"&&define.amd?define(["highcharts"],r):e.VueHighcharts=r(e.Highcharts)})(this,function(e){"use strict";e="default"in e?e["default"]:e;var r={highcharts:"Chart",highstock:"StockChart",highmaps:"Map","highcharts-renderer":"Renderer"};function t(e){var r;if(e===null||typeof e!=="object"){return e}if(e instanceof Array){r=[];for(var i=e.length-1;i>=0;i--){r[i]=t(e[i])}return r}if(e instanceof Object){r={};for(var h in e){r[h]=t(e[h])}return r}}function i(e){return e("div")}function h(e,h,n){var s=h[r[e]];if(!s){return h.win?null:{render:i}}var o=e==="highcharts-renderer";var a={name:e,props:o?{width:{type:Number,required:true},height:{type:Number,required:true}}:{options:{type:Object,required:true}},methods:{_initChart:function(){this._renderChart();if(o){this.$watch("width",this._renderChart);this.$watch("height",this._renderChart)}else{this.$watch("options",this._renderChart,{deep:true})}},_renderChart:function(){if(o){this.renderer&&this.$el.removeChild(this.renderer.box);this.renderer=new s(this.$el,this.width,this.height)}else{this.chart=new s(this.$el,t(this.options))}}},beforeDestroy:function(){if(o){this.$el.removeChild(this.renderer.box);for(var e in this.renderer){delete this.renderer[e]}this.renderer=null}else{this.chart.destroy()}}};var d=/^1\./.test(n.version);if(d){a.template="<div></div>";a.ready=function(){this._initChart()}}else{a.render=i;a.mounted=function(){this._initChart()}}return a}function n(t,i){var n=i&&i.Highcharts||e;t.prototype.Highcharts=n;for(var s in r){var o=h(s,n,t);o&&t.component(s,o)}}return n}); |
{ | ||
"name": "vue-highcharts", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Highcharts component for Vue", | ||
"main": "dist/vue-highcharts.js", | ||
"jsnext:main": "src/index.js", | ||
"module": "src/index.js", | ||
"files": [ | ||
@@ -39,21 +39,22 @@ "dist", | ||
"peerDependencies": { | ||
"highcharts": ">=4.2.0" | ||
"highcharts": ">=4.2.0", | ||
"vue": ">=1.0.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"eslint": "^3.8.1", | ||
"eslint-config-google": "^0.7.0", | ||
"highcharts": "^5.0.0", | ||
"karma": "^1.3.0", | ||
"eslint": "^3.19.0", | ||
"eslint-config-google": "^0.7.1", | ||
"highcharts": "^5.0.10", | ||
"karma": "^1.6.0", | ||
"karma-chai": "^0.1.0", | ||
"karma-coverage": "^1.1.1", | ||
"karma-mocha": "^1.2.0", | ||
"karma-phantomjs-launcher": "^1.0.2", | ||
"karma-mocha": "^1.3.0", | ||
"karma-phantomjs-launcher": "^1.0.4", | ||
"karma-rollup-plugin": "^0.2.4", | ||
"mocha": "^3.1.2", | ||
"phantomjs-prebuilt": "^2.1.13", | ||
"rollup": "^0.36.3", | ||
"uglify-js": "^2.7.3", | ||
"vue": "^2.0.3" | ||
"mocha": "^3.3.0", | ||
"phantomjs-prebuilt": "^2.1.14", | ||
"rollup": "^0.41.6", | ||
"uglify-js": "^2.8.22", | ||
"vue": "^2.3.0" | ||
} | ||
} |
@@ -6,2 +6,3 @@ # vue-highcharts | ||
[![Dependencies](https://img.shields.io/david/weizhenye/vue-highcharts.svg)](https://david-dm.org/weizhenye/vue-highcharts) | ||
[![Download](https://img.shields.io/npm/dm/vue-highcharts.svg)](https://www.npmjs.com/package/vue-highcharts) | ||
[![NPM version](https://img.shields.io/npm/v/vue-highcharts.svg)](https://www.npmjs.com/package/vue-highcharts) | ||
@@ -15,3 +16,3 @@ [![License](https://img.shields.io/npm/l/vue-highcharts.svg)](https://github.com/weizhenye/vue-highcharts/blob/master/LICENSE) | ||
* Vue >= 1.0.0 | ||
* Vue >= 1.0.0 (support both v1 and v2) | ||
* Highcharts >= 4.2.0 | ||
@@ -18,0 +19,0 @@ |
import clone from './clone.js'; | ||
import ctors from './constrators.js'; | ||
import ctors from './constructors.js'; | ||
function render(createElement) { | ||
return createElement('div'); | ||
} | ||
function create(tagName, Highcharts, Vue) { | ||
var Ctor = Highcharts[ctors[tagName]]; | ||
if (!Ctor) { | ||
return null; | ||
return Highcharts.win | ||
? null | ||
// When running in server, Highcharts will not be instanced, | ||
// so there're no constructors in Highcharts, | ||
// to avoid unmated content during SSR, it returns minimum component. | ||
: { render: render }; | ||
} | ||
@@ -56,5 +65,3 @@ var isRenderer = tagName === 'highcharts-renderer'; | ||
} else { | ||
component.render = function(createElement) { | ||
return createElement('div'); | ||
}; | ||
component.render = render; | ||
component.mounted = function() { | ||
@@ -68,2 +75,1 @@ this._initChart(); | ||
export default create; | ||
import HighchartsOnly from 'highcharts'; | ||
import ctors from './constrators.js'; | ||
import ctors from './constructors.js'; | ||
import create from './create.js'; | ||
@@ -4,0 +4,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
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
13811
219
88
2