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.

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.

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.

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.6.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.6-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geg_metrics-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 72ae2a3a1acf2ee3582c6342ecc1691f3f5e1f48f48facf1622b1b609b9ad8d5
MD5 d5915bebbc1f6667e1f9a0f3ea65ce17
BLAKE2b-256 61a77e23ac4a0ca4a836cc6c2e7e8bf92bfccbfb8827f275e039a9fa7b84151d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: geg_metrics-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 59978a8378c9ff57f48ac695c26089e9fd185ef264ed2dc62be568e55790c5d2
MD5 3d0be5ae259f9e5bc1b40cf276c5a77a
BLAKE2b-256 94b031bd8216abe87d85ec8fd107b4e49b8445c165c0978c987c310f08e718ef

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