Inputs
You can specify input elements within the settings and tracks sections, allowing users to parameterize and customize their visualization. Galaxy Charts currently supports these input types: boolean, color, data, data_json, data_table, float, integer, select, text, and textarea.
Below is a template for a generic input element. It includes label, help, name, and type attributes. Additional type-specific options are described in the sections below.
<input>
<label>My Input Label</label>
<help>My Input Help</help>
<name>my_input_name</name>
<type>boolean | color | data | data_json | data_table | float | integer | select | text | textarea</type>
...
</input>Boolean
Boolean inputs are useful to display yes/no options to the user.
Example:
<input>
<label>My Boolean Label</label>
<help>My Boolean Help</help>
<name>my_boolean_name</name>
<type>boolean</type>
</input>Translates to:
my_boolean_name = true
Color
Users may also select colors, this can be particular useful to distinguish data tracks e.g. in bar or line diagrams.
Example:
<input>
<label>My Color Label</label>
<help>My Color Help</help>
<name>my_color_name</name>
<type>color</type>
</input>Translates to:
my_color_name = #0284c7
Data
You can use a data input field to let users select a dataset from Galaxy, with optional filtering by file extension like bed or tabular. See the list of supported datatypes for details.
| Option | Type | Default | Description |
|---|---|---|---|
| extension | string | none | Filter by extension |
Example:
<input>
<label>My Data Label</label>
<help>My Data Help</help>
<name>my_data_name</name>
<type>data</type>
<extension>my_data_extension</extension>
</input>Translates to:
my_data_name = dataset_id_a
Data JSON
A data_json input field can load a JSON array of objects from a URL. Each object should have id and name attributes. Additional key-value pairs are allowed. The input populates a select field with these options.
| Option | Type | Default | Description |
|---|---|---|---|
| url | string | none | URL pointing to the JSON Array |
Example:
<input>
<label>My Data JSON</label>
<help>My Data JSON</help>
<name>my_data_json_name</name>
<type>data_json</type>
<url>my_data_json_url</url>
</input>Translates to:
my_data_json_name = json_entry_id_a
Data Table
A data_table input field can load tool data tables from Galaxy and present each row as an option to the user. The tables must be publicly accessible.
| Option | Type | Default | Description |
|---|---|---|---|
| tables | array | none | List of publicly accessible Galaxy Tool Data table names |
Example:
<input>
<label>My Data Table</label>
<help>My Data Table</help>
<name>my_data_table_name</name>
<type>data_table</type>
<tables>
<table>tool_data_table_name</table>
</tables>
</input>Translates to:
my_data_table_name = table_row_1
Float
float inputs support the following options:
| Option | Type | Default | Description |
|---|---|---|---|
| min | float | none | Minimum allowed value |
| max | float | none | Maximum allowed value |
Example:
<input>
<label>My Float Label</label>
<help>My Float Help</help>
<name>my_float_name</name>
<type>float</type>
<min>0</min>
<max>10</max>
</input>Translates to:
my_float_name = 1
Integer
integer inputs support the following options:
| Option | Type | Default | Description |
|---|---|---|---|
| min | integer | none | Minimum allowed value |
| max | integer | none | Maximum allowed value |
Example:
<input>
<label>My Integer Label</label>
<help>My Integer Help</help>
<name>my_integer_name</name>
<type>integer</type>
<min>0</min>
<max>10</max>
</input>Translates to:
my_integer_name = 1
Select
You may also declare select fields.
| Option | Type | Default | Description |
|---|---|---|---|
| filterable | boolean | false | Enable searching and filtering of options |
Example:
<input>
<label>My Select Label</label>
<help>My Select Help</help>
<name>my_select_name</name>
<type>select</type>
<filterable>false</filterable>
<value>my_option_a</value>
<data>
<data>
<label>My Option A Label</label>
<value>my_option_a</value>
</data>
<data>
<label>My Option B Label</label>
<value>my_option_b</value>
</data>
...
</data>
</input>Translates to:
my_select_name = my_option_a
Text
You may also declare text inputs.
| Option | Type | Default | Description |
|---|---|---|---|
| deferred | boolean | false | Trigger update on every keystroke or only after input completion |
Example:
<input>
<label>My Text Label</label>
<help>My Text Help</help>
<name>my_text_name</name>
<type>text</type>
<deferred>false</deferred>
</input>Translates to:
my_text_name = My Text
Text Area
Last but not least, textarea inputs can be declared.
<input>
<label>My Text Area Label</label>
<help>My Text Area Help</help>
<name>my_textarea_name</name>
<type>textarea</type>
</input>Translates to:
my_textarea_name = My Text Area
Conditional
In addition to the atomic inputs described above, you may also define conditional inputs. A conditional input includes a test_param, which determines which case-specific inputs are displayed. The test_param can be of type boolean (for two cases) or select (for multiple cases). Based on the selected value, the corresponding set of inputs defined in the cases section will be shown.
The following example demonstrates a conditional input with a boolean test_param controlling which inputs are shown.
<input>
<label>My Conditional Input</label>
<help>My Conditional Help</help>
<name>my_conditional</name>
<type>conditional</type>
<test_param>
<name>my_condition</name>
<type>boolean</type>
<value>true</value>
<data>
<data>
<label>My Condition: True</label>
<value>true</value>
</data>
<data>
<label>My Condition: False</label>
<value>false</value>
</data>
</data>
</test_param>
<cases>
<cases>
<value>true</value>
<inputs>
<inputs>
<label>My Text Area Label</label>
<help>My Text Area Help</help>
<name>my_textarea_name</name>
<type>textarea</type>
</inputs>
...
</inputs>
</cases>
<cases>
<value>false</value>
<inputs>
<inputs>
<label>My Text Area Label</label>
<help>My Text Area Help</help>
<name>my_textarea_name</name>
<type>textarea</type>
</inputs>
...
</inputs>
</cases>
</cases>
</input>