plotly / dash-daq

Control components for Dash
MIT License
141 stars 40 forks source link

Color not Dash Output type #44

Closed matthijsramlab closed 5 years ago

matthijsramlab commented 5 years ago

The color option is not a Dash Output type. I would like to change the color of the switch depending on the user input. Should I instead use the theme parameter?

The error message I got:

dash.exceptions.IncorrectTypeException: The output argument stop_know.color is not of type dash.Output.

My component:

daq.ToggleSwitch(id='stop_know', value=False, color="#FF5E5E")

shammamah-zz commented 5 years ago

Hey @matthijsramlab! Would you be able to post the code that you're using?

matthijsramlab commented 5 years ago

Hi, you can close the issue. I made a stupid mistake...

@app.callback( [ State('stop_know', 'color'), State('stop_at_bead', 'color'), State('stop_at_layer', 'color'), ], [ Input('dio_updater', 'n_intervals') ], [ State('stop_know', 'value'), State('stop_at_bead', 'value'), State('stop_at_layer', 'value'), State('robot_name', 'children') ] )

Instead of setting them as an Output, I typed State....

shammamah-zz commented 5 years ago

Glad you figured it out :)