Changed default example

This commit is contained in:
Ozzie Gooen 2020-08-12 09:40:52 +01:00
parent c39d749a1d
commit 8a758d0bb5
4 changed files with 19 additions and 5 deletions

View File

@ -183,7 +183,9 @@ module DemoDist = {
|> E.R.bind(_, a => |> E.R.bind(_, a =>
switch (a) { switch (a) {
| `DistPlus(d) => Ok((r, DistPlus.T.normalize(d))) | `DistPlus(d) => Ok((r, DistPlus.T.normalize(d)))
| n => {Js.log2("Error here",n); Error("wrong type")} | n =>
Js.log2("Error here", n);
Error("wrong type");
} }
) )
) )
@ -214,9 +216,17 @@ let make = () => {
~initialState={ ~initialState={
//guesstimatorString: "mm(normal(-10, 2), uniform(18, 25), lognormal({mean: 10, stdev: 8}), triangular(31,40,50))", //guesstimatorString: "mm(normal(-10, 2), uniform(18, 25), lognormal({mean: 10, stdev: 8}), triangular(31,40,50))",
guesstimatorString: " guesstimatorString: "
foo(t) = normal(t,2) us_economy_2018 = (10.5 to 10.6)T
bar(t) = foo(t) growth_rate = 1.08 to 1.2
bar", us_economy(t) = us_economy_2018 * (growth_rate^t)
us_population_2019 = 320M to 330M
us_population_growth_rate = 1.01 to 1.02
us_population(t) = us_population_2019 * (us_population_growth_rate^t)
gdp_per_person(t) = us_economy(t)/us_population(t)
gdp_per_person
",
domainType: "Complete", domainType: "Complete",
xPoint: "50.0", xPoint: "50.0",
xPoint2: "60.0", xPoint2: "60.0",

View File

@ -107,5 +107,6 @@ let init = {
showPercentiles: false, showPercentiles: false,
distributions: [ distributions: [
{yLog: false, xLog: false, isCumulative: false, height: 4}, {yLog: false, xLog: false, isCumulative: false, height: 4},
{yLog: false, xLog: false, isCumulative: true, height: 1},
], ],
}; };

View File

@ -78,7 +78,7 @@
"type": "linear", "type": "linear",
"range": "height", "range": "height",
"nice": true, "nice": true,
"zero": false, "zero": true,
"domain": { "data": "facet", "field": "p99" } "domain": { "data": "facet", "field": "p99" }
} }
], ],

View File

@ -46,6 +46,9 @@ let to_: (float, float) => result(node, string) =
// let render = {"inputs": [`dist], "outputs": [`renderedDist]}; // let render = {"inputs": [`dist], "outputs": [`renderedDist]};
// let render = {"inputs": [`distRenderedDist], "outputs": [`renderedDist]}; // let render = {"inputs": [`distRenderedDist], "outputs": [`renderedDist]};
// type types = [`Float| `Dist];
// type def = {types};
let fnn = let fnn =
( (
evaluationParams: ExpressionTypes.ExpressionTree.evaluationParams, evaluationParams: ExpressionTypes.ExpressionTree.evaluationParams,