Browse Source

rename anomaly to something else

master
Coin de Gamma 5 years ago
parent
commit
ce634152d4
  1. 2
      src/controllers/analytic_controller.ts
  2. 26
      src/graph_renderer.ts
  3. 4
      src/graph_tooltip.ts

2
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)) {

26
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;

4
src/graph_tooltip.ts

@ -12,7 +12,7 @@ export class GraphTooltip {
constructor(
private $elem: JQuery<HTMLElement>, 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 '';
}

Loading…
Cancel
Save