Skip to content

Commit

Permalink
Fix assurance icon detection with varying and missing alt. target values
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Apr 1, 2024
1 parent 1750d66 commit 3200a47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Outlier Flagging/assuranceIconToDraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import type { viewModelClass } from "../Classes";

export default function assuranceIconToDraw(viewModel: viewModelClass): string {
const imp_direction: string = viewModel.inputSettings.settings.outliers.improvement_direction;
const alt_target: number = viewModel.inputSettings.settings.lines.alt_target;
const N: number = viewModel.controlLimits.ll99.length - 1;
const alt_target: number = viewModel.controlLimits?.alt_targets?.[N];

if (alt_target === null || imp_direction === "neutral") {
return "none";
}

const N: number = viewModel.controlLimits.ll99.length - 1;
const impDirectionIncrease: boolean = imp_direction === "increase";

if (alt_target > viewModel.controlLimits.ul99[N]) {
Expand Down

0 comments on commit 3200a47

Please sign in to comment.