Commit 3356ad10 authored by ea42gh's avatar ea42gh
Browse files

load a file from geogebra.org

parent f37ccaaf
%% Cell type:code id: tags:
``` python
%%HTML
<script type="text/javascript" src="https://cdn.geogebra.org/apps/deployggb.js"></script>
```
%% Output
%% Cell type:code id: tags:
``` python
from IPython.display import Javascript,HTML
import panel as pn
pn.extension()
```
%% Output
%% Cell type:markdown id: tags:
See: https://github.com/geogebra/math-apps-examples
* https://www.geogebra.org/m/GAwMxpJX
* https://www.geogebra.org/m/XTaau2F5
%% Cell type:code id: tags:
``` python
pn.Column(
pn.pane.HTML("""<div style="float:center;width:900;text-align:center;">
<strong style="height:100px;color:darkred;font-size:40px;">GeoGebra Applet</strong>
</div>""", width=950),
pn.pane.HTML('''<div id="applet_container" style="border:2px solid black;"></div>''', width=950, height=650, margin=25)
)
```
%% Output
Column
[0] HTML(str, width=950)
[1] HTML(str, height=650, margin=25, sizing_mode='fixed', width=950)
%% Cell type:markdown id: tags:
You might open
* https://www.geogebra.org/m/GAwMxpJX
There is a Javascript API to figure out...
%% Cell type:code id: tags:
``` python
Javascript('''
var tutorials = {
'AG':['Graphing', 'https://www.geogebra.org/tutorial/graphing'],
'2': ['Geometry', 'https://www.geogebra.org/tutorial/geometry'],
'3': ['Spreadsheet','https://www.geogebra.org/tutorial/spreadsheet'],
'4': ['CAS', 'https://www.geogebra.org/tutorial/cas'],
'5': ['3D Geometry','https://www.geogebra.org/tutorial/3d'],
'6': ['Statistics', 'https://www.geogebra.org/tutorial/statistics']
};
function updateHelp(p){
document.getElementById('tutorial-link').href = tutorials[p][1];
document.getElementById('tutorial-link').innerText = tutorials[p][0]+" Tutorial";
}
function perspective(p){
console.log("HERE 3");
updateHelp(p);
console.log("HERE 4");
ggbApplet.setPerspective(p);
console.log("HERE 5");
}
var parameters = {
"id": "ggbApplet",
"material_id": "XTaau2F5",
"width": 800,
"height": 600,
"showToolBar": true,
"borderColor": null,
"showMenuBar": true,
"allowStyleBar": true,
"showAlgebraInput": true,
"enableLabelDrags": false,
"enableShiftDragZoom": true,
"capturingThreshold": null,
"showToolBarHelp": false,
"errorDialogsActive": true,
"showTutorialLink": true,
"showLogging": true,
"useBrowserForJS": false,
"perspective": "AG"};
var applet = new GGBApplet(parameters, '5.0', 'applet_container');
// when used with Math Apps Bundle, uncomment this:
// applet.setHTML5Codebase('GeoGebra/HTML5/5.0/web3d/');
//window.onload = function() { applet.inject('applet_container'); updateHelp('AG');}
// =================================================== want to make these available elsewhere. There is likely a better way!
window.ggb = applet
applet.inject('applet_container'); updateHelp('AG');
''')
```
%% Output
<IPython.core.display.Javascript object>
%% Cell type:code id: tags:
``` python
```
%% Output
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment