Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validating input #13

Open
vchuravy opened this issue Aug 22, 2014 · 3 comments
Open

Validating input #13

vchuravy opened this issue Aug 22, 2014 · 3 comments

Comments

@vchuravy
Copy link

I would like to put constraints on my inputs making them either co-dependent or at least validate them take the following Gadfly plot

@manipulate for μ in -5:5, σ in 0:5, min in -10:0, max in 0:10
    dist = Normal(μ, σ)
    plot(x -> pdf(dist,x), min, max) 
end 

I would like to validated an input like this.

@manipulate for μ in -5:5, σ = 10, min = -10 , max = 10 | max >= min |  σ >= 0
    dist = Normal(μ, σ)
    plot(x -> pdf(dist,x), min, max) 
end 
@shashi
Copy link
Member

shashi commented Aug 23, 2014

validation is possible with simple if statements although you are going to have to return a plot at the end of the block so that it doesn't get replaced by nothing. Co-dependent widgets seems like a great idea but will be hard to get right. Will try to do this in a 0.2.0 release.

@vchuravy
Copy link
Author

The idea of letting @manipulate handle validation would be that we could raise a warning at the front end and in the case that the validation fails, keep the last output.

@shashi
Copy link
Member

shashi commented Aug 23, 2014

Alright, that seems doable. Will try this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants