Skip to main content

Mathematical optimization for data visualization

Project description

vizopt

Mathematical optimization for data visualization, specifically designed for graph layouts with hierarchical inclusion constraints ("bubble layouts").

Uses JAX for automatic differentiation and JIT compilation to efficiently optimize layouts via gradient descent.

Installation

pip install vizopt

Quick Start

import networkx as nx
from vizopt.bubblejax import optimize_bubble_layout

# Create a graph
graph = nx.Graph()
graph.add_edges_from([("Munich", "Vienna"), ("Vienna", "Prague")])

# Define inclusion tree (cities in countries)
inclusion_tree = nx.DiGraph()
inclusion_tree.add_edges_from([
    ("Munich", "Germany"),
    ("Vienna", "Austria"),
    ("Prague", "Czechia"),
])

# Optimize layout
result = optimize_bubble_layout(
    graph=graph,
    inclusion_tree=inclusion_tree,
    node_radii={"Munich": 0.3, "Vienna": 0.3, "Prague": 0.3},
)

Features

  • Multi-objective optimization (edge lengths, compactness, collision avoidance, inclusion constraints)
  • Efficient JAX-based gradient descent with JIT compilation
  • Handles arbitrary hierarchical inclusion relationships
  • NetworkX integration

Examples

See examples/examples_with_bubbles.ipynb for detailed usage.

License

MIT

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

vizopt-0.0.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

vizopt-0.0.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file vizopt-0.0.2.tar.gz.

File metadata

  • Download URL: vizopt-0.0.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vizopt-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b54a183c0dfc21c20822b0817e4967a43af1abf23d6a1ff0e6d1eab08b402cd7
MD5 21bb449717b5bbedcddbee0512470714
BLAKE2b-256 acd425a9fa606199ae6dc2c566bd02013cbba72785619566d44a22cc152231f0

See more details on using hashes here.

File details

Details for the file vizopt-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: vizopt-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vizopt-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 313747073f6a81f7cfe0e1fd50f27a65bde5ebe0e0aed0e2f8310db350ac07e8
MD5 f5338a98a01a3d29e88c6be25123afe8
BLAKE2b-256 a4018da9178cc8fbeec5ee045a8bc89ce62d1f514211c1be056e6891ddaa0fcf

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