-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from AUS-DOH-Safety-and-Quality/tooltip-displa…
…y-truncs Tooltip display truncs
- Loading branch information
Showing
23 changed files
with
163 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import plotKey from "../Type Definitions/plotKey" | ||
|
||
type controlLimitsArgs = { | ||
keys: plotKey[]; | ||
values: number[]; | ||
numerators?: number[]; | ||
denominators?: number[]; | ||
targets: number[]; | ||
ll99: number[]; | ||
ll95: number[]; | ||
ul95: number[]; | ||
ul99: number[]; | ||
count?: number[]; | ||
} | ||
|
||
class controlLimits { | ||
keys: plotKey[]; | ||
values: number[]; | ||
numerators?: number[]; | ||
denominators?: number[]; | ||
targets: number[]; | ||
ll99: number[]; | ||
ll95: number[]; | ||
ul95: number[]; | ||
ul99: number[]; | ||
count?: number[]; | ||
|
||
constructor(args: controlLimitsArgs) { | ||
this.keys = args.keys; | ||
this.values = args.values; | ||
if (args.numerators || !(args.numerators === null || args.numerators === undefined)) { | ||
this.numerators = args.numerators; | ||
} | ||
if (args.denominators || !(args.denominators === null || args.denominators === undefined)) { | ||
this.denominators = args.denominators; | ||
} | ||
this.targets = args.targets; | ||
this.ll99 = args.ll99; | ||
this.ll95 = args.ll95; | ||
this.ul95 = args.ul95; | ||
this.ul99 = args.ul99; | ||
if (args.count || !(args.count === null || args.count === undefined)) { | ||
this.count = args.count; | ||
} | ||
} | ||
} | ||
|
||
export default controlLimits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import * as d3 from "d3"; | ||
import rep from "../Functions/rep"; | ||
import dataObject from "../Classes/dataObject" | ||
import controlLimits from "../Type Definitions/controlLimits" | ||
import controlLimits from "../Classes/controlLimits" | ||
|
||
function cLimits(inputData: dataObject): controlLimits { | ||
let cl: number = d3.mean(inputData.numerators); | ||
let sigma: number = Math.sqrt(cl); | ||
|
||
return { | ||
return new controlLimits({ | ||
keys: inputData.keys, | ||
values: inputData.numerators, | ||
targets: rep(cl, inputData.keys.length), | ||
ll99: rep(Math.max(cl - 3 * sigma, 0), inputData.keys.length), | ||
ll95: rep(Math.max(cl - 2 * sigma, 0), inputData.keys.length), | ||
ul95: rep(cl + 2*sigma, inputData.keys.length), | ||
ul99: rep(cl + 3*sigma, inputData.keys.length), | ||
}; | ||
}); | ||
} | ||
|
||
export default cLimits; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.