Skip to main content

Graph drawing metrics and GEG parser

Project description

GEG Encodes Graphs

GEG Encodes Graphs is a JSON based storage format for encoding graph drawings which contain complex edge geometries using SVG path commands. GEG enables readability metric calculations on drawings containing curved/polygonal edges.

This package contains code for reading/writing GEG files, converting to/from other common formats, and several readability metric implementations.

For more information, see the following publication: G. J. Mooney, T. Hegemann, A. Wolff, M. Wybrow, and H. Purchase, "Universal Quality Metrics for Graph Drawings: Which Graphs Excite Us Most?," in Graph Drawing and Network Visualization (GD 2025), 2025.

Installation

Install from PyPI (distribution name is geg-metrics):

pip install geg-metrics

Then import as:

import geg

Usage

Read a GEG file and compute a metric

import geg

G = geg.read_geg("example.geg")
print("Aspect ratio:", geg.aspect_ratio(G))

Convert GraphML to GEG and compute metrics

import geg

# Read GraphML into an internal graph, convert to a GEG-like NetworkX graph
G = geg.graphml_to_geg("example.graphml")

# Optionally write out a .geg file
geg.write_geg(G, "example_converted.geg")

# Compute metrics
print("Aspect ratio:", geg.aspect_ratio(G))
print("Angular resolution (avg):", geg.angular_resolution_avg_angle(G))
print("Edge length deviation:", geg.edge_length_deviation(G))

Render to SVG

import geg

G = geg.read_geg("example.geg")
geg.to_svg(G, "example.svg", margin=50)

Notes

  • Install name on PyPI is geg-metrics, but the import is import geg.
  • Most metrics expect node coordinates (x, y) and edge paths (path) to be present.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geg_metrics-0.1.8.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geg_metrics-0.1.8-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file geg_metrics-0.1.8.tar.gz.

File metadata

  • Download URL: geg_metrics-0.1.8.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for geg_metrics-0.1.8.tar.gz
Algorithm Hash digest
SHA256 e6923359a7f199ee312a03524fe9089220314e54ba350bc11cb5f76b1e173367
MD5 336367026aa7e40e1cd41bdbdc4e6356
BLAKE2b-256 12ba8c2d9cb7b5196baaef85b56b79d2de4563cba80d64ac1f53b07de060848e

See more details on using hashes here.

File details

Details for the file geg_metrics-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: geg_metrics-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for geg_metrics-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 16c5f511fb74a1b0cb5e9e09dd3756a876ccaf80a4102b1bda5704ffffc19002
MD5 7591135865b85b05f301a89e634b8f5c
BLAKE2b-256 4c848987f60004560032fb75919c031d94bb4b1e67dfed9daefb5c344335010c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page