adamhajari / spyre

a web application framework for python
MIT License
832 stars 157 forks source link

Add a button input #84

Closed gramster closed 6 years ago

gramster commented 6 years ago

A dashboard could have multiple inputs. The result may be computationally expensive to generate, so auto-refresh on a change to any one input may be undesirable, but explicit refresh on any one input may be desirable. It doesn't seem like there is a good way to do this. Having a button widget seems like a good solve.

Based on some example screen shots of a stock dashboard it looks like there used to be one but it has been removed?

adamhajari commented 6 years ago

@gramster

Thanks for catching the discrepancy. I've updated the README to be consistent with the screenshots. controls come in two types: "button" and "hidden". Output updates are connected to controls through the outputs' "control_id" attribute. You can activate a control by either explicitly pushing a button, or by connecting the control to an input and changing the input.

There's an example of how the two control types are used in this ipython notebook tutorial: https://github.com/adamhajari/spyre/tree/master/tutorial/pydata2015_seattle (also referenced in this pydata talk: https://www.youtube.com/watch?v=NPV2hHV6hxY)