Skip to content

Add dash example #1305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions _includes/documentation_eg.html
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,11 @@ <h4 class="example-section-title" id="layout-options">
</div>
{% endif %}

{% if page.dash_url !=blank %}
<h1>Dash Example</h1>
<iframe width="100%" height="900px" src="{{ page.dash_url}}" frameborder="0" allowfullscreen=""></iframe>
{% endif %}

{% if page.language == "python" or page.language == "r" or page.language == "plotly_js" %}
<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>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions _posts/python/3d/2017-02-24-python-3d-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
has_thumbnail: true
thumbnail: thumbnail/mixed.jpg
page_type: example_index
dash_url: https://dash-simple-apps.plotly.host/dash-3dplot/frameBorder=0
order: 20
---

Expand Down
1 change: 1 addition & 0 deletions _posts/python/basic/2017-02-24-python-basic-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
has_thumbnail: true
thumbnail: thumbnail/mixed.jpg
page_type: example_index
dash_url: https://dash-simple-apps.plotly.host/dash-basicplot/frameBorder=0
order: 8
---

Expand Down
216 changes: 127 additions & 89 deletions _posts/python/basic/line-plots/2015-06-30-lines.html

Large diffs are not rendered by default.

81 changes: 52 additions & 29 deletions _posts/python/basic/line-plots/lines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,52 @@
"py.iplot(fig, filename= 'shaded_lines')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Dash Example"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650px\"\n",
" src=\"https://dash-simple-apps.plotly.host/dash-lineplot/?frameBorder=0\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x1091fcb00>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.display import IFrame\n",
"IFrame(src= \"https://dash-simple-apps.plotly.host/dash-lineplot/\", width=\"100%\", height=\"650px\", frameBorder=\"0\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Find the dash app source code [here](https://github.com/plotly/simple-example-chart-apps/tree/master/line)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -703,7 +749,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -729,20 +775,6 @@
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Python27\\lib\\site-packages\\IPython\\nbconvert.py:13: ShimWarning:\n",
"\n",
"The `IPython.nbconvert` package has been deprecated since IPython 4.0. You should import from nbconvert instead.\n",
"\n",
"C:\\Python27\\lib\\site-packages\\publisher\\publisher.py:53: UserWarning:\n",
"\n",
"Did you \"Save\" this notebook before running this command? Remember to save, always save.\n",
"\n"
]
}
],
"source": [
Expand All @@ -763,35 +795,26 @@
" page_type='example_index', has_thumbnail='true', display_as='basic', order=3.3,\n",
" ipynb= '~notebook_demo/3')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.14"
"pygments_lexer": "ipython3",
"version": "3.7.2"
}
},
"nbformat": 4,
Expand Down
69 changes: 61 additions & 8 deletions _posts/python/layout/labels/2015-06-30-labels.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
---
{% raw %}
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<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>.
<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>.
Expand All @@ -27,8 +26,7 @@ <h4 id="New-to-Plotly?">New to Plotly?<a class="anchor-link" href="#New-to-Plotl
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<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>

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

</div>
</div>
</div>
</div>

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

<div class="output_area">

<div class="prompt output_prompt">Out[1]:</div>
<div class="prompt output_prompt">Out[1]:</div>



Expand Down Expand Up @@ -119,7 +117,7 @@ <h4 id="Version-Check">Version Check<a class="anchor-link" href="#Version-Check"
<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>
</pre></div>

</div>
</div>
</div>
</div>

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

<div class="output_area">

<div class="prompt output_prompt">Out[2]:</div>
<div class="prompt output_prompt">Out[2]:</div>



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

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h4 id="Dash-Example">Dash Example<a class="anchor-link" href="#Dash-Example">&#182;</a></h4>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[1]:</div>
<div class="inner_cell">
<div class="input_area">
<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>
<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>
</pre></div>

</div>
</div>
</div>

<div class="output_wrapper">
<div class="output">


<div class="output_area">

<div class="prompt output_prompt">Out[1]:</div>



<div class="output_html rendered_html output_subarea output_execute_result">

<iframe
width="100%"
height="650px"
src="https://dash-simple-apps.plotly.host/dash-figurelabelsplot/?frameBorder=0"
frameborder="0"
allowfullscreen
></iframe>

</div>

</div>

</div>
</div>

</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Find the dash app source code <a href="https://github.com/plotly/simple-example-chart-apps/tree/master/figurelabels">here</a></p>

</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<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>

Expand Down
67 changes: 52 additions & 15 deletions _posts/python/layout/labels/labels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,52 @@
"py.iplot(fig, filename='styling-names')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Dash Example"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650px\"\n",
" src=\"https://dash-simple-apps.plotly.host/dash-figurelabelsplot/?frameBorder=0\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x10d9fec50>"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.display import IFrame\n",
"IFrame(src= \"https://dash-simple-apps.plotly.host/dash-figurelabelsplot/\", width=\"100%\", height=\"650px\", frameBorder=\"0\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Find the dash app source code [here](https://github.com/plotly/simple-example-chart-apps/tree/master/figurelabels)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -114,7 +160,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -146,18 +192,16 @@
"output_type": "stream",
"text": [
"Collecting git+https://github.com/plotly/publisher.git\n",
" Cloning https://github.com/plotly/publisher.git to /tmp/pip-req-build-g_hb8ys1\n",
" Cloning https://github.com/plotly/publisher.git to /private/var/folders/s5/vjqn03zs7nn8zs_fwzcf14r40000gn/T/pip-req-build-6uxltodf\n",
"Building wheels for collected packages: publisher\n",
" Running setup.py bdist_wheel for publisher ... \u001b[?25ldone\n",
"\u001b[?25h Stored in directory: /tmp/pip-ephem-wheel-cache-clgwp6cl/wheels/99/3e/a0/fbd22ba24cca72bdbaba53dbc23c1768755fb17b3af0f33966\n",
" Building wheel for publisher (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Stored in directory: /private/var/folders/s5/vjqn03zs7nn8zs_fwzcf14r40000gn/T/pip-ephem-wheel-cache-k18ub0dj/wheels/99/3e/a0/fbd22ba24cca72bdbaba53dbc23c1768755fb17b3af0f33966\n",
"Successfully built publisher\n",
"Installing collected packages: publisher\n",
" Found existing installation: publisher 0.13\n",
" Uninstalling publisher-0.13:\n",
" Successfully uninstalled publisher-0.13\n",
"Successfully installed publisher-0.13\n",
"\u001b[33mYou are using pip version 10.0.1, however version 19.0.3 is available.\n",
"You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n"
"Successfully installed publisher-0.13\n"
]
}
],
Expand All @@ -178,13 +222,6 @@
" page_type='example_index', has_thumbnail='false', display_as='layout_opt', order=0.5, \n",
" ipynb='~notebook_demo/271')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -203,7 +240,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.7.2"
}
},
"nbformat": 4,
Expand Down
1 change: 1 addition & 0 deletions _posts/python/maps/2017-02-24-python-maps-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
has_thumbnail: true
thumbnail: thumbnail/mixed.jpg
page_type: example_index
dash_url: https://dash-simple-apps.plotly.host/dash-mapplot/frameBorder=0
order: 20
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
has_thumbnail: true
thumbnail: thumbnail/mixed.jpg
page_type: example_index
dash_url: https://dash-simple-apps.plotly.host/dash-statisticalplot/frameBorder=0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this app isn't unauthenticated so users will see the login screen

order: 20
---

Expand Down
Loading