visual

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package visual provides visual comparison tools for compression results. Competitive feature vs other tools that only show token counts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnimatedDiff

func AnimatedDiff(originalTokens, compressedTokens int, durationMs int) string

AnimatedDiff shows an animated compression visualization (for terminals that support it).

func CompactDiff

func CompactDiff(originalTokens, compressedTokens int) string

CompactDiff creates a compact one-line comparison.

func DiffStats

func DiffStats(originalTokens, compressedTokens int) string

DiffStats creates a visual bar chart of compression.

func ExportDiffHTML

func ExportDiffHTML(original, compressed string, originalTokens, compressedTokens int) string

ExportDiffHTML exports diff as HTML for web viewing.

func ShowHighlights

func ShowHighlights(original, compressed string) []string

ShowHighlights displays key compression highlights.

func VisualDiff

func VisualDiff(original, compressed string, originalTokens, compressedTokens int) string

VisualDiff creates a side-by-side comparison with highlights.

Types

type DiffHighlight

type DiffHighlight struct {
	Type           string // "removed", "kept", "changed", "compressed"
	OriginalLine   string
	CompressedLine string
	Explanation    string
}

DiffHighlight represents a notable change in the compression.

type DiffResult

type DiffResult struct {
	OriginalLines   int
	CompressedLines int
	LinesRemoved    int
	LinesChanged    int
	LinesKept       int

	OriginalTokens   int
	CompressedTokens int
	TokensSaved      int

	Highlights []DiffHighlight
}

DiffResult represents a visual comparison of before/after compression.

Jump to

Keyboard shortcuts

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