Documentation
¶
Overview ¶
Package export provides functionality for exporting timeline visualizations to static image formats like SVG and PNG.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExportFormat ¶
type ExportFormat string
ExportFormat represents the output format for timeline export.
const ( FormatSVG ExportFormat = "svg" FormatPNG ExportFormat = "png" FormatJSONL ExportFormat = "jsonl" )
type ExportOptions ¶
type ExportOptions struct {
// Format is the output format (svg, png, jsonl).
Format ExportFormat
// TimeRange filters events to a specific time window.
// If Since is zero, uses the first event time.
// If Until is zero, uses the last event time.
Since time.Time
Until time.Time
// Dimensions for the output image.
Width int // Default: 1200
Height int // Default: auto-calculated based on agent count
// Scale multiplier for PNG export (1x, 2x, 3x).
// Ignored for SVG.
Scale int // Default: 1
// Theme controls the color scheme.
Theme ExportTheme
// IncludeLegend adds a color legend to the export.
IncludeLegend bool
// SessionName is included in the export metadata.
SessionName string
// IncludeMetadata adds session info to the export.
IncludeMetadata bool
}
ExportOptions configures the timeline export.
func DefaultExportOptions ¶
func DefaultExportOptions() ExportOptions
DefaultExportOptions returns sensible defaults for export.
type ExportTheme ¶
type ExportTheme struct {
BackgroundColor string
TextColor string
AxisColor string
IdleColor string
WorkingColor string
WaitingColor string
ErrorColor string
StoppedColor string
ClaudeColor string
CodexColor string
GeminiColor string
}
ExportTheme defines colors for different timeline states.
func DefaultTheme ¶
func DefaultTheme() ExportTheme
DefaultTheme returns the default color theme matching the TUI.
func LightTheme ¶
func LightTheme() ExportTheme
LightTheme returns a light color theme suitable for print/docs.
type TimelineExporter ¶
type TimelineExporter struct {
// contains filtered or unexported fields
}
TimelineExporter handles exporting timeline events to various formats.
func NewTimelineExporter ¶
func NewTimelineExporter(opts ExportOptions) *TimelineExporter
NewTimelineExporter creates a new exporter with the given options.
func (*TimelineExporter) ExportPNG ¶
func (e *TimelineExporter) ExportPNG(events []state.AgentEvent) ([]byte, error)
ExportPNG exports timeline events to PNG format.
func (*TimelineExporter) ExportSVG ¶
func (e *TimelineExporter) ExportSVG(events []state.AgentEvent) ([]byte, error)
ExportSVG exports timeline events to SVG format.