Browse Source

Hidden analytic units in tooltip #239 (#332)

master
rozetko 6 years ago committed by GitHub
parent
commit
032a758562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/panel/graph_panel/controllers/analytic_controller.ts
  2. 6
      src/panel/graph_panel/graph_tooltip.ts

13
src/panel/graph_panel/controllers/analytic_controller.ts

@ -80,12 +80,15 @@ export class AnalyticController {
} }
private _segmentsSearcher(point: number, rangeDist: number): AnalyticSegmentPair[] { private _segmentsSearcher(point: number, rangeDist: number): AnalyticSegmentPair[] {
var result: AnalyticSegmentPair[] = []; let result: AnalyticSegmentPair[] = [];
this._analyticUnitsSet.items.forEach(at => { this._analyticUnitsSet.items.forEach(analyticUnit => {
var segs = at.segments.findSegments(point, rangeDist); if(!analyticUnit.visible) {
return;
}
const segs = analyticUnit.segments.findSegments(point, rangeDist);
segs.forEach(s => { segs.forEach(s => {
result.push({ analyticUnit: at, segment: s }); result.push({ analyticUnit, segment: s });
}) });
}) })
return result; return result;
} }

6
src/panel/graph_panel/graph_tooltip.ts

@ -116,7 +116,7 @@ export class GraphTooltip {
} }
seriesHtml += this._appendAnomaliesHTML(pos.x, rangeDist); seriesHtml += this._appendAnalyticsHTML(pos.x, rangeDist);
this._renderAndShow(absoluteTime, seriesHtml, pos, xMode); this._renderAndShow(absoluteTime, seriesHtml, pos, xMode);
@ -140,7 +140,7 @@ export class GraphTooltip {
group += '<div class="graph-tooltip-value">' + value + '</div>'; group += '<div class="graph-tooltip-value">' + value + '</div>';
group += this._appendAnomaliesHTML(pos.x, rangeDist); group += this._appendAnalyticsHTML(pos.x, rangeDist);
this._renderAndShow(absoluteTime, group, pos, xMode); this._renderAndShow(absoluteTime, group, pos, xMode);
} }
@ -192,7 +192,7 @@ export class GraphTooltip {
} }
}; };
private _appendAnomaliesHTML(pos: number, rangeDist: number): string { private _appendAnalyticsHTML(pos: number, rangeDist: number): string {
if(this._analyticSegmentsSearcher === undefined) { if(this._analyticSegmentsSearcher === undefined) {
return ''; return '';
} }

Loading…
Cancel
Save