Skip to content

Commit

Permalink
progress on introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
YouGuessedMyName committed Feb 19, 2025
1 parent f0b0814 commit 772259c
Show file tree
Hide file tree
Showing 7 changed files with 1,526 additions and 120 deletions.
1,050 changes: 985 additions & 65 deletions docs/getting_started/03_prism.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/getting_started/04_mdp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
22 changes: 9 additions & 13 deletions docs/getting_started/prism.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<iframe
id="prismLMoYBkjdpt"
id="prismMwNjHIHzQW"
width="820"
height="620"
frameborder="0"
Expand Down Expand Up @@ -552,7 +552,7 @@
{ id: 174, label: `nextnand
€ : 1.0
☆ 0`, group: &quot;states&quot;, hidden: true, physics: false },
{ id: 175, label: `end,target
{ id: 175, label: `target,end
€ : 0.0
☆ 1`, group: &quot;states&quot;, hidden: true, physics: false },
{ id: 176, label: `end
Expand Down Expand Up @@ -942,19 +942,20 @@
}
};
function makeNeighborsVisible(homeId) {
//var ids = network.getConnectedNodes(myNode);
homeNode = nodes.get(homeId);
// Make outgoing nodes visible
var nodeIds = network.getConnectedNodes(homeId, &quot;to&quot;);
for (let i = 0; i &lt; nodeIds.length; i++) {
var toNodeId = nodeIds[i];
var toNode = nodes.get(toNodeId);
toNode[&quot;hidden&quot;] = false;
toNode[&quot;physics&quot;] = true;
toNode[&quot;x&quot;] = network.getPosition(homeId)[&quot;x&quot;] + 30;
toNode[&quot;y&quot;] = network.getPosition(homeId)[&quot;y&quot;];
nodes.update(toNode);
if (toNode[&quot;hidden&quot;]) {
toNode[&quot;hidden&quot;] = false;
toNode[&quot;physics&quot;] = true;
toNode[&quot;x&quot;] = network.getPosition(homeId)[&quot;x&quot;];
toNode[&quot;y&quot;] = network.getPosition(homeId)[&quot;y&quot;];
nodes.update(toNode);
}
}
// Make edges visible, if both of the nodes are also visible
var edgeIds = network.getConnectedEdges(homeId);
Expand All @@ -970,11 +971,6 @@
}
}
};
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);
Expand Down
32 changes: 18 additions & 14 deletions docs/introduction/1-Introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 1,
"id": "df22ee92-d159-46de-913b-bf22e1022386",
"metadata": {},
"outputs": [
Expand All @@ -27,7 +27,7 @@
"text/html": [
"\n",
" <iframe\n",
" id=\"modelyDaSwoAKcF\"\n",
" id=\"modelCjZjdbwtet\"\n",
" width=\"675\"\n",
" height=\"395\"\n",
" frameborder=\"0\"\n",
Expand Down Expand Up @@ -333,11 +333,13 @@
" for (let i = 0; i &lt; nodeIds.length; i++) {\n",
" var toNodeId = nodeIds[i];\n",
" var toNode = nodes.get(toNodeId);\n",
" toNode[&quot;hidden&quot;] = false;\n",
" toNode[&quot;physics&quot;] = true;\n",
" toNode[&quot;x&quot;] = network.getPosition(homeId)[&quot;x&quot;];\n",
" toNode[&quot;y&quot;] = network.getPosition(homeId)[&quot;y&quot;];\n",
" nodes.update(toNode);\n",
" if (toNode[&quot;hidden&quot;]) {\n",
" toNode[&quot;hidden&quot;] = false;\n",
" toNode[&quot;physics&quot;] = true;\n",
" toNode[&quot;x&quot;] = network.getPosition(homeId)[&quot;x&quot;];\n",
" toNode[&quot;y&quot;] = network.getPosition(homeId)[&quot;y&quot;];\n",
" nodes.update(toNode);\n",
" }\n",
" }\n",
" // Make edges visible, if both of the nodes are also visible\n",
" var edgeIds = network.getConnectedEdges(homeId);\n",
Expand Down Expand Up @@ -412,7 +414,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"id": "9c7665b1-0d99-49e8-bd28-a9742bfb36cc",
"metadata": {},
"outputs": [
Expand All @@ -421,7 +423,7 @@
"text/html": [
"\n",
" <iframe\n",
" id=\"modelZzyFZrfYby\"\n",
" id=\"modelPhWIKICszG\"\n",
" width=\"223\"\n",
" height=\"233\"\n",
" frameborder=\"0\"\n",
Expand Down Expand Up @@ -604,11 +606,13 @@
" for (let i = 0; i &lt; nodeIds.length; i++) {\n",
" var toNodeId = nodeIds[i];\n",
" var toNode = nodes.get(toNodeId);\n",
" toNode[&quot;hidden&quot;] = false;\n",
" toNode[&quot;physics&quot;] = true;\n",
" toNode[&quot;x&quot;] = network.getPosition(homeId)[&quot;x&quot;];\n",
" toNode[&quot;y&quot;] = network.getPosition(homeId)[&quot;y&quot;];\n",
" nodes.update(toNode);\n",
" if (toNode[&quot;hidden&quot;]) {\n",
" toNode[&quot;hidden&quot;] = false;\n",
" toNode[&quot;physics&quot;] = true;\n",
" toNode[&quot;x&quot;] = network.getPosition(homeId)[&quot;x&quot;];\n",
" toNode[&quot;y&quot;] = network.getPosition(homeId)[&quot;y&quot;];\n",
" nodes.update(toNode);\n",
" }\n",
" }\n",
" // Make edges visible, if both of the nodes are also visible\n",
" var edgeIds = network.getConnectedEdges(homeId);\n",
Expand Down
Loading

0 comments on commit 772259c

Please sign in to comment.