tower

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package tower provides the physical tower visualization engine.

Overview

Stacktower's primary visualization is a "tower" of blocks, where each block represents a package and rests on the blocks it depends on. This package implements the multi-stage pipeline required to transform a DAG into a 2D tower layout:

  1. Ordering ([ordering]): Determine horizontal sequence of blocks in each row to minimize crossings.
  2. Layout ([layout]): Compute (x, y) coordinates and dimensions (w, h) for every block.
  3. Styles ([styles]): Define the visual appearance (simple, hand-drawn, colors, text).
  4. Sink ([sink]): Export the final layout to various formats (SVG, JSON, PNG, PDF).

Rendering Pipeline

The rendering process typically follows these steps:

g := dag.New(...)
// ... populate graph ...

// 1. Transform the graph into a row-based structure
transform.Normalize(g)

// 2. Compute the physical layout
l := layout.Build(g, width, height, layout.WithOrderer(ordering.Barycentric{}))

// 3. Render to a specific format
svg := sink.RenderSVG(l, sink.WithStyle(styles.NewSimple()))

Subpackages

  • [layout]: The core layout engine that positions blocks based on row orderings.
  • [ordering]: Algorithms for determining the best horizontal arrangement of blocks.
  • [sink]: Final output generators for different file formats.
  • [styles]: Visual themes and drawing primitives.
  • [transform]: Graph transformations specific to tower visualizations (e.g., merging subdividers).
  • [feature]: High-level visualization features like Nebraska ranking and brittle detection.

[layout]: github.com/matzehuels/stacktower/pkg/render/tower/layout [ordering]: github.com/matzehuels/stacktower/pkg/render/tower/ordering [sink]: github.com/matzehuels/stacktower/pkg/render/tower/sink [styles]: github.com/matzehuels/stacktower/pkg/render/tower/styles [transform]: github.com/matzehuels/stacktower/pkg/render/tower/transform [feature]: github.com/matzehuels/stacktower/pkg/render/tower/feature

Directories

Path Synopsis
Package feature provides analysis features for tower visualizations.
Package feature provides analysis features for tower visualizations.
Package layout computes block positions for tower visualizations.
Package layout computes block positions for tower visualizations.
Package ordering provides algorithms for determining the left-to-right arrangement of nodes within each row of a layered graph.
Package ordering provides algorithms for determining the left-to-right arrangement of nodes within each row of a layered graph.
Package sink provides output format renderers for tower visualizations.
Package sink provides output format renderers for tower visualizations.
Package styles defines visual styles for tower rendering.
Package styles defines visual styles for tower rendering.
handdrawn
Package handdrawn provides an XKCD-inspired hand-drawn visual style.
Package handdrawn provides an XKCD-inspired hand-drawn visual style.
Package transform provides post-layout transformations for tower rendering.
Package transform provides post-layout transformations for tower rendering.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL