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

add save and embed to sim notebook #131

Merged
merged 1 commit into from
Nov 7, 2024
Merged
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 docs/getting_started/die.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<iframe
id="dieeRDskhMrxq"
id="dieIGTgHLKedG"
width="820"
height="620"
frameborder="0"
Expand Down
8 changes: 4 additions & 4 deletions docs/getting_started/die.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"metadata": {
"execution": {
"iopub.execute_input": "2024-11-07T11:13:31.640897Z",
Expand All @@ -36,7 +36,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"metadata": {
"execution": {
"iopub.execute_input": "2024-11-07T11:13:31.811899Z",
Expand All @@ -52,7 +52,7 @@
"text/html": [
"\n",
" <iframe\n",
" id=\"dieeRDskhMrxq\"\n",
" id=\"dieIGTgHLKedG\"\n",
" width=\"820\"\n",
" height=\"620\"\n",
" frameborder=\"0\"\n",
Expand Down Expand Up @@ -288,7 +288,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2024-11-07T11:13:31.918412Z",
Expand Down
196 changes: 196 additions & 0 deletions docs/getting_started/model.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@

<iframe
id="modellPtmSPREUD"
width="820"
height="620"
frameborder="0"
srcdoc="
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;title&gt;Network&lt;/title&gt;
&lt;script
type=&quot;text/javascript&quot;
src=&quot;https://unpkg.com/vis-network/standalone/umd/vis-network.min.js&quot;
&gt;&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
#mynetwork {

width: 800px;
height: 600px;
border: 1px solid lightgray;

}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;mynetwork&quot;&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;

var nodes = new vis.DataSet([{ id: 0, label: `init`, group: &quot;states&quot; },
{ id: 1, label: `carchosen`, group: &quot;states&quot; },
{ id: 2, label: `open`, group: &quot;states&quot; },
{ id: 3, label: `goatrevealed`, group: &quot;states&quot; },
{ id: 4, label: `done`, group: &quot;states&quot; },
]);
var edges = new vis.DataSet([{ from: 0, to: 1, label: &quot;1/3&quot; },
{ from: 1, to: 2, label: &quot;1&quot; },
{ from: 2, to: 3, label: &quot;1&quot; },
{ from: 3, to: 4, label: &quot;1&quot; },
]);
var options = {
&quot;__fake_macros&quot;: {
&quot;__group_macro&quot;: {
&quot;borderWidth&quot;: 1,
&quot;color&quot;: {
&quot;background&quot;: &quot;white&quot;,
&quot;border&quot;: &quot;black&quot;,
&quot;highlight&quot;: {
&quot;background&quot;: &quot;white&quot;,
&quot;border&quot;: &quot;red&quot;
}
},
&quot;shape&quot;: &quot;ellipse&quot;,
&quot;mass&quot;: 1,
&quot;font&quot;: {
&quot;color&quot;: &quot;black&quot;,
&quot;size&quot;: 14
}
}
},
&quot;groups&quot;: {
&quot;states&quot;: {
&quot;borderWidth&quot;: 1,
&quot;color&quot;: {
&quot;background&quot;: &quot;white&quot;,
&quot;border&quot;: &quot;black&quot;,
&quot;highlight&quot;: {
&quot;background&quot;: &quot;white&quot;,
&quot;border&quot;: &quot;red&quot;
}
},
&quot;shape&quot;: &quot;ellipse&quot;,
&quot;mass&quot;: 1,
&quot;font&quot;: {
&quot;color&quot;: &quot;black&quot;,
&quot;size&quot;: 14
}
},
&quot;actions&quot;: {
&quot;borderWidth&quot;: 1,
&quot;color&quot;: {
&quot;background&quot;: &quot;lightblue&quot;,
&quot;border&quot;: &quot;black&quot;,
&quot;highlight&quot;: {
&quot;background&quot;: &quot;white&quot;,
&quot;border&quot;: &quot;red&quot;
}
},
&quot;shape&quot;: &quot;box&quot;,
&quot;mass&quot;: 1,
&quot;font&quot;: {
&quot;color&quot;: &quot;black&quot;,
&quot;size&quot;: 14
}
},
&quot;scheduled_actions&quot;: {
&quot;borderWidth&quot;: 1,
&quot;color&quot;: {
&quot;background&quot;: &quot;pink&quot;,
&quot;border&quot;: &quot;black&quot;,
&quot;highlight&quot;: {
&quot;background&quot;: &quot;white&quot;,
&quot;border&quot;: &quot;red&quot;
}
},
&quot;shape&quot;: &quot;box&quot;,
&quot;mass&quot;: 1,
&quot;font&quot;: {
&quot;color&quot;: &quot;black&quot;,
&quot;size&quot;: 14
},
&quot;schedColor&quot;: false
}
},
&quot;reload_button&quot;: false,
&quot;edges&quot;: {
&quot;arrows&quot;: &quot;to&quot;,
&quot;font&quot;: {
&quot;color&quot;: &quot;black&quot;,
&quot;size&quot;: 14
},
&quot;color&quot;: {
&quot;color&quot;: &quot;black&quot;
}
},
&quot;numbers&quot;: {
&quot;fractions&quot;: true,
&quot;digits&quot;: 5
},
&quot;results_and_rewards&quot;: {
&quot;show_results&quot;: true,
&quot;resultSymbol&quot;: &quot;\u2606&quot;,
&quot;show_rewards&quot;: true
},
&quot;layout&quot;: {
&quot;randomSeed&quot;: 5
},
&quot;misc&quot;: {
&quot;enable_physics&quot;: true,
&quot;width&quot;: 800,
&quot;height&quot;: 600,
&quot;explore&quot;: false
},
&quot;saving&quot;: {
&quot;relative_path&quot;: true,
&quot;filename&quot;: &quot;layouts/NAME.json&quot;,
&quot;save_button&quot;: false,
&quot;load_button&quot;: false
},
&quot;positions&quot;: {},
&quot;width&quot;: 800,
&quot;height&quot;: 600,
&quot;physics&quot;: true
};
//js
var container = document.getElementById(&quot;mynetwork&quot;);
var data = {
nodes: nodes,
edges: edges,
};
var network = new vis.Network(container, data, options);
function makeAllNodesInvisible() {
ids = nodes.getIds();
for (let i = 0; i &lt; ids.length; i++) {
var nodeId = ids[i];
var node = nodes.get(nodeId);
node[&quot;hidden&quot;] = true;
nodes.update(node);
}
};
function makeNeighborsVisible(myNode) {
var ids = network.getConnectedNodes(myNode, &#x27;to&#x27;);
for (let i = 0; i &lt; ids.length; i++) {
var nodeId = ids[i];
var node = nodes.get(nodeId);
node[&quot;hidden&quot;] = false;
nodes.update(node);
}
};
function makeNodeVisible(nodeId) {
var node = nodes.get(nodeId);
node[&quot;hidden&quot;] = false;
nodes.update(node);
};
network.on( &#x27;click&#x27;, function(properties) {
var nodeId = network.getNodeAt({x:properties.event.srcEvent.offsetX, y:properties.event.srcEvent.offsetY});
makeNeighborsVisible(nodeId);
});

&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
"
border:none !important;
allowfullscreen webkitallowfullscreen mozallowfullscreen
></iframe>
Loading