forked from radovankavicky/dash-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamic_content.py
More file actions
43 lines (34 loc) · 1.06 KB
/
Copy pathdynamic_content.py
File metadata and controls
43 lines (34 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- coding: utf-8 -*-
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State, Event
from pandas_datareader import data as web
from datetime import datetime as dt
import plotly.graph_objs as go
import json
from server import app
import styles
import tools
examples = [
tools.load_example(s) for s in [
'tutorial/examples/dynamic_content.py'
]
]
layout = html.Div(children=[
dcc.Markdown('''
## Loading Content Dynamically
Dash callbacks can return any type of property.
By returning `children`, they can even dynamically
render their content.
This is an example that can be used in app development for
quicker feedback.
Instead of refreshing the page to view your layout,
just render the layout as a response to clicking on a button.
'''.replace(' ', '')),
dcc.SyntaxHighlighter(
examples[0][0],
language='python',
customStyle=styles.code_container
),
html.Div(examples[0][1], className="example-container")
])