Skip to content

Inputs

You can specify input elements within the settings and tracks sections, allowing users to parameterize and customize their visualization. Galaxy Charts currently supports the following input types: boolean, color, data, float, integer, select, text and textarea.

Below is a template for a generic input element. It includes attributes such as label, help, name, and type, along with an optional data array used for select inputs:

xml
<input>
    <label>My Input Label</label>
    <help>My Input Help</help>
    <name>my_input_name</name>
    <type>boolean | color | float | integer | select | text | textarea</type>
    <data>
        <data>
            <label>My Option 1 Label</label>
            <value>my_option_1</value>
        </data>
        ...
    </data>
</input>

Boolean Input

Boolean inputs are useful to display yes/no options to the user e.g.

xml
<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 Input

Users may also select colors, this can be particular useful to distinguish data tracks e.g. in bar or line diagrams:

xml
<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 Input

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.

xml
<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

Float Input

xml
<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 Input

xml
<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 Input

xml
<input>
    <label>My Select Label</label>
    <help>My Select Help</help>
    <name>my_select_name</name>
    <type>select</type>
    <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 Input

You may also declare text inputs.

xml
<input>
    <label>My Text Label</label>
    <help>My Text Help</help>
    <name>my_text_name</name>
    <type>text</type>
</input>

Translates to:

my_text_name = My Text

Text Area Input

Last but not least, textarea inputs can be declared.

xml
<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 Input

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.

xml
<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>