Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalTrace ¶
func UnmarshalTrace(json.RawMessage) (types.Trace, error)
Types ¶
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 *Animation `json:"animation,omitempty"` // Frames are the animation frames Frames []Frame `json:"frames,omitempty"` }
Fig is the base type for figures.
func (*Fig) AddTraces ¶
AddTraces Is a shorthand to add figures to a given figure. It handles the case where the Traces value is nil.
func (*Fig) UnmarshalJSON ¶
UnmarshalJSON is a custom unmarshal function to properly handle special cases.
type Frame ¶ added in v0.7.0
type Frame struct { // Baseframe // The name of the frame into which this frame's properties are merged before applying. This is used to unify properties and avoid needing to specify the same values for the same properties in multiple frames. Baseframe types.StringType `json:"baseframe,omitempty"` // Data // A list of traces this frame modifies. The format is identical to the normal trace definition. Data []types.Trace `json:"data,omitempty"` // Group // An identifier that specifies the group to which the frame belongs, used by animate to select a subset of frames. Group types.StringType `json:"group,omitempty"` // Layout // Layout properties which this frame modifies. The format is identical to the normal layout definition. Layout *Layout `json:"layout,omitempty"` // Name // A label by which to identify the frame Name types.StringType `json:"name,omitempty"` // Traces // A list of trace indices that identify the respective traces in the data attribute Traces []int `json:"traces,omitempty"` }
Frame
Click to show internal directories.
Click to hide internal directories.