Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
couchand committed Nov 2, 2017
1 parent d9629b2 commit 0ab109d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/ui/src/util/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function ComputeByteScale(bytes: number): UnitValue {
}

export function BytesToUnitValue(bytes: number): UnitValue {
const scale = ComputeByteScale(bytes, kibi, byteUnits);
const scale = ComputeByteScale(bytes);
return {
value: bytes / scale.value,
units: scale.units,
Expand Down
14 changes: 7 additions & 7 deletions pkg/ui/src/views/cluster/containers/clusterOverview/capacity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ const axis = d3.svg.axis()
.ticks(5);

function recomputeScale(el: d3.Selection<CapacityChartProps>) {
var capacity = el.datum();
const capacity = el.datum();

// Compute the appropriate scale factor for a value slightly smaller than the
// usable capacity, so that if the usable capacity is exactly 1 {MiB,GiB,etc}
// we show the scale in the next-smaller unit.
var byteScale = ComputeByteScale(capacity.usable - 1);
const byteScale = ComputeByteScale(capacity.usable - 1);

var scaled = {
const scaled = {
used: capacity.used / byteScale.value,
usable: capacity.usable / byteScale.value,
};
el.datum(scaled)
el.datum(scaled);

axis.tickFormat(function (d) {
return d + " " + byteScale.units;
Expand All @@ -57,7 +57,7 @@ function chart(el: d3.Selection<CapacityChartProps>) {
recomputeScale(el);

const axisGroup = el.selectAll("g.axis")
.data(() => [null]);
.data(() => [0]);

axisGroup.enter()
.append("g")
Expand All @@ -67,7 +67,7 @@ function chart(el: d3.Selection<CapacityChartProps>) {
axisGroup.call(axis);
axisGroup.selectAll("text").attr("y", AXIS_MARGIN + TICK_SIZE);

const bg= el.selectAll(".bg")
const bg = el.selectAll(".bg")
.data((d: CapacityChartProps) => [d]);

bg.enter()
Expand All @@ -87,7 +87,7 @@ function chart(el: d3.Selection<CapacityChartProps>) {
.attr("height", 10)
.attr("y", 5);

bar
bar
.attr("width", (d: CapacityChartProps) => scale(d.used));

}
Expand Down

0 comments on commit 0ab109d

Please sign in to comment.