fix: run yarn format
This commit is contained in:
parent
872204d38e
commit
be8edcba13
|
@ -54,31 +54,36 @@ export const DistributionChart: React.FC<DistributionChartProps> = ({
|
||||||
React.useEffect(() => setExpY(expY), [expY]);
|
React.useEffect(() => setExpY(expY), [expY]);
|
||||||
|
|
||||||
const [sized] = useSize((size) => {
|
const [sized] = useSize((size) => {
|
||||||
|
|
||||||
const p3wrapped = distribution.inv(0.025);
|
const p3wrapped = distribution.inv(0.025);
|
||||||
const p97wrapped = distribution.inv(0.975);
|
const p97wrapped = distribution.inv(0.975);
|
||||||
if (p3wrapped.tag == "Error") {
|
if (p3wrapped.tag == "Error") {
|
||||||
return <ErrorAlert heading="Distribution Calculation Error">
|
return (
|
||||||
{distributionErrorToString(p3wrapped.value)}
|
<ErrorAlert heading="Distribution Calculation Error">
|
||||||
</ErrorAlert>
|
{distributionErrorToString(p3wrapped.value)}
|
||||||
|
</ErrorAlert>
|
||||||
|
);
|
||||||
} else if (p97wrapped.tag == "Error") {
|
} else if (p97wrapped.tag == "Error") {
|
||||||
return <ErrorAlert heading="Distribution Calculation Error">
|
return (
|
||||||
{distributionErrorToString(p97wrapped.value)}
|
<ErrorAlert heading="Distribution Calculation Error">
|
||||||
</ErrorAlert>
|
{distributionErrorToString(p97wrapped.value)}
|
||||||
|
</ErrorAlert>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const p3 = p3wrapped.value
|
const p3 = p3wrapped.value;
|
||||||
const p97 = p97wrapped.value
|
const p97 = p97wrapped.value;
|
||||||
|
|
||||||
const truncatedDistributionWrapper = distribution.truncate(p3, p97)
|
const truncatedDistributionWrapper = distribution.truncate(p3, p97);
|
||||||
if (truncatedDistributionWrapper.tag == "Error") {
|
if (truncatedDistributionWrapper.tag == "Error") {
|
||||||
return <ErrorAlert heading="Distribution Truncation For Display Error">
|
return (
|
||||||
{distributionErrorToString(truncatedDistributionWrapper.value)}
|
<ErrorAlert heading="Distribution Truncation For Display Error">
|
||||||
</ErrorAlert>
|
{distributionErrorToString(truncatedDistributionWrapper.value)}
|
||||||
|
</ErrorAlert>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const truncatedDistribution = truncatedDistributionWrapper.value
|
const truncatedDistribution = truncatedDistributionWrapper.value;
|
||||||
|
|
||||||
const shape = distribution.pointSet();
|
const shape = distribution.pointSet();
|
||||||
const shapeTruncated = truncatedDistribution.pointSet();// distribution.pointSet();
|
const shapeTruncated = truncatedDistribution.pointSet(); // distribution.pointSet();
|
||||||
|
|
||||||
if (shapeTruncated.tag === "Error") {
|
if (shapeTruncated.tag === "Error") {
|
||||||
return (
|
return (
|
||||||
|
@ -115,8 +120,11 @@ export const DistributionChart: React.FC<DistributionChartProps> = ({
|
||||||
<Vega
|
<Vega
|
||||||
spec={spec}
|
spec={spec}
|
||||||
data={
|
data={
|
||||||
truncateTo95ci ?
|
truncateTo95ci
|
||||||
{ con: shapeTruncated.value.continuous, dis: shapeTruncated.value.discrete }
|
? {
|
||||||
|
con: shapeTruncated.value.continuous,
|
||||||
|
dis: shapeTruncated.value.discrete,
|
||||||
|
}
|
||||||
: { con: shape.value.continuous, dis: shape.value.discrete }
|
: { con: shape.value.continuous, dis: shape.value.discrete }
|
||||||
}
|
}
|
||||||
width={widthProp - 10}
|
width={widthProp - 10}
|
||||||
|
@ -140,10 +148,10 @@ export const DistributionChart: React.FC<DistributionChartProps> = ({
|
||||||
// Check whether we should disable the checkbox
|
// Check whether we should disable the checkbox
|
||||||
{...(massBelow0
|
{...(massBelow0
|
||||||
? {
|
? {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
tooltip:
|
tooltip:
|
||||||
"Your distribution has mass lower than or equal to 0. Log only works on strictly positive values.",
|
"Your distribution has mass lower than or equal to 0. Log only works on strictly positive values.",
|
||||||
}
|
}
|
||||||
: {})}
|
: {})}
|
||||||
/>
|
/>
|
||||||
<CheckBox label="Exp Y scale" value={isExpY} onChange={setExpY} />
|
<CheckBox label="Exp Y scale" value={isExpY} onChange={setExpY} />
|
||||||
|
|
|
@ -45,7 +45,7 @@ export interface SquiggleChartProps {
|
||||||
truncateTo95ci?: boolean;
|
truncateTo95ci?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultOnChange = () => { };
|
const defaultOnChange = () => {};
|
||||||
const defaultChartSettings = { start: 0, stop: 10, count: 20 };
|
const defaultChartSettings = { start: 0, stop: 10, count: 20 };
|
||||||
|
|
||||||
export const SquiggleChart: React.FC<SquiggleChartProps> = ({
|
export const SquiggleChart: React.FC<SquiggleChartProps> = ({
|
||||||
|
|
|
@ -104,7 +104,7 @@ export const SquiggleEditor: React.FC<SquiggleEditorProps> = ({
|
||||||
showSummary,
|
showSummary,
|
||||||
logX,
|
logX,
|
||||||
expY,
|
expY,
|
||||||
truncateTo95ci
|
truncateTo95ci,
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user