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