Skip to content

Commit

Permalink
trade jupyter notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jhconning committed Feb 8, 2021
1 parent d10c645 commit 91e72ff
Show file tree
Hide file tree
Showing 14 changed files with 8,994 additions and 2 deletions.
18 changes: 16 additions & 2 deletions _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,26 @@
- file: notes/Labor
- file: notes/TradeModelsStructure

- part: Trade Notebooks
chapters:
- file: notebooks/Ricardian_Trade
- file: notebooks/SFM
- file: notebooks/Tariff_in_general_equilibrium
- file: notebooks/IRS_monopolistic

- part: Site Building Details
chapters:
- file: notes/how
- file: notes/jb_tricks
- file: notebooks/embed_geogebra


- part: Links and Resources
chapters:
- file: notes/twitter

- part: Site Building Details
chapters:
- file: notes/how
- file: notes/embed_geogebra
- file: notes/embed_geogebra
- file: notes/jb_tricks
- file: notebooks/embed_geogebra
496 changes: 496 additions & 0 deletions notebooks/CRSTechnology.ipynb

Large diffs are not rendered by default.

3,681 changes: 3,681 additions & 0 deletions notebooks/IRS_monopolistic.ipynb

Large diffs are not rendered by default.

994 changes: 994 additions & 0 deletions notebooks/Ricardian_Trade.ipynb

Large diffs are not rendered by default.

1,096 changes: 1,096 additions & 0 deletions notebooks/SFM.ipynb

Large diffs are not rendered by default.

770 changes: 770 additions & 0 deletions notebooks/Tariff_in_general_equilibrium.ipynb

Large diffs are not rendered by default.

287 changes: 287 additions & 0 deletions notebooks/embed_geogebra.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# How to Embed Geogebra"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import IPython.display as display"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<iframe width=\"800\" height=\"600\" src=\"https://www.geogebra.org/classic/mcfuhcne\" style=\"border: 1px solid black\"></iframe>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fig01 = \"\"\"\n",
"<iframe width=\"800\" height=\"600\" src=\"https://www.geogebra.org/classic/mcfuhcne\" style=\"border: 1px solid black\"></iframe>\n",
"\"\"\"\n",
"display.HTML(fig01)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"800\"\n",
" height=\"600\"\n",
" src=\"https://www.geogebra.org/classic/mcfuhcne?style=border%3A+1px+solid+black\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x168af69c108>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.display import IFrame\n",
"IFrame('https://www.geogebra.org/classic/mcfuhcne', width=800, height=600, style=\"border: 1px solid black\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Easiest solution seems to be to IFrame the simple geogebra link and resize with the width and height. \n",
"Drawbacks and questions: \n",
" - might make the object quite large.\n",
" - how turn off the command palette?\n",
" \n",
" The other solution is to get the long embed from geogebra"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"600\"\n",
" height=\"700\"\n",
" src=\"https://www.geogebra.org/classic/fe2qwgef\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x168af72d088>"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"IFrame(\"https://www.geogebra.org/classic/fe2qwgef\", width=600, height=700)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"800\"\n",
" height=\"600\"\n",
" src=\"https://www.geogebra.org/material/iframe/id/23587/width/1600/height/715/border/888888/rc/false/ai/false/sdz/false/smb/false/stb/false/stbh/true/ld/false/sri/false\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x168af731e08>"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"IFrame(\"https://www.geogebra.org/material/iframe/id/23587/width/1600/height/715/border/888888/rc/false/ai/false/sdz/false/smb/false/stb/false/stbh/true/ld/false/sri/false\", width=800, height=600)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Geogebra documentation on [IFrame embedding](https://wiki.geogebra.org/en/Reference:Material_Embedding_(Iframe))\n"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<iframe scrolling=\"no\"\n",
"src=\"https://www.geogebra.org/material/iframe/id/23587/width/700/height/700/border/888888/rc/false/ai/true/sdz/false/smb/false/stb/false/stbh/true/ld/false/sri/false\"\n",
"width=\"400x\"\n",
"height=\"400px\"\n",
"style=\"border:0px;\" allowfullscreen>\n",
"</iframe>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%html\n",
"<iframe scrolling=\"no\"\n",
"src=\"https://www.geogebra.org/material/iframe/id/23587/width/700/height/700/border/888888/rc/false/ai/true/sdz/false/smb/false/stb/false/stbh/true/ld/false/sri/false\"\n",
"width=\"400x\"\n",
"height=\"400px\"\n",
"style=\"border:0px;\" allowfullscreen>\n",
"</iframe>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Below I reduce the embedded height in the URL to 415 down from 715"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<iframe scrolling=\"yes\"\n",
"src=\"http://www.geogebra.org/material/iframe/id/23587/width/1100/height/415/border/888888/rc/false/ai/false/sdz/false/smb/false/stb/false/stbh/true/ld/false/sri/false/at/preferhtml5\"\n",
"width=\"1600px\"\n",
"height=\"715px\"\n",
"style=\"border:0px;\">\n",
"</iframe>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%html\n",
"<iframe scrolling=\"yes\"\n",
"src=\"http://www.geogebra.org/material/iframe/id/23587/width/1100/height/415/border/888888/rc/false/ai/false/sdz/false/smb/false/stb/false/stbh/true/ld/false/sri/false/at/preferhtml5\"\n",
"width=\"1600px\"\n",
"height=\"715px\"\n",
"style=\"border:0px;\">\n",
"</iframe>"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<iframe scrolling=\"yes\"\n",
"src=\"https://www.geogebra.org/material/iframe/id/gpfbwb6n/\"\n",
"width=\"1200px\"\n",
"height=\"700px\"\n",
"style=\"border:0px;\">\n",
"</iframe>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%html\n",
"<iframe scrolling=\"yes\"\n",
"src=\"https://www.geogebra.org/material/iframe/id/gpfbwb6n/\"\n",
"width=\"1200px\"\n",
"height=\"700px\"\n",
"style=\"border:0px;\">\n",
"</iframe>\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit 91e72ff

Please sign in to comment.