You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@airavata.apache.org by "Marcus Christie (Jira)" <ji...@apache.org> on 2020/04/07 22:53:00 UTC

[jira] [Updated] (AIRAVATA-3285) Interactive output view providers

     [ https://issues.apache.org/jira/browse/AIRAVATA-3285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcus Christie updated AIRAVATA-3285:
--------------------------------------
    Description: 
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
- [ ] 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

  was:
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


Resources:
* took inspiration from https://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html


> 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
> - [ ] 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)