Fixed bug that would not truncate correctly
This commit is contained in:
		
							parent
							
								
									b14f1244c2
								
							
						
					
					
						commit
						747e3a6706
					
				|  | @ -146,6 +146,7 @@ module DemoDist = { | |||
|                (), | ||||
|              ); | ||||
|            let response = DistPlusRenderer.run(inputs); | ||||
|            Js.log(response); | ||||
|            switch (RenderTypes.DistPlusRenderer.Outputs.distplus(response)) { | ||||
|            | Some(distPlus) => <DistPlusPlot distPlus /> | ||||
|            | _ => | ||||
|  |  | |||
|  | @ -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 = | ||||
|  |  | |||
|  | @ -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) => | ||||
|  |  | |||
|  | @ -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); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user