Merge remote-tracking branch 'origin/master' into feature/1101

This commit is contained in:
Roman Galochkin 2020-03-04 13:28:16 +03:00
commit 6a2a3848a8
3 changed files with 58 additions and 15 deletions

View File

@ -20,23 +20,68 @@ let setup = dist =>
~sampleCount=10000,
~outputXYPoints=2000,
~truncateTo=Some(1000),
);
)
|> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />);
let distributions = () =>
<div>
<div>
<h2> {"Single-Discrete" |> ReasonReact.string} </h2>
<h2 className="text-gray-800 text-xl font-bold">
{"Initial Section" |> ReasonReact.string}
</h2>
<h3 className="text-gray-600 text-lg font-bold">
{"Continuous" |> ReasonReact.string}
</h3>
{setup(DistPlusIngredients.make(~guesstimatorString="5 to 20", ()))}
<h3 className="text-gray-600 text-lg font-bold">
{"Discrete" |> ReasonReact.string}
</h3>
{setup(
DistPlusIngredients.make(~guesstimatorString="floor(10 to 20)", ()),
)}
<h3 className="text-gray-600 text-lg font-bold">
{"Mixed" |> ReasonReact.string}
</h3>
{setup(
DistPlusIngredients.make(
~guesstimatorString=
"uniform(0,1) > 0.3 ? lognormal(6.652, -0.41): 0",
~domain=
RightLimited({xPoint: 50.0, excludingProbabilityMass: 0.3}),
~guesstimatorString="mm(5 to 20, floor(20 to 30), [.5,.5])",
(),
),
)
|> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)}
)}
<h2 className="text-gray-800 text-xl font-bold">
{"Over Time" |> ReasonReact.string}
</h2>
<h3 className="text-gray-600 text-lg font-bold">
{"Continuous" |> ReasonReact.string}
</h3>
{setup(
DistPlusIngredients.make(
~guesstimatorString="5 to 20",
~unit=TimeDistribution({zero: MomentRe.momentNow(), unit: `years}),
(),
),
)}
<h3 className="text-gray-600 text-lg font-bold">
{"Discrete" |> ReasonReact.string}
</h3>
{setup(
DistPlusIngredients.make(
~guesstimatorString="floor(10 to 20)",
~unit=TimeDistribution({zero: MomentRe.momentNow(), unit: `years}),
(),
),
)}
<h3 className="text-gray-600 text-lg font-bold">
{"Mixed" |> ReasonReact.string}
</h3>
{setup(
DistPlusIngredients.make(
~guesstimatorString="mm(5 to 20, floor(20 to 30), [.5,.5])",
~unit=TimeDistribution({zero: MomentRe.momentNow(), unit: `years}),
(),
),
)}
</div>
</div>;
let entry = EntryTypes.(entry(~title="Pdf", ~render=distributions));
let entry = EntryTypes.(entry(~title="Pdf", ~render=distributions));

View File

@ -245,7 +245,7 @@ let make = (~distPlus: DistTypes.distPlus) => {
<button
className=button
onClick={_ => dispatch(CHANGE_LOG(index))}>
{(state.log ? "log" : "linear") |> ReasonReact.string}
{(config.log ? "x-log" : "x-linear") |> ReasonReact.string}
</button>
<button
className=button
@ -259,18 +259,18 @@ let make = (~distPlus: DistTypes.distPlus) => {
<button
className=button
onClick={_ => dispatch(HEIGHT_INCREMENT(index))}>
{"Expand" |> ReasonReact.string}
{"expand" |> ReasonReact.string}
</button>
<button
className=button
onClick={_ => dispatch(HEIGHT_DECREMENT(index))}>
{"Compress" |> ReasonReact.string}
{"shrink" |> ReasonReact.string}
</button>
{index != 0
? <button
className=button
onClick={_ => dispatch(REMOVE_DIST(index))}>
{"Remove" |> ReasonReact.string}
{"remove" |> ReasonReact.string}
</button>
: ReasonReact.null}
</div>

View File

@ -5,7 +5,6 @@ type chartConfig = {
};
type state = {
log: bool,
showStats: bool,
showParams: bool,
distributions: list(chartConfig),
@ -87,7 +86,6 @@ let reducer = (state: state, action: action) =>
};
let init = {
log: false,
showStats: false,
showParams: false,
distributions: [