plot

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VeryLowRisk  uint = 10
	LowRisk      uint = 15
	MediumRisk   uint = 20
	HighRisk     uint = 25
	VeryHighRisk uint = 30
	CriticalRisk uint = 35
)
View Source
var HeightPx = 800

If choose picture height in px

View Source
var ScatterSymbolSize = 8
View Source
var WidthPx = 1200

If choose picture width in px

View Source
var WithLegend = true

If need to show legend in chart

View Source
var WithRisks = false

If need to devide risks into categories

View Source
var WithScroll = false

If need to show scroll in chart

View Source
var WithTooltip = true

If need to show tooltip in chart

Functions

func CreateScatterChart

func CreateScatterChart(entries []ScatterEntry, mapper EntryMapper, outputPath string) error

TODO: pass EntryMapper as parameter!

func ValidateRiskThresholds

func ValidateRiskThresholds() error

Need to make it more general TODO refactor

Types

type Category

type Category = string

type EntryMapper

type EntryMapper interface {
	Map(ScatterData) Category
	Style(Category) opts.ItemStyle
}

TODO: Maybe categorizer?

type NoopMapper

type NoopMapper struct{}

func (*NoopMapper) Map

func (rm *NoopMapper) Map(data ScatterData) Category

func (*NoopMapper) Style

func (rm *NoopMapper) Style(category Category) opts.ItemStyle

type RiskLevel

type RiskLevel struct {
	Name  string
	Color string
	Min   uint
	Max   uint
}

type RisksMapper

type RisksMapper struct {
	// contains filtered or unexported fields
}

func NewRisksMapper

func NewRisksMapper() *RisksMapper

func (*RisksMapper) Map

func (rm *RisksMapper) Map(data ScatterData) Category

func (*RisksMapper) Style

func (rm *RisksMapper) Style(category Category) opts.ItemStyle

type ScatterData

type ScatterData struct {
	Complexity float64
	Churn      uint
}

type ScatterEntry

type ScatterEntry struct {
	ScatterData
	File string
}

type ScatterSeries

type ScatterSeries map[Category][]opts.ScatterData

Jump to

Keyboard shortcuts

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