Documentation
¶
Overview ¶
package viz defines common interfaces and data structures for generating visualizations.
Package viz provides plotting and diagramming utilities.
Index ¶
- type Bar
- type Binding
- type BoundElement
- type DataPoint
- type DataSeries
- type DotGenerator
- type DotTraceGenerator
- type ExcalidrawElement
- type ExcalidrawFile
- type ExcalidrawGenerator
- type ExcalidrawScene
- type GridLine
- type LegendItem
- type MermaidSequenceGenerator
- type MermaidStaticGenerator
- type MultiSeriesPlotData
- type PlotConfig
- type PlotMetadata
- type PlotType
- type Plotter
- type SVGPlotter
- type SequenceDiagramGenerator
- type SeriesPath
- type StaticDiagramGenerator
- type SvgGenerator
- type TemplateData
- type XTick
- type YAxisMode
- type YTick
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundElement ¶
type BoundElement struct{ Type, ID string }
type DataPoint ¶
type DataPoint struct { X int64 // Typically Unix timestamp in milliseconds Y float64 // The value (e.g., latency, count) }
DataPoint represents a single plot point for time-series charts.
type DataSeries ¶
DataSeries represents a single named series of data points.
type DotGenerator ¶
type DotGenerator struct{}
func (*DotGenerator) Generate ¶
func (g *DotGenerator) Generate(diagram *protos.SystemDiagram) (string, error)
type DotTraceGenerator ¶
type DotTraceGenerator struct{}
DotTraceGenerator generates a DOT graph from a trace.
type ExcalidrawElement ¶
type ExcalidrawElement struct { ID string `json:"id"` Type string `json:"type"` X float64 `json:"x"` Y float64 `json:"y"` Width float64 `json:"width"` Height float64 `json:"height"` Angle float64 `json:"angle,omitempty"` StrokeColor string `json:"strokeColor"` BackgroundColor string `json:"backgroundColor"` FillStyle string `json:"fillStyle"` StrokeWidth int `json:"strokeWidth"` StrokeStyle string `json:"strokeStyle"` Roughness int `json:"roughness"` Opacity int `json:"opacity"` Seed int64 `json:"seed"` Version int `json:"version"` VersionNonce int64 `json:"versionNonce"` IsDeleted bool `json:"isDeleted,omitempty"` BoundElements []*BoundElement `json:"boundElements,omitempty"` StartBinding *Binding `json:"startBinding,omitempty"` EndBinding *Binding `json:"endBinding,omitempty"` Points [][]float64 `json:"points,omitempty"` Text string `json:"text,omitempty"` FontSize float64 `json:"fontSize,omitempty"` FontFamily int `json:"fontFamily,omitempty"` TextAlign string `json:"textAlign,omitempty"` VerticalAlign string `json:"verticalAlign,omitempty"` Baseline int `json:"baseline,omitempty"` ContainerId *string `json:"containerId,omitempty"` OriginalText string `json:"originalText,omitempty"` StrokeSharpness string `json:"strokeSharpness,omitempty"` StartArrowhead *string `json:"startArrowhead,omitempty"` EndArrowhead *string `json:"endArrowhead,omitempty"` }
type ExcalidrawFile ¶
type ExcalidrawGenerator ¶
type ExcalidrawGenerator struct{}
func (*ExcalidrawGenerator) Generate ¶
func (g *ExcalidrawGenerator) Generate(diagram *protos.SystemDiagram) (string, error)
type ExcalidrawScene ¶
type ExcalidrawScene struct {
// contains filtered or unexported fields
}
type LegendItem ¶
type MermaidSequenceGenerator ¶
type MermaidSequenceGenerator struct{}
MermaidSequenceGenerator generates Mermaid sequence diagrams from a trace.
type MermaidStaticGenerator ¶
type MermaidStaticGenerator struct{}
func (*MermaidStaticGenerator) Generate ¶
func (g *MermaidStaticGenerator) Generate(diagram *protos.SystemDiagram) (string, error)
type MultiSeriesPlotData ¶
type MultiSeriesPlotData struct { Series []DataSeries Metadata PlotMetadata }
MultiSeriesPlotData represents a complete dataset for a multi-series plot.
type PlotConfig ¶
type PlotConfig struct { Width int Height int MarginTop int MarginRight int MarginBottom int MarginLeft int GridColor string TextColor string YAxisMode YAxisMode // Y-axis scaling mode Colors []string // Palette for multi-series plots PlotType PlotType }
PlotConfig holds styling and dimension configuration.
func DefaultPlotConfig ¶
func DefaultPlotConfig() PlotConfig
DefaultPlotConfig returns sensible defaults.
type PlotMetadata ¶
type PlotMetadata struct { XLabel string `json:"xLabel,omitempty"` YLabel string `json:"yLabel,omitempty"` Title string `json:"title,omitempty"` }
PlotMetadata contains chart labels and title.
type Plotter ¶
type Plotter interface {
Generate(series []DataSeries, title, xLabel, yLabel string) (string, error)
}
Plotter defines the interface for creating plots and charts.
type SVGPlotter ¶
type SVGPlotter struct {
// contains filtered or unexported fields
}
SVGPlotter implements the Plotter interface to generate SVG charts.
func NewSVGPlotter ¶
func NewSVGPlotter(config PlotConfig) *SVGPlotter
func (*SVGPlotter) Generate ¶
func (p *SVGPlotter) Generate(series []DataSeries, title, xLabel, yLabel string) (string, error)
Generate creates an SVG string from a multi-series dataset.
type SequenceDiagramGenerator ¶
SequenceDiagramGenerator defines the interface for creating dynamic sequence diagrams from a trace.
type SeriesPath ¶
type SeriesPath struct{ Path, Color string }
type StaticDiagramGenerator ¶
type StaticDiagramGenerator interface {
Generate(diagram *protos.SystemDiagram) (string, error)
}
StaticDiagramGenerator defines the interface for creating static architecture diagrams.
type SvgGenerator ¶
type SvgGenerator struct{}
func (*SvgGenerator) Generate ¶
func (g *SvgGenerator) Generate(diagram *protos.SystemDiagram) (string, error)
type TemplateData ¶
type TemplateData struct { Config PlotConfig Metadata PlotMetadata InnerWidth int InnerHeight int XTicks []XTick YTicks []YTick GridLines []GridLine SeriesPaths []SeriesPath Bars []Bar LegendItems []LegendItem }
TemplateData contains all data needed for SVG template rendering.