Fix some build errors about error values
This commit is contained in:
parent
e2e30641b3
commit
eb86d12d63
|
@ -172,15 +172,11 @@ export const FunctionChart1Dist: React.FC<FunctionChart1DistProps> = ({
|
||||||
const signalListeners = { mousemove: handleHover, mouseout: handleOut };
|
const signalListeners = { mousemove: handleHover, mouseout: handleOut };
|
||||||
|
|
||||||
//TODO: This custom error handling is a bit hacky and should be improved.
|
//TODO: This custom error handling is a bit hacky and should be improved.
|
||||||
let mouseItem: result<SqValue, SqError> = !!mouseOverlay
|
let showChart: JSX.Element | null = null;
|
||||||
? fn.call([mouseOverlay])
|
if (!isNaN(mouseOverlay)) {
|
||||||
: {
|
let mouseItem = fn.call([mouseOverlay]);
|
||||||
tag: "Error",
|
|
||||||
value: SqError.createOtherError(
|
showChart =
|
||||||
"Hover x-coordinate returned NaN. Expected a number."
|
|
||||||
),
|
|
||||||
};
|
|
||||||
let showChart =
|
|
||||||
mouseItem.tag === "Ok" &&
|
mouseItem.tag === "Ok" &&
|
||||||
mouseItem.value.tag === SqValueTag.Distribution ? (
|
mouseItem.value.tag === SqValueTag.Distribution ? (
|
||||||
<DistributionChart
|
<DistributionChart
|
||||||
|
@ -191,6 +187,7 @@ export const FunctionChart1Dist: React.FC<FunctionChart1DistProps> = ({
|
||||||
{...distributionPlotSettings}
|
{...distributionPlotSettings}
|
||||||
/>
|
/>
|
||||||
) : null;
|
) : null;
|
||||||
|
}
|
||||||
|
|
||||||
let getPercentilesMemoized = React.useMemo(
|
let getPercentilesMemoized = React.useMemo(
|
||||||
() => getPercentiles({ chartSettings, fn, environment }),
|
() => getPercentiles({ chartSettings, fn, environment }),
|
||||||
|
|
|
@ -19,4 +19,4 @@ let createTodoError = (v: string) => Reducer_ErrorValue.RETodo(v)
|
||||||
let createOtherError = (v: string) => Reducer_ErrorValue.REOther(v)
|
let createOtherError = (v: string) => Reducer_ErrorValue.REOther(v)
|
||||||
|
|
||||||
@genType
|
@genType
|
||||||
let getErrorSource = (err: reducerErrorValueWithSource) => err.sourceId
|
let getSource = (err: reducerErrorValueWithSource) => err.sourceId
|
||||||
|
|
Loading…
Reference in New Issue
Block a user