grob

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalTrace

func UnmarshalTrace(json.RawMessage) (types.Trace, error)

Types

type Bar

type Bar struct {
	Type types.TraceType `json:"type"`
}

func (*Bar) GetType

func (b *Bar) GetType() types.TraceType

type Config

type Config struct{}

type Fig

type Fig struct {
	// Data The data to be plotted is described in an array usually called data, whose elements are trace objects of various types (e.g. scatter, bar etc) as documented in the Full Reference.
	// https://plotly.com/javascript/reference
	Data []types.Trace `json:"data,omitempty"`

	// Layout The layout of the plot – non-data-related visual attributes such as the title, annotations etc – is described in an object usually called layout, as documented in/ the Full Reference.
	// https://plotly.com/javascript/reference/layout
	Layout *Layout `json:"layout,omitempty"`

	// Config High-level configuration options for the plot, such as the scroll/zoom/hover behaviour, is described in an object usually called config, as documented here. The difference between config and layout is that layout relates to the content of the plot, whereas config relates to the context in which the plot is being shown.
	// https://plotly.com/javascript/configuration-options
	Config *Config `json:"config,omitempty"`

	// Animation is not yet implemented, feel free to insert custom a struct
	Animation interface{} `json:"animation,omitempty"`

	// Frames are the animation frames
	Frames interface{} `json:"frames,omitempty"`
}

Fig is the base type for figures.

func (*Fig) AddTraces

func (fig *Fig) AddTraces(traces ...types.Trace)

AddTraces Is a shorthand to add figures to a given figure. It handles the case where the Traces value is nil.

func (*Fig) Info

func (fig *Fig) Info() types.Version

func (*Fig) UnmarshalJSON

func (fig *Fig) UnmarshalJSON(data []byte) error

UnmarshalJSON is a custom unmarshal function to properly handle special cases.

type Layout

type Layout struct{}

Jump to

Keyboard shortcuts

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