Skip to content
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

TST: testing plotly #381

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
shell: bash -l {0}
run: |
rm -r _build/.doctrees
jb build lectures --path-output ./ -nW --keep-going
jb build lectures --path-output ./
- name: Upload Execution Reports (HTML)
uses: actions/upload-artifact@v2
if: failure()
Expand Down
39 changes: 39 additions & 0 deletions lectures/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,52 @@ latex:
sphinx:
extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_exercise, sphinx_togglebutton, sphinx.ext.intersphinx, sphinx_proof, sphinx_tojupyter]
config:
suppress_warnings: ["mystnb.unknown_mime_type"]
nb_mime_priority_overrides: [
# HTML
['html', 'application/vnd.plotly.v1+json', 9],
['html', 'application/vnd.jupyter.widget-view+json', 10],
['html', 'application/javascript', 20],
['html', 'text/html', 30],
['html', 'text/latex', 40],
['html', 'image/svg+xml', 50],
['html', 'image/png', 60],
['html', 'image/jpeg', 70],
['html', 'text/markdown', 80],
['html', 'text/plain', 90],
# Jupyter Notebooks
['jupyter', 'application/vnd.plotly.v1+json', 9],
['jupyter', 'application/vnd.jupyter.widget-view+json', 10],
['jupyter', 'application/javascript', 20],
['jupyter', 'text/html', 30],
['jupyter', 'text/latex', 40],
['jupyter', 'image/svg+xml', 50],
['jupyter', 'image/png', 60],
['jupyter', 'image/jpeg', 70],
['jupyter', 'text/markdown', 80],
['jupyter', 'text/plain', 90],
# LaTeX
['latex', 'text/latex', 10],
['latex', 'application/pdf', 20],
['latex', 'image/png', 30],
['latex', 'image/jpeg', 40],
['latex', 'text/markdown', 50],
['latex', 'text/plain', 60],
['latex', 'text/html', 70],
['latex', 'application/vnd.plotly.v1+json', 80],
['latex', 'application/vnd.jupyter.widget-view+json', 90],
# Link Checker
['linkcheck', 'text/plain', 10],
]
# false-positive links
linkcheck_ignore: ['https://doi.org/https://doi.org/10.2307/1235116']
# myst-nb config
nb_render_image_options:
width: 80%
nb_code_prompt_show: "Show {type}"
# -------------
html_js_files:
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
html_favicon: _static/lectures-favicon.ico
html_theme: quantecon_book_theme
html_static_path: ['_static']
Expand Down
1 change: 1 addition & 0 deletions lectures/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ parts:
numbered: true
chapters:
- file: about
- file: plotly
- caption: Economic Data
numbered: true
chapters:
Expand Down
31 changes: 31 additions & 0 deletions lectures/plotly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.15.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

# Plotly Example

```{code-cell} ipython3
!pip install plotly
```

An example plot

(plotlyfig)=
```{code-cell} ipython3
import plotly.express as px
fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
fig.show()
```

```{only} latex
This figure is interactive you may [click here to see this figure on the website](https://intro.quantecon.org/plotly.html#plotlyfig)
```
Loading