Skip to content

Commit

Permalink
ui: remove percentage axis units
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
couchand committed Nov 28, 2017
1 parent bb24e4e commit 70c4419
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
17 changes: 0 additions & 17 deletions pkg/ui/src/views/cluster/util/graphs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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]);
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/ui/src/views/shared/components/metricQuery/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

/**
Expand Down

0 comments on commit 70c4419

Please sign in to comment.