Skip to content

Commit 0a93085

Browse files
setting up docs
1 parent a180e7d commit 0a93085

30 files changed

+1856
-458
lines changed

.github/workflows/ci.yml

Lines changed: 72 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,86 @@
1-
name: CI
1+
name: CI & Deploy
2+
23
on:
3-
push:
4-
branches: [ "master" ]
5-
pull_request:
6-
branches: [ "master" ]
4+
push:
5+
branches: ["master", "main"]
6+
pull_request:
7+
branches: ["master", "main"]
8+
79
jobs:
810
test:
9-
name: setup and run tests
11+
name: Setup and Run Tests
1012
runs-on: ubuntu-latest
11-
1213
strategy:
1314
matrix:
1415
python-version: ["3.12"]
1516

1617
steps:
17-
- uses: actions/checkout@v4
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
1825

1926
- name: Install uv
20-
uses: astral-sh/setup-uv@v5
27+
uses: astral-sh/setup-uv@v1
28+
29+
- name: Install project and dependencies
30+
run: |
31+
uv sync --all-extras --dev
32+
uv pip install -e . --no-deps
2133
22-
- name: Install the project
23-
run: uv sync --locked --all-extras --dev && uv pip install -e .
2434
- name: Run tests
2535
run: uv run pytest tests
36+
37+
deploy-docs:
38+
name: Deploy MkDocs Site to GitHub Pages
39+
runs-on: ubuntu-latest
40+
needs: test # Only run this job if the 'test' job succeeds
41+
# Only run this job on pushes to the 'master' or 'main' branch, NOT on pull requests
42+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
43+
44+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
45+
permissions:
46+
contents: read
47+
pages: write
48+
id-token: write
49+
50+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
51+
concurrency:
52+
group: "pages"
53+
cancel-in-progress: false
54+
55+
steps:
56+
- name: Checkout repository
57+
uses: actions/checkout@v4
58+
59+
- name: Set up Python
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: '3.12'
63+
64+
- name: Install uv
65+
uses: astral-sh/setup-uv@v1
66+
67+
- name: Install dependencies for docs
68+
run: |
69+
uv sync --all-extras
70+
uv pip install -e . --no-deps
71+
72+
- name: Generate Graph Example HTML Files
73+
run: python generate_graph_examples.py
74+
75+
- name: Build MkDocs site
76+
run: uv run mkdocs build --verbose
77+
78+
- name: Upload artifact for GitHub Pages
79+
uses: actions/upload-pages-artifact@v3
80+
with:
81+
path: './site' # Path to the directory containing the built MkDocs site
82+
83+
- name: Deploy to GitHub Pages
84+
id: deployment
85+
uses: actions/deploy-pages@v4
86+
# This action will automatically use the artifact uploaded in the previous step

.github/workflows/docs.yml

Whitespace-only changes.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
!pyproject.toml
1313
!uv.lock
1414
!.pre-commit-config.yaml
15+
!mkdocs.yml
16+
!generate_graph_examples.py
1517

1618

1719
# recursively re-ignore

examples/advanced_showcase_graph.html renamed to docs/assets/generated_graphs/advanced_showcase_example.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>NX-VIS Visualizer - Advanced Showcase</title>
7+
<title>Advanced Graph Showcase</title>
88
<script type="text/javascript" src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"></script>
99
<link href="https://unpkg.com/vis-network/styles/vis-network.min.css" rel="stylesheet" type="text/css" />
1010
<style type="text/css">
@@ -62,7 +62,7 @@
6262
transform: rotate(-90deg); /* Right arrow for collapsed state */
6363
}
6464

65-
#config-container-content-ccb18885 {
65+
#config-container-content-fc8d7387 {
6666
max-height: 40vh; /* Default expanded max height */
6767
overflow-y: auto;
6868
padding: 15px;
@@ -71,15 +71,15 @@
7171
transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
7272
}
7373

74-
.collapsed #config-container-content-ccb18885 {
74+
.collapsed #config-container-content-fc8d7387 {
7575
max-height: 0;
7676
padding-top: 0;
7777
padding-bottom: 0;
7878
overflow: hidden;
7979
border-bottom: none; /* Hide border when collapsed */
8080
}
8181

82-
#mynetwork-ccb18885 {
82+
#mynetwork-fc8d7387 {
8383
width: 100%;
8484
flex-grow: 1; /* Graph takes remaining vertical space */
8585
min-height: 0; /* Important for flex children to shrink */
@@ -119,28 +119,28 @@
119119
</style>
120120
</head>
121121
<body>
122-
<div class="config-panel-wrapper" id="config-panel-wrapper-ccb18885">
123-
<div class="config-panel-header" id="config-panel-header-ccb18885" role="button" tabindex="0" aria-expanded="true" aria-controls="config-container-content-ccb18885">
122+
<div class="config-panel-wrapper" id="config-panel-wrapper-fc8d7387">
123+
<div class="config-panel-header" id="config-panel-header-fc8d7387" role="button" tabindex="0" aria-expanded="true" aria-controls="config-container-content-fc8d7387">
124124
<h3>Configuration</h3>
125-
<button class="config-toggle-btn" id="config-toggle-btn-ccb18885" aria-label="Toggle configuration panel"></button>
125+
<button class="config-toggle-btn" id="config-toggle-btn-fc8d7387" aria-label="Toggle configuration panel"></button>
126126
</div>
127-
<div id="config-container-content-ccb18885">
127+
<div id="config-container-content-fc8d7387">
128128
<!-- Vis.js configuration UI will be injected here -->
129129
</div>
130130
</div>
131131

132-
<div id="mynetwork-ccb18885"></div>
132+
<div id="mynetwork-fc8d7387"></div>
133133

134134
<script type="text/javascript">
135135
(function() {
136136
var nodesArray = [{"id": "R0", "label": "R0", "group": 0, "value": 1, "title": "Random Node R0\nGroup: 0\nValue: 1", "font": {"color": "black", "size": 10}}, {"id": "R1", "label": "R1", "group": 1, "value": 2, "title": "Random Node R1\nGroup: 1\nValue: 2", "font": {}}, {"id": "R2", "label": "R2", "group": 2, "value": 3, "title": "Random Node R2\nGroup: 2\nValue: 3", "font": {}}, {"id": "R3", "label": "R3", "group": 3, "value": 4, "title": "Random Node R3\nGroup: 3\nValue: 4", "font": {}}, {"id": "R4", "label": "R4", "group": 0, "value": 5, "title": "Random Node R4\nGroup: 0\nValue: 5", "font": {"color": "black", "size": 10}}, {"id": "R5", "label": "R5", "group": 1, "value": 1, "title": "Random Node R5\nGroup: 1\nValue: 1", "font": {}}, {"id": "R6", "label": "R6", "group": 2, "value": 2, "title": "Random Node R6\nGroup: 2\nValue: 2", "font": {}}, {"id": "R7", "label": "R7", "group": 3, "value": 3, "title": "Random Node R7\nGroup: 3\nValue: 3", "font": {}}, {"id": "R8", "label": "R8", "group": 0, "value": 4, "title": "Random Node R8\nGroup: 0\nValue: 4", "font": {"color": "black", "size": 10}}, {"id": "R9", "label": "R9", "group": 1, "value": 5, "title": "Random Node R9\nGroup: 1\nValue: 5", "font": {}}, {"id": "R10", "label": "R10", "group": 2, "value": 1, "title": "Random Node R10\nGroup: 2\nValue: 1", "font": {}}, {"id": "R11", "label": "R11", "group": 3, "value": 2, "title": "Random Node R11\nGroup: 3\nValue: 2", "font": {}}, {"id": "R12", "label": "R12", "group": 0, "value": 3, "title": "Random Node R12\nGroup: 0\nValue: 3", "font": {"color": "black", "size": 10}}, {"id": "R13", "label": "R13", "group": 1, "value": 4, "title": "Random Node R13\nGroup: 1\nValue: 4", "font": {}}, {"id": "R14", "label": "R14", "group": 2, "value": 5, "title": "Random Node R14\nGroup: 2\nValue: 5", "font": {}}, {"id": "R15", "label": "R15", "group": 3, "value": 1, "title": "Random Node R15\nGroup: 3\nValue: 1", "font": {}}, {"id": "R16", "label": "R16", "group": 0, "value": 2, "title": "Random Node R16\nGroup: 0\nValue: 2", "font": {"color": "black", "size": 10}}, {"id": "R17", "label": "R17", "group": 1, "value": 3, "title": "Random Node R17\nGroup: 1\nValue: 3", "font": {}}, {"id": "R18", "label": "R18", "group": 2, "value": 4, "title": "Random Node R18\nGroup: 2\nValue: 4", "font": {}}, {"id": "R19", "label": "R19", "group": 3, "value": 5, "title": "Random Node R19\nGroup: 3\nValue: 5", "font": {}}, {"id": "Source", "label": "START", "shape": "diamond", "color": {"background": "lightgreen", "border": "darkgreen", "highlight": {"background": "green", "border": "darkgreen"}}, "size": 30, "group": 4, "title": "This is the main Source node", "font": {"size": 16, "color": "darkgreen", "face": "Arial", "strokeWidth": 1, "strokeColor": "white"}, "fixed": {"x": true, "y": true}, "x": -400, "y": -200}, {"id": "Sink", "label": "END", "shape": "star", "color": "gold", "size": 30, "group": 4, "title": "This is the main Sink node", "font": {"size": 16, "color": "black", "face": "Georgia"}, "fixed": {"x": true, "y": true}, "x": 400, "y": 200}, {"id": "Hub", "label": "Central Hub", "shape": "ellipse", "color": "lightblue", "size": 25, "group": 5, "title": "A central connecting hub", "font": {"multi": "html", "bold": "18px arial darkblue"}}, {"id": "Isolated", "label": "I'm Alone", "shape": "text", "title": "An isolated node example", "color": "#FFCCFF", "font": {"size": 12, "color": "purple"}}];
137-
var edgesArray = [{"from": "R0", "to": "Source", "weight": 1, "color": "darkgreen", "label": "S->R0"}, {"from": "R0", "to": "R1", "weight": 1, "color": "#cccccc", "title": "R0-R1"}, {"from": "R0", "to": "R5", "color": {"color": "red", "highlight": "darkred", "hover": "pink", "opacity": 0.7}, "label": "Opacity Edge", "weight": 2}, {"from": "R1", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R1 to Hub"}, {"from": "R3", "to": "Sink", "weight": 3, "color": "orange", "label": "R3->E", "arrows": "to"}, {"from": "R5", "to": "Source", "weight": 3, "color": "darkgreen", "label": "S->R5"}, {"from": "R5", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R5 to Hub"}, {"from": "R5", "to": "R6", "weight": 1, "color": "#cccccc", "title": "R5-R6"}, {"from": "R7", "to": "Sink", "weight": 3, "color": "orange", "label": "R7->E", "arrows": "to"}, {"from": "R9", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R9 to Hub"}, {"from": "R10", "to": "Source", "weight": 2, "color": "darkgreen", "label": "S->R10"}, {"from": "R11", "to": "Sink", "weight": 3, "color": "orange", "label": "R11->E", "arrows": "to"}, {"from": "R11", "to": "R12", "weight": 1, "color": "#cccccc", "title": "R11-R12"}, {"from": "R13", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R13 to Hub"}, {"from": "R15", "to": "Source", "weight": 1, "color": "darkgreen", "label": "S->R15"}, {"from": "R15", "to": "Sink", "weight": 3, "color": "orange", "label": "R15->E", "arrows": "to"}, {"from": "R16", "to": "R17", "weight": 1, "color": "#cccccc", "title": "R16-R17"}, {"from": "R17", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R17 to Hub"}, {"from": "R19", "to": "Sink", "weight": 3, "color": "orange", "label": "R19->E", "arrows": "to"}, {"from": "Source", "to": "Hub", "weight": 5, "color": "darkgreen", "width": 4, "title": "Main link to Hub"}, {"from": "Sink", "to": "Hub", "weight": 5, "color": "blue", "width": 4, "title": "Main link from Hub to Sink", "arrows": "to", "smooth": {"type": "curvedCW", "roundness": 0.2}}];
137+
var edgesArray = [{"from": "R0", "to": "Source", "weight": 1, "color": "darkgreen", "label": "S->R0"}, {"from": "R0", "to": "R5", "color": {"color": "red", "highlight": "darkred", "hover": "pink", "opacity": 0.7}, "label": "Opacity Edge", "weight": 2}, {"from": "R1", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R1 to Hub"}, {"from": "R1", "to": "R2", "weight": 1, "color": "#cccccc", "title": "R1-R2"}, {"from": "R3", "to": "Sink", "weight": 3, "color": "orange", "label": "R3->E", "arrows": "to"}, {"from": "R4", "to": "R5", "weight": 1, "color": "#cccccc", "title": "R4-R5"}, {"from": "R5", "to": "Source", "weight": 3, "color": "darkgreen", "label": "S->R5"}, {"from": "R5", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R5 to Hub"}, {"from": "R7", "to": "Sink", "weight": 3, "color": "orange", "label": "R7->E", "arrows": "to"}, {"from": "R9", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R9 to Hub"}, {"from": "R10", "to": "Source", "weight": 2, "color": "darkgreen", "label": "S->R10"}, {"from": "R11", "to": "Sink", "weight": 3, "color": "orange", "label": "R11->E", "arrows": "to"}, {"from": "R13", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R13 to Hub"}, {"from": "R15", "to": "Source", "weight": 1, "color": "darkgreen", "label": "S->R15"}, {"from": "R15", "to": "Sink", "weight": 3, "color": "orange", "label": "R15->E", "arrows": "to"}, {"from": "R17", "to": "Hub", "weight": 2, "dashes": [5, 5], "color": "gray", "title": "R17 to Hub"}, {"from": "R19", "to": "Sink", "weight": 3, "color": "orange", "label": "R19->E", "arrows": "to"}, {"from": "Source", "to": "Hub", "weight": 5, "color": "darkgreen", "width": 4, "title": "Main link to Hub"}, {"from": "Sink", "to": "Hub", "weight": 5, "color": "blue", "width": 4, "title": "Main link from Hub to Sink", "arrows": "to", "smooth": {"type": "curvedCW", "roundness": 0.2}}];
138138
var optionsObject = {"autoResize": true, "nodes": {"shape": "dot", "size": 16, "font": {"size": 12, "color": "#333333", "face": "Tahoma"}, "borderWidth": 2, "borderWidthSelected": 4, "scaling": {"min": 10, "max": 30, "label": {"enabled": true, "min": 8, "max": 20}}, "shadow": {"enabled": true, "size": 5, "x": 3, "y": 3}}, "edges": {"width": 1, "smooth": {"type": "dynamic", "roundness": 0.5, "enabled": true}, "arrows": {"to": {"enabled": false, "scaleFactor": 0.8, "type": "arrow"}}, "color": {"color": "#848484", "highlight": "#000000", "hover": "#555555", "inherit": "from", "opacity": 1.0}, "font": {"size": 10, "color": "black", "strokeWidth": 0, "align": "horizontal"}, "scaling": {"min": 1, "max": 8, "label": {"enabled": false}}, "hoverWidth": 1.5, "selectionWidth": 2}, "physics": {"enabled": true, "barnesHut": {"gravitationalConstant": -15000, "springConstant": 0.05, "springLength": 120, "damping": 0.15, "avoidOverlap": 0.2, "centralGravity": 0.1}, "solver": "barnesHut", "stabilization": {"iterations": 1000, "fit": true, "enabled": true, "updateInterval": 50, "onlyDynamicEdges": false}, "adaptiveTimestep": true, "minVelocity": 0.75}, "interaction": {"hover": true, "dragNodes": true, "dragView": true, "zoomView": true, "tooltipDelay": 200, "navigationButtons": true, "keyboard": {"enabled": true, "speed": {"x": 10, "y": 10, "zoom": 0.05}, "bindToWindow": true}, "multiselect": true, "selectable": true, "selectConnectedEdges": true}, "layout": {"randomSeed": 42, "improvedLayout": true}, "groups": {"0": {"color": {"background": "cyan", "border": "blue"}, "shape": "dot"}, "1": {"color": {"background": "pink", "border": "purple"}, "shape": "square", "font": {"color": "purple"}}, "2": {"color": {"background": "yellow", "border": "orange"}, "shape": "triangle"}, "3": {"color": {"background": "lime", "border": "green"}, "shape": "triangleDown"}, "4": {"borderWidth": 3, "shadow": {"enabled": false}}, "5": {"shape": "hexagon", "color": "lightgray"}}, "configure": {"enabled": true, "showButton": false}};
139139

140-
var configWrapper = document.getElementById('config-panel-wrapper-ccb18885');
141-
var configHeader = document.getElementById('config-panel-header-ccb18885');
142-
var configContent = document.getElementById('config-container-content-ccb18885');
143-
var toggleButton = document.getElementById('config-toggle-btn-ccb18885'); // Also target button for ARIA
140+
var configWrapper = document.getElementById('config-panel-wrapper-fc8d7387');
141+
var configHeader = document.getElementById('config-panel-header-fc8d7387');
142+
var configContent = document.getElementById('config-container-content-fc8d7387');
143+
var toggleButton = document.getElementById('config-toggle-btn-fc8d7387'); // Also target button for ARIA
144144

145145
if (optionsObject.configure && optionsObject.configure.enabled) {
146146
if (!optionsObject.configure.container) { // Only set if user hasn't provided one
@@ -178,7 +178,7 @@ <h3>Configuration</h3>
178178

179179
var nodes = new vis.DataSet(nodesArray);
180180
var edges = new vis.DataSet(edgesArray);
181-
var graphContainer = document.getElementById('mynetwork-ccb18885');
181+
var graphContainer = document.getElementById('mynetwork-fc8d7387');
182182
var data = { nodes: nodes, edges: edges };
183183
var network = new vis.Network(graphContainer, data, optionsObject);
184184

0 commit comments

Comments
 (0)