Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

galaga-anywidget

Interactive AnyWidget visualizations for Galaga geometric algebra.

The first renderer draws direct points, dipoles, lines, and circles in a two-dimensional conformal model. It owns semantic Euclidean point coordinates, so browser drags participate in Marimo's normal reactive execution while the notebook keeps all geometric constructions in Python.

For the Galaga 2 beta, opt into prereleases:

python -m pip install --pre "galaga-anywidget>=2.0.0b1,<3"

Persistent reactive construction

Requires Python 3.11+. In Marimo, first create the native-null conformal model in a setup cell:

from galaga import Algebra, presets
from galaga.cga import ConformalModel

cga = ConformalModel(Algebra(config=presets.cga(2)), expr=True)

Construct and render the visualization in a cell that has no dependency on changing geometry:

import galaga_anywidget.viz as viz

circle_viz = viz.CGA2D(
    cga,
    colors=["#0072B2", "#D55E00", "#009E73", "#7C3AED"],
)
circle_viz

Read named coordinates in another cell and construct ordinary multivectors:

px, py = circle_viz.coordinates("P", default=(-1.75, -0.75))
qx, qy = circle_viz.coordinates("Q", default=(0.25, 1.5))
rx, ry = circle_viz.coordinates("R", default=(1.75, -0.5))

P = cga.up(px, py).named("P")
Q = cga.up(qx, qy).named("Q")
R = cga.up(rx, ry).named("R")

Keep the derived algebra in its own ordinary cell:

C = (P ^ Q ^ R).named("C")

Then synchronize the current values into the persistent widget:

circle_viz.display([P, Q, R], immutable=[C])

The three points are draggable and the dotted circle is read-only. Dragging a point updates the named coordinate pair, which causes Marimo to reconstruct the conformal point and every dependent value. The widget never duplicates the circle construction in JavaScript.

For compact static or one-cell views, use viz.display([point, dipole, line, circle], model=cga). The lower-level CGA2DPlot API supports explicit keys, replacements, dependent geometry, and solid, dashed, or dotted line styles.

Oblique metric plane

oblique2d visualizes a positive-definite two-dimensional Gram metric. It embeds the stored basis in a Euclidean drawing plane, so the lengths and angle of the displayed basis arrows are implied by the Gram matrix. Grade-1 values are arrows; grade-2 values are oriented parallelograms whose signed area follows the bivector coefficient:

from galaga import Algebra
from galaga_anywidget import oblique2d

algebra = Algebra(gram=[[1.0, 0.5], [0.5, 1.0]])
e1, e2 = algebra.basis_vectors()
plane = oblique2d(algebra, [2 * e1 + e2, (e1 ^ e2).named("area")])
plane

Indefinite or degenerate metrics are rejected because they do not have this faithful Euclidean 2D interpretation.

The design and interaction lessons are recorded in GALAGA_ANYWIDGET.md.

Metadata

Release files for galaga-anywidget 2.0.0b3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for galaga-anywidget 2.0.0b3
File Size Uploaded Provenance Actions
galaga_anywidget-2.0.0b3.tar.gz 29.9 kB Without provenance Details for galaga_anywidget-2.0.0b3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for galaga-anywidget 2.0.0b3
File Interpreter ABI Platform Actions
galaga_anywidget-2.0.0b3-py3-none-any.whl Python 3 none any Details for galaga_anywidget-2.0.0b3-py3-none-any.whl

Total release size: 55.2 kB

Release files / galaga_anywidget-2.0.0b3.tar.gz

Download URL galaga_anywidget-2.0.0b3.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ff0dd9511c7b751a62e8858b1496bff288e9cfe87738831195d190265336d5e8
BLAKE2b-256 checksum
How to use checksums
6955a8d740d5a61ff4edd0896af36d707d0e11c1b47196fa5096e618a88c5ffd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / galaga_anywidget-2.0.0b3-py3-none-any.whl

Download URL galaga_anywidget-2.0.0b3-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5411d4063a81978ff9f1a7a5f06731055c165ec3dcba180f60cb8ee60894f6c0
BLAKE2b-256 checksum
How to use checksums
675d5c52b2067f34dccbc0f0b78434d73668de20c1985f06ca83d05b4e48e00b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for galaga-anywidget 2.0.0b3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page