Quelle JupyterViz Demo Notebook.ipynb
Sprache: unbekannt
|
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# JupyterViz Demo Notebook\n",
"\n",
"Execute the cells below to see the visualizations.\n",
"\n",
"Many more examples are available in the `manual.pdf` file in the `doc` folder."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"true"
]
},
"execution_count": 1,
"metadata": {
"text/plain": ""
},
"output_type": "execute_result"
}
],
"source": [
"LoadPackage( \"jupyterviz\" );"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"( function ( element ) {\n",
"if(!window.hasOwnProperty(\"runGAP\")){window.runGAP=function(code,callback){if(!Jupyter||!Jupyter.notebook||!Jupyter.notebook.kernel)return callback(null,\"JavaScript-based output must be re-evaluated when the notebook\"+\" is reloaded. (Re-run the cell to clear this problem.)\");var errorMessages=[];var timeout=null;Jupyter.notebook.kernel.execute(code,{iopub:{output:function(message){if(\"data\"in message.content)return callback(message.content.data,null);if(!(\"text\"in message.content))return callback(null,message.content);errorMessages.push(message.content.text);if(timeout!==null)clearTimeout(timeout);timeout=setTimeout(function(){callback(null,errorMessages.join(\"\\n\"))},200)},clear_output:function(message){}},shell:{reply:function(message){}},input:function(message){}},{})}}if(!window.hasOwnProperty(\"librariesLoadedFromGAP\")){window.librariesLoadedFromGAP={}}function myCallback(){if(!window.hasOwnProperty(\"librariesLoadedFromGAP\")){window.librariesLoadedFromGAP={}}function myCallback(){window.createVisualization(element,{\"data\" : {\"data\" : [{\"x\" : [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],\"y\" : [1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51,1,2,1,14,1,2,2,14,1,6,1,4,2,2,1,52,2,5],\"type\" : \"line\"}],\"layout\" : {\"height\" : 400}},\"tool\" : \"plotly\"}\n",
",function(element,visualization){\n",
"});\n",
"}if(window.librariesLoadedFromGAP.hasOwnProperty(\"viz-tool-plotly\"\n",
")){myCallback()}else{var filenameString=JSON.stringify(\"viz-tool-plotly\"\n",
");var GAPcode=\"JUPVIZFileContents( LoadJavaScriptFile( \"+filenameString+\" ) );\";window.runGAP(GAPcode,function(result,error){if(error)throw Error(\"When loading library \"+filenameString+\": \"+error);result=result[\"text/plain\"];window.librariesLoadedFromGAP[\"viz-tool-plotly\"\n",
"]=result;try{var whatItEvaluatesTo=eval(result)}catch(e){throw Error(\"Error evaluating code for library \"+filenameString+\": \"+e)}return myCallback()})}\n",
"}if(window.librariesLoadedFromGAP.hasOwnProperty(\"main\"\n",
")){myCallback()}else{var filenameString=JSON.stringify(\"main\"\n",
");var GAPcode=\"JUPVIZFileContents( LoadJavaScriptFile( \"+filenameString+\" ) );\";window.runGAP(GAPcode,function(result,error){if(error)throw Error(\"When loading library \"+filenameString+\": \"+error);result=result[\"text/plain\"];window.librariesLoadedFromGAP[\"main\"\n",
"]=result;try{var whatItEvaluatesTo=eval(result)}catch(e){throw Error(\"Error evaluating code for library \"+filenameString+\": \"+e)}return myCallback()})}\n",
";\n",
"} )( element.get( 0 ) )"
]
},
"execution_count": 2,
"metadata": {
"application/javascript": ""
},
"output_type": "execute_result"
}
],
"source": [
"Plot( [1..50], NrSmallGroups );"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"( function ( element ) {\n",
"if(!window.hasOwnProperty(\"runGAP\")){window.runGAP=function(code,callback){if(!Jupyter||!Jupyter.notebook||!Jupyter.notebook.kernel)return callback(null,\"JavaScript-based output must be re-evaluated when the notebook\"+\" is reloaded. (Re-run the cell to clear this problem.)\");var errorMessages=[];var timeout=null;Jupyter.notebook.kernel.execute(code,{iopub:{output:function(message){if(\"data\"in message.content)return callback(message.content.data,null);if(!(\"text\"in message.content))return callback(null,message.content);errorMessages.push(message.content.text);if(timeout!==null)clearTimeout(timeout);timeout=setTimeout(function(){callback(null,errorMessages.join(\"\\n\"))},200)},clear_output:function(message){}},shell:{reply:function(message){}},input:function(message){}},{})}}if(!window.hasOwnProperty(\"librariesLoadedFromGAP\")){window.librariesLoadedFromGAP={}}function myCallback(){if(!window.hasOwnProperty(\"librariesLoadedFromGAP\")){window.librariesLoadedFromGAP={}}function myCallback(){window.createVisualization(element,{\"data\" : {\"elements\" : [{\"data\" : {\"id\" : \"1\"}},{\"data\" : {\"id\" : \"2\"}},{\"data\" : {\"id\" : \"3\"}},{\"data\" : {\"id\" : \"4\"}},{\"data\" : {\"id\" : \"5\"}},{\"data\" : {\"id\" : \"6\"}},{\"data\" : {\"id\" : \"7\"}},{\"data\" : {\"id\" : \"8\"}},{\"data\" : {\"id\" : \"9\"}},{\"data\" : {\"id\" : \"10\"}},{\"data\" : {\"source\" : \"1\",\"target\" : \"2\"}},{\"data\" : {\"source\" : \"1\",\"target\" : \"4\"}},{\"data\" : {\"source\" : \"1\",\"target\" : \"7\"}},{\"data\" : {\"source\" : \"1\",\"target\" : \"9\"}},{\"data\" : {\"source\" : \"2\",\"target\" : \"2\"}},{\"data\" : {\"source\" : \"2\",\"target\" : \"3\"}},{\"data\" : {\"source\" : \"2\",\"target\" : \"5\"}},{\"data\" : {\"source\" : \"2\",\"target\" : \"10\"}},{\"data\" : {\"source\" : \"3\",\"target\" : \"1\"}},{\"data\" : {\"source\" : \"3\",\"target\" : \"9\"}},{\"data\" : {\"source\" : \"6\",\"target\" : \"1\"}},{\"data\" : {\"source\" : \"7\",\"target\" : \"1\"}},{\"data\" : {\"source\" : \"7\",\"target\" : \"7\"}},{\"data\" : {\"source\" : \"7\",\"target\" : \"9\"}},{\"data\" : {\"source\" : \"7\",\"target\" : \"10\"}},{\"data\" : {\"source\" : \"8\",\"target\" : \"1\"}},{\"data\" : {\"source\" : \"8\",\"target\" : \"5\"}},{\"data\" : {\"source\" : \"8\",\"target\" : \"6\"}},{\"data\" : {\"source\" : \"8\",\"target\" : \"8\"}},{\"data\" : {\"source\" : \"8\",\"target\" : \"9\"}},{\"data\" : {\"source\" : \"8\",\"target\" : \"10\"}},{\"data\" : {\"source\" : \"9\",\"target\" : \"1\"}},{\"data\" : {\"source\" : \"9\",\"target\" : \"8\"}},{\"data\" : {\"source\" : \"10\",\"target\" : \"1\"}}],\"layout\" : {\"name\" : \"cose\"},\"style\" : [{\"style\" : {\"content\" : \"data(id)\"},\"selector\" : \"node\"}]},\"height\" : 400,\"tool\" : \"cytoscape\"}\n",
",function(element,visualization){\n",
"});\n",
"}if(window.librariesLoadedFromGAP.hasOwnProperty(\"viz-tool-cytoscape\"\n",
")){myCallback()}else{var filenameString=JSON.stringify(\"viz-tool-cytoscape\"\n",
");var GAPcode=\"JUPVIZFileContents( LoadJavaScriptFile( \"+filenameString+\" ) );\";window.runGAP(GAPcode,function(result,error){if(error)throw Error(\"When loading library \"+filenameString+\": \"+error);result=result[\"text/plain\"];window.librariesLoadedFromGAP[\"viz-tool-cytoscape\"\n",
"]=result;try{var whatItEvaluatesTo=eval(result)}catch(e){throw Error(\"Error evaluating code for library \"+filenameString+\": \"+e)}return myCallback()})}\n",
"}if(window.librariesLoadedFromGAP.hasOwnProperty(\"main\"\n",
")){myCallback()}else{var filenameString=JSON.stringify(\"main\"\n",
");var GAPcode=\"JUPVIZFileContents( LoadJavaScriptFile( \"+filenameString+\" ) );\";window.runGAP(GAPcode,function(result,error){if(error)throw Error(\"When loading library \"+filenameString+\": \"+error);result=result[\"text/plain\"];window.librariesLoadedFromGAP[\"main\"\n",
"]=result;try{var whatItEvaluatesTo=eval(result)}catch(e){throw Error(\"Error evaluating code for library \"+filenameString+\": \"+e)}return myCallback()})}\n",
";\n",
"} )( element.get( 0 ) )"
]
},
"execution_count": 8,
"metadata": {
"application/javascript": ""
},
"output_type": "execute_result"
}
],
"source": [
"PlotGraph( RandomMat( 10, 10 ) - 1 );"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "GAP 4",
"language": "gap",
"name": "gap-4"
},
"language_info": {
"codemirror_mode": "gap",
"file_extension": ".g",
"mimetype": "text/x-gap",
"name": "GAP 4",
"nbconvert_exporter": "",
"pygments_lexer": "gap",
"version": "4.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
[ Dauer der Verarbeitung: 0.2 Sekunden
(vorverarbeitet)
]
|
2026-04-02
|