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

ng2-vizabi

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-vizabi - npm Package Compare versions

Comparing version 0.17.5-3 to 0.17.6-21

27

components/vizabi/vizabi-service.js

@@ -11,12 +11,12 @@ "use strict";

};
var core_1 = require('@angular/core');
var urlon = require('URLON');
var VizabiService = (function () {
function VizabiService() {
const core_1 = require("@angular/core");
const urlon = require('URLON');
let VizabiService = class VizabiService {
constructor() {
}
VizabiService.prototype.modelToString = function (model) {
modelToString(model) {
model = model || {};
return urlon.stringify(model);
};
VizabiService.prototype.stringToModel = function (str) {
}
stringToModel(str) {
str = str || '_';

@@ -33,10 +33,9 @@ if (str) {

return {};
};
VizabiService = __decorate([
core_1.Injectable(),
__metadata('design:paramtypes', [])
], VizabiService);
return VizabiService;
}());
}
};
VizabiService = __decorate([
core_1.Injectable(),
__metadata("design:paramtypes", [])
], VizabiService);
exports.VizabiService = VizabiService;
//# sourceMappingURL=vizabi-service.js.map

@@ -22,3 +22,2 @@ import { OnInit, OnDestroy, ElementRef } from '@angular/core';

private minInitialModel;
private Vizabi;
constructor(element: ElementRef, vService: VizabiService);

@@ -29,2 +28,3 @@ ngOnInit(): void;

private readerProcessing();
private setMetadata();
private modelHashProcessing();

@@ -31,0 +31,0 @@ private persistentChangeProcessing();

@@ -11,7 +11,8 @@ "use strict";

};
var core_1 = require('@angular/core');
var vizabi_service_1 = require('./vizabi-service');
const core_1 = require("@angular/core");
const vizabi_service_1 = require("./vizabi-service");
const Vizabi = require('vizabi');
require('zone.js/dist/zone');
var VizabiDirective = (function () {
function VizabiDirective(element, vService) {
let VizabiDirective = class VizabiDirective {
constructor(element, vService) {
this.element = element;

@@ -22,5 +23,4 @@ this.vService = vService;

}
VizabiDirective.prototype.ngOnInit = function () {
this.Vizabi = require('vizabi');
this.minInitialModel = this.Vizabi.utils.deepClone(this.model);
ngOnInit() {
this.minInitialModel = Vizabi.utils.deepClone(this.model);
// set default value

@@ -35,3 +35,3 @@ this.stopUrlRedirect = this.stopUrlRedirect || false;

this.persistentChangeProcessing();
this.component.instance = this.Vizabi(this.chartType, this.view, this.model);
this.component.instance = Vizabi(this.chartType, this.view, this.model);
this.onCreated.emit({

@@ -43,41 +43,54 @@ order: this.order,

});
};
VizabiDirective.prototype.ngOnDestroy = function () {
var _this = this;
Object.keys(this.Vizabi._instances).forEach(function (instanceKey) {
_this.Vizabi._instances[instanceKey] = null;
// update language
this.setMetadata();
}
ngOnDestroy() {
Object.keys(Vizabi._instances).forEach(instanceKey => {
//if (Vizabi._instances[instanceKey]._id === this.component.instance._id) {
Vizabi._instances[instanceKey] = null;
//}
});
this.component.instance.clear();
this.view.remove();
};
VizabiDirective.prototype.createView = function () {
}
createView() {
this.view = document.createElement('div');
this.view.style.height = '100%';
this.element.nativeElement.appendChild(this.view);
};
VizabiDirective.prototype.readerProcessing = function () {
}
readerProcessing() {
if (this.readerModuleObject && this.readerGetMethod && this.readerName &&
this.readerParams && this.readerModuleObject[this.readerGetMethod]) {
var readerObject = this.readerModuleObject[this.readerGetMethod].apply(this, this.readerParams);
this.Vizabi.Reader.extend(this.readerName, readerObject);
const readerObject = this.readerModuleObject[this.readerGetMethod].apply(this, this.readerParams);
Vizabi.Reader.extend(this.readerName, readerObject);
}
};
VizabiDirective.prototype.modelHashProcessing = function () {
}
setMetadata() {
// set language
// this.component.instance.model.language.strings.set(this.model.language.id, this.translations);
}
modelHashProcessing() {
if (this.modelHash) {
var str = encodeURI(decodeURIComponent(this.modelHash));
var urlModel = this.vService.stringToModel(str);
this.Vizabi.utils.deepExtend(this.model, urlModel);
const str = encodeURI(decodeURIComponent(this.modelHash));
const urlModel = this.vService.stringToModel(str);
Vizabi.utils.deepExtend(this.model, urlModel);
}
};
VizabiDirective.prototype.persistentChangeProcessing = function () {
}
persistentChangeProcessing() {
this.model.bind = this.model.bind || {};
this.model.bind.ready = this.onPersistentChange.bind(this);
this.model.bind.persistentChange = this.onPersistentChange.bind(this);
};
VizabiDirective.prototype.onPersistentChange = function () {
var minModelDiff = this.component.instance.getPersistentMinimalModel(this.minInitialModel);
var modelState = this.vService.modelToString(minModelDiff);
}
onPersistentChange() {
const minModelDiff = this.component.instance.getPersistentMinimalModel(this.minInitialModel);
// fix :: clear translations
/*delete minModelDiff['language']['strings'];
if(Vizabi.utils.isEmpty(minModelDiff['language'])) {
delete minModelDiff['language'];
}*/
const modelState = this.vService.modelToString(minModelDiff);
// check if something changed
if (modelState == this.modelState) {
// nothing was changed
//console.log("onPersistentChange:", " nothing was changed");
return false;

@@ -87,2 +100,3 @@ }

this.modelState = modelState;
//console.log("onPersistentChange:", " new state ", modelState);
// check if change url is needed

@@ -99,65 +113,64 @@ if (!this.stopUrlRedirect && window && window.location) {

});
};
VizabiDirective.prototype.setExtResources = function () {
}
setExtResources() {
if (this.extResources) {
this.Vizabi._globals.ext_resources = this.extResources;
Vizabi._globals.ext_resources = this.extResources;
}
};
__decorate([
core_1.Input(),
__metadata('design:type', Number)
], VizabiDirective.prototype, "order", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Object)
], VizabiDirective.prototype, "readerModuleObject", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], VizabiDirective.prototype, "readerGetMethod", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Array)
], VizabiDirective.prototype, "readerParams", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], VizabiDirective.prototype, "readerName", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Object)
], VizabiDirective.prototype, "model", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], VizabiDirective.prototype, "modelHash", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Object)
], VizabiDirective.prototype, "extResources", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], VizabiDirective.prototype, "chartType", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], VizabiDirective.prototype, "stopUrlRedirect", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', core_1.EventEmitter)
], VizabiDirective.prototype, "onCreated", void 0);
__decorate([
core_1.Output(),
__metadata('design:type', core_1.EventEmitter)
], VizabiDirective.prototype, "onChanged", void 0);
VizabiDirective = __decorate([
core_1.Directive({
selector: 'vizabi'
}),
__metadata('design:paramtypes', [core_1.ElementRef, vizabi_service_1.VizabiService])
], VizabiDirective);
return VizabiDirective;
}());
}
};
__decorate([
core_1.Input(),
__metadata("design:type", Number)
], VizabiDirective.prototype, "order", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], VizabiDirective.prototype, "readerModuleObject", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", String)
], VizabiDirective.prototype, "readerGetMethod", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", Array)
], VizabiDirective.prototype, "readerParams", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", String)
], VizabiDirective.prototype, "readerName", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], VizabiDirective.prototype, "model", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", String)
], VizabiDirective.prototype, "modelHash", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], VizabiDirective.prototype, "extResources", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", String)
], VizabiDirective.prototype, "chartType", void 0);
__decorate([
core_1.Input(),
__metadata("design:type", Boolean)
], VizabiDirective.prototype, "stopUrlRedirect", void 0);
__decorate([
core_1.Output(),
__metadata("design:type", core_1.EventEmitter)
], VizabiDirective.prototype, "onCreated", void 0);
__decorate([
core_1.Output(),
__metadata("design:type", core_1.EventEmitter)
], VizabiDirective.prototype, "onChanged", void 0);
VizabiDirective = __decorate([
core_1.Directive({
selector: 'vizabi'
}),
__metadata("design:paramtypes", [core_1.ElementRef, vizabi_service_1.VizabiService])
], VizabiDirective);
exports.VizabiDirective = VizabiDirective;
//# sourceMappingURL=vizabi.js.map
{
"name": "ng2-vizabi",
"version": "0.17.5-3",
"version": "0.17.6-21",
"description": "angular2 vizabi component",
"scripts": {
"flow.compile": "npm run flow.compile:common",
"flow.compile:common": "typings install && ./node_modules/.bin/tsc",
"flow.compile:common": "tsc",
"flow.compile:system": "./.config/bundle-system.js",
"flow.copy:src": "./node_modules/.bin/cpy ng2-vizabi.ts \"components/*.ts\" ts --parents",
"flow.clean": "./node_modules/.bin/del bundles coverage demo-build typings \"components/**/*.+(js|d.ts|js.map)\" dist \"ng2-vizabi.+(js|d.ts|js.map)\"",
"flow.copy:src": "cpy ng2-vizabi.ts \"components/*.ts\" ts --parents",
"flow.clean": "del bundles coverage demo-build \"components/**/*.+(js|d.ts|js.map)\" dist \"ng2-vizabi.+(js|d.ts|js.map)\"",
"flow.deploy:gh-pages": "npm run flow.build:prod && ./node_modules/.bin/gh-pages -d demo-build",
"flow.changelog": "./node_modules/.bin/conventional-changelog -i CHANGELOG.md -s -p angular -v",
"flow.github-release": "./node_modules/.bin/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",
"flow.changelog": "conventional-changelog -i CHANGELOG.md -s -p angular -v",
"flow.github-release": "conventional-github-releaser -p angular",
"flow.build:prod": "NODE_ENV=production webpack --progress --color",
"flow.build:dev": "webpack --progress --color",
"flow.serve:dev": "webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
"flow.serve:prod": "NODE_ENV=production webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
"prepublish": "npm run flow.clean && npm run flow.compile",
"start": "npm run flow.compile && npm run flow.serve:dev",
"test": "NODE_ENV=test ./node_modules/.bin/karma start",
"test": "NODE_ENV=test karma start",
"preversion": "npm test",

@@ -49,3 +49,3 @@ "version": "npm run flow.changelog && git add -A",

"bluebird": "3.4.6",
"vizabi": "0.17.5-1"
"vizabi": "0.17.6-21"
},

@@ -59,5 +59,12 @@ "devDependencies": {

"@angular/platform-browser-dynamic": "2.0.0",
"@types/chai": "3.4.34",
"@types/mocha": "2.2.33",
"@types/node": "6.0.52",
"@types/redux": "3.6.0",
"@types/webpack": "2.0.0",
"@types/zone.js": "0.0.27",
"async": "2.0.0",
"awesome-typescript-loader": "2.2.4",
"bootstrap": "3.3.7",
"chai": "3.5.0",
"codecov": "1.0.1",

@@ -95,2 +102,3 @@ "compression-webpack-plugin": "0.3.1",

"marked": "0.3.6",
"mocha": "3.2.0",
"ng2-bootstrap": "1.1.5",

@@ -108,8 +116,7 @@ "phantomjs-polyfill": "0.0.2",

"systemjs-builder": "0.15.32",
"ts-loader": "0.8.2",
"typescript": "2.0.3",
"typings": "1.4.0",
"vizabi-ddfcsv-reader": "0.5.4",
"webpack": "1.13.2",
"webpack-dev-server": "1.16.1",
"ts-loader": "1.3.2",
"typescript": "2.1.4",
"vizabi-ddfcsv-reader": "0.6.1",
"webpack": "1.14.0",
"webpack-dev-server": "1.16.2",
"zone.js": "0.6.25"

@@ -116,0 +123,0 @@ },

{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",

@@ -9,14 +9,16 @@ "moduleResolution": "node",

"declaration": true,
"sourceMap": true
"sourceMap": true,
"types": [
"node",
"mocha",
"chai"
]
},
"exclude": [
"node_modules",
"typings/main.d.ts",
"typings/main"
"**/*.spec.ts"
],
"filesGlob": [
"./src/**/*.ts",
"!./node_modules/**/*.ts",
"src/custom_typings.d.ts",
"typings/browser.d.ts"
"include": [
"./components/vizabi",
"./demo/index"
],

@@ -23,0 +25,0 @@ "compileOnSave": false,

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