Hello, I am trying to get the dyamic input box to work with dcc.RangeSlider per the original example with dcc.Slider found here:
The code below does not work, any ideas would be appreciated.
Thank you,
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"]
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div(
[
dcc.RangeSlider(
id="slider", min=0, max=20,
marks={i: str(i) for i in range(21)},
value=[3,5]
),
dcc.Input(
id="input", type="number", min=0, max=20, value=3
),
dcc.Input(
id="input1", type="number", min=0, max=20, value=3
),
]
)
@app.callback(
Output("input", "value"),
Output("input1", "value"),
Output("slider", "value"),
Output("slider1", "value"),
Input("input", "value"),
Input("input1", "value"),
Input("slider", "value"),
Input("slider1", "value"),
)
def callback(input_value, input_value1,slider_value,slider_value1):
ctx = dash.callback_context
trigger_id = ctx.triggered[0]["prop_id"].split(".")[0]
print(trigger_id,'WTFFFFFFFFFFFF')
value = input_value if trigger_id == "input" else slider_value
value1 = input_value1 if trigger_id == "input1" else slider_value1
return value, value,value1,value1
if __name__ == '__main__':
app.run_server(debug=False)