Marcus Christie created AIRAVATA-3285:
-----------------------------------------
Summary: 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
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
--
This message was sent by Atlassian Jira
(v8.3.4#803005)