From b453751866df69a1a251990b835efc33f7b51e43 Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Sat, 7 Jul 2018 11:40:58 +0300 Subject: [PATCH] some commit --- dist/module.js | 2 +- src/models/analytic_unit.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/module.js b/dist/module.js index 10f7282..2f01424 100644 --- a/dist/module.js +++ b/dist/module.js @@ -270,7 +270,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticSegment\", function() { return AnalyticSegment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticUnit\", function() { return AnalyticUnit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticUnitsSet\", function() { return AnalyticUnitsSet; });\n/* harmony import */ var _segment_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./segment_array */ \"./models/segment_array.ts\");\n/* harmony import */ var _segment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./segment */ \"./models/segment.ts\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar AnalyticSegment = /** @class */ (function (_super) {\n __extends(AnalyticSegment, _super);\n function AnalyticSegment(labeled, key, from, to) {\n var _this = _super.call(this, key, from, to) || this;\n _this.labeled = labeled;\n if (!lodash__WEBPACK_IMPORTED_MODULE_2___default.a.isBoolean(labeled)) {\n throw new Error('labeled value is not boolean');\n }\n return _this;\n }\n return AnalyticSegment;\n}(_segment__WEBPACK_IMPORTED_MODULE_1__[\"Segment\"]));\n\nvar AnalyticUnit = /** @class */ (function () {\n function AnalyticUnit(_panelObject) {\n this._panelObject = _panelObject;\n this._selected = false;\n this._deleteMode = false;\n this._saving = false;\n this._segmentSet = new _segment_array__WEBPACK_IMPORTED_MODULE_0__[\"SegmentArray\"]();\n if (_panelObject === undefined) {\n this._panelObject = {};\n }\n lodash__WEBPACK_IMPORTED_MODULE_2___default.a.defaults(this._panelObject, {\n name: 'analytcUnitName', confidence: 0.2, color: 'red', pattern: 'General'\n });\n //this._metric = new Metric(_panelObject.metric);\n }\n Object.defineProperty(AnalyticUnit.prototype, \"key\", {\n get: function () { return this.name; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"name\", {\n get: function () { return this._panelObject.name; },\n set: function (value) { this._panelObject.name = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"pattern\", {\n get: function () { return this._panelObject.pattern.split(' ')[0]; },\n set: function (value) { this._panelObject.pattern = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"confidence\", {\n get: function () { return this._panelObject.confidence; },\n set: function (value) { this._panelObject.confidence = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"color\", {\n get: function () { return this._panelObject.color; },\n set: function (value) { this._panelObject.color = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"selected\", {\n get: function () { return this._selected; },\n set: function (value) { this._selected = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"deleteMode\", {\n get: function () { return this._deleteMode; },\n set: function (value) { this._deleteMode = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"saving\", {\n get: function () { return this._saving; },\n set: function (value) { this._saving = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"visible\", {\n get: function () {\n return (this._panelObject.visible === undefined) ? true : this._panelObject.visible;\n },\n set: function (value) {\n this._panelObject.visible = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"metric\", {\n get: function () { return this._metric; },\n enumerable: true,\n configurable: true\n });\n AnalyticUnit.prototype.addLabeledSegment = function (segment) {\n var asegment = new AnalyticSegment(true, segment.id, segment.from, segment.to);\n this._segmentSet.addSegment(asegment);\n return asegment;\n };\n AnalyticUnit.prototype.removeSegmentsInRange = function (from, to) {\n return this._segmentSet.removeInRange(from, to);\n };\n Object.defineProperty(AnalyticUnit.prototype, \"segments\", {\n get: function () { return this._segmentSet; },\n set: function (value) {\n this._segmentSet.setSegments(value.getSegments());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"status\", {\n get: function () { return this._status; },\n set: function (value) {\n if (value !== 'ready' &&\n value !== 'learning' &&\n value !== 'pending' &&\n value !== 'failed') {\n throw new Error('Unsupported status value: ' + value);\n }\n this._status = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"error\", {\n get: function () { return this._error; },\n set: function (value) { this._error = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"isActiveStatus\", {\n get: function () {\n return this.status !== 'ready' && this.status !== 'failed';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"panelObject\", {\n get: function () { return this._panelObject; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"alertEnabled\", {\n get: function () { return this._alertEnabled; },\n set: function (value) { this._alertEnabled = value; },\n enumerable: true,\n configurable: true\n });\n return AnalyticUnit;\n}());\n\nvar AnalyticUnitsSet = /** @class */ (function () {\n function AnalyticUnitsSet(_panelObject) {\n this._panelObject = _panelObject;\n if (_panelObject === undefined) {\n throw new Error('panel object can`t be undefined');\n }\n this._mapIdIndex = new Map();\n this._items = _panelObject.map(function (p) { return new AnalyticUnit(p); });\n this._rebuildIndex();\n }\n Object.defineProperty(AnalyticUnitsSet.prototype, \"items\", {\n get: function () { return this._items; },\n enumerable: true,\n configurable: true\n });\n AnalyticUnitsSet.prototype.addItem = function (item) {\n this._panelObject.push(item.panelObject);\n this._mapIdIndex[item.name] = this._items.length;\n this._items.push(item);\n };\n AnalyticUnitsSet.prototype.removeItem = function (id) {\n var index = this._mapIdIndex[id];\n this._panelObject.splice(index, 1);\n this._items.splice(index, 1);\n this._rebuildIndex();\n };\n AnalyticUnitsSet.prototype._rebuildIndex = function () {\n var _this = this;\n this._items.forEach(function (a, i) {\n _this._mapIdIndex[a.key] = i;\n });\n };\n AnalyticUnitsSet.prototype.byId = function (id) {\n return this._items[this._mapIdIndex[id]];\n };\n AnalyticUnitsSet.prototype.byIndex = function (index) {\n return this._items[index];\n };\n return AnalyticUnitsSet;\n}());\n\n\n\n//# sourceURL=webpack:///./models/analytic_unit.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticSegment\", function() { return AnalyticSegment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticUnit\", function() { return AnalyticUnit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticUnitsSet\", function() { return AnalyticUnitsSet; });\n/* harmony import */ var _segment_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./segment_array */ \"./models/segment_array.ts\");\n/* harmony import */ var _segment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./segment */ \"./models/segment.ts\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar AnalyticSegment = /** @class */ (function (_super) {\n __extends(AnalyticSegment, _super);\n function AnalyticSegment(labeled, key, from, to) {\n var _this = _super.call(this, key, from, to) || this;\n _this.labeled = labeled;\n if (!lodash__WEBPACK_IMPORTED_MODULE_2___default.a.isBoolean(labeled)) {\n throw new Error('labeled value is not boolean');\n }\n return _this;\n }\n return AnalyticSegment;\n}(_segment__WEBPACK_IMPORTED_MODULE_1__[\"Segment\"]));\n\nvar AnalyticUnit = /** @class */ (function () {\n function AnalyticUnit(_panelObject) {\n this._panelObject = _panelObject;\n this._selected = false;\n this._deleteMode = false;\n this._saving = false;\n this._segmentSet = new _segment_array__WEBPACK_IMPORTED_MODULE_0__[\"SegmentArray\"]();\n if (_panelObject === undefined) {\n this._panelObject = {};\n }\n lodash__WEBPACK_IMPORTED_MODULE_2___default.a.defaults(this._panelObject, {\n name: 'AnalyticUnitName', confidence: 0.2, color: 'red', pattern: 'General'\n });\n //this._metric = new Metric(_panelObject.metric);\n }\n Object.defineProperty(AnalyticUnit.prototype, \"key\", {\n get: function () { return this.name; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"name\", {\n get: function () { return this._panelObject.name; },\n set: function (value) { this._panelObject.name = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"pattern\", {\n get: function () { return this._panelObject.pattern.split(' ')[0]; },\n set: function (value) { this._panelObject.pattern = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"confidence\", {\n get: function () { return this._panelObject.confidence; },\n set: function (value) { this._panelObject.confidence = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"color\", {\n get: function () { return this._panelObject.color; },\n set: function (value) { this._panelObject.color = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"selected\", {\n get: function () { return this._selected; },\n set: function (value) { this._selected = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"deleteMode\", {\n get: function () { return this._deleteMode; },\n set: function (value) { this._deleteMode = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"saving\", {\n get: function () { return this._saving; },\n set: function (value) { this._saving = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"visible\", {\n get: function () {\n return (this._panelObject.visible === undefined) ? true : this._panelObject.visible;\n },\n set: function (value) {\n this._panelObject.visible = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"metric\", {\n get: function () { return this._metric; },\n enumerable: true,\n configurable: true\n });\n AnalyticUnit.prototype.addLabeledSegment = function (segment) {\n var asegment = new AnalyticSegment(true, segment.id, segment.from, segment.to);\n this._segmentSet.addSegment(asegment);\n return asegment;\n };\n AnalyticUnit.prototype.removeSegmentsInRange = function (from, to) {\n return this._segmentSet.removeInRange(from, to);\n };\n Object.defineProperty(AnalyticUnit.prototype, \"segments\", {\n get: function () { return this._segmentSet; },\n set: function (value) {\n this._segmentSet.setSegments(value.getSegments());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"status\", {\n get: function () { return this._status; },\n set: function (value) {\n if (value !== 'ready' &&\n value !== 'learning' &&\n value !== 'pending' &&\n value !== 'failed') {\n throw new Error('Unsupported status value: ' + value);\n }\n this._status = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"error\", {\n get: function () { return this._error; },\n set: function (value) { this._error = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"isActiveStatus\", {\n get: function () {\n return this.status !== 'ready' && this.status !== 'failed';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"panelObject\", {\n get: function () { return this._panelObject; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"alertEnabled\", {\n get: function () { return this._alertEnabled; },\n set: function (value) { this._alertEnabled = value; },\n enumerable: true,\n configurable: true\n });\n return AnalyticUnit;\n}());\n\nvar AnalyticUnitsSet = /** @class */ (function () {\n function AnalyticUnitsSet(_panelObject) {\n this._panelObject = _panelObject;\n if (_panelObject === undefined) {\n throw new Error('panel object can`t be undefined');\n }\n this._mapIdIndex = new Map();\n this._items = _panelObject.map(function (p) { return new AnalyticUnit(p); });\n this._rebuildIndex();\n }\n Object.defineProperty(AnalyticUnitsSet.prototype, \"items\", {\n get: function () { return this._items; },\n enumerable: true,\n configurable: true\n });\n AnalyticUnitsSet.prototype.addItem = function (item) {\n this._panelObject.push(item.panelObject);\n this._mapIdIndex[item.name] = this._items.length;\n this._items.push(item);\n };\n AnalyticUnitsSet.prototype.removeItem = function (id) {\n var index = this._mapIdIndex[id];\n this._panelObject.splice(index, 1);\n this._items.splice(index, 1);\n this._rebuildIndex();\n };\n AnalyticUnitsSet.prototype._rebuildIndex = function () {\n var _this = this;\n this._items.forEach(function (a, i) {\n _this._mapIdIndex[a.key] = i;\n });\n };\n AnalyticUnitsSet.prototype.byId = function (id) {\n return this._items[this._mapIdIndex[id]];\n };\n AnalyticUnitsSet.prototype.byIndex = function (index) {\n return this._items[index];\n };\n return AnalyticUnitsSet;\n}());\n\n\n\n//# sourceURL=webpack:///./models/analytic_unit.ts?"); /***/ }), diff --git a/src/models/analytic_unit.ts b/src/models/analytic_unit.ts index f81288a..f484718 100644 --- a/src/models/analytic_unit.ts +++ b/src/models/analytic_unit.ts @@ -36,7 +36,7 @@ export class AnalyticUnit { this._panelObject = {}; } _.defaults(this._panelObject, { - name: 'analytcUnitName', confidence: 0.2, color: 'red', pattern: 'General' + name: 'AnalyticUnitName', confidence: 0.2, color: 'red', pattern: 'General' }); //this._metric = new Metric(_panelObject.metric);