You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `Input`, `State`, and `Output` now accept components instead of ID strings and Dash `callback` will auto-generate the component's ID under-the-hood if not supplied. This allows usage like:
- Rearranged Keyword Arguments - `options` & `value` are now the first two keywords which means they can be supplied as positional arguments without the keyword. Supplying the keywords (`options=` and `value=`) is still supported.
39
+
- Flexible Types - `options` can be supplied in two new forms:
40
+
1. An array of `string|number|bool` where `label` and `value` are equal to the items in the list.
41
+
2. A dictionary where the keys and values set as `value` and `label` respectively.
- Rearranged Keyword Arugments - `min`, `max`, and `step` are now the first three keyword arguments which means they can be supplied as positional arguments without the keyword.
79
+
- Flexible Types
80
+
- `step` will be calculated implicitly if not given.
81
+
- `marks` will be auto generated if not given. It will use `min` and `max` and will respect `step` if supplied. Auto generated marks labels are SI unit formatted. Around 5 human-readable marks will be created.
82
+
- To remove the Slider's marks, set `marks=None`.
83
+
84
+
Before:
85
+
86
+
```python
87
+
dcc.Slider(marks={1: 2, 2: 2, 3: 3})
88
+
```
89
+
90
+
After:
91
+
```python
92
+
dcc.Slider(min=1, max=3, step=1)
93
+
```
94
+
Or equivalently:
95
+
```python
96
+
dcc.Slider(1, 3, 1)
97
+
```
98
+
Step can also be omitted and the `Slider` will attempt to create a nice, human readable step with SI units and around 5 marks:
99
+
```python
100
+
dcc.Slider(0, 100)
101
+
```
102
+
103
+
The SI units and ranges supported in `marks` are:
104
+
* `µ` - micro, 10⁻⁶
105
+
* `m` - milli, 10⁻³
106
+
* `` (none) - 10⁰
107
+
* `k` - kilo, 10³
108
+
* `M` - mega, 10⁶
109
+
* `G` - giga, 10⁹
110
+
* `T` - tera, 10¹²
111
+
* `P` - peta, 10¹⁵
112
+
* `E` - exa, 10¹⁸
113
+
114
+
_Ranges below 10µ are not supported by the Slider. This is a bug: https://github.com/plotly/dash/issues/1766_
115
+
116
+
**`DataTable`**
117
+
118
+
- Rearranged Keyword Arguments - `data` and `columns` the first twokeyword arguments which means they can be supplied as positional arguments without the keyword.
119
+
- Inferred Properties - If `columns` isn't supplied then it is extracted from the the first row in `data`
120
+
121
+
Before:
122
+
123
+
```python
124
+
dash_table.DataTable(data=df.to_dict('records'), columns=[{'name': i, 'id': i} for i in df.columns])
125
+
```
126
+
After:
127
+
128
+
```python
129
+
dash_table.DataTable(data=df.to_dict('records'))
130
+
```
131
+
132
+
### New Component Properties
133
+
134
+
**`Checklist` & `RadioItems`**
135
+
136
+
- A new property `inline` appends `display: inline-block` to `labelStyle`.
0 commit comments