Comments (4)
There are two concepts that are in Beta for doing this: Events
and State
. I haven't documented them yet because I'm not confident yet that Events
is the correct abstraction. For now, you can see an example here on how they work: https://gist.github.com/chriddyp/e546a2a2c05df29c868e4cef57fb2105, but just know that this may change in the future.
In the short term, I'm planning on adding "click stateto every component, an attribute that is something like
n_clicks`. Then, you could subscribe to that change with something like:
@dash.dependencies(Output(...), [Input('my-button', n_clicks')])
def update_on_click(number_of_times_the_button_has_been_clicked):
return ...
If you knew the number of times the button has been clicked, you could even do something like toggle things on and off depending on whether n_clicks
was even or odd.
from dash.
now documented in https://plot.ly/dash/state
from dash.
The example does not work - there is an error in line 52 -
NameError: global name 'go' is not defined
from dash.
The idea of being able to access the state of a giving component aligns pretty well with how React handles things like this. Or maybe, there could be a "redux store" could be accessed at any point by any function.
from dash.
Related Issues (20)
- [BUG] `clickData` from `go.ScatterMapbox` does not work when an invalid tile layer is specified.
- [BUG] Scattermapbox cluster bug - “The layer does not exist in the map’s style…” HOT 5
- [BUG] Possible XSS issue within metadata HOT 3
- [Feature Request] Make Pages `dcc.Location` id public? HOT 2
- [BUG] `Patch` does not seem to work correctly for data updates of figures created with `make_subplots` HOT 2
- [Feature Request] support multiple URL path levels in path template
- [BUG] Import error with typing_extensions == 4.9.0 HOT 3
- [BUG] dash_duo.get_logs() returns None instead of an empty list HOT 1
- [Feature Request] Remove dependency on LGPL licensed `ansi2html` HOT 2
- [Help] how to add a contentChange listener on html.Div components HOT 1
- [BUG] HOT 1
- [BUG] dcc.Input selectionStart not functioning as expected
- [Feature Request] Add date support for dcc.Slider/dcc.RangeSlider
- [BUG] use Patch to append children,but init ui disappear HOT 2
- [BUG] callback in infinite loop but only triggered once HOT 4
- Selenium 4.2.0 Version Vulnerability
- [Feature Request] Render table can add Grand Total HOT 1
- Decouple Dash & Celery HOT 1
- [Feature Request] Allow background callback tasks to programmatically retry later. HOT 10
- [Feature Request] Add multiple needles to daq.Gauge
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash.