Added very simple lambdaDeclaration to React components
This commit is contained in:
parent
d1f2f71912
commit
533c97c41c
|
@ -202,6 +202,25 @@ const SquiggleItem: React.FC<SquiggleItemProps> = ({
|
|||
</VariableBox>
|
||||
);
|
||||
}
|
||||
case "lambdaDeclaration": {
|
||||
switch (expression.value.tag) {
|
||||
case "Continuous": {
|
||||
return (
|
||||
<FunctionChart
|
||||
fn={expression.value.value.fn}
|
||||
chartSettings={chartSettings}
|
||||
environment={{
|
||||
sampleCount: environment.sampleCount / 10,
|
||||
xyPointLength: environment.xyPointLength / 10,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
case "RelativeComparison": {
|
||||
return <></>;
|
||||
}
|
||||
}
|
||||
}
|
||||
case "lambda":
|
||||
return (
|
||||
<FunctionChart
|
||||
|
|
|
@ -185,5 +185,7 @@ function createTsExport(
|
|||
return tag("date", x.value);
|
||||
case "EvTimeDuration":
|
||||
return tag("timeDuration", x.value);
|
||||
case "EvDeclaration":
|
||||
return tag("lambdaDeclaration", x.value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import {
|
|||
discreteShape,
|
||||
continuousShape,
|
||||
lambdaValue,
|
||||
lambdaDeclaration
|
||||
} from "../rescript/TypescriptInterface.gen";
|
||||
import { Distribution } from "./distribution";
|
||||
import { tagged, tag } from "./types";
|
||||
|
@ -63,6 +64,10 @@ export type rescriptExport =
|
|||
| {
|
||||
TAG: 11; // EvTimeDuration
|
||||
_0: number;
|
||||
}
|
||||
| {
|
||||
TAG: 12; // EvDeclaration
|
||||
_0: lambdaDeclaration;
|
||||
};
|
||||
|
||||
type rescriptDist =
|
||||
|
@ -96,6 +101,7 @@ export type squiggleExpression =
|
|||
| tagged<"number", number>
|
||||
| tagged<"date", Date>
|
||||
| tagged<"timeDuration", number>
|
||||
| tagged<"lambdaDeclaration", lambdaDeclaration>
|
||||
| tagged<"record", { [key: string]: squiggleExpression }>;
|
||||
|
||||
export { lambdaValue };
|
||||
|
@ -141,6 +147,8 @@ export function convertRawToTypescript(
|
|||
return tag("date", result._0);
|
||||
case 11: // EvTimeDuration
|
||||
return tag("number", result._0);
|
||||
case 12: // EvDeclaration
|
||||
return tag("lambdaDeclaration", result._0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,9 @@ let distributionErrorToString = DistributionTypes.Error.toString
|
|||
@genType
|
||||
type lambdaValue = ReducerInterface_ExpressionValue.lambdaValue
|
||||
|
||||
@genType
|
||||
type lambdaDeclaration = ReducerInterface_ExpressionValue.lambdaDeclaration
|
||||
|
||||
@genType
|
||||
let defaultSamplingEnv = DistributionOperation.defaultEnv
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user