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

ng-chartist

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-chartist - npm Package Compare versions

Comparing version 2.0.0-beta.1 to 3.0.0

bundles/ng-chartist.umd.js.map

379

bundles/ng-chartist.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('chartist')) :
typeof define === 'function' && define.amd ? define('ng-chartist', ['exports', '@angular/core', 'chartist'], factory) :
(factory((global['ng-chartist'] = {}),global['@angular/core'],global.Chartist));
}(this, (function (exports,core,Chartist) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('chartist'), require('@angular/core')) :
typeof define === 'function' && define.amd ? define('ng-chartist', ['exports', 'chartist', '@angular/core'], factory) :
(factory((global['ng-chartist'] = {}),global.Chartist,global.ng.core));
}(this, (function (exports,Chartist,core) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
function __values(o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m) return m.call(o);
return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function __values(o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m)
return m.call(o);
return {
next: function () {
if (o && i >= o.length)
o = void 0;
return { value: o && o[i++], done: !o };
}
};
}
catch (error) { e = { error: error }; }
finally {
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m)
return o;
var i = m.call(o), r, ar = [], e;
try {
if (r && !r.done && (m = i["return"])) m.call(i);
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
ar.push(r.value);
}
finally { if (e) throw e.error; }
}
return ar;
}
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
var ChartistComponent = /** @class */ (function () {
function ChartistComponent(element) {
this.element = element.nativeElement;
}
ChartistComponent.prototype.ngOnInit = function () {
var _this = this;
if (!this.type || !this.data) {
Promise.reject('Expected at least type and data.');
catch (error) {
e = { error: error };
}
return this.renderChart().then(function (chart) {
if (_this.events !== undefined) {
_this.bindEvents(chart);
}
return chart;
});
};
ChartistComponent.prototype.ngOnChanges = function (changes) {
this.update(changes);
};
ChartistComponent.prototype.ngOnDestroy = function () {
if (this.chart) {
this.chart.detach();
}
};
ChartistComponent.prototype.renderChart = function () {
var _this = this;
var promises = [
this.type,
this.element,
this.data,
this.options,
this.responsiveOptions
];
return Promise.all(promises).then(function (values) {
var _a = __read(values), type = _a[0], args = _a.slice(1);
if (!(type in Chartist)) {
throw new Error(type + " is not a valid chart type");
}
_this.chart = ((Chartist))[type].apply(((Chartist)), __spread(args));
return _this.chart;
});
};
ChartistComponent.prototype.update = function (changes) {
if (!this.chart || 'type' in changes) {
this.renderChart();
}
else {
if (changes["data"]) {
this.data = changes["data"].currentValue;
}
if (changes["options"]) {
this.options = changes["options"].currentValue;
}
((this.chart)).update(this.data, this.options);
}
};
ChartistComponent.prototype.bindEvents = function (chart) {
try {
for (var _a = __values(Object.keys(this.events)), _b = _a.next(); !_b.done; _b = _a.next()) {
var event = _b.value;
chart.on(event, this.events[event]);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
if (r && !r.done && (m = i["return"]))
m.call(i);
}
finally { if (e_1) throw e_1.error; }
finally {
if (e)
throw e.error;
}
}
var e_1, _c;
};
return ChartistComponent;
}());
ChartistComponent.decorators = [
{ type: core.Component, args: [{
selector: 'x-chartist',
template: '<ng-content></ng-content>'
},] },
];
ChartistComponent.ctorParameters = function () { return [
{ type: core.ElementRef, },
]; };
ChartistComponent.propDecorators = {
"data": [{ type: core.Input },],
"type": [{ type: core.Input },],
"options": [{ type: core.Input },],
"responsiveOptions": [{ type: core.Input },],
"events": [{ type: core.Input },],
};
var ChartistModule = /** @class */ (function () {
function ChartistModule() {
return ar;
}
return ChartistModule;
}());
ChartistModule.decorators = [
{ type: core.NgModule, args: [{
declarations: [ChartistComponent],
exports: [ChartistComponent]
},] },
];
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
exports.ChartistModule = ChartistModule;
exports.ɵa = ChartistComponent;
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ChartistComponent = /** @class */ (function () {
function ChartistComponent(element) {
this.element = element.nativeElement;
}
/**
* @return {?}
*/
ChartistComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
if (!this.type || !this.data) {
Promise.reject('Expected at least type and data.');
}
return this.renderChart().then(function (chart) {
if (_this.events !== undefined) {
_this.bindEvents(chart);
}
return chart;
});
};
/**
* @param {?} changes
* @return {?}
*/
ChartistComponent.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
this.update(changes);
};
/**
* @return {?}
*/
ChartistComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this.chart) {
this.chart.detach();
}
};
/**
* @return {?}
*/
ChartistComponent.prototype.renderChart = /**
* @return {?}
*/
function () {
var _this = this;
/** @type {?} */
var promises = [
this.type,
this.element,
this.data,
this.options,
this.responsiveOptions
];
return Promise.all(promises).then(function (values) {
var _a = __read(values), type = _a[0], args = _a.slice(1);
if (!(type in Chartist)) {
throw new Error(type + " is not a valid chart type");
}
_this.chart = (( /** @type {?} */(Chartist)))[type].apply((( /** @type {?} */(Chartist))), __spread(args));
return _this.chart;
});
};
/**
* @param {?} changes
* @return {?}
*/
ChartistComponent.prototype.update = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (!this.chart || 'type' in changes) {
this.renderChart();
}
else {
if (changes.data) {
this.data = changes.data.currentValue;
}
if (changes.options) {
this.options = changes.options.currentValue;
}
(( /** @type {?} */(this.chart))).update(this.data, this.options);
}
};
/**
* @param {?} chart
* @return {?}
*/
ChartistComponent.prototype.bindEvents = /**
* @param {?} chart
* @return {?}
*/
function (chart) {
var e_1, _a;
try {
for (var _b = __values(Object.keys(this.events)), _c = _b.next(); !_c.done; _c = _b.next()) {
var event_1 = _c.value;
chart.on(event_1, this.events[event_1]);
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
};
ChartistComponent.decorators = [
{ type: core.Component, args: [{
selector: 'x-chartist',
template: '<ng-content></ng-content>'
}] }
];
/** @nocollapse */
ChartistComponent.ctorParameters = function () {
return [
{ type: core.ElementRef }
];
};
ChartistComponent.propDecorators = {
data: [{ type: core.Input }],
type: [{ type: core.Input }],
options: [{ type: core.Input }],
responsiveOptions: [{ type: core.Input }],
events: [{ type: core.Input }]
};
return ChartistComponent;
}());
Object.defineProperty(exports, '__esModule', { value: true });
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var ChartistModule = /** @class */ (function () {
function ChartistModule() {
}
ChartistModule.decorators = [
{ type: core.NgModule, args: [{
declarations: [ChartistComponent],
imports: [],
exports: [ChartistComponent]
},] }
];
return ChartistModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
exports.ChartistComponent = ChartistComponent;
exports.ChartistModule = ChartistModule;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=ng-chartist.umd.js.map
//# sourceMappingURL=ng-chartist.umd.js.map
{
"name": "ng-chartist",
"version": "2.0.0-beta.1",
"version": "3.0.0",
"description": "Chartist component for Angular",

@@ -21,49 +21,4 @@ "repository": {

"homepage": "https://github.com/willsoto/ng-chartist",
"files": [
"src/",
"dist/"
],
"devDependencies": {
"@angular/common": "^5.2.9",
"@angular/compiler": "^5.2.9",
"@angular/compiler-cli": "^5.2.9",
"@angular/core": "^5.2.9",
"@angular/forms": "^5.2.9",
"@angular/platform-browser": "^5.2.9",
"@angular/platform-browser-dynamic": "^5.2.9",
"@angular/router": "^5.2.9",
"@types/chartist": "^0.9.38",
"@types/jasmine": "^2.8.6",
"@types/rx": "^4.1.1",
"awesome-typescript-loader": "^5.0.0",
"chartist": "^0.11.0",
"core-js": "^2.5.4",
"es6-shim": "^0.35.3",
"greenkeeper-lockfile": "1",
"husky": "^0.14.3",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine-core": "^3.1.0",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.1.1",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^3.0.0",
"lint-staged": "^7.0.4",
"ng-packagr": "^2.4.1",
"prettier": "^1.11.1",
"puppeteer": "^1.2.0",
"reflect-metadata": "0.1.12",
"rxjs": "6.0.0-alpha.0",
"standard-version": "^4.3.0",
"tslint": "5.9.1",
"tslint-loader": "^3.6.0",
"typedoc": "^0.11.1",
"typescript": "^2.8.1",
"validate-commit": "^3.4.0",
"webpack": "^4.5.0",
"webpack-cli": "^2.0.14",
"webpack-serve": "^0.3.1",
"zone.js": "^0.8.25"
},
"peerDependencies": {
"@angular/common": ">=4.1.2",
"@angular/core": ">=4.1.2",

@@ -73,16 +28,15 @@ "@types/chartist": "^0.9.38",

},
"lint-staged": {
"*.{ts,js,md,json}": [
"prettier --write",
"git add"
]
},
"main": "bundles/ng-chartist.umd.js",
"module": "esm5/ng-chartist.js",
"es2015": "esm2015/ng-chartist.js",
"module": "fesm5/ng-chartist.js",
"es2015": "fesm2015/ng-chartist.js",
"esm5": "esm5/ng-chartist.js",
"esm2015": "esm2015/ng-chartist.js",
"fesm5": "fesm5/ng-chartist.js",
"fesm2015": "fesm2015/ng-chartist.js",
"typings": "ng-chartist.d.ts",
"metadata": "ng-chartist.metadata.json",
"sideEffects": false,
"dependencies": {
"tslib": "^1.7.1"
"tslib": "^1.9.0"
}
}

@@ -13,7 +13,7 @@ # Angular Chartist

* [About](#about)
* [Installation](#installation)
* [Documentation](#documentation)
* [Development](#development)
* [License](#licence)
- [About](#about)
- [Installation](#installation)
- [Documentation](#documentation)
- [Development](#development)
- [License](#license)

@@ -34,3 +34,3 @@ ## About

* For TSC <= 1.8:
- For TSC <= 1.8:

@@ -45,3 +45,3 @@ ```

* For TSC = 2.0+ typings can be installed through npm directly:
- For TSC = 2.0+ typings can be installed through npm directly:

@@ -70,3 +70,3 @@ ```

* using `.angular-cli.json`:
- Add to styles section in `angular.json` file:

@@ -80,19 +80,13 @@ ```javascript

* or in the `index.html` file with:
- or in the `index.html` file with:
```html
<link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css"
/>
```
You may also find it useful to view the [demo source](https://github.com/willsoto/ng-chartist/blob/master/demo/demo.ts).
You may also find it useful to view the [demo source](https://github.com/willsoto/ng-chartist/blob/master/projects/ng-chartist-demo/src/app/app.component.ts).
### Usage without a module bundler
```
<script src="node_modules/ng-chartist/dist/ng-chartist.js"></script>
<script>
// everything is exported ngChartist namespace
</script>
```
## Documentation

@@ -106,4 +100,4 @@

* Install [Node.js](http://nodejs.org/) and NPM (should come with)
* Install local dev dependencies: `npm install` while current directory is this repo
- Install [Node.js](http://nodejs.org/) and NPM (should come with)
- Install local dev dependencies: `npm install` while current directory is this repo

@@ -120,3 +114,3 @@ ### Development server

* Bump the version in package.json (once the module hits 1.0 this will become automatic)
- Bump the version in package.json (once the module hits 1.0 this will become automatic)

@@ -123,0 +117,0 @@ ```bash

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