{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### New to Plotly?\n",
"Plotly's Python library is free and open source! [Get started](https://plotly.com/python/getting-started/) by downloading the client and [reading the primer](https://plotly.com/python/getting-started/).\n",
"
You can set up Plotly to work in [online](https://plotly.com/python/getting-started/#initialization-for-online-plotting) or [offline](https://plotly.com/python/getting-started/#initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plotly.com/python/getting-started/#start-plotting-online).\n",
"
We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!\n",
"#### Version Check\n",
"Note: The presentations API is available in version 2.2.1.+
\n",
"Run `pip install plotly --upgrade` to update your Plotly version."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'2.4.1'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import plotly\n",
"plotly.__version__"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Plotly Presentations\n",
"To use Plotly's Presentations API you will write your presentation code in a string of markdown and then pass that through the Presentations API function `pres.Presentation()`. This creates a JSON version of your presentation. To upload the presentation online pass it through `py.presentation_ops.upload()`.\n",
"\n",
"In your string, use `---` on a single line to seperate two slides. To put a title in your slide, put a line that starts with any number of `#`s. Only your first title will be appear in your slide. A title looks like:\n",
"\n",
"`# slide title`\n",
"\n",
"Anything that comes after the title will be put as text in your slide. Check out the example below to see this in action."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Current Limitations\n",
"`Boldface`, _italics_ and [hypertext](https://www.w3.org/WhatIs.html) are not supported features of the Presentation API."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Display in Jupyter\n",
"The function below generates HTML code to display the presentation in an iframe directly in Jupyter."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def url_to_iframe(url, text=True):\n",
" html = ''\n",
" # style\n",
" html += '''
Click on the presentation above and use left/right arrow keys to flip through the slides.
\n", "Click on the presentation above and use left/right arrow keys to flip through the slides.
\n", "Click on the presentation above and use left/right arrow keys to flip through the slides.
\n", "Click on the presentation above and use left/right arrow keys to flip through the slides.
\n", "Click on the presentation above and use left/right arrow keys to flip through the slides.
\n", "Click on the presentation above and use left/right arrow keys to flip through the slides.
\n", "Click on the presentation above and use left/right arrow keys to flip through the slides.
\n", "Click on the presentation above and use left/right arrow keys to flip through the slides.
\n", "