From 70c44194d917ef9f9463c9d18b8ed29079f5faaa Mon Sep 17 00:00:00 2001 From: Andrew Couch Date: Mon, 27 Nov 2017 14:27:07 -0500 Subject: [PATCH] ui: remove percentage axis units The enum value AxisUnits.Percentage is presently unused. This removes it, along with dead code to calculate axis ticks for percentage values. If it comes up in the future that we need it, we can add it back in. --- pkg/ui/src/views/cluster/util/graphs.ts | 17 ----------------- .../shared/components/metricQuery/index.tsx | 4 ---- 2 files changed, 21 deletions(-) diff --git a/pkg/ui/src/views/cluster/util/graphs.ts b/pkg/ui/src/views/cluster/util/graphs.ts index f06344c45b88..68b74d83c592 100644 --- a/pkg/ui/src/views/cluster/util/graphs.ts +++ b/pkg/ui/src/views/cluster/util/graphs.ts @@ -204,20 +204,6 @@ function ComputeDurationAxisDomain( return axisDomain; } -const percentIncrementTable = [0.25, 0.5, 0.75, 1.0]; - -function ComputePercentageAxisDomain( - min: number, max: number, -) { - const range = max - min; - const increment = computeNormalizedIncrement(range, percentIncrementTable); - const axisDomain = new AxisDomain(min, max, increment); - axisDomain.label = "percentage"; - axisDomain.tickFormat = d3.format(".0%"); - axisDomain.guideFormat = d3.format(".2%"); - return axisDomain; -} - const timeIncrementDurations = [ moment.duration(1, "m"), moment.duration(5, "m"), @@ -327,9 +313,6 @@ function ProcessDataPoints( case AxisUnits.Duration: yAxisDomain = ComputeDurationAxisDomain(yExtent[0], yExtent[1]); break; - case AxisUnits.Percentage: - yAxisDomain = ComputePercentageAxisDomain(yExtent[0], yExtent[1]); - break; default: yAxisDomain = ComputeCountAxisDomain(yExtent[0], yExtent[1]); } diff --git a/pkg/ui/src/views/shared/components/metricQuery/index.tsx b/pkg/ui/src/views/shared/components/metricQuery/index.tsx index a7c022b7b89d..23f1d690fdc6 100644 --- a/pkg/ui/src/views/shared/components/metricQuery/index.tsx +++ b/pkg/ui/src/views/shared/components/metricQuery/index.tsx @@ -41,10 +41,6 @@ export enum AxisUnits { * Units are durations expressed in nanoseconds. */ Duration, - /** - * Units are percentages expressed as fractional values of 1 (1.0 = 100%). - */ - Percentage, } /**