viz

package
v0.0.0-...-b9ed496 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Overview

Package viz contains code for displaying data visualizations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAndUploadFeatureImage

func GenerateAndUploadFeatureImage(ctx context.Context, id, title, chartHTML string, data []*DataEntry, isCurrency bool) (string, error)

func GenerateBarChartHTML

func GenerateBarChartHTML(title string, data []*DataEntry, isCurrency, darkMode bool, options ...ChartOption) (string, error)

GenerateBarChartHTML generates an bare HTML file containing only styles, fonts and.

func GenerateBarChartJS

func GenerateBarChartJS(selector, title string, data []*DataEntry, isCurrency bool, options ...ChartOption) (string, error)

func GenerateLineChartHTML

func GenerateLineChartHTML(title string, data []*DataEntry, isCurrency, darkMode bool, options ...ChartOption) (string, error)

GenerateLineChartHTML generates an bare HTML file containing only styles, fonts and.

func GenerateLineChartJS

func GenerateLineChartJS(selector, title string, data []*DataEntry, isCurrency bool, options ...ChartOption) (string, error)

func GeneratePieChartHTML

func GeneratePieChartHTML(title string, data []*DataEntry, isCurrency, darkMode bool, options ...ChartOption) (string, error)

GeneratePieChartHTML generates an bare HTML file containing only styles, fonts and.

func GeneratePieChartJS

func GeneratePieChartJS(selector, title string, data []*DataEntry, isCurrency bool, options ...ChartOption) (string, error)

func GenerateStackedBarChartJS

func GenerateStackedBarChartJS(selector, title string, data []*DataEntry, isCurrency bool, options ...ChartOption) (string, error)

func RenderBody

func RenderBody(question, schemaThoughts, analysis, sqlQuery string) string

func RenderGraphJS

func RenderGraphJS(chartJS string) string

func ScreenshotHTML

func ScreenshotHTML(ctx context.Context, srcHTML string, options ...ScreenshotOption) ([]byte, error)

Types

type ChartOption

type ChartOption func(*ChartOptions)

func WithBreakpointWidth

func WithBreakpointWidth() ChartOption

func WithFixedHeight

func WithFixedHeight(height int) ChartOption

func WithFixedWidth

func WithFixedWidth(width int) ChartOption

type ChartOptions

type ChartOptions struct {
	BaseWidthJS  string
	BaseHeightJS string
	Theme        string
}

type DataEntry

type DataEntry struct {
	Name  string
	Date  int
	Value float64
}

type ScreenshotOption

type ScreenshotOption func(*ScreenshotOptions)

func WithHeight

func WithHeight(height float64) ScreenshotOption

func WithScale

func WithScale(scale float64) ScreenshotOption

func WithWaitForSelector

func WithWaitForSelector(selector string) ScreenshotOption

func WithWidth

func WithWidth(width float64) ScreenshotOption

type ScreenshotOptions

type ScreenshotOptions struct {
	Width, Height, Scale float64
	WaitForSelectors     []string
}

Jump to

Keyboard shortcuts

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