timeseries

package
v0.0.0-...-c898a9f Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ChartTmp = `` /* 2965-byte string literal not displayed */

Variables

This section is empty.

Functions

func DispFile

func DispFile(w http.ResponseWriter, r *http.Request)

Displays a paticular file in a folder

func ListFiles

func ListFiles(w http.ResponseWriter, r *http.Request)

Lists the Files in the current folder.

func StartServer

func StartServer()

Types

type HTML

type HTML struct {
	Title string
	Story string

	Charts []LineChart
}

func NewHTML

func NewHTML(title string, story string) (*HTML, error)

func (*HTML) Render

func (h *HTML) Render(outName string)

Render renders the chart based on the input parameters

type LineChart

type LineChart struct {
	Title string
	X     []string
	Y     []float64
	Index int
}

func Chart

func Chart(title string, t Timeseries, index int) LineChart

type Timeseries

type Timeseries map[time.Time]float64

FIXME: In future maybe this can be changed to time.Time but this is a good start

func New

func New() Timeseries

func ReadCSV

func ReadCSV(d []byte) (Timeseries, error)

func (Timeseries) Add

func (t Timeseries) Add(strTime string, pt float64) error

func (Timeseries) SortedCoordinates

func (t Timeseries) SortedCoordinates() ([]time.Time, []float64)

Jump to

Keyboard shortcuts

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