table

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

View Source
const PluginKind = "Table"

Variables

This section is empty.

Functions

func Table

func Table(options ...Option) panel.Option

Types

type Align

type Align string
const (
	LeftAlign   Align = "left"
	CenterAlign Align = "center"
	RightAlign  Align = "right"
)

type Builder

type Builder struct {
	PluginSpec `json:",inline" yaml:",inline"`
}

type CellSettings

type CellSettings struct {
	Condition       Condition `json:"condition" yaml:"condition"`
	Text            string    `json:"text,omitempty" yaml:"text,omitempty"`
	TextColor       string    `json:"textColor,omitempty" yaml:"textColor,omitempty"`
	BackgroundColor string    `json:"backgroundColor,omitempty" yaml:"backgroundColor,omitempty"`
}

type ColumnSettings

type ColumnSettings struct {
	Name              string         `json:"name" yaml:"name"`
	Header            string         `json:"header,omitempty" yaml:"header,omitempty"`
	HeaderDescription string         `json:"headerDescription,omitempty" yaml:"headerDescription,omitempty"`
	CellDescription   string         `json:"cellDescription,omitempty" yaml:"cellDescription,omitempty"`
	Format            *common.Format `json:"format,omitempty" yaml:"format,omitempty"`
	Align             Align          `json:"align,omitempty" yaml:"align,omitempty"`
	EnableSorting     bool           `json:"enableSorting,omitempty" yaml:"enableSorting,omitempty"`
	Sort              Sort           `json:"sort,omitempty" yaml:"sort,omitempty"`
	Width             float64        `json:"width,omitempty" yaml:"width,omitempty"`
	Hide              bool           `json:"hide,omitempty" yaml:"hide,omitempty"`
}

type Condition

type Condition struct {
	Kind ConditionKind `json:"kind" yaml:"kind"`
	Spec interface{}   `json:"spec" yaml:"spec"`
}

func (*Condition) UnmarshalJSON

func (c *Condition) UnmarshalJSON(data []byte) error

func (*Condition) UnmarshalYAML

func (c *Condition) UnmarshalYAML(unmarshal func(interface{}) error) error

type ConditionKind

type ConditionKind string
const (
	ValueConditionKind ConditionKind = "Value"
	RangeConditionKind ConditionKind = "Range"
	RegexConditionKind ConditionKind = "Regex"
	MiscConditionKind  ConditionKind = "Misc"
)

type Density

type Density string
const (
	CompactDensity  Density = "auto"
	StandardDensity Density = "always"
)

type MiscConditionSpec

type MiscConditionSpec struct {
	Value MiscValue `json:"value" yaml:"value"`
}

type MiscValue

type MiscValue string
var (
	EmptyValue MiscValue = "empty"
	NullValue  MiscValue = "null"
	NaNValue   MiscValue = "NaN"
	TrueValue  MiscValue = "true"
	FalseValue MiscValue = "false"
)

type Option

type Option func(plugin *Builder) error

func Transform

func Transform(transforms []common.Transform) Option

func WithCellSettings

func WithCellSettings(settings []CellSettings) Option

func WithColumnSettings

func WithColumnSettings(settings []ColumnSettings) Option

func WithDensity

func WithDensity(density Density) Option

type PluginSpec

type PluginSpec struct {
	Density        Density            `json:"density,omitempty" yaml:"density,omitempty"`
	ColumnSettings []ColumnSettings   `json:"columnSettings,omitempty" yaml:"columnSettings,omitempty"`
	CellSettings   []CellSettings     `json:"cellSettings,omitempty" yaml:"cellSettings,omitempty"`
	Transforms     []common.Transform `json:"transforms,omitempty" yaml:"transforms,omitempty"`
}

type RangeConditionSpec

type RangeConditionSpec struct {
	Min float64 `json:"min,omitempty" yaml:"min,omitempty"`
	Max float64 `json:"max,omitempty" yaml:"max,omitempty"`
}

type RegexConditionSpec

type RegexConditionSpec struct {
	Expr string `json:"expr" yaml:"expr"`
}

type Sort added in v0.6.1

type Sort string
const (
	AscSort  Sort = "asc"
	DescSort Sort = "desc"
)

type ValueConditionSpec

type ValueConditionSpec struct {
	Value string `json:"value" yaml:"value"`
}

Jump to

Keyboard shortcuts

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