ng2-charts
Advanced tools
Comparing version 1.0.0-beta.0 to 1.0.2
@@ -1,7 +0,14 @@ | ||
import { OnDestroy, OnInit, ElementRef } from 'angular2/core'; | ||
import { OnDestroy, OnInit, OnChanges, ElementRef } from 'angular2/core'; | ||
export declare class Charts { | ||
constructor(element: ElementRef); | ||
} | ||
export declare class BaseChart implements OnInit, OnDestroy { | ||
export declare class BaseChart implements OnInit, OnDestroy, OnChanges { | ||
private element; | ||
data: Array<any>; | ||
labels: Array<any>; | ||
options: any; | ||
chartType: string; | ||
series: Array<any>; | ||
colours: Array<any>; | ||
legend: boolean; | ||
private ctx; | ||
@@ -11,9 +18,2 @@ private cvs; | ||
private chart; | ||
private _data; | ||
private labels; | ||
private options; | ||
private _chartType; | ||
private series; | ||
private colours; | ||
private legend; | ||
private legendTemplate; | ||
@@ -26,9 +26,8 @@ private initFlag; | ||
ngOnInit(): void; | ||
ngOnChanges(): void; | ||
ngOnDestroy(): void; | ||
private data; | ||
private chartType; | ||
setLegend(): void; | ||
getColour(colour: Array<number>): any; | ||
getRandomInt(min: any, max: any): any; | ||
rgba(colour: any, alpha: any): string; | ||
getRandomInt(min: number, max: number): number; | ||
rgba(colour: Array<number>, alpha: number): string; | ||
click(evt: any): void; | ||
@@ -35,0 +34,0 @@ hover(evt: any): void; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -24,3 +25,3 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
return Charts; | ||
})(); | ||
}()); | ||
exports.Charts = Charts; | ||
@@ -30,3 +31,3 @@ var BaseChart = (function () { | ||
this.element = element; | ||
this._data = []; | ||
this.data = []; | ||
this.labels = []; | ||
@@ -112,2 +113,7 @@ this.options = { responsive: true }; | ||
}; | ||
BaseChart.prototype.ngOnChanges = function () { | ||
if (this.initFlag) { | ||
this.refresh(); | ||
} | ||
}; | ||
BaseChart.prototype.ngOnDestroy = function () { | ||
@@ -123,28 +129,2 @@ if (this.chart) { | ||
}; | ||
Object.defineProperty(BaseChart.prototype, "data", { | ||
get: function () { | ||
return this._data; | ||
}, | ||
set: function (value) { | ||
this._data = value; | ||
if (this.initFlag && this._data && this._data.length > 0) { | ||
this.refresh(); | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(BaseChart.prototype, "chartType", { | ||
get: function () { | ||
return this._chartType; | ||
}, | ||
set: function (value) { | ||
this._chartType = value; | ||
if (this.initFlag && this._chartType && this._chartType.length > 0) { | ||
this.refresh(); | ||
} | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
BaseChart.prototype.setLegend = function () { | ||
@@ -185,5 +165,2 @@ var list = this.parent.getElementsByTagName('ul'); | ||
} | ||
else { | ||
console.log('not point'); | ||
} | ||
}; | ||
@@ -198,5 +175,2 @@ BaseChart.prototype.hover = function (evt) { | ||
} | ||
else { | ||
console.log('not point'); | ||
} | ||
}; | ||
@@ -241,2 +215,6 @@ BaseChart.prototype.getChartBuilder = function (ctx, data, options) { | ||
BaseChart.prototype.refresh = function () { | ||
var _this = this; | ||
if (this.options.responsive && this.parent.clientHeight === 0) { | ||
return setTimeout(function () { return _this.refresh(); }, 50); | ||
} | ||
this.ngOnDestroy(); | ||
@@ -256,2 +234,30 @@ var dataset = []; | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Array) | ||
], BaseChart.prototype, "data", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Array) | ||
], BaseChart.prototype, "labels", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Object) | ||
], BaseChart.prototype, "options", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', String) | ||
], BaseChart.prototype, "chartType", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Array) | ||
], BaseChart.prototype, "series", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Array) | ||
], BaseChart.prototype, "colours", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Boolean) | ||
], BaseChart.prototype, "legend", void 0); | ||
BaseChart = __decorate([ | ||
@@ -276,5 +282,4 @@ core_1.Component({ | ||
return BaseChart; | ||
})(); | ||
}()); | ||
exports.BaseChart = BaseChart; | ||
exports.CHART_DIRECTIVES = [Charts, BaseChart]; | ||
//# sourceMappingURL=charts.js.map |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
function __export(m) { | ||
@@ -5,2 +6,1 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
__export(require('./components/charts/charts')); | ||
//# sourceMappingURL=ng2-charts.js.map |
{ | ||
"name": "ng2-charts", | ||
"version": "1.0.0-beta.0", | ||
"version": "1.0.2", | ||
"description": "Reactive, responsive, beautiful charts for Angular2 based on Chart.js", | ||
"scripts": { | ||
"deploy": "NODE_ENV=production webpack -p --progress --color --optimize-minimize --optimize-dedupe --optimize-occurence-order", | ||
"prepublish": "gulp clean && tsc", | ||
"server": "webpack-dev-server --hot --inline --colors --display-error-details --display-cached", | ||
"start": "npm run server", | ||
"test": "gulp lint" | ||
"flow.install:typings": "./node_modules/.bin/typings install", | ||
"flow.compile": "npm run flow.install:typings && npm run flow.compile:common && npm run flow.compile:system ", | ||
"flow.compile:common": "./node_modules/.bin/tsc", | ||
"flow.compile:system": "./.config/bundle-system.js", | ||
"flow.copy:src": "./node_modules/.bin/cpy ng2-charts.ts \"components/**/*.ts\" ts --parents", | ||
"flow.clean": "./node_modules/.bin/del bundles coverage demo-build typings \"components/**/*.+(js|d.ts|js.map)\" dist \"ng2-bootstrap.+(js|d.ts|js.map)\"", | ||
"flow.deploy:gh-pages": "npm run flow.build:prod && ./node_modules/.bin/gh-pages -d demo-build", | ||
"flow.eslint": "./node_modules/.bin/eslint --ignore-path .gitignore --ext js --fix . .config", | ||
"flow.tslint": "./node_modules/.bin/gulp lint", | ||
"flow.lint": "npm run flow.eslint && npm run flow.tslint", | ||
"flow.changelog": "./node_modules/.bin/conventional-changelog -i CHANGELOG.md -s -p angular -v", | ||
"flow.github-release": "conventional-github-releaser -p angular", | ||
"flow.build:prod": "NODE_ENV=production ./node_modules/.bin/webpack --progress --color", | ||
"flow.build:dev": "./node_modules/.bin/webpack --progress --color", | ||
"flow.serve:dev": "./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached", | ||
"flow.serve:prod": "NODE_ENV=production ./node_modules/.bin/webpack-dev-server --hot --inline --colors --display-error-details --display-cached", | ||
"prepublish": "npm run flow.clean && npm run flow.compile && npm run flow.copy:src", | ||
"postpublish": "npm run flow.deploy:gh-pages", | ||
"start": "npm run flow.serve:dev", | ||
"test": "npm run flow.lint", | ||
"karma-test": "NODE_ENV=test ./node_modules/.bin/karma start", | ||
"preversion": "npm test", | ||
"version": "npm run flow.changelog && git add -A", | ||
"postversion": "git push origin development && git push --tags" | ||
}, | ||
@@ -29,36 +48,51 @@ "main": "ng2-charts.js", | ||
"homepage": "https://github.com/valor-software/ng2-charts#readme", | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"angular2": "2.0.0-beta.14" | ||
}, | ||
"dependencies": { | ||
"chart.js": "1.0.2" | ||
}, | ||
"devDependencies": { | ||
"angular2": "2.0.0-beta.0", | ||
"angular2": "2.0.0-beta.14", | ||
"async": "2.0.0-rc.3", | ||
"bootstrap": "3.3.6", | ||
"chart.js": "1.0.2", | ||
"clean-webpack-plugin": "0.1.5", | ||
"compression-webpack-plugin": "0.2.0", | ||
"es6-shim": "0.33.13", | ||
"eslint": "1.10.3", | ||
"exports-loader": "0.6.2", | ||
"gulp": "3.9.0", | ||
"gulp-clean": "0.3.1", | ||
"gulp-eslint": "1.1.1", | ||
"gulp-size": "2.0.0", | ||
"gulp-tsc": "1.1.4", | ||
"gulp-tslint": "4.2.2", | ||
"html-loader": "0.4.0", | ||
"clean-webpack-plugin": "0.1.8", | ||
"compression-webpack-plugin": "0.3.1", | ||
"conventional-changelog-cli": "1.1.1", | ||
"conventional-github-releaser": "1.1.1", | ||
"copy-webpack-plugin": "1.1.1", | ||
"cpy-cli": "1.0.0", | ||
"del-cli": "0.2.0", | ||
"es6-promise": "3.1.2", | ||
"es6-shim": "0.35.0", | ||
"eslint-config-valorsoft": "0.0.10", | ||
"exports-loader": "0.6.3", | ||
"gulp": "3.9.1", | ||
"gulp-clean": "0.3.2", | ||
"gulp-eslint": "2.0.0", | ||
"gulp-size": "2.1.0", | ||
"gulp-tsc": "1.1.5", | ||
"gulp-tslint": "4.3.5", | ||
"html-loader": "0.4.3", | ||
"html-webpack-plugin": "2.15.0", | ||
"markdown-loader": "0.1.7", | ||
"marked": "0.3.5", | ||
"ng2-bootstrap": "1.0.0-beta.2", | ||
"ng2-bootstrap": "1.0.11", | ||
"pre-commit": "1.1.2", | ||
"prismjs": "valorkin/prism", | ||
"prismjs": "1.4.1", | ||
"prismjs-loader": "0.0.2", | ||
"raw-loader": "0.5.1", | ||
"reflect-metadata": "0.1.2", | ||
"reflect-metadata": "0.1.3", | ||
"require-dir": "0.3.0", | ||
"rxjs": "5.0.0-beta.0", | ||
"rxjs": "5.0.0-beta.6", | ||
"systemjs-builder": "0.15.15", | ||
"transfer-webpack-plugin": "0.1.4", | ||
"ts-loader": "0.7.2", | ||
"tslint": "3.2.1", | ||
"typescript": "1.7.5", | ||
"webpack": "1.12.10", | ||
"webpack-dev-server": "1.14.0", | ||
"zone.js": "0.5.10" | ||
"ts-loader": "0.8.2", | ||
"tslint-config-valorsoft": "0.0.3", | ||
"typescript": "1.8.10", | ||
"typings": "0.7.12", | ||
"webpack": "1.12.15", | ||
"webpack-dev-server": "1.14.1", | ||
"zone.js": "0.6.10" | ||
}, | ||
@@ -65,0 +99,0 @@ "contributors": [ |
@@ -1,11 +0,15 @@ | ||
# ng2-charts | ||
# ng2-charts [![npm version](https://badge.fury.io/js/ng2-charts.svg)](http://badge.fury.io/js/ng2-charts) | ||
Beautiful charts for Angular2 based on Chart.js | ||
Directive for [ng2-charts](https://github.com/valor-software/ng2-charts) component. | ||
Follow to be notified about new releases: [twitter](https://twitter.com/valorkin) | ||
Follow me at [twitter](https://twitter.com/valorkin) to be notified about new releases. | ||
[![Code Climate](https://codeclimate.com/github/valor-software/ng2-charts/badges/gpa.svg)](https://codeclimate.com/github/valor-software/ng2-charts) | ||
[![Join the chat at https://gitter.im/valor-software/ng2-bootstrap](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/valor-software/ng2-bootstrap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Dependency Status](https://david-dm.org/valor-software/ng2-charts.svg)](https://david-dm.org/valor-software/ng2-charts) | ||
[![devDependency Status](https://david-dm.org/valor-software/ng2-charts/dev-status.svg)](https://david-dm.org/valor-software/ng2-charts#info=devDependencies) | ||
[![Throughput Graph](https://graphs.waffle.io/valor-software/ng2-charts/throughput.svg)](https://waffle.io/valor-software/ng2-charts/metrics) | ||
# Usage & Demo | ||
[http://valor-software.github.io/ng2-charts/](http://valor-software.github.io/ng2-charts/) | ||
- - - | ||
@@ -46,3 +50,3 @@ | ||
- `labels` (`?Array<any>`) - x axis labels. It's necessary for charts: line, bar and radar. And just labels (on hover) for charts: polar area, pie and doughnut | ||
- `chart-type` (`?string`) - indicates the type of charts, it can be: 'Line', 'Bar', 'Radar', 'Pie', 'PolarArea', 'Doughnut' | ||
- `chartType` (`?string`) - indicates the type of charts, it can be: 'Line', 'Bar', 'Radar', 'Pie', 'PolarArea', 'Doughnut' | ||
- `options` (`?any`) - chart options (as from [Chart.js documentation](http://www.chartjs.org/docs/)) | ||
@@ -55,4 +59,4 @@ - `series` (`?Array<any>`) - name points on the chart, work for line, bar and radar | ||
- `chart-click`: fires when click on a chart has occurred, returns information regarding active points and labels | ||
- `chart-hover`: fires when mousemove (hover) on a chart has occurred, returns information regarding active points and labels | ||
- `chartClick`: fires when click on a chart has occurred, returns information regarding active points and labels | ||
- `chartHover`: fires when mousemove (hover) on a chart has occurred, returns information regarding active points and labels | ||
@@ -59,0 +63,0 @@ |
{ | ||
"version": "1.7.5", | ||
"version": "1.8.9", | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "commonjs", | ||
"outDir": ".", | ||
"sourceMap": true, | ||
"moduleResolution": "node", | ||
"sourceMap": false, | ||
"declaration": true, | ||
"removeComments": true, | ||
"removeComments": false, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"noImplicitAny": true, | ||
"listFiles": false, | ||
"noLib": false, | ||
"noEmitOnError": false, | ||
"noImplicitAny": false | ||
"noLib": false | ||
}, | ||
@@ -21,4 +20,5 @@ "exclude": [ | ||
"files": [ | ||
"./ng2-charts.ts" | ||
"./ng2-charts.ts", | ||
"./typings/browser.d.ts" | ||
] | ||
} |
{ | ||
"rules": { | ||
"class-name": true, | ||
"comment-format": [true, "check-space"], | ||
"curly": true, | ||
"eofline": true, | ||
"forin": true, | ||
"indent": [true, "spaces"], | ||
"label-position": true, | ||
"label-undefined": true, | ||
"max-line-length": [false, 140], | ||
"no-arg": true, | ||
"no-bitwise": true, | ||
"no-console": [true, | ||
"debug", | ||
"info", | ||
"time", | ||
"timeEnd", | ||
"trace" | ||
], | ||
"no-construct": true, | ||
"no-debugger": true, | ||
"no-duplicate-key": true, | ||
"no-duplicate-variable": true, | ||
"no-empty": false, | ||
"no-eval": true, | ||
"no-shadowed-variable": true, | ||
"no-string-literal": true, | ||
"no-switch-case-fall-through": true, | ||
"no-trailing-comma": true, | ||
"no-trailing-whitespace": true, | ||
"no-unused-expression": true, | ||
"no-unused-variable": false, | ||
"no-unreachable": true, | ||
"no-use-before-declare": true, | ||
"no-var-keyword": true, | ||
"one-line": [true, | ||
"check-open-brace", | ||
"check-catch", | ||
"check-else", | ||
"check-whitespace" | ||
], | ||
"quotemark": [true, "single"], | ||
"radix": true, | ||
"semicolon": true, | ||
"sort-object-literal-keys": false, | ||
"triple-equals": [true, "allow-null-check"], | ||
"variable-name": false, | ||
"whitespace": [true, | ||
"check-branch", | ||
"check-decl", | ||
"check-operator", | ||
"check-separator" | ||
] | ||
} | ||
"extends": "./node_modules/tslint-config-valorsoft/tslint.json", | ||
"rulesDirectory": "./node_modules/codelyzer/dist/src" | ||
} |
Sorry, the diff of this file is not supported yet
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
57399
25
768
0
74
2
42
1
+ Addedchart.js@1.0.2
+ Addedangular2@2.0.0-beta.14(transitive)
+ Addedchart.js@1.0.2(transitive)
+ Addedes6-shim@0.35.8(transitive)
+ Addedreflect-metadata@0.1.2(transitive)
+ Addedrxjs@5.0.0-beta.2(transitive)
+ Addedzone.js@0.6.26(transitive)