Fixed dependencies in the components directory

This commit is contained in:
Ozzie Gooen 2022-02-18 17:23:06 -05:00
parent e86aafbc8c
commit 8a0e84bb5b
3 changed files with 11 additions and 11 deletions

View File

@ -105,7 +105,7 @@ module DemoDist = {
sampleCount: Some(options.sampleCount), sampleCount: Some(options.sampleCount),
outputXYPoints: Some(options.outputXYPoints), outputXYPoints: Some(options.outputXYPoints),
kernelWidth: options.kernelWidth, kernelWidth: options.kernelWidth,
shapeLength: Some(options.downsampleTo |> E.O.default(1000)), pointSetDistLength: Some(options.downsampleTo |> E.O.default(1000)),
}, },
~squiggleString, ~squiggleString,
~environment=[ ~environment=[

View File

@ -1,7 +1,7 @@
open DistPlusPlotReducer open DistPlusPlotReducer
let plotBlue = #hex("1860ad") let plotBlue = #hex("1860ad")
let showAsForm = (distPlus: ForetoldAppSquiggle.DistTypes.distPlus) => let showAsForm = (distPlus: ForetoldAppSquiggle.PointSetTypes.distPlus) =>
<div> <Antd.Input value={distPlus.squiggleString |> E.O.default("")} /> </div> <div> <Antd.Input value={distPlus.squiggleString |> E.O.default("")} /> </div>
let showFloat = (~precision=3, number) => <NumberShower number precision /> let showFloat = (~precision=3, number) => <NumberShower number precision />
@ -24,14 +24,14 @@ let table = (distPlus, x) =>
<td className="px-4 py-2 border "> <td className="px-4 py-2 border ">
{distPlus {distPlus
|> ForetoldAppSquiggle.DistPlus.T.xToY(x) |> ForetoldAppSquiggle.DistPlus.T.xToY(x)
|> ForetoldAppSquiggle.DistTypes.MixedPoint.toDiscreteValue |> ForetoldAppSquiggle.PointSetTypes.MixedPoint.toDiscreteValue
|> Js.Float.toPrecisionWithPrecision(_, ~digits=7) |> Js.Float.toPrecisionWithPrecision(_, ~digits=7)
|> React.string} |> React.string}
</td> </td>
<td className="px-4 py-2 border "> <td className="px-4 py-2 border ">
{distPlus {distPlus
|> ForetoldAppSquiggle.DistPlus.T.xToY(x) |> ForetoldAppSquiggle.DistPlus.T.xToY(x)
|> ForetoldAppSquiggle.DistTypes.MixedPoint.toContinuousValue |> ForetoldAppSquiggle.PointSetTypes.MixedPoint.toContinuousValue
|> Js.Float.toPrecisionWithPrecision(_, ~digits=7) |> Js.Float.toPrecisionWithPrecision(_, ~digits=7)
|> React.string} |> React.string}
</td> </td>
@ -155,7 +155,7 @@ let adjustBoth = discreteProbabilityMassFraction => {
module DistPlusChart = { module DistPlusChart = {
@react.component @react.component
let make = (~distPlus: ForetoldAppSquiggle.DistTypes.distPlus, ~config: chartConfig, ~onHover) => { let make = (~distPlus: ForetoldAppSquiggle.PointSetTypes.distPlus, ~config: chartConfig, ~onHover) => {
open ForetoldAppSquiggle.DistPlus open ForetoldAppSquiggle.DistPlus
let discrete = distPlus |> T.toDiscrete |> E.O.fmap(ForetoldAppSquiggle.Discrete.getShape) let discrete = distPlus |> T.toDiscrete |> E.O.fmap(ForetoldAppSquiggle.Discrete.getShape)
@ -176,7 +176,7 @@ module DistPlusChart = {
let maxX = distPlus |> T.Integral.yToX(0.99999) let maxX = distPlus |> T.Integral.yToX(0.99999)
let timeScale = distPlus.unit |> ForetoldAppSquiggle.DistTypes.DistributionUnit.toJson let timeScale = distPlus.unit |> ForetoldAppSquiggle.PointSetTypes.DistributionUnit.toJson
let discreteProbabilityMassFraction = distPlus |> T.toDiscreteProbabilityMassFraction let discreteProbabilityMassFraction = distPlus |> T.toDiscreteProbabilityMassFraction
let (yMaxDiscreteDomainFactor, yMaxContinuousDomainFactor) = adjustBoth( let (yMaxDiscreteDomainFactor, yMaxContinuousDomainFactor) = adjustBoth(
@ -202,13 +202,13 @@ module DistPlusChart = {
module IntegralChart = { module IntegralChart = {
@react.component @react.component
let make = (~distPlus: ForetoldAppSquiggle.DistTypes.distPlus, ~config: chartConfig, ~onHover) => { let make = (~distPlus: ForetoldAppSquiggle.PointSetTypes.distPlus, ~config: chartConfig, ~onHover) => {
let integral = distPlus.integralCache let integral = distPlus.integralCache
let continuous = integral |> ForetoldAppSquiggle.Continuous.toLinear |> E.O.fmap(ForetoldAppSquiggle.Continuous.getShape) let continuous = integral |> ForetoldAppSquiggle.Continuous.toLinear |> E.O.fmap(ForetoldAppSquiggle.Continuous.getShape)
let minX = distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.00001) let minX = distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.00001)
let maxX = distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.99999) let maxX = distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.99999)
let timeScale = distPlus.unit |> ForetoldAppSquiggle.DistTypes.DistributionUnit.toJson let timeScale = distPlus.unit |> ForetoldAppSquiggle.PointSetTypes.DistributionUnit.toJson
<DistributionPlot <DistributionPlot
xScale={config.xLog ? "log" : "linear"} xScale={config.xLog ? "log" : "linear"}
yScale={config.yLog ? "log" : "linear"} yScale={config.yLog ? "log" : "linear"}
@ -225,7 +225,7 @@ module IntegralChart = {
module Chart = { module Chart = {
@react.component @react.component
let make = (~distPlus: ForetoldAppSquiggle.DistTypes.distPlus, ~config: chartConfig, ~onHover) => { let make = (~distPlus: ForetoldAppSquiggle.PointSetTypes.distPlus, ~config: chartConfig, ~onHover) => {
let chart = React.useMemo2( let chart = React.useMemo2(
() => () =>
config.isCumulative config.isCumulative
@ -246,7 +246,7 @@ module Chart = {
let button = "bg-gray-300 hover:bg-gray-500 text-grey-darkest text-xs px-4 py-1" let button = "bg-gray-300 hover:bg-gray-500 text-grey-darkest text-xs px-4 py-1"
@react.component @react.component
let make = (~distPlus: ForetoldAppSquiggle.DistTypes.distPlus) => { let make = (~distPlus: ForetoldAppSquiggle.PointSetTypes.distPlus) => {
let (x, setX) = React.useState(() => 0.) let (x, setX) = React.useState(() => 0.)
let (state, dispatch) = React.useReducer(DistPlusPlotReducer.reducer, DistPlusPlotReducer.init) let (state, dispatch) = React.useReducer(DistPlusPlotReducer.reducer, DistPlusPlotReducer.init)

View File

@ -30,7 +30,7 @@ module Internal = {
@react.component @react.component
@module("./PercentilesChart.js") @module("./PercentilesChart.js")
let make = (~dists: array<(float, DistTypes.distPlus)>, ~children=React.null) => { let make = (~dists: array<(float, PointSetTypes.distPlus)>, ~children=React.null) => {
let data = dists -> Belt.Array.map(((x, r)) => let data = dists -> Belt.Array.map(((x, r)) =>
{ {
"x": x, "x": x,