Minor cleanup

This commit is contained in:
Ozzie Gooen 2020-02-27 09:45:46 +00:00
parent 6c6f1e151c
commit 2638607228
4 changed files with 45 additions and 45 deletions

View File

@ -140,9 +140,9 @@ let make = () => {
<div> <div>
{DistPlusIngredients.make(~guesstimatorString, ~domain, ~unit, ()) {DistPlusIngredients.make(~guesstimatorString, ~domain, ~unit, ())
|> DistPlusIngredients.toDistPlus( |> DistPlusIngredients.toDistPlus(
~sampleCount=10000, ~sampleCount=1000,
~outputXYPoints=2000, ~outputXYPoints=1000,
~truncateTo=Some(1000), ~truncateTo=Some(100),
) )
|> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)} |> E.O.React.fmapOrNull(distPlus => <DistPlusPlot distPlus />)}
</div> </div>

View File

@ -40,7 +40,7 @@ module DistPlusChart = {
height=120 height=120
?discrete ?discrete
?continuous ?continuous
color={`hex("333")} color={`hex("5f6b7e")}
onHover onHover
timeScale timeScale
/>; />;
@ -71,7 +71,7 @@ module IntegralChart = {
maxX maxX
height=80 height=80
?continuous ?continuous
color={`hex("333")} color={`hex("5f6b7e")}
timeScale timeScale
onHover onHover
/>; />;
@ -94,78 +94,78 @@ let make = (~distPlus: DistTypes.distPlus) => {
<div> <div>
chart chart
chart2 chart2
<table className="table-auto"> <table className="table-auto text-sm">
<thead> <thead>
<tr> <tr>
<th className="px-4 py-2"> {"X Point" |> ReasonReact.string} </th> <td className="px-4 py-2 "> {"X Point" |> ReasonReact.string} </td>
<th className="px-4 py-2"> <td className="px-4 py-2">
{"Discrete Value" |> ReasonReact.string} {"Discrete Value" |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2"> <td className="px-4 py-2">
{"Continuous Value" |> ReasonReact.string} {"Continuous Value" |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2"> <td className="px-4 py-2">
{"Y Integral to Point" |> ReasonReact.string} {"Y Integral to Point" |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2"> <td className="px-4 py-2">
{"Y Integral Total" |> ReasonReact.string} {"Y Integral Total" |> ReasonReact.string}
</th> </td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<th className="px-4 py-2 border "> <td className="px-4 py-2 border">
{x |> E.Float.toString |> ReasonReact.string} {x |> E.Float.toString |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2 border "> <td className="px-4 py-2 border ">
{distPlus {distPlus
|> Distributions.DistPlus.T.xToY(x) |> Distributions.DistPlus.T.xToY(x)
|> DistTypes.MixedPoint.toDiscreteValue |> DistTypes.MixedPoint.toDiscreteValue
|> Js.Float.toPrecisionWithPrecision(_, ~digits=7) |> Js.Float.toPrecisionWithPrecision(_, ~digits=7)
|> ReasonReact.string} |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2 border "> <td className="px-4 py-2 border ">
{distPlus {distPlus
|> Distributions.DistPlus.T.xToY(x) |> Distributions.DistPlus.T.xToY(x)
|> DistTypes.MixedPoint.toContinuousValue |> DistTypes.MixedPoint.toContinuousValue
|> Js.Float.toPrecisionWithPrecision(_, ~digits=7) |> Js.Float.toPrecisionWithPrecision(_, ~digits=7)
|> ReasonReact.string} |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2 border "> <td className="px-4 py-2 border ">
{distPlus {distPlus
|> Distributions.DistPlus.T.Integral.xToY(~cache=None, x) |> Distributions.DistPlus.T.Integral.xToY(~cache=None, x)
|> E.Float.with2DigitsPrecision |> E.Float.with2DigitsPrecision
|> ReasonReact.string} |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2 border "> <td className="px-4 py-2 border ">
{distPlus {distPlus
|> Distributions.DistPlus.T.Integral.sum(~cache=None) |> Distributions.DistPlus.T.Integral.sum(~cache=None)
|> E.Float.with2DigitsPrecision |> E.Float.with2DigitsPrecision
|> ReasonReact.string} |> ReasonReact.string}
</th> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<table className="table-auto"> <table className="table-auto text-sm">
<thead> <thead>
<tr> <tr>
<th className="px-4 py-2"> <td className="px-4 py-2">
{"Continuous Total" |> ReasonReact.string} {"Continuous Total" |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2"> <td className="px-4 py-2">
{"Scaled Continuous Total" |> ReasonReact.string} {"Scaled Continuous Total" |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2"> <td className="px-4 py-2">
{"Discrete Total" |> ReasonReact.string} {"Discrete Total" |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2"> <td className="px-4 py-2">
{"Scaled Discrete Total" |> ReasonReact.string} {"Scaled Discrete Total" |> ReasonReact.string}
</th> </td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<th className="px-4 py-2 border "> <td className="px-4 py-2 border">
{distPlus {distPlus
|> Distributions.DistPlus.T.toContinuous |> Distributions.DistPlus.T.toContinuous
|> E.O.fmap( |> E.O.fmap(
@ -174,8 +174,8 @@ let make = (~distPlus: DistTypes.distPlus) => {
|> E.O.fmap(E.Float.with2DigitsPrecision) |> E.O.fmap(E.Float.with2DigitsPrecision)
|> E.O.default("") |> E.O.default("")
|> ReasonReact.string} |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2 border "> <td className="px-4 py-2 border ">
{distPlus {distPlus
|> Distributions.DistPlus.T.toScaledContinuous |> Distributions.DistPlus.T.toScaledContinuous
|> E.O.fmap( |> E.O.fmap(
@ -184,23 +184,23 @@ let make = (~distPlus: DistTypes.distPlus) => {
|> E.O.fmap(E.Float.with2DigitsPrecision) |> E.O.fmap(E.Float.with2DigitsPrecision)
|> E.O.default("") |> E.O.default("")
|> ReasonReact.string} |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2 border "> <td className="px-4 py-2 border ">
{distPlus {distPlus
|> Distributions.DistPlus.T.toDiscrete |> Distributions.DistPlus.T.toDiscrete
|> E.O.fmap(Distributions.Discrete.T.Integral.sum(~cache=None)) |> E.O.fmap(Distributions.Discrete.T.Integral.sum(~cache=None))
|> E.O.fmap(E.Float.with2DigitsPrecision) |> E.O.fmap(E.Float.with2DigitsPrecision)
|> E.O.default("") |> E.O.default("")
|> ReasonReact.string} |> ReasonReact.string}
</th> </td>
<th className="px-4 py-2 border "> <td className="px-4 py-2 border ">
{distPlus {distPlus
|> Distributions.DistPlus.T.toScaledDiscrete |> Distributions.DistPlus.T.toScaledDiscrete
|> E.O.fmap(Distributions.Discrete.T.Integral.sum(~cache=None)) |> E.O.fmap(Distributions.Discrete.T.Integral.sum(~cache=None))
|> E.O.fmap(E.Float.with2DigitsPrecision) |> E.O.fmap(E.Float.with2DigitsPrecision)
|> E.O.default("") |> E.O.default("")
|> ReasonReact.string} |> ReasonReact.string}
</th> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -76,7 +76,7 @@ module Styles = {
selector(".x-axis", [fontSize(`px(9))]), selector(".x-axis", [fontSize(`px(9))]),
selector(".x-axis .domain", [display(`none)]), selector(".x-axis .domain", [display(`none)]),
selector(".x-axis .tick line", [display(`none)]), selector(".x-axis .tick line", [display(`none)]),
selector(".x-axis .tick text", [color(`hex("bfcad4"))]), selector(".x-axis .tick text", [color(`hex("7a8998"))]),
selector(".chart .area-path", [SVG.fill(chartColor)]), selector(".chart .area-path", [SVG.fill(chartColor)]),
selector(".lollipops-line", [SVG.stroke(`hex("bfcad4"))]), selector(".lollipops-line", [SVG.stroke(`hex("bfcad4"))]),
selector( selector(

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Estiband</title> <title>Highly Speculative Forecasts</title>
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet">
<link href="./styles/index.css" rel="stylesheet"> <link href="./styles/index.css" rel="stylesheet">
<script src="./Index.re" defer></script> <script src="./Index.re" defer></script>