Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
briangann committed Aug 5, 2023
1 parent 833b57f commit c776932
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/components/Gauge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export const Gauge: React.FC<GaugeOptions> = (options) => {
max: nextThresholdValue,
color: sorted[0].color,
};
}
};

// TODO: handle returning undefined when there is no upper band
const getUpperBand = (sorted: Threshold[]) => {
Expand All @@ -412,7 +412,7 @@ export const Gauge: React.FC<GaugeOptions> = (options) => {
max: options.maxValue,
color: sorted[index].color,
};
}
};

// TODO: handle returning undefined when there are no inner bands
const getInnerBands = (sorted: Threshold[], lower: ExpandedThresholdBand, upper: ExpandedThresholdBand) => {
Expand All @@ -426,12 +426,12 @@ export const Gauge: React.FC<GaugeOptions> = (options) => {
});
}
return innerBands;
}
};

const expandThresholdBands = () => {
// check if there are no thresholds
if (options.thresholds && options.thresholds!.steps.length === 0) {
return ({ lowerBand: undefined, innerBands: undefined, upperBand: undefined })
return ({ lowerBand: undefined, innerBands: undefined, upperBand: undefined });
}
const sorted = sortThresholds(options.thresholds!.steps);
// get the lower band
Expand All @@ -441,7 +441,7 @@ export const Gauge: React.FC<GaugeOptions> = (options) => {
// get the inner bands
const innerBands = getInnerBands(sorted, lowerBand, upperBand);
return ({ lowerBand, innerBands, upperBand });
}
};

const createThresholdBands = () => {
// do not show thresholds if this is false
Expand Down
6 changes: 3 additions & 3 deletions src/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const Markers: MarkerType[] = [

export interface ExpandedThresholdBand {
index: number;
min: number,
max: number,
color: string
min: number;
max: number;
color: string;
}

0 comments on commit c776932

Please sign in to comment.