Skip to content

Commit 9c2d753

Browse files
Merge pull request #19 from PhilipMathieu/showcase
Add docs, build upgrades
2 parents ac634b9 + cc6b89b commit 9c2d753

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+11690
-1253
lines changed

.github/workflows/mkdocs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build and Publish Docs
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Configure Git Credentials
17+
run: |
18+
git config user.name github-actions[bot]
19+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.x
23+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
24+
- uses: actions/cache@v4
25+
with:
26+
key: mkdocs-material-${{ env.cache_id }}
27+
path: .cache
28+
restore-keys: |
29+
mkdocs-material-
30+
- run: pip install mkdocs-material
31+
- run: mkdocs gh-deploy --force

_version.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# file generated by setuptools_scm
2+
# don't change, don't track in version control
3+
TYPE_CHECKING = False
4+
if TYPE_CHECKING:
5+
from typing import Tuple, Union
6+
7+
VERSION_TUPLE = Tuple[Union[int, str], ...]
8+
else:
9+
VERSION_TUPLE = object
10+
11+
version: str
12+
__version__: str
13+
__version_tuple__: VERSION_TUPLE
14+
version_tuple: VERSION_TUPLE
15+
16+
__version__ = version = "0.0.2.dev15"
17+
__version_tuple__ = version_tuple = (0, 0, 2, "dev15")

docs/assets/logo_128.png

2.99 KB
Loading

docs/assets/logo_512.png

12.6 KB
Loading

docs/contributing.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Contributing
2+
3+
## Documentation
4+
5+
Documentation is built with MkDocs - for full documentation visit [mkdocs.org](https://www.mkdocs.org). To install the packages needed for local development, run:
6+
```
7+
pip install graphreadability[docs]
8+
```
9+
10+
This will install `mkdocs` (documentation generator), `mkdocs-material` (theme), `mkdocstrings` (plugin adding lots of cross-referencing abilities), and `mkdocstrings-python` (the additional handler needed for Python).
11+
12+
### MkDocs Commands
13+
14+
* `mkdocs serve` - Start the live-reloading docs server.
15+
* `mkdocs build` - Build the documentation site.
16+
* `mkdocs -h` - Print help message and exit.
17+
18+
### MkDocs Project layout
19+
20+
mkdocs.yml # The configuration file.
21+
docs/
22+
index.md # The documentation homepage.
23+
... # Other markdown pages, images and other files.

docs/index.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# graphreadability
2+
3+
Python module for applying readability metrics to network and graph visualizations.
4+
5+
## Credits
6+
Created by Philip Englund Mathieu, MS DS '24, as part of Northeastern University's Khoury College of Computer Sciences Research Apprenticeship program. Advised by Prof. Cody Dunne. For additional attributions, see [the dedicated references page](references.md).
7+
8+
## Installation
9+
10+
```
11+
pip install graphreadability
12+
```
13+
14+
## Usage
15+
16+
```python
17+
# Suggested import syntax
18+
import networkx as nx
19+
import graphreadability as gr
20+
21+
# Create a basic graph using NetworkX
22+
G = nx.Graph()
23+
G.add_nodes_from(
24+
[
25+
(1, {"x": 1, "y": 1}),
26+
(2, {"x": -1, "y": 1}),
27+
(3, {"x": -1, "y": -1}),
28+
(4, {"x": 1, "y": -1}),
29+
(5, {"x": 2, "y": 1}),
30+
]
31+
)
32+
G.add_edges_from([(1, 2), (2, 3), (3, 4), (4, 2), (1, 3)])
33+
34+
# Create a MetricsSuite to calculate readability metrics
35+
M = gr.MetricsSuite(G)
36+
37+
# Calculate readability metrics
38+
M.calculate_metrics()
39+
40+
# Print results
41+
M.pretty_print_metrics()
42+
```
43+
44+
Expected Output:
45+
46+
```
47+
--------------------------------------------------
48+
Metric Value Weight
49+
--------------------------------------------------
50+
angular_resolution 0.312 1
51+
aspect_ratio 0.667 1
52+
crossing_angle 1.000 1
53+
edge_crossing 1.000 1
54+
edge_length 0.829 1
55+
edge_orthogonality 0.600 1
56+
gabriel_ratio 0.556 1
57+
neighbourhood_preservation 0.333 1
58+
node_orthogonality 0.417 1
59+
node_resolution 0.277 1
60+
node_uniformity 0.812 1
61+
--------------------------------------------------
62+
Evaluation using weighted_sum: 0.61855
63+
--------------------------------------------------
64+
```

docs/metrics.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Supported Metrics
2+
3+
This page documents the metrics included with the current version. The contents are generated directly from the `graphreadability.metrics.metrics.py`.
4+
5+
::: graphreadability.metrics.metrics

docs/metricssuite.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# MetricsSuite
2+
3+
::: graphreadability.MetricsSuite

docs/references.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# References
2+
3+
Two papers served as primary references to this work:
4+
5+
1. G. J. Mooney, H. C. Purchase, M. Wybrow, and S. G. Kobourov, “The Multi-Dimensional Landscape of Graph Drawing Metrics”.
6+
2. C. Dunne, S. I. Ross, B. Shneiderman, and M. Martino, “Readability metric feedback for aiding node-link visualization designers,” IBM Journal of Research and Development, vol. 59, no. 2/3, p. 14:1-14:16, Mar. 2015, doi: 10.1147/JRD.2015.2411412
7+
8+
Additional thanks to Gavin Mooney, who shared the code accompanying [1] on GitHub and permitted my reuse.

0 commit comments

Comments
 (0)