Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: dashboard/dashboard/pinpoint/elements/job-page-chart.html

Issue 3013223002: [pinpoint] Narrower chart bounds. (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/pinpoint/elements/job-page-chart.html
diff --git a/dashboard/dashboard/pinpoint/elements/job-page-chart.html b/dashboard/dashboard/pinpoint/elements/job-page-chart.html
index da9b7933f8912978e002cc3b361d5fd9eb7c1bd4..deafe473a99264b33050c77a90ac54aec1dbd8e5 100644
--- a/dashboard/dashboard/pinpoint/elements/job-page-chart.html
+++ b/dashboard/dashboard/pinpoint/elements/job-page-chart.html
@@ -95,9 +95,15 @@ found in the LICENSE file.
if (anyNumbers) {
// Numeric data. Set the bounds based on the data.
- const flatValues = [].concat(...valuesByChange);
- lowerBound = percentile(flatValues, 0.1);
- upperBound = percentile(flatValues, 0.9);
+ // The bounds are the interquartile range of all points, but at the
+ // same time ensuring that every median point shows up on the graph.
+ const allValues = [].concat(...valuesByChange);
+ const changeMedians =
+ valuesByChange.filter(v => v.length).map(v => percentile(v, 0.5));
+ lowerBound =
+ Math.min(percentile(allValues, 0.25), Math.min(...changeMedians));
+ upperBound =
+ Math.max(percentile(allValues, 0.75), Math.max(...changeMedians));
if (!(isFinite(lowerBound) && isFinite(upperBound))) {
lowerBound = 0;
upperBound = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698