Input Components
Creates and returns an instance of the InputDropdown component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the dropdown component. This should be a unique string name for this component within the form group. |
required |
label |
str
|
Display label for the dropdown. |
required |
values |
tuple or list
|
Either a list of dropdown values or a tuple containing a DataFrame and column name. |
required |
action_url |
str
|
URL to which the form submits. Defaults to "/". |
'/'
|
selected_value |
str
|
Initially selected value in the dropdown. Defaults to "Select All". |
'Select All'
|
Returns:
Name | Type | Description |
---|---|---|
InputDropdown |
An instance of the InputDropdown component. |
Example with Tuple:
In the below example, we are giving the dropdown a unique identifier of condition_selection, with a label of
Select a condition
, and the values from the dataframedf
and the columncondition
.
ComponentManager.Inputs.dropdown(
name = 'condition_selection',
label = 'Select a condition: ',
values = (df, 'condition'))
Source code in dashboard_builder/managers.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
Creates and returns an instance of the TextInput component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the text input component. |
required |
label |
str
|
Display label for the text input. |
required |
default_value |
str
|
Default value for the text input. Defaults to an empty string. |
''
|
Returns:
Name | Type | Description |
---|---|---|
TextInput |
An instance of the TextInput component. |
Source code in dashboard_builder/managers.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
Creates and returns an instance of the InputRadio component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the radio button input component. |
required |
label |
str
|
Display label for the radio button input. |
required |
options |
list
|
List of options for the radio button. |
required |
default_value |
str
|
Default option for the radio button. If not provided, the first option will be chosen. |
None
|
Returns:
Name | Type | Description |
---|---|---|
InputRadio |
An instance of the InputRadio component. |
Source code in dashboard_builder/managers.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
Creates and returns an instance of the InputSlider_Numerical component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the slider input component. |
required |
label |
str
|
Display label for the slider input. |
required |
min_value |
int
|
Minimum value for the slider. Defaults to 0. |
0
|
max_value |
int
|
Maximum value for the slider. Defaults to 100. |
100
|
step |
int
|
Step increment for the slider. Defaults to 1. |
1
|
default_value |
int
|
Default value for the slider. Defaults to 50. |
50
|
Returns:
Name | Type | Description |
---|---|---|
InputSlider_Numerical |
An instance of the InputSlider_Numerical component. |
Source code in dashboard_builder/managers.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|
Creates and returns an instance of the InputSlider_Categorical component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the slider input component. |
required |
label |
str
|
Display label for the slider input. |
required |
categories |
list
|
List of categories for the slider. |
required |
default_value |
str
|
Default category for the slider. If not provided, the first category will be chosen. |
None
|
Returns:
Name | Type | Description |
---|---|---|
InputSlider_Categorical |
An instance of the InputSlider_Categorical component. |
Source code in dashboard_builder/managers.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
|