diff --git a/src/components/charts/DistPlusPlot.re b/src/components/charts/DistPlusPlot.re index 32be15ad..139606be 100644 --- a/src/components/charts/DistPlusPlot.re +++ b/src/components/charts/DistPlusPlot.re @@ -1,14 +1,22 @@ type state = { log: bool, showStats: bool, + showParams: bool, height: int, }; type action = | CHANGE_LOG | CHANGE_SHOW_STATS + | CHANGE_SHOW_PARAMS | CHANGE_HEIGHT(int); +let showAsForm = (distPlus: DistTypes.distPlus) => { +
+ E.O.default("")} /> +
; +}; + let table = (distPlus, x) => {
@@ -207,6 +215,8 @@ module IntegralChart = { }; }; +let button = "bg-gray-300 hover:bg-gray-500 text-grey-darkest text-xs px-4 py-1"; + [@react.component] let make = (~distPlus: DistTypes.distPlus) => { let (x, setX) = React.useState(() => 0.); @@ -217,8 +227,9 @@ let make = (~distPlus: DistTypes.distPlus) => { | CHANGE_LOG => {...state, log: !state.log} | CHANGE_HEIGHT(height) => {...state, height} | CHANGE_SHOW_STATS => {...state, showStats: !state.showStats} + | CHANGE_SHOW_PARAMS => {...state, showParams: !state.showParams} }, - {log: false, height: 80, showStats: false}, + {log: false, height: 80, showStats: false, showParams: false}, ); let chart = React.useMemo2( @@ -231,25 +242,36 @@ let make = (~distPlus: DistTypes.distPlus) => { [|distPlus|], );
-
dispatch(CHANGE_LOG)}> - {(state.log ? "true" : "False") |> ReasonReact.string} -
-
dispatch(CHANGE_SHOW_STATS)}> - {"Stats" |> ReasonReact.string} -
-
dispatch(CHANGE_HEIGHT(state.height + 40))}> - {"HightPlus" |> ReasonReact.string} -
-
- dispatch( - CHANGE_HEIGHT(state.height < 81 ? state.height : state.height - 40), - ) - }> - {"HightMinus" |> ReasonReact.string} -
chart chart2 +
+ + + + + +
+ {state.showParams ? showAsForm(distPlus) : ReasonReact.null} {state.showStats ? table(distPlus, x) : ReasonReact.null}
; // chart diff --git a/src/distributions/DistPlusIngredients.re b/src/distributions/DistPlusIngredients.re index 9882b917..2f6be1a1 100644 --- a/src/distributions/DistPlusIngredients.re +++ b/src/distributions/DistPlusIngredients.re @@ -31,7 +31,7 @@ let toDistPlus = ~shape=_, ~domain=t.domain, ~unit=t.unit, - ~guesstimatorString=None, + ~guesstimatorString=Some(t.guesstimatorString), (), ), ) diff --git a/src/interface/FormBuilder.re b/src/interface/FormBuilder.re index 35f61608..94e7b4cb 100644 --- a/src/interface/FormBuilder.re +++ b/src/interface/FormBuilder.re @@ -20,8 +20,8 @@ let propValue = (t: Prop.Value.t) => { | DistPlusIngredients((r: DistTypes.distPlusIngredients)) => let newDistribution = DistPlusIngredients.toDistPlus( - ~sampleCount=2000, - ~outputXYPoints=1000, + ~sampleCount=1000, + ~outputXYPoints=2000, ~truncateTo=Some(500), r, );