Documentation ¶
Index ¶
- Variables
- func DownloadSchema(version string, schemaURL string, outputpath string) (string, error)
- func UnmarshalRole(obj json.RawMessage, role *Role) error
- type AnimationAttributes
- type Attribute
- type ConfigAttributes
- type Creator
- type Defs
- type Frames
- type Layout
- type LayoutAttributes
- type Meta
- type MetaKey
- type Renderer
- func (r *Renderer) CreateAnimation(dir string) error
- func (r *Renderer) CreateConfig(dir string) error
- func (r *Renderer) CreateFrames(dir string) error
- func (r *Renderer) CreateLayout(dir string) error
- func (r *Renderer) CreatePlotly(dir string, version Version) 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) CreateUnmarshalTests(dir string) error
- func (r *Renderer) WriteAnimation(w io.Writer) error
- func (r *Renderer) WriteConfig(w io.Writer) error
- func (r *Renderer) WriteFrames(w io.Writer) error
- func (r *Renderer) WriteLayout(w io.Writer) error
- func (r *Renderer) WritePlotGo(w io.Writer, graphObjectsImportPath string, cdnUrl string) error
- func (r *Renderer) WritePlotly(w io.Writer, version Version) error
- func (r *Renderer) WriteTrace(traceName string, w io.Writer) error
- func (r *Renderer) WriteUnmarshal(w io.Writer) error
- func (r *Renderer) WriteUnmarshalTests(w io.Writer) error
- type Role
- type Root
- type Schema
- type Schemas
- type Trace
- type TraceAttributes
- type Traces
- type ValObject
- type ValType
- type Version
Constants ¶
This section is empty.
Variables ¶
var MetaKeys = []MetaKey{
"_isSubplotObj",
"_isLinkedToArray",
"_arrayAttrRegexps",
"_deprecated",
"description",
"role",
"editType",
"impliedEdits",
}
Functions ¶
func DownloadSchema ¶ added in v0.6.0
DownloadSchema gets the schema file for a given version, and either saves the raw content, or prepares the file for the generator if prep is set to true
func UnmarshalRole ¶
func UnmarshalRole(obj json.RawMessage, role *Role) error
Types ¶
type AnimationAttributes ¶ added in v0.7.0
func (*AnimationAttributes) UnmarshalJSON ¶ added in v0.7.0
func (attr *AnimationAttributes) UnmarshalJSON(b []byte) error
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 provides the functionality to create a file
type Frames ¶ added in v0.7.0
type Frames struct {
Attribute *Attribute `json:"-"`
}
func (*Frames) UnmarshalJSON ¶ added in v0.7.0
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) CreateAnimation ¶ added in v0.7.0
CreateAnimation creates the config file in the given director
func (*Renderer) CreateConfig ¶
CreateConfig creates the config file in the given director
func (*Renderer) CreateFrames ¶ added in v0.7.0
CreateFrames creates the config file in the given director
func (*Renderer) CreateLayout ¶
CreateLayout creates the layout file in the given directory
func (*Renderer) CreatePlotly ¶ added in v0.5.0
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) CreateUnmarshalTests ¶ added in v0.6.0
CreateUnmarshalTests creates the unmarshal file on the given directory
func (*Renderer) WriteAnimation ¶ added in v0.7.0
WriteAnimation writes config to the given writer
func (*Renderer) WriteConfig ¶
WriteConfig writes config to the given writer
func (*Renderer) WriteFrames ¶ added in v0.7.0
WriteFrames writes config to the given writer
func (*Renderer) WriteLayout ¶
WriteLayout writes layout to the given writer
func (*Renderer) WritePlotGo ¶ added in v0.6.0
WritePlotly writes the base plotly file
func (*Renderer) WritePlotly ¶ added in v0.5.0
WritePlotly writes the base plotly file
func (*Renderer) WriteTrace ¶
WriteTrace writes a trace by name to a writer
func (*Renderer) WriteUnmarshal ¶
WriteUnmarshal writes unmarshal to the given 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 *AnimationAttributes `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" )
type Version ¶ added in v0.6.0
type Version struct { Name string `yaml:"Name"` // name of the version Tag string `yaml:"Tag"` // git tag of the plotly version URL string `yaml:"URL"` // url under which the plotly schema json file can be downloaded directly Path string `yaml:"Path"` // path under which the schema file will be saved locally for future use Generated string `yaml:"Generated"` // path for the generated package Cdn string `yaml:"CDN"` // url for the cdn which should be included in the head of the generated html }
func ReadSchemas ¶ added in v0.6.0
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |