module Shapee = {
[@react.component]
let make = (~shape: DistributionTypes.pointsType, ~timeScale, ~onHover) => {
let discrete = Shape.PointsType.scaledDiscreteComponent(shape);
let continuous = Shape.PointsType.scaledContinuousComponent(shape);
{discrete |> E.O.React.fmapOrNull(Shape.Discrete.render)}
;
};
};
module GenericDist = {
[@react.component]
let make = (~genericDistribution: DistributionTypes.genericDistribution) => {
let (x, setX) = React.useState(() => 0.);
let timeScale =
genericDistribution.unit |> DistributionTypes.DistributionUnit.toJson;
let chart =
React.useMemo1(
() => {
genericDistribution
|> DistributionTypes.shape
|> E.O.React.fmapOrNull(shape => {
setX(_ => r)} />
})
},
[|genericDistribution|],
);
chart
{"X Point" |> ReasonReact.string} |
{"Y Integral to Point" |> ReasonReact.string}
|
{x |> E.Float.toString |> ReasonReact.string}
|
{genericDistribution->GenericDistribution.yIntegral(x)
|> E.O.fmap(E.Float.with2DigitsPrecision)
|> E.O.default("")
|> ReasonReact.string}
|
;
};
};
[@react.component]
let make = (~dist) => {
switch ((dist: DistributionTypes.genericDistribution)) {
| {generationSource: Shape(_)} =>
| _ =>
};
};