-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from delsim/doc_tweaks
Prerelease 0.4.3
- Loading branch information
Showing
21 changed files
with
292 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import os | ||
import django | ||
from channels.routing import get_default_application | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings") | ||
django.setup() | ||
application = get_default_application() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* Extra CSS markup for demo pages */ | ||
|
||
.btnspace { margin-bottom: 10px; } | ||
|
||
.dpd-example-wrapper { background-color: #e0e0e0; padding: 10px; } | ||
.dpd-example { background-color: white; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
{%load plotly_dash%} | ||
{%load staticfiles%} | ||
{%load bootstrap4%} | ||
{%bootstrap_css%} | ||
{%bootstrap_javascript jquery="full"%} | ||
<link rel="stylesheet" type="text/css" href="{%static "demo/demo.css"%}"></link> | ||
<title>Django Plotly Dash Examples - {%block title%}{%endblock%}</title> | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark"> | ||
<div class="navbar-nav"> | ||
<a class="navbar-brand" href="#"> | ||
<img src="{%static "demo/logo.svg"%}" alt="Logo"/> | ||
</a> | ||
<a class="nav-item nav-link btn btn-lg" href="{%url "home"%}">Contents</a> | ||
<a class="nav-item nav-link btn btn-lg" href="{%url "demo-one"%}">Demo One - Simple Use</a> | ||
<a class="nav-item nav-link btn btn-lg" href="{%url "demo-two"%}">Demo Two - Initial State</a> | ||
<a class="nav-item nav-link btn btn-lg" href="{%url "demo-three"%}">Demo Three - Enhanced Callbacks</a> | ||
<a class="nav-item nav-link btn btn-lg" href="{%url "demo-four"%}">Demo Four - Live Updating</a> | ||
</div> | ||
</nav> | ||
<div class="container"> | ||
{%block content%}{%endblock%} | ||
</div> | ||
</body> | ||
{%block post_body%}{%endblock%} | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{%extends "base.html"%} | ||
{%load plotly_dash%} | ||
|
||
{%block post_body%}{%plotly_message_pipe%}{%endblock%} | ||
|
||
{%block title%}Demo Four - Live Updating{%endblock%} | ||
|
||
{%block content%} | ||
<h1>Live Updating</h1> | ||
<p> | ||
Live updating uses a websocket connection. The server pushes messages to the UI, and this is then translated into a | ||
callback through a dash component. | ||
</p> | ||
<div class="card bg-light border-dark"> | ||
<div class="card-body"> | ||
<p><span>{</span>% load plotly_dash %}</p> | ||
<p><span>{</span>% plotly_app slug="connected-2" %}</p> | ||
</div> | ||
</div> | ||
<p> | ||
</p> | ||
<div class="card border-dark"> | ||
<div class="card-body"> | ||
{%plotly_app slug="connected-2"%} | ||
</div> | ||
</div> | ||
<p> | ||
</p> | ||
<div class="card border-dark"> | ||
<div class="card-body"> | ||
{%plotly_app slug="connected-2"%} | ||
</div> | ||
</div> | ||
{%endblock%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{%extends "base.html"%} | ||
{%load plotly_dash%} | ||
|
||
{%block title%}Demo One - Simple Embedding{%endblock%} | ||
|
||
{%block content%} | ||
<h1>Simple App Embedding</h1> | ||
<p> | ||
This is a simple example of use of a dash application within a Django template. Use of | ||
the plotly_app template tag with the name of a dash application represents the simplest use of | ||
the django_plotly_dash framework. | ||
</p> | ||
<div class="card bg-light border-dark"> | ||
<div class="card-body"> | ||
<p><span>{</span>% load plotly_dash %}</p> | ||
<p><span>{</span>% plotly_app name="SimpleExample" %}</p> | ||
</div> | ||
</div> | ||
<p></p> | ||
<div class="card border-dark"> | ||
<div class="card-body"> | ||
{%plotly_app name="SimpleExample"%} | ||
</div> | ||
</div> | ||
{%endblock%} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{%extends "base.html"%} | ||
{%load plotly_dash%} | ||
|
||
{%block title%}Demo Three - Additional Callback Functionality{%endblock%} | ||
|
||
{%block content%} | ||
<h1>Enhanced Callback Functionality</h1> | ||
<p> | ||
If any callback is registered as an enhanced one, then all of the callbacks receive extra values | ||
as kwargs. These include the Dash application instance, a per-session dictionary that can contain anything | ||
suitable for inclusion in a standard Django session, and the Django User instance. | ||
The session state is per user session at the Django level, so it is shared across all of the Dash applications. | ||
</p> | ||
<p> | ||
Changes made to any values contained within the initial state can also be persisted when using enhanced callbacks. This is a | ||
per-app-instance flag and, when set, the response of every callback is checked and persisted if it has changed. The second | ||
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 | ||
then reloads this one. These changes can also be observed in the update timestamp or initial content json content of | ||
the <a href="{%url "admin:django_plotly_dash_dashapp_changelist" %}">model</a>. | ||
</p> | ||
<div class="card bg-light border-dark"> | ||
<div class="card-body"> | ||
<p><span>{</span>% load plotly_dash %}</p> | ||
<p><span>{</span>% plotly_app name="Ex2" ratio=0.15 %}</p> | ||
<p><span>{</span>% plotly_app slug="ex2-3" ratio=0.15 %}</p> | ||
</div> | ||
</div> | ||
<p> | ||
</p> | ||
<div class="card border-dark"> | ||
<div class="card-body"> | ||
{%plotly_app name="Ex2" ratio=0.15 %} | ||
</div> | ||
</div> | ||
<p> | ||
</p> | ||
<div class="card border-dark"> | ||
<div class="card-body"> | ||
{%plotly_app slug="ex2-3" ratio=0.15 %} | ||
</div> | ||
</div> | ||
{%endblock%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{%extends "base.html"%} | ||
{%load plotly_dash%} | ||
|
||
{%block title%}Demo Two - Initial State{%endblock%} | ||
|
||
{%block content%} | ||
<h1>Initial State</h1> | ||
<p> | ||
Referring to an instance of a dash application, uniquely identified by a slug, will use the persisted | ||
representation of that app along with its initial state. | ||
</p> | ||
<p> | ||
Each time this page is reloaded, the application will revert to its stored intial state. This initial | ||
state is persisted in a standard | ||
Django <a href="{%url "admin:django_plotly_dash_dashapp_changelist" %}">model</a>. | ||
</p> | ||
<div class="card bg-light border-dark"> | ||
<div class="card-body"> | ||
<p><span>{</span>% load plotly_dash %}</p> | ||
<p><span>{</span>% plotly_app slug="simpleexample-1" ratio=0.2 %}</p> | ||
</div> | ||
</div> | ||
<p> | ||
</p> | ||
<div class="card border-dark"> | ||
<div class="card-body"> | ||
{%plotly_app slug="simpleexample-1" ratio=0.2 %} | ||
</div> | ||
</div> | ||
{%endblock%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,15 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
{%load plotly_dash%} | ||
<title>Simple stuff</title> | ||
</head> | ||
<body> | ||
<div> | ||
<p>Navigational links : | ||
<a href="{%url "home"%}">Main Page</a> | ||
<a href="{%url "second"%}">Second Page</a> | ||
</p> | ||
</div> | ||
<div> | ||
Content here | ||
{%plotly_app slug="simpleexample-1" ratio=0.2 %} | ||
</div> | ||
<div> | ||
Content here | ||
{%plotly_app name="SimpleExample"%} | ||
</div> | ||
<div> | ||
Content here | ||
{%plotly_app name="Ex2"%} | ||
</div> | ||
<div> | ||
WS Content here | ||
{%plotly_app name="Connected"%} | ||
</div> | ||
<div> | ||
WS Content here | ||
{%plotly_app slug="connected-2"%} | ||
</div> | ||
</body> | ||
{%plotly_message_pipe%} | ||
</html> | ||
{%extends "base.html"%} | ||
{%block title%} Index{%endblock%} | ||
{%block content%} | ||
<h1>Demonstration Application</h1> | ||
<div> | ||
This is the django_plotly_dash demo application. It contains a number of separate pages that | ||
exhibit different features of the integration of Plotly Dash into the Django framework. | ||
</div> | ||
<ul class="btnspace"> | ||
<li><a class="btn btn-primary btnspace" href="{%url "demo-one"%}">Demo One</a> - direct insertion of one or more Dash applications into a Django template</li> | ||
<li><a class="btn btn-primary btnspace" href="{%url "demo-two"%}">Demo Two</a> - storage of application initial state within Django</li> | ||
<li><a class="btn btn-primary btnspace" href="{%url "demo-three"%}">Demo Three</a> - adding Django features with enhanced callbacks</li> | ||
<li><a class="btn btn-primary btnspace" href="{%url "demo-four"%}">Demo Four</a> - live updating of apps by pushing from the Django server</li> | ||
</ul> | ||
{%endblock%} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.