[ 
https://issues.apache.org/jira/browse/AIRAVATA-3285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17134390#comment-17134390
 ] 

Marcus Christie commented on AIRAVATA-3285:
-------------------------------------------

Mostly have the validation support done. Next step is to not load output view 
if one or more of the interactive parameter values is invalid.

> Interactive output view providers
> ---------------------------------
>
>                 Key: AIRAVATA-3285
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-3285
>             Project: Airavata
>          Issue Type: Bug
>          Components: Django Portal
>            Reporter: Marcus Christie
>            Assignee: Marcus Christie
>            Priority: Major
>
> Add support for interactive output viewers.
> h5. Design proposal
> The output view provider generate_data function signature is
> {code}
> def generate_data(self, request, experiment_output, experiment, 
> output_file=None):
>      ...
> {code}
> Propose changing this to
> {code}
> def generate_data(self, request, experiment_output, experiment, 
> output_file=None, **kwargs):
> {code}
> Where {{kwargs}} can hold additional, optional parameters that are controlled 
> by interactive widgets.
> To support interactivity, generate_data function should return a dictionary 
> that includes an *{{interactive}}* key with a dictionary of interactive 
> parameters and their current value. Depending on the type of value, an 
> interactive widget will be displayed in the portal to allow controlling that 
> value. For example, if the value is a boolean, a checkbox widget will be 
> displayed to allow the user to toggle that value.
> When interactive values are modified by the user, the {{generate_data}} 
> function will be called again with the interactive values passed as keyword 
> arguments. For example, if the interactive parameter is {{show_grid}} and it 
> is type boolean, then {{generate_data}} will be called like so
> {code}
> output_view_provider.generate_data(request, experiment_output, experiment, 
> output_file, show_grid=show_grid)
> {code}
> Other widget types:
> * integer, float - numeric slider with optional min, max, and step size 
> specification
> * string - text input
> * list of values, select one - drop down
> * list of values, select multiple - checkboxes
> h5. TODO
> - [x] refactor ui code for reusability amongst display types
> - [x] support interactive parameters for link and html display types
> - [x] implement string - text input type
> - [x] implement float - slider
> - [x] display current value on slider widget
> - [ ] add validation support
> - [ ] support integers in slider widget
> - [ ] support keyboard interaction in slider widget
> - [ ] implement multi-select - checkboxes
> - [ ] update tutorial/documentation
> - [ ] support for labels and help text
> - [ ] support passing through type information for when it can't be inferred
> - [ ] allow a shortcut where the interactive parameters are just name/value 
> pairs and the type is inferred?
> Resources:
> * took inspiration from 
> https://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to