canvas

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const PluginKind = "Canvas"

Variables

This section is empty.

Functions

func Chart

func Chart(options ...Option) panel.Option

Types

type AnchorPoint

type AnchorPoint string
const (
	AnchorN  AnchorPoint = "n"
	AnchorS  AnchorPoint = "s"
	AnchorE  AnchorPoint = "e"
	AnchorW  AnchorPoint = "w"
	AnchorNW AnchorPoint = "nw"
	AnchorNE AnchorPoint = "ne"
	AnchorSW AnchorPoint = "sw"
	AnchorSE AnchorPoint = "se"
)

type BackgroundSpec

type BackgroundSpec struct {
	ID       string   `json:"id" yaml:"id"`
	Name     string   `json:"name,omitempty" yaml:"name,omitempty"`
	Position Point    `json:"position" yaml:"position"`
	Width    float64  `json:"width" yaml:"width"`
	Height   float64  `json:"height" yaml:"height"`
	Color    string   `json:"color,omitempty" yaml:"color,omitempty"`
	Opacity  *float64 `json:"opacity,omitempty" yaml:"opacity,omitempty"`
	Image    string   `json:"image,omitempty" yaml:"image,omitempty"`
	ImageFit ImageFit `json:"imageFit,omitempty" yaml:"imageFit,omitempty"`
	Global   bool     `json:"global,omitempty" yaml:"global,omitempty"`
}

type Builder

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

type ColorMode

type ColorMode string
const (
	ThresholdColorMode ColorMode = "threshold"
	FixedColorMode     ColorMode = "fixed"
)

type EdgeSpec

type EdgeSpec struct {
	ID                  string        `json:"id" yaml:"id"`
	Name                string        `json:"name,omitempty" yaml:"name,omitempty"`
	Source              string        `json:"source" yaml:"source"`
	Target              *string       `json:"target,omitempty" yaml:"target,omitempty"`
	SourceAnchor        AnchorPoint   `json:"sourceAnchor,omitempty" yaml:"sourceAnchor,omitempty"`
	TargetAnchor        AnchorPoint   `json:"targetAnchor,omitempty" yaml:"targetAnchor,omitempty"`
	FreeEndpoint        *Point        `json:"freeEndpoint,omitempty" yaml:"freeEndpoint,omitempty"`
	Bidirectional       bool          `json:"bidirectional,omitempty" yaml:"bidirectional,omitempty"`
	ThicknessMode       ThicknessMode `json:"thicknessMode,omitempty" yaml:"thicknessMode,omitempty"`
	StrokeWidth         *float64      `json:"strokeWidth,omitempty" yaml:"strokeWidth,omitempty"`
	SourceQueryIndex    *uint         `json:"sourceQueryIndex,omitempty" yaml:"sourceQueryIndex,omitempty"`
	TargetQueryIndex    *uint         `json:"targetQueryIndex,omitempty" yaml:"targetQueryIndex,omitempty"`
	SourceLabelTemplate string        `json:"sourceLabelTemplate,omitempty" yaml:"sourceLabelTemplate,omitempty"`
	TargetLabelTemplate string        `json:"targetLabelTemplate,omitempty" yaml:"targetLabelTemplate,omitempty"`
}

type EdgeThresholdStep

type EdgeThresholdStep struct {
	Value       float64 `json:"value" yaml:"value"`
	StrokeWidth float64 `json:"strokeWidth" yaml:"strokeWidth"`
}

type ImageFit

type ImageFit string
const (
	CoverImageFit   ImageFit = "cover"
	ContainImageFit ImageFit = "contain"
	StretchImageFit ImageFit = "stretch"
)

type LabelPosition

type LabelPosition string
const (
	AbovePosition  LabelPosition = "above"
	BelowPosition  LabelPosition = "below"
	LeftPosition   LabelPosition = "left"
	RightPosition  LabelPosition = "right"
	CenterPosition LabelPosition = "center"
)

type NodeKind

type NodeKind string
const (
	RectangleKind NodeKind = "rectangle"
	IconKind      NodeKind = "icon"
	TextKind      NodeKind = "text"
)

type NodeSpec

type NodeSpec struct {
	ID              string        `json:"id" yaml:"id"`
	Position        Point         `json:"position" yaml:"position"`
	Width           float64       `json:"width" yaml:"width"`
	Height          float64       `json:"height" yaml:"height"`
	Kind            NodeKind      `json:"kind" yaml:"kind"`
	Label           string        `json:"label,omitempty" yaml:"label,omitempty"`
	LabelPosition   LabelPosition `json:"labelPosition,omitempty" yaml:"labelPosition,omitempty"`
	LabelPadding    float64       `json:"labelPadding,omitempty" yaml:"labelPadding,omitempty"`
	Icon            string        `json:"icon,omitempty" yaml:"icon,omitempty"`
	URL             string        `json:"url,omitempty" yaml:"url,omitempty"`
	Background      string        `json:"background,omitempty" yaml:"background,omitempty"`
	BackgroundImage string        `json:"backgroundImage,omitempty" yaml:"backgroundImage,omitempty"`
	QueryIndex      *uint         `json:"queryIndex,omitempty" yaml:"queryIndex,omitempty"`
	ColorMode       ColorMode     `json:"colorMode,omitempty" yaml:"colorMode,omitempty"`
	// Color is a hex color string (e.g. "#ff0000").
	Color string `json:"color,omitempty" yaml:"color,omitempty"`
}

type Option

type Option func(plugin *Builder) error

type PluginSpec

type PluginSpec struct {
	Thresholds             *common.Thresholds   `json:"thresholds,omitempty" yaml:"thresholds,omitempty"`
	Format                 *common.Format       `json:"format,omitempty" yaml:"format,omitempty"`
	EdgeThresholdWidths    []EdgeThresholdStep  `json:"edgeThresholdWidths,omitempty" yaml:"edgeThresholdWidths,omitempty"`
	EdgeDefaultStrokeWidth *float64             `json:"edgeDefaultStrokeWidth,omitempty" yaml:"edgeDefaultStrokeWidth,omitempty"`
	QuerySettings          []QueryColorSettings `json:"querySettings,omitempty" yaml:"querySettings,omitempty"`
	Backgrounds            []BackgroundSpec     `json:"backgrounds,omitempty" yaml:"backgrounds,omitempty"`
	Nodes                  []NodeSpec           `json:"nodes,omitempty" yaml:"nodes,omitempty"`
	Edges                  []EdgeSpec           `json:"edges,omitempty" yaml:"edges,omitempty"`
}

type Point

type Point struct {
	X float64 `json:"x" yaml:"x"`
	Y float64 `json:"y" yaml:"y"`
}

type QueryColorSettings

type QueryColorSettings struct {
	QueryIndex uint      `json:"queryIndex" yaml:"queryIndex"`
	ColorMode  ColorMode `json:"colorMode" yaml:"colorMode"`
	ColorValue string    `json:"colorValue" yaml:"colorValue"`
}

type ThicknessMode

type ThicknessMode string
const (
	FixedThicknessMode     ThicknessMode = "fixed"
	ThresholdThicknessMode ThicknessMode = "threshold"
)

Jump to

Keyboard shortcuts

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