diff --git a/src/components/DistBuilder.re b/src/components/DistBuilder.re index 2fc9aa2c..2724cab7 100644 --- a/src/components/DistBuilder.re +++ b/src/components/DistBuilder.re @@ -146,6 +146,7 @@ module DemoDist = { (), ); let response = DistPlusRenderer.run(inputs); + Js.log(response); switch (RenderTypes.DistPlusRenderer.Outputs.distplus(response)) { | Some(distPlus) => | _ => diff --git a/src/distPlus/renderers/DistPlusRenderer.re b/src/distPlus/renderers/DistPlusRenderer.re index 36d8c857..c2bf8360 100644 --- a/src/distPlus/renderers/DistPlusRenderer.re +++ b/src/distPlus/renderers/DistPlusRenderer.re @@ -4,9 +4,10 @@ let truncateIfShould = outputs: RenderTypes.ShapeRenderer.Combined.outputs, dist, ) => { + let willTruncate = shouldTruncate - && RenderTypes.ShapeRenderer.Combined.methodUsed(outputs) == `Sampling - ? dist |> Distributions.DistPlus.T.truncate(recommendedLength) : dist; + && RenderTypes.ShapeRenderer.Combined.methodUsed(outputs) == `Sampling; + willTruncate ? dist |> Distributions.DistPlus.T.truncate(recommendedLength) : dist; }; let run = diff --git a/src/distPlus/renderers/RenderTypes.re b/src/distPlus/renderers/RenderTypes.re index a8c2161d..95a36204 100644 --- a/src/distPlus/renderers/RenderTypes.re +++ b/src/distPlus/renderers/RenderTypes.re @@ -61,7 +61,7 @@ module ShapeRenderer = { }; let methodUsed = ({symbolic, sampling}:outputs) => switch(symbolic, sampling){ | (Some(Ok(_)), _) => `Symbolic - | (None, Some({shape: Some(_)})) => `Sampling + | (_, Some({shape: Some(_)})) => `Sampling | _ => `None } let getShape = (r: outputs) => diff --git a/src/distPlus/renderers/ShapeRenderer.re b/src/distPlus/renderers/ShapeRenderer.re index 210b2817..183bd6fa 100644 --- a/src/distPlus/renderers/ShapeRenderer.re +++ b/src/distPlus/renderers/ShapeRenderer.re @@ -1,4 +1,4 @@ -// This transforms an array intesperced with spaces or newlines with a normally formatted one. +// This transforms an array intersperced with spaces or newlines with a normally formatted one. // "3 4 5 3 2 1 " -> "[3,4,5,3,2,1]"" let formatMessyArray = str => { let split = Js.String.splitByRe([%re "/\\n|\\r|\\s/"], str);