cropgraph

package module
v0.0.0-...-aaeb6b0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Unlicense Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsFloat

func AsFloat(value interface{}) float64

func Bar3D

func Bar3D(keys []int, dates []string, graphStyle graphStyle, columns []string, values [][]interface{}) *charts.Bar3D

func BatchFileToGraph

func BatchFileToGraph(batchFile string, configFile string) error

func GenerateGraph

func GenerateGraph(page *components.Page, graphType GraphDefinition, theme, dateformat string, values [][]interface{}) *components.Page

graph generation

func HandleColumnViewOperation

func HandleColumnViewOperation(operationDefinition OperationDefinition, columnValues [][]interface{}) []interface{}

func HermesCsvToGraph

func HermesCsvToGraph(inputFile string, config *Config, outputFile string) error

HermesCsvToGraph reads the hermes simulation output file and generates graphs as defined in the config file

func MakePage

func MakePage() *components.Page

MakePage creates a new web page

func MultiFileToGraph

func MultiFileToGraph(inputFiles []string, config *Config, outputFile string) error

func MultiplyColumnValues

func MultiplyColumnValues(columnValues []interface{}, factor float64) []interface{}

func ReadFileData

func ReadFileData(inputFile string, config Config) (map[string][]interface{}, map[string]int, error)

func SavePage

func SavePage(page *components.Page, outfile string) error

SavePage saves the web page to a file

func WriteDefaultConfigFile

func WriteDefaultConfigFile(configFile string) error

write default config file

Types

type Config

type Config struct {
	// type of input file
	InputType string
	// number of header lines in the input file
	NumHeader int
	// date format of the input file
	DateFormat string `yaml:",omitempty"`
	// delimiter of the input file (e.g. tab, comma, space)
	Delimiter string
	// theme of the graph
	Theme string `yaml:",omitempty"`
	// selected names of the columns
	ColumnToGraph map[string]GraphDefinition
	// multiple files to be plotted
	MultiFiles bool `yaml:",omitempty"`
}

func ReadConfigFile

func ReadConfigFile(configFile string) (*Config, error)

type GraphDefinition

type GraphDefinition struct {
	// type of the graph
	GraphType string
	// title of the graph
	Title string
	// names of the columns to be plotted
	Columns []string
	// name of Date column
	DateColumn string
	// operation to be applied to the columns
	ColumnView []OperationDefinition `yaml:",omitempty"`
}

type OperationDefinition

type OperationDefinition struct {
	// type of the operation
	// OperationType string
	Operation string
	// name of the column to be operated
	Name string
	// multiply factor
	Multiply float64 `yaml:",omitempty"`
	// names of the columns to affected by the operation
	Columns []string
	// operation parameters
	Parameters map[string]interface{} `yaml:",omitempty"`
}

Jump to

Keyboard shortcuts

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