Skip to content

Commit

Permalink
partial model now contains transitions, and expanded add_transtions f…
Browse files Browse the repository at this point in the history
…unction:
  • Loading branch information
PimLeerkes committed Nov 1, 2024
2 parents 4cc9464 + 53b2774 commit efb6372
Show file tree
Hide file tree
Showing 33 changed files with 44,268 additions and 607 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Docs

on:
# Runs on pushes targeting the default branch
# Runs on pushes targeting the default branch and pull requests.
push:
branches: [main]
pull_request:
types: [opened, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
- name: Run tests
run: poetry run pytest -vv

- name: List kernels
run: poetry run jupyter kernelspec list

- name: Glob notebooks in docs folder
uses: tj-actions/glob@v22
id: glob
Expand Down
206 changes: 206 additions & 0 deletions docs/getting_started/die.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@

<iframe
id="dieeQbbbtTbpv"
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: `rolled1`, group: &quot;states&quot; },
{ id: 2, label: `rolled2`, group: &quot;states&quot; },
{ id: 3, label: `rolled3`, group: &quot;states&quot; },
{ id: 4, label: `rolled4`, group: &quot;states&quot; },
{ id: 5, label: `rolled5`, group: &quot;states&quot; },
{ id: 6, label: `rolled6`, group: &quot;states&quot; },
]);
var edges = new vis.DataSet([{ from: 0, to: 1, label: &quot;1/6&quot; },
{ from: 0, to: 2, label: &quot;1/6&quot; },
{ from: 0, to: 3, label: &quot;1/6&quot; },
{ from: 0, to: 4, label: &quot;1/6&quot; },
{ from: 0, to: 5, label: &quot;1/6&quot; },
{ from: 0, to: 6, label: &quot;1/6&quot; },
{ from: 1, to: 1, label: &quot;1&quot; },
{ from: 2, to: 2, label: &quot;1&quot; },
{ from: 3, to: 3, label: &quot;1&quot; },
{ from: 4, to: 4, label: &quot;1&quot; },
{ from: 5, to: 5, label: &quot;1&quot; },
{ from: 6, to: 6, 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

0 comments on commit efb6372

Please sign in to comment.