Skip to content

Commit 61d4ccf

Browse files
author
Mark Gibbs
committed
More improvements to the demo
1 parent 97a0873 commit 61d4ccf

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

demo/demo/templates/demo_three.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
{%block content%}
77
<h1>Enhanced Callback Functionality</h1>
88
<p>
9+
If any callback is registered as an enhanced one, then all of the callbacks receive extra values
10+
as kwargs. These include the Dash application instance, a per-session dictionary that can contain anything
11+
suitable for inclusion in a standard Django session, and the Django User instance.
12+
The session state is per user session at the Django level, so it is shared across all of the Dash applications.
13+
</p>
14+
<p>
15+
Changes made to any values contained within the initial state can also be persisted when using enhanced callbacks. This is a
16+
per-app-instance flag and, when set, the response of every callback is checked and persisted if it has changed. The second
17+
of the two apps below is configured in this manner; any changes made on this page should reappear if one visits a different page and
18+
then reloads this one. These changes can also be observed in the update timestamp or initial content json content of
19+
the <a href="{%url "admin:django_plotly_dash_dashapp_changelist" %}">model</a>.
920
</p>
1021
<div class="card bg-light border-dark">
1122
<div class="card-body">

demo/demo/templates/demo_two.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ <h1>Initial State</h1>
99
Referring to an instance of a dash application, uniquely identified by a slug, will use the persisted
1010
representation of that app along with its initial state.
1111
</p>
12+
<p>
13+
Each time this page is reloaded, the application will revert to its stored intial state. This initial
14+
state is persisted in a standard
15+
Django <a href="{%url "admin:django_plotly_dash_dashapp_changelist" %}">model</a>.
16+
</p>
1217
<div class="card bg-light border-dark">
1318
<div class="card-body">
1419
<p><span>{</span>% load plotly_dash %}</p>

0 commit comments

Comments
 (0)