Documentation
¶
Index ¶
- Variables
- func GenerateSummary(datasets []*Dataset) string
- func GenerateTitle(datasets []*Dataset) string
- func ValidateStyle(style *StyleConfig) error
- type ChartRecommendation
- type ChartSelector
- type ChartType
- type DataPattern
- type Dataset
- type EChartsGenerator
- type Report
- type ReportGenerator
- type ReportMetadata
- type StyleConfig
- type StyleGuideClient
- type Visualization
- type VisualizationTool
- func (t *VisualizationTool) Backend() string
- func (t *VisualizationTool) Description() string
- func (t *VisualizationTool) Execute(ctx context.Context, params map[string]interface{}) (*shuttle.Result, error)
- func (t *VisualizationTool) InputSchema() *shuttle.JSONSchema
- func (t *VisualizationTool) Name() string
Constants ¶
This section is empty.
Variables ¶
var ErrStyleGuideRemoteNotImplemented = errors.New("styleguide: remote fetch not implemented")
ErrStyleGuideRemoteNotImplemented is returned when a non-empty StyleGuide endpoint is configured but the remote gRPC client is not implemented yet.
Functions ¶
func GenerateSummary ¶
GenerateSummary creates a summary from datasets
func GenerateTitle ¶
GenerateTitle creates a title from datasets
func ValidateStyle ¶
func ValidateStyle(style *StyleConfig) error
ValidateStyle validates a StyleConfig has all required fields
Types ¶
type ChartRecommendation ¶
type ChartRecommendation struct {
ChartType ChartType
Title string
Rationale string // Why this chart was recommended
Config map[string]interface{} // Chart-specific config
Confidence float64 // 0.0 to 1.0
}
ChartRecommendation represents a chart selection with confidence
type ChartSelector ¶
type ChartSelector struct {
// contains filtered or unexported fields
}
ChartSelector analyzes data and recommends appropriate chart types
func NewChartSelector ¶
func NewChartSelector(styleConfig *StyleConfig) *ChartSelector
NewChartSelector creates a new chart selector
func (*ChartSelector) AnalyzeDataset ¶
func (cs *ChartSelector) AnalyzeDataset(ds *Dataset) *DataPattern
AnalyzeDataset examines dataset structure and patterns
func (*ChartSelector) RecommendChart ¶
func (cs *ChartSelector) RecommendChart(ds *Dataset) *ChartRecommendation
RecommendChart analyzes a dataset and recommends the best chart type
func (*ChartSelector) RecommendChartsForDatasets ¶
func (cs *ChartSelector) RecommendChartsForDatasets(datasets []*Dataset) []*ChartRecommendation
RecommendChartsForDatasets recommends charts for multiple datasets
type ChartType ¶
type ChartType string
ChartType represents the type of visualization
const ( ChartTypeBar ChartType = "bar" ChartTypeLine ChartType = "line" ChartTypePie ChartType = "pie" ChartTypeScatter ChartType = "scatter" ChartTypeRadar ChartType = "radar" ChartTypeBoxPlot ChartType = "boxplot" ChartTypeTreeMap ChartType = "treemap" ChartTypeGraph ChartType = "graph" ChartTypeTimeSeries ChartType = "timeseries" )
type DataPattern ¶
type DataPattern struct {
HasRanking bool // Data can be ranked (frequency, score, etc.)
HasCategories bool // Data has categorical dimensions
HasTimeSeries bool // Data has temporal ordering
HasContinuous bool // Data has continuous distribution
HasArrayFields bool // Data has array/nested fields
HasRelations bool // Data has relationships/edges
Cardinality int // Number of unique items
DataPoints int // Total data points
NumericCols []string // Numeric column names
CategoryCols []string // Categorical column names
TimeCols []string // Time/date column names
}
DataPattern represents the structure/pattern of data
type Dataset ¶
type Dataset struct {
Name string // e.g., "top_50_patterns", "risk_distribution"
Data []map[string]interface{} // Array of data objects
Schema map[string]string // Column name → type mapping
Source string // e.g., "stage-9-npath-full-results"
RowCount int
Metadata map[string]interface{}
}
Dataset represents aggregated data from presentation tools
type EChartsGenerator ¶
type EChartsGenerator struct {
// contains filtered or unexported fields
}
EChartsGenerator generates ECharts configurations with Hawk StyleGuide
func NewEChartsGenerator ¶
func NewEChartsGenerator(style *StyleConfig) *EChartsGenerator
NewEChartsGenerator creates a new ECharts config generator
func (*EChartsGenerator) Generate ¶
func (eg *EChartsGenerator) Generate(ds *Dataset, rec *ChartRecommendation) (string, error)
Generate creates ECharts JSON configuration for a dataset and chart type
type Report ¶
type Report struct {
Title string `json:"title"`
Summary string `json:"summary"` // Executive summary
Visualizations []Visualization `json:"visualizations"`
GeneratedAt string `json:"generated_at"`
Metadata ReportMetadata `json:"metadata"`
}
Report represents a complete report with multiple visualizations
type ReportGenerator ¶
type ReportGenerator struct {
// contains filtered or unexported fields
}
ReportGenerator assembles complete HTML reports with embedded charts
func NewReportGenerator ¶
func NewReportGenerator(styleClient *StyleGuideClient) *ReportGenerator
NewReportGenerator creates a new report generator
func NewReportGeneratorWithStyle ¶
func NewReportGeneratorWithStyle(style *StyleConfig) *ReportGenerator
NewReportGeneratorWithStyle creates a report generator with custom style
func (*ReportGenerator) ExportHTML ¶
func (rg *ReportGenerator) ExportHTML(report *Report) (string, error)
ExportHTML generates self-contained HTML with embedded charts
func (*ReportGenerator) ExportJSON ¶
func (rg *ReportGenerator) ExportJSON(report *Report) (string, error)
ExportJSON exports report as JSON
func (*ReportGenerator) GenerateReport ¶
func (rg *ReportGenerator) GenerateReport(ctx context.Context, datasets []*Dataset, title, summary string) (*Report, error)
GenerateReport creates a complete report from datasets
type ReportMetadata ¶
type ReportMetadata struct {
DataSource string `json:"data_source"`
WorkflowID string `json:"workflow_id"`
AgentID string `json:"agent_id"`
RowsSource int `json:"rows_source"` // Original row count
RowsReduced int `json:"rows_reduced"` // Reduced row count
Reduction float64 `json:"reduction"` // Percentage reduction
Extra map[string]interface{} `json:"extra"`
}
ReportMetadata contains metadata about report generation
type StyleConfig ¶
type StyleConfig struct {
ColorPrimary string // Teradata Orange
ColorBackground string // Transparent or dark
ColorText string // Light text
ColorTextMuted string // Muted text
ColorBorder string // Border color
ColorGlass string // Glass morphism
ColorPalette []string // Color palette for series
FontFamily string // IBM Plex Mono
FontSizeTitle int // Title font size
FontSizeLabel int // Label font size
FontSizeTooltip int // Tooltip font size
AnimationDuration int // Animation duration in ms
AnimationEasing string // Easing function
ShadowBlur int // Shadow blur radius
GlowIntensity float64 // Glow intensity (0.0-1.0)
}
StyleConfig holds Hawk StyleGuide design tokens
func DefaultStyleConfig ¶
func DefaultStyleConfig() *StyleConfig
DefaultStyleConfig returns Hawk StyleGuide defaults
func GetThemeVariant ¶
func GetThemeVariant(variant string) *StyleConfig
GetThemeVariant returns a style config for a specific theme variant
func MergeStyles ¶
func MergeStyles(custom, defaults *StyleConfig) *StyleConfig
MergeStyles merges a custom style with defaults (custom overrides defaults)
type StyleGuideClient ¶
type StyleGuideClient struct {
// contains filtered or unexported fields
}
StyleGuideClient fetches styling from Hawk StyleGuide service.
func NewStyleGuideClient ¶
func NewStyleGuideClient(endpoint string) *StyleGuideClient
NewStyleGuideClient creates a new StyleGuide client. It uses the global zap.Logger for any fallback warnings; call StyleGuideClient.WithLogger to inject a specific logger.
func (*StyleGuideClient) FetchStyle ¶
func (sgc *StyleGuideClient) FetchStyle(ctx context.Context, theme string) (*StyleConfig, error)
FetchStyle retrieves the current style configuration from Hawk. It respects ctx cancellation: if ctx is done, it returns ctx.Err(). An empty endpoint returns default styling without calling the network. A non-empty endpoint returns ErrStyleGuideRemoteNotImplemented until the gRPC client exists. The theme argument is reserved for the future RPC; it is not used until that client is implemented.
func (*StyleGuideClient) FetchStyleWithFallback ¶
func (sgc *StyleGuideClient) FetchStyleWithFallback(ctx context.Context, theme string) *StyleConfig
FetchStyleWithFallback calls StyleGuideClient.FetchStyle and returns DefaultStyleConfig on any error, including context cancellation, ErrStyleGuideRemoteNotImplemented when the endpoint is non-empty but the remote client is not implemented yet, and future RPC failures. It logs the error with the configured zap.Logger (see StyleGuideClient.WithLogger). Callers that need to detect misconfiguration, respect cancellation, or surface errors to users should use FetchStyle instead.
func (*StyleGuideClient) WithLogger ¶ added in v1.3.0
func (sgc *StyleGuideClient) WithLogger(logger *zap.Logger) *StyleGuideClient
WithLogger sets the structured logger used by StyleGuideClient.FetchStyleWithFallback. A nil logger is replaced by zap.NewNop so the client never panics on write. The receiver is returned for chaining.
type Visualization ¶
type Visualization struct {
Type ChartType `json:"type"`
Title string `json:"title"`
Description string `json:"description"`
EChartsConfig string `json:"echarts_config"` // JSON string
Insight string `json:"insight"` // AI-generated caption
DataPoints int `json:"data_points"`
Metadata map[string]interface{} `json:"metadata"`
}
Visualization represents a single chart with embedded data
type VisualizationTool ¶
type VisualizationTool struct {
// contains filtered or unexported fields
}
VisualizationTool provides visualization capabilities for agents
func NewVisualizationTool ¶
func NewVisualizationTool() *VisualizationTool
NewVisualizationTool creates a new visualization tool
func (*VisualizationTool) Backend ¶
func (t *VisualizationTool) Backend() string
func (*VisualizationTool) Description ¶
func (t *VisualizationTool) Description() string
func (*VisualizationTool) InputSchema ¶
func (t *VisualizationTool) InputSchema() *shuttle.JSONSchema
func (*VisualizationTool) Name ¶
func (t *VisualizationTool) Name() string