# Range Slider updated by dropdown list?

**URL:** https://community.plotly.com/t/range-slider-updated-by-dropdown-list/38076
**Category:** Dash Python
**Created:** [April 20, 2020, 11:23am UTC](https://community.plotly.com/t/range-slider-updated-by-dropdown-list/38076 "2020-04-20T11:23:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![antjes88](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@antjes88](https://community.plotly.com/u/antjes88)
#### Post date: [April 20, 2020, 11:23am UTC](https://community.plotly.com/t/range-slider-updated-by-dropdown-list/38076/1 "2020-04-20T11:23:42Z")

</div>

I am trying to make a range slider that would be moduified by a dropdown list. Basically, to give some context, range slider would be for time and the dropdown list is stablishing date from.

My code looks like this:

#################################  
#######HERE THE LAYOUT###############  
#################################

> df\_call = call\_to\_db\_analysis(‘Incomes’, dt(2019, 1, 1))  
> df\_to = df\_call[‘Date’].drop\_duplicates().to\_frame().reset\_index(drop=True)  
> df\_to[‘Date\_str’] = df\_to[‘Date’].dt.strftime(‘%b-%Y’)  
> options\_ =   
> for i in df\_to.index:  
> options\_.append({‘label’: df\_to.loc[i, ‘Date\_str’], ‘value’: df\_to.loc[i, ‘Date’]})
> 
> dd\_from\_analysis = dcc.Dropdown(id=‘dropdown-date-from-analysis’,  
> options=options\_,  
> value=df\_to.loc[11, ‘Date’],  
> style={‘text-align’: ‘left’})
> 
> app\_cuentas\_dash.layout = html.Div([  
> dcc.RangeSlider(id=“range-slider-analysis”),  
> dd\_from\_analysis  
> ]  
> )

#################################  
#######HERE THE CALLBACK#############  
#################################

> @app\_cuentas\_dash.callback([Output(‘range-slider-analysis’, ‘min’),  
> Output(‘range-slider-analysis’, ‘max’),  
> Output(‘range-slider-analysis’, ‘marks’),  
> Output(‘range-slider-analysis’, ‘value’)],  
> [Input(‘dropdown-date-from-analysis’, ‘value’)])  
> def update\_figure(value\_from\_date):  
> df\_rs = analysis.call\_to\_db\_analysis(‘Incomes’,  
> value\_from\_date)[‘Date’].drop\_duplicates().to\_frame().reset\_index(drop=True)  
> min\_rs, max\_rs, marks\_rs, value\_rs = analysis.rs\_analysis(df\_rs)  
> return min\_rs, max\_rs, marks\_rs, value\_rs

###################################################  
#############DEFINITON OF RANGE SLIDER PARAMETERS##########  
##################################################

> def rs\_analysis(df\_rs):  
> min\_rs = 0  
> max\_rs = df\_rs[‘Date’].shape[0] - 1  
> marks\_rs = marks\_dict\_analysis(df\_rs, type\_=2),  
> value\_rs = [0, df\_rs[‘Date’].shape[0] - 1]  
> return min\_rs, max\_rs, marks\_rs, value\_rs

###############################################

I am having problems to pass any parameters to the range slider.
