Skip to content

Commit 2af808b

Browse files
Merge pull request #1305 from plotly/add_simple_apps
Add dash example
2 parents 8751a13 + 92ceec9 commit 2af808b

File tree

11 files changed

+423
-172
lines changed

11 files changed

+423
-172
lines changed

_includes/documentation_eg.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,11 @@ <h4 class="example-section-title" id="layout-options">
627627
</div>
628628
{% endif %}
629629

630+
{% if page.dash_url !=blank %}
631+
<h1>Dash Example</h1>
632+
<iframe width="100%" height="900px" src="{{ page.dash_url}}" frameborder="0" allowfullscreen=""></iframe>
633+
{% endif %}
634+
630635
{% if page.language == "python" or page.language == "r" or page.language == "plotly_js" %}
631636
<a href="https://plot.ly/products/dash/"><img src="https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/1140px-Dash-ad.png"></a>
632637
{% endif %}

_posts/python/3d/2017-02-24-python-3d-index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
has_thumbnail: true
1010
thumbnail: thumbnail/mixed.jpg
1111
page_type: example_index
12+
dash_url: https://dash-simple-apps.plotly.host/dash-3dplot/frameBorder=0
1213
order: 20
1314
---
1415

_posts/python/basic/2017-02-24-python-basic-index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
has_thumbnail: true
1010
thumbnail: thumbnail/mixed.jpg
1111
page_type: example_index
12+
dash_url: https://dash-simple-apps.plotly.host/dash-basicplot/frameBorder=0
1213
order: 8
1314
---
1415

_posts/python/basic/line-plots/2015-06-30-lines.html

Lines changed: 127 additions & 89 deletions
Large diffs are not rendered by default.

_posts/python/basic/line-plots/lines.ipynb

Lines changed: 52 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,52 @@
693693
"py.iplot(fig, filename= 'shaded_lines')"
694694
]
695695
},
696+
{
697+
"cell_type": "markdown",
698+
"metadata": {},
699+
"source": [
700+
"### Dash Example"
701+
]
702+
},
703+
{
704+
"cell_type": "code",
705+
"execution_count": 6,
706+
"metadata": {},
707+
"outputs": [
708+
{
709+
"data": {
710+
"text/html": [
711+
"\n",
712+
" <iframe\n",
713+
" width=\"100%\"\n",
714+
" height=\"650px\"\n",
715+
" src=\"https://dash-simple-apps.plotly.host/dash-lineplot/?frameBorder=0\"\n",
716+
" frameborder=\"0\"\n",
717+
" allowfullscreen\n",
718+
" ></iframe>\n",
719+
" "
720+
],
721+
"text/plain": [
722+
"<IPython.lib.display.IFrame at 0x1091fcb00>"
723+
]
724+
},
725+
"execution_count": 6,
726+
"metadata": {},
727+
"output_type": "execute_result"
728+
}
729+
],
730+
"source": [
731+
"from IPython.display import IFrame\n",
732+
"IFrame(src= \"https://dash-simple-apps.plotly.host/dash-lineplot/\", width=\"100%\", height=\"650px\", frameBorder=\"0\")\n"
733+
]
734+
},
735+
{
736+
"cell_type": "markdown",
737+
"metadata": {},
738+
"source": [
739+
"Find the dash app source code [here](https://github.com/plotly/simple-example-chart-apps/tree/master/line)"
740+
]
741+
},
696742
{
697743
"cell_type": "markdown",
698744
"metadata": {},
@@ -703,7 +749,7 @@
703749
},
704750
{
705751
"cell_type": "code",
706-
"execution_count": 14,
752+
"execution_count": 7,
707753
"metadata": {},
708754
"outputs": [
709755
{
@@ -729,20 +775,6 @@
729775
},
730776
"metadata": {},
731777
"output_type": "display_data"
732-
},
733-
{
734-
"name": "stderr",
735-
"output_type": "stream",
736-
"text": [
737-
"C:\\Python27\\lib\\site-packages\\IPython\\nbconvert.py:13: ShimWarning:\n",
738-
"\n",
739-
"The `IPython.nbconvert` package has been deprecated since IPython 4.0. You should import from nbconvert instead.\n",
740-
"\n",
741-
"C:\\Python27\\lib\\site-packages\\publisher\\publisher.py:53: UserWarning:\n",
742-
"\n",
743-
"Did you \"Save\" this notebook before running this command? Remember to save, always save.\n",
744-
"\n"
745-
]
746778
}
747779
],
748780
"source": [
@@ -763,35 +795,26 @@
763795
" page_type='example_index', has_thumbnail='true', display_as='basic', order=3.3,\n",
764796
" ipynb= '~notebook_demo/3')"
765797
]
766-
},
767-
{
768-
"cell_type": "code",
769-
"execution_count": null,
770-
"metadata": {
771-
"collapsed": true
772-
},
773-
"outputs": [],
774-
"source": []
775798
}
776799
],
777800
"metadata": {
778801
"anaconda-cloud": {},
779802
"kernelspec": {
780-
"display_name": "Python 2",
803+
"display_name": "Python 3",
781804
"language": "python",
782-
"name": "python2"
805+
"name": "python3"
783806
},
784807
"language_info": {
785808
"codemirror_mode": {
786809
"name": "ipython",
787-
"version": 2
810+
"version": 3
788811
},
789812
"file_extension": ".py",
790813
"mimetype": "text/x-python",
791814
"name": "python",
792815
"nbconvert_exporter": "python",
793-
"pygments_lexer": "ipython2",
794-
"version": "2.7.14"
816+
"pygments_lexer": "ipython3",
817+
"version": "3.7.2"
795818
}
796819
},
797820
"nbformat": 4,

_posts/python/layout/labels/2015-06-30-labels.html

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
---
1717
{% raw %}
1818
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
19-
</div>
20-
<div class="inner_cell">
19+
</div><div class="inner_cell">
2120
<div class="text_cell_render border-box-sizing rendered_html">
2221
<h4 id="New-to-Plotly?">New to Plotly?<a class="anchor-link" href="#New-to-Plotly?">&#182;</a></h4><p>Plotly's Python library is free and open source! <a href="https://plot.ly/python/getting-started/">Get started</a> by downloading the client and <a href="https://plot.ly/python/getting-started/">reading the primer</a>.
2322
<br>You can set up Plotly to work in <a href="https://plot.ly/python/getting-started/#initialization-for-online-plotting">online</a> or <a href="https://plot.ly/python/getting-started/#initialization-for-offline-plotting">offline</a> mode, or in <a href="https://plot.ly/python/getting-started/#start-plotting-online">jupyter notebooks</a>.
@@ -27,8 +26,7 @@ <h4 id="New-to-Plotly?">New to Plotly?<a class="anchor-link" href="#New-to-Plotl
2726
</div>
2827
</div>
2928
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
30-
</div>
31-
<div class="inner_cell">
29+
</div><div class="inner_cell">
3230
<div class="text_cell_render border-box-sizing rendered_html">
3331
<h4 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check">&#182;</a></h4><p>Plotly's Python API is updated frequently. Run pip install plotly --upgrade to update your Plotly version.</p>
3432

@@ -44,7 +42,7 @@ <h4 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check"
4442
<span class="n">plotly</span><span class="o">.</span><span class="n">__version__</span>
4543
</pre></div>
4644

47-
</div>
45+
</div>
4846
</div>
4947
</div>
5048

@@ -54,7 +52,7 @@ <h4 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check"
5452

5553
<div class="output_area">
5654

57-
<div class="prompt output_prompt">Out[1]:</div>
55+
<div class="prompt output_prompt">Out[1]:</div>
5856

5957

6058

@@ -119,7 +117,7 @@ <h4 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check"
119117
<span class="n">py</span><span class="o">.</span><span class="n">iplot</span><span class="p">(</span><span class="n">fig</span><span class="p">,</span> <span class="n">filename</span><span class="o">=</span><span class="s1">&#39;styling-names&#39;</span><span class="p">)</span>
120118
</pre></div>
121119

122-
</div>
120+
</div>
123121
</div>
124122
</div>
125123

@@ -129,7 +127,7 @@ <h4 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check"
129127

130128
<div class="output_area">
131129

132-
<div class="prompt output_prompt">Out[2]:</div>
130+
<div class="prompt output_prompt">Out[2]:</div>
133131

134132

135133

@@ -144,8 +142,63 @@ <h4 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check"
144142

145143
</div>
146144
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
145+
</div><div class="inner_cell">
146+
<div class="text_cell_render border-box-sizing rendered_html">
147+
<h4 id="Dash-Example">Dash Example<a class="anchor-link" href="#Dash-Example">&#182;</a></h4>
148+
</div>
149+
</div>
147150
</div>
151+
<div class="cell border-box-sizing code_cell rendered">
152+
<div class="input">
153+
<div class="prompt input_prompt">In&nbsp;[1]:</div>
148154
<div class="inner_cell">
155+
<div class="input_area">
156+
<div class=" highlight hl-ipython3"><pre><span></span><span class="kn">from</span> <span class="nn">IPython.display</span> <span class="k">import</span> <span class="n">IFrame</span>
157+
<span class="n">IFrame</span><span class="p">(</span><span class="n">src</span><span class="o">=</span> <span class="s2">&quot;https://dash-simple-apps.plotly.host/dash-figurelabelsplot/&quot;</span><span class="p">,</span> <span class="n">width</span><span class="o">=</span><span class="s2">&quot;100%&quot;</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="s2">&quot;650px&quot;</span><span class="p">,</span> <span class="n">frameBorder</span><span class="o">=</span><span class="s2">&quot;0&quot;</span><span class="p">)</span>
158+
</pre></div>
159+
160+
</div>
161+
</div>
162+
</div>
163+
164+
<div class="output_wrapper">
165+
<div class="output">
166+
167+
168+
<div class="output_area">
169+
170+
<div class="prompt output_prompt">Out[1]:</div>
171+
172+
173+
174+
<div class="output_html rendered_html output_subarea output_execute_result">
175+
176+
<iframe
177+
width="100%"
178+
height="650px"
179+
src="https://dash-simple-apps.plotly.host/dash-figurelabelsplot/?frameBorder=0"
180+
frameborder="0"
181+
allowfullscreen
182+
></iframe>
183+
184+
</div>
185+
186+
</div>
187+
188+
</div>
189+
</div>
190+
191+
</div>
192+
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
193+
</div><div class="inner_cell">
194+
<div class="text_cell_render border-box-sizing rendered_html">
195+
<p>Find the dash app source code <a href="https://github.com/plotly/simple-example-chart-apps/tree/master/figurelabels">here</a></p>
196+
197+
</div>
198+
</div>
199+
</div>
200+
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
201+
</div><div class="inner_cell">
149202
<div class="text_cell_render border-box-sizing rendered_html">
150203
<h4 id="Reference">Reference<a class="anchor-link" href="#Reference">&#182;</a></h4><p>See <a href="https://plot.ly/python/reference/#layout">https://plot.ly/python/reference/#layout</a> for more information!</p>
151204

_posts/python/layout/labels/labels.ipynb

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,52 @@
104104
"py.iplot(fig, filename='styling-names')"
105105
]
106106
},
107+
{
108+
"cell_type": "markdown",
109+
"metadata": {},
110+
"source": [
111+
"#### Dash Example"
112+
]
113+
},
114+
{
115+
"cell_type": "code",
116+
"execution_count": 1,
117+
"metadata": {},
118+
"outputs": [
119+
{
120+
"data": {
121+
"text/html": [
122+
"\n",
123+
" <iframe\n",
124+
" width=\"100%\"\n",
125+
" height=\"650px\"\n",
126+
" src=\"https://dash-simple-apps.plotly.host/dash-figurelabelsplot/?frameBorder=0\"\n",
127+
" frameborder=\"0\"\n",
128+
" allowfullscreen\n",
129+
" ></iframe>\n",
130+
" "
131+
],
132+
"text/plain": [
133+
"<IPython.lib.display.IFrame at 0x10d9fec50>"
134+
]
135+
},
136+
"execution_count": 1,
137+
"metadata": {},
138+
"output_type": "execute_result"
139+
}
140+
],
141+
"source": [
142+
"from IPython.display import IFrame\n",
143+
"IFrame(src= \"https://dash-simple-apps.plotly.host/dash-figurelabelsplot/\", width=\"100%\", height=\"650px\", frameBorder=\"0\")\n"
144+
]
145+
},
146+
{
147+
"cell_type": "markdown",
148+
"metadata": {},
149+
"source": [
150+
"Find the dash app source code [here](https://github.com/plotly/simple-example-chart-apps/tree/master/figurelabels)"
151+
]
152+
},
107153
{
108154
"cell_type": "markdown",
109155
"metadata": {},
@@ -114,7 +160,7 @@
114160
},
115161
{
116162
"cell_type": "code",
117-
"execution_count": 4,
163+
"execution_count": 3,
118164
"metadata": {},
119165
"outputs": [
120166
{
@@ -146,18 +192,16 @@
146192
"output_type": "stream",
147193
"text": [
148194
"Collecting git+https://github.com/plotly/publisher.git\n",
149-
" Cloning https://github.com/plotly/publisher.git to /tmp/pip-req-build-g_hb8ys1\n",
195+
" Cloning https://github.com/plotly/publisher.git to /private/var/folders/s5/vjqn03zs7nn8zs_fwzcf14r40000gn/T/pip-req-build-6uxltodf\n",
150196
"Building wheels for collected packages: publisher\n",
151-
" Running setup.py bdist_wheel for publisher ... \u001b[?25ldone\n",
152-
"\u001b[?25h Stored in directory: /tmp/pip-ephem-wheel-cache-clgwp6cl/wheels/99/3e/a0/fbd22ba24cca72bdbaba53dbc23c1768755fb17b3af0f33966\n",
197+
" Building wheel for publisher (setup.py) ... \u001b[?25ldone\n",
198+
"\u001b[?25h Stored in directory: /private/var/folders/s5/vjqn03zs7nn8zs_fwzcf14r40000gn/T/pip-ephem-wheel-cache-k18ub0dj/wheels/99/3e/a0/fbd22ba24cca72bdbaba53dbc23c1768755fb17b3af0f33966\n",
153199
"Successfully built publisher\n",
154200
"Installing collected packages: publisher\n",
155201
" Found existing installation: publisher 0.13\n",
156202
" Uninstalling publisher-0.13:\n",
157203
" Successfully uninstalled publisher-0.13\n",
158-
"Successfully installed publisher-0.13\n",
159-
"\u001b[33mYou are using pip version 10.0.1, however version 19.0.3 is available.\n",
160-
"You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n"
204+
"Successfully installed publisher-0.13\n"
161205
]
162206
}
163207
],
@@ -178,13 +222,6 @@
178222
" page_type='example_index', has_thumbnail='false', display_as='layout_opt', order=0.5, \n",
179223
" ipynb='~notebook_demo/271')"
180224
]
181-
},
182-
{
183-
"cell_type": "code",
184-
"execution_count": null,
185-
"metadata": {},
186-
"outputs": [],
187-
"source": []
188225
}
189226
],
190227
"metadata": {
@@ -203,7 +240,7 @@
203240
"name": "python",
204241
"nbconvert_exporter": "python",
205242
"pygments_lexer": "ipython3",
206-
"version": "3.6.5"
243+
"version": "3.7.2"
207244
}
208245
},
209246
"nbformat": 4,

_posts/python/maps/2017-02-24-python-maps-index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
has_thumbnail: true
1010
thumbnail: thumbnail/mixed.jpg
1111
page_type: example_index
12+
dash_url: https://dash-simple-apps.plotly.host/dash-mapplot/frameBorder=0
1213
order: 20
1314
---
1415

_posts/python/statistical/2017-02-24-python-statistic-index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
has_thumbnail: true
1010
thumbnail: thumbnail/mixed.jpg
1111
page_type: example_index
12+
dash_url: https://dash-simple-apps.plotly.host/dash-statisticalplot/frameBorder=0
1213
order: 20
1314
---
1415

0 commit comments

Comments
 (0)