roadmap

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 4 Imported by: 4

Documentation

Overview

roadmap provides data for generating roadmaps

roadmap provides data for generating roadmaps

roadmap provides data for generating roadmaps

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QuarterInt32sBeginEnd

func QuarterInt32sBeginEnd(begin, end int32) (int32, int32)

QuarterInt32sBeginEnd converts relative and default quarter times to absolute int32 quarter numbers.

Types

type Canvas

type Canvas struct {
	MinTime time.Time
	MaxTime time.Time
	MinX    int64 // time
	MaxX    int64 // time
	MaxY    int64
	MinY    int64
	MinCell int32
	MaxCell int32
	Range   mathutil.RangeInt64
	Items   []Item
	Rows    [][]Item
}

func GetCanvasQuarter

func GetCanvasQuarter(start, end int32) (Canvas, error)
type Item struct {
	MinTime time.Time
	MaxTime time.Time
	MinCell int32 // Inflated by Canvas
	MaxCell int32 // Inflated by Canvas
	Min     int64 // Inflated by Canvas
	Max     int64 // Inflated by Canvas
	Name    string
	URL     string
	Color   string
}
func (i *Item) SetMinMaxQuarter(qtrMin, qtrMax int32) error {
	if qtrMax < qtrMin {
		return fmt.Errorf("Max is < min: min [%v] max [%v]", qtrMin, qtrMax)
	}
	err := i.SetMinQuarter(qtrMin)
	if err != nil {
		return err
	}
	return i.SetMaxQuarter(qtrMax)
}
func (i *Item) SetMinQuarter(qtr int32) error {
	qt, err := tu.QuarterInt32StartTime(qtr)
	if err != nil {
		return err
	}
	i.MinTime = qt
	return nil
}
func (i *Item) SetMaxQuarter(qtr int32) error {
	qt, err := tu.QuarterInt32EndTime(qtr)
	if err != nil {
		return err
	}
	i.MaxTime = qt
	return nil
}

func (*Canvas) AddItem

func (can *Canvas) AddItem(item Item)

func (*Canvas) BuildRows

func (can *Canvas) BuildRows()

func (*Canvas) InflateItem

func (can *Canvas) InflateItem(item Item) (Item, error)

func (*Canvas) InflateItems

func (can *Canvas) InflateItems() error

func (*Canvas) SetMaxQuarter

func (can *Canvas) SetMaxQuarter(qtr int32) error

func (*Canvas) SetMinMaxQuarter

func (can *Canvas) SetMinMaxQuarter(qtrMin, qtrMax int32) error

func (*Canvas) SetMinQuarter

func (can *Canvas) SetMinQuarter(qtr int32) error

func (*Canvas) SetRangeCells

func (can *Canvas) SetRangeCells(cells int32)

type Feature

type Feature struct {
	Name      string
	URL       string
	StartTime time.Time
	EndTime   time.Time
	StartIdx  int32
	EndIdx    int32
}

func (*Feature) AddIndexes

func (f *Feature) AddIndexes(range64 mathutil.RangeInt64) error

func (*Feature) SortTimes

func (f *Feature) SortTimes()

type Initiative

type Initiative struct {
	Name     string
	Features []Feature
	Rows     [][]Feature // Array of array of non-overlapping features
}

func (*Initiative) BuildRows

func (init *Initiative) BuildRows(start, end time.Time, range64 mathutil.RangeInt64) ([][]Feature, error)

type Item

type Item struct {
	MinTime            time.Time
	MaxTime            time.Time
	MinCell            int32 // Inflated by Canvas
	MaxCell            int32 // Inflated by Canvas
	Min                int64 // Inflated by Canvas
	Max                int64 // Inflated by Canvas
	Name               string
	NameShort          string
	URL                string
	ForegroundColorHex string
	BackgroundColorHex string
}

func (*Item) SetMaxQuarter

func (i *Item) SetMaxQuarter(qtr int32) error

func (*Item) SetMinMaxQuarter

func (i *Item) SetMinMaxQuarter(qtrMin, qtrMax int32) error

func (*Item) SetMinQuarter

func (i *Item) SetMinQuarter(qtr int32) error

type Roadmap

type Roadmap struct {
	Initiatives     []Initiative
	ReportStartTime time.Time
	ReportEndTime   time.Time
	Cells           int32
	Range64         mathutil.RangeInt64
}

func NewRoadmap

func NewRoadmap(reportStartTime, reportEndTime time.Time, numCells int32) Roadmap

func (*Roadmap) Build

func (rm *Roadmap) Build() error

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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