Use new chart in FormBuilder
This commit is contained in:
parent
a6f5aa7fc0
commit
2e1287e746
|
@ -6,7 +6,8 @@ let data: DistributionTypes.xyShape = {
|
|||
// "mm(floor(uniform(30,35)), normal(50,20), [.25,.5])",
|
||||
let timeDist =
|
||||
GenericDistribution.make(
|
||||
~generationSource=GuesstimatorString("floor(normal(30,3))"),
|
||||
~generationSource=
|
||||
GuesstimatorString("mm(floor(normal(30,3)), normal(39,1), [.5,.5])"),
|
||||
~probabilityType=Pdf,
|
||||
~domain=Complete,
|
||||
~unit=TimeDistribution({zero: MomentRe.momentNow(), unit: `days}),
|
||||
|
@ -24,14 +25,5 @@ let distributions = () =>
|
|||
<h2> {"Simple Continuous" |> ReasonReact.string} </h2>
|
||||
</div>
|
||||
</div>;
|
||||
// <GenericDistributionChart dist=mixedDist />
|
||||
// <div>
|
||||
// <h2> {"Time Distribution" |> ReasonReact.string} </h2>
|
||||
// <GenericDistributionChart dist=timeDist />
|
||||
// </div>
|
||||
// <div>
|
||||
// <h2> {"Domain Limited Distribution" |> ReasonReact.string} </h2>
|
||||
// <GenericDistributionChart dist=domainLimitedDist />
|
||||
// </div>
|
||||
|
||||
let entry = EntryTypes.(entry(~title="Pdf", ~render=distributions));
|
|
@ -197,8 +197,9 @@ module Mixed = {
|
|||
let minX = (t: DistributionTypes.mixedShape) =>
|
||||
min(t.continuous |> Continuous.minX, t.discrete |> Discrete.minX);
|
||||
|
||||
let maxX = (t: DistributionTypes.mixedShape) =>
|
||||
min(t.continuous |> Continuous.maxX, t.discrete |> Discrete.maxX);
|
||||
let maxX = (t: DistributionTypes.mixedShape) => {
|
||||
max(t.continuous |> Continuous.maxX, t.discrete |> Discrete.maxX);
|
||||
};
|
||||
|
||||
let mixedMultiply =
|
||||
(
|
||||
|
|
|
@ -21,19 +21,10 @@ let propValue = (t: Prop.Value.t) => {
|
|||
let newDistribution =
|
||||
GenericDistribution.renderIfNeeded(~sampleCount=1000, r);
|
||||
switch (newDistribution) {
|
||||
| Some({
|
||||
generationSource:
|
||||
Shape(
|
||||
Mixed({
|
||||
continuous: n,
|
||||
discrete: d,
|
||||
discreteProbabilityMassFraction: f,
|
||||
}),
|
||||
),
|
||||
}) =>
|
||||
| Some(distribution) =>
|
||||
<div>
|
||||
<Chart height=100 data={n |> Shape.Continuous.toJs} />
|
||||
{d |> Shape.Discrete.scaleYToTotal(f) |> Shape.Discrete.render}
|
||||
{GenericDistribution.normalize(distribution)
|
||||
|> E.O.React.fmapOrNull(dist => <GenericDistributionChart dist />)}
|
||||
</div>
|
||||
| None => "Something went wrong" |> ReasonReact.string
|
||||
| _ => <div />
|
||||
|
|
Loading…
Reference in New Issue
Block a user