diff --git a/src/controllers/analytic_controller.ts b/src/controllers/analytic_controller.ts index c4d303d..0d713f0 100644 --- a/src/controllers/analytic_controller.ts +++ b/src/controllers/analytic_controller.ts @@ -318,7 +318,7 @@ export class AnalyticController { } - deleteLabelingAnomalySegmentsInRange(from: number, to: number) { + deleteLabelingAnalyticUnitSegmentsInRange(from: number, to: number) { var allRemovedSegs = this.labelingUnit.removeSegmentsInRange(from, to); allRemovedSegs.forEach(s => { if(!this._labelingDataAddedSegments.has(s.id)) { diff --git a/src/graph_renderer.ts b/src/graph_renderer.ts index 16ed8b5..2605935 100644 --- a/src/graph_renderer.ts +++ b/src/graph_renderer.ts @@ -4,10 +4,10 @@ import { GraphTooltip } from './graph_tooltip'; import { convertValuesToHistogram, getSeriesValues } from './histogram'; import { AnalyticController, - REGION_FILL_ALPHA as ANOMALY_REGION_FILL_ALPHA, - REGION_STROKE_ALPHA as ANOMALY_REGION_STROKE_ALPHA, - REGION_DELETE_COLOR_LIGHT as ANOMALY_REGION_DELETE_COLOR_LIGHT, - REGION_DELETE_COLOR_DARK as ANOMALY_REGION_DELETE_COLOR_DARK + REGION_FILL_ALPHA, + REGION_STROKE_ALPHA, + REGION_DELETE_COLOR_LIGHT, + REGION_DELETE_COLOR_DARK } from './controllers/analytic_controller'; import { GraphCtrl } from './module'; @@ -107,7 +107,7 @@ export class GraphRenderer { return; } - if(this._isAnomalyEvent(selectionEvent)) { + if(this._isHasticEvent(selectionEvent)) { this.plot.clearSelection(); var id = this._analyticController.getNewTempSegmentId(); var segment = new Segment( @@ -116,7 +116,7 @@ export class GraphRenderer { Math.round(selectionEvent.xaxis.to) ); if(this._analyticController.labelingDeleteMode) { - this._analyticController.deleteLabelingAnomalySegmentsInRange( + this._analyticController.deleteLabelingAnalyticUnitSegmentsInRange( segment.from, segment.to ); } else { @@ -147,7 +147,7 @@ export class GraphRenderer { return; } - if(this._isAnomalyEvent(flotEvent)) { + if(this._isHasticEvent(flotEvent)) { return; } @@ -340,16 +340,16 @@ export class GraphRenderer { var color = COLOR_SELECTION; var fillAlpha = 0.4; var strokeAlpha = 0.4; - if(this._isAnomalyEvent(e)) { + if(this._isHasticEvent(e)) { if(this._analyticController.labelingDeleteMode) { color = this.contextSrv.user.lightTheme ? - ANOMALY_REGION_DELETE_COLOR_LIGHT : - ANOMALY_REGION_DELETE_COLOR_DARK; + REGION_DELETE_COLOR_LIGHT : + REGION_DELETE_COLOR_DARK; } else { color = this._analyticController.labelingUnit.color; } - fillAlpha = ANOMALY_REGION_FILL_ALPHA; - strokeAlpha = ANOMALY_REGION_STROKE_ALPHA; + fillAlpha = REGION_FILL_ALPHA; + strokeAlpha = REGION_STROKE_ALPHA; } this.plot.getOptions().selection.color = color } @@ -805,7 +805,7 @@ export class GraphRenderer { return '%H:%M'; } - private _isAnomalyEvent(obj: any) { + private _isHasticEvent(obj: any) { return (obj.ctrlKey || obj.metaKey) && this.contextSrv.isEditor && this._analyticController.labelingMode; diff --git a/src/graph_tooltip.ts b/src/graph_tooltip.ts index 2370651..96441b1 100644 --- a/src/graph_tooltip.ts +++ b/src/graph_tooltip.ts @@ -12,7 +12,7 @@ export class GraphTooltip { constructor( private $elem: JQuery, private dashboard, private scope, private getSeriesFn, - private _anomalySegmentsSearcher: AnalyticSegmentsSearcher + private _analyticSegmentsSearcher: AnalyticSegmentsSearcher ) { this.ctrl = scope.ctrl; this.panel = this.ctrl.panel; @@ -192,7 +192,7 @@ export class GraphTooltip { private _appendAnomaliesHTML(pos: number, rangeDist: number): string { var result = ''; - var segments = this._anomalySegmentsSearcher(pos, rangeDist); + var segments = this._analyticSegmentsSearcher(pos, rangeDist); if(segments.length === 0) { return ''; }