Documentation ¶
Index ¶
- Variables
- func UnmarshalRole(obj json.RawMessage, role *Role) error
- type Attribute
- type ConfigAttributes
- type Creator
- type Defs
- type Layout
- type LayoutAttributes
- type Meta
- type MetaKey
- type Renderer
- func (r *Renderer) CreateConfig(dir string) error
- func (r *Renderer) CreateLayout(dir string) error
- func (r *Renderer) CreateTrace(dir string, name string) error
- func (r *Renderer) CreateTraces(dir string) error
- func (r *Renderer) CreateUnmarshal(dir string) error
- func (r *Renderer) WriteConfig(w io.Writer) error
- func (r *Renderer) WriteLayout(w io.Writer) error
- func (r *Renderer) WriteTrace(traceName string, w io.Writer) error
- func (r *Renderer) WriteUnmarshal(w io.Writer) error
- type Role
- type Root
- type Schema
- type Trace
- type TraceAttributes
- type Traces
- type ValObject
- type ValType
Constants ¶
This section is empty.
Variables ¶
var MetaKeys = []MetaKey{
"_isSubplotObj",
"_isLinkedToArray",
"_arrayAttrRegexps",
"_deprecated",
"description",
"role",
"editType",
"impliedEdits",
}
Functions ¶
func UnmarshalRole ¶
func UnmarshalRole(obj json.RawMessage, role *Role) error
Types ¶
type Attribute ¶
type Attribute struct { Role Role `json:"role,omitempty"` Description string `json:"description,omitempty"` EditType string `json:"editType,omitempty"` ValType ValType `json:"valType,omitempty"` Values []interface{} `json:"values,omitempty"` Flags []string `json:"flags,omitempty"` Extras []interface{} `json:"extras,omitempty"` Dflt interface{} `json:"dflt,omitempty"` Min json.Number `json:"min,omitempty"` Max json.Number `json:"max,omitempty"` ArrayOK bool `json:"arrayOk,omitempty"` Anim bool `json:"anim,omitempty"` Name string `json:"-"` Attributes map[string]*Attribute `json:"-"` Items map[string]*Attribute `json:"-"` Parent *Attribute `json:"-"` }
type ConfigAttributes ¶
func (*ConfigAttributes) UnmarshalJSON ¶
func (attr *ConfigAttributes) UnmarshalJSON(b []byte) error
type Creator ¶
type Creator interface {
Create(name string) (io.WriteCloser, error)
}
Creator provices the functionality to create a file
type Layout ¶
type Layout struct {
LayoutAttributes LayoutAttributes `json:"layoutAttributes,omitempty"`
}
type LayoutAttributes ¶
func (*LayoutAttributes) UnmarshalJSON ¶
func (attr *LayoutAttributes) UnmarshalJSON(b []byte) error
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer handles the process to render a Root to a Creator interface
func NewRenderer ¶
NewRenderer initializes a renderer
func (*Renderer) CreateConfig ¶
CreateConfig creates the config file in the given director
func (*Renderer) CreateLayout ¶
CreateLayout creates the layout file in the given directory
func (*Renderer) CreateTrace ¶
CreateTrace creates a file with the content of a trace by name
func (*Renderer) CreateTraces ¶
CreateTraces creates all traces in the given directory
func (*Renderer) CreateUnmarshal ¶
CreateUnmarshal creates the unmarshal file on the given directory
func (*Renderer) WriteConfig ¶
WriteConfig writes config to the given writer
func (*Renderer) WriteLayout ¶
WriteLayout writes layout to the given writer
func (*Renderer) WriteTrace ¶
WriteTrace writes a trace by name to a writer
type Root ¶
type Root struct { SHA1 string `json:"sha1,omitempty"` Modified bool `json:"modified,omitempty"` Schema *Schema `json:"schema,omitempty"` }
Root represents the root of the plotly schema It is basically the struct representation of the json schema content
type Schema ¶
type Schema struct { Defs *Defs `json:"defs,omitempty"` Traces Traces `json:"traces,omitempty"` Layout Layout `json:"layout,omitempty"` // Transforms *Transforms `json:"transforms,omitempty"` // Frames *Frames `json:"frames,omitempty"` // Animation *Animation `json:"animation,omitempty"` Config *ConfigAttributes `json:"config,omitempty"` }
type Trace ¶
type Trace struct { Meta *Meta `json:"meta,omitempty"` // Categories []string `json:"categories,omitempty"` Animatable bool `json:"animatable,omitempty"` Type string `json:"type,omitempty"` Attributes TraceAttributes `json:"attributes,omitempty"` LayoutAttributes LayoutAttributes `json:"layoutAttributes,omitempty"` }
type TraceAttributes ¶
func (*TraceAttributes) Sorted ¶
func (attr *TraceAttributes) Sorted() []string
func (*TraceAttributes) UnmarshalJSON ¶
func (attr *TraceAttributes) UnmarshalJSON(b []byte) error
type ValType ¶
type ValType string
const ( ValTypeDataArray ValType = "data_array" ValTypeEnum ValType = "enumerated" ValTypeBoolean ValType = "boolean" ValTypeNumber ValType = "number" ValTypeInteger ValType = "integer" ValTypeString ValType = "string" ValTypeColor ValType = "color" ValTypeColorlist ValType = "colorlist" ValTypeColorscale ValType = "colorscale" ValTypeAngle ValType = "angle" ValTypeSubplotID ValType = "subplotid" ValTypeFlagList ValType = "flaglist" ValTypeAny ValType = "any" ValTypeInfoArray ValType = "info_array" )