complexgraph

package
v1.0.7-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README

Complex Graph Component

Data Struct

Field Description
Title The title of line graph
Dimensions Defining multiple legend in a Complex Graph
XAxis X-axis property definition
YAxis Y-axis property definition
Series Y-axis data
Inverse Inverse the x,y axis, the default is not inverse

Axis Struct

Field Description
Type Axis Type
Name Axis Name
Dimensions List of dimensions on the current axis
Position Axis position,x-axis optional: bottom, top, y-axis optional left, right
Data Indicates the x-axis data when the axis is the x-axis
DataStructure Data structures on the same axis

Sere Struct

Field Description
Name Sere Name
Dimension data dimension
Type Data display type, optional: bar,line
Data Data

Demo

Complex Graph Demo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Axis

type Axis struct {
	Type          Type                     `json:"type"`
	Name          string                   `json:"name,omitempty"`
	Dimensions    []string                 `json:"dimensions,omitempty"`
	Position      Position                 `json:"position,omitempty"`
	Data          []interface{}            `json:"data,omitempty"`
	DataStructure *structure.DataStructure `json:"structure"`
}

Axis .

type AxisBuilder

type AxisBuilder struct {
	// contains filtered or unexported fields
}

AxisBuilder .

func NewAxisBuilder

func NewAxisBuilder() *AxisBuilder

NewAxisBuilder .

func (*AxisBuilder) Build

func (d *AxisBuilder) Build() *Axis

Build .

func (*AxisBuilder) WithData

func (d *AxisBuilder) WithData(data ...interface{}) *AxisBuilder

WithData .

func (*AxisBuilder) WithDataStructure

func (d *AxisBuilder) WithDataStructure(typ structure.Type, precision structure.Precision, enable bool) *AxisBuilder

WithDataStructure .

func (*AxisBuilder) WithDimensions

func (d *AxisBuilder) WithDimensions(dimensions ...string) *AxisBuilder

WithDimensions .

func (*AxisBuilder) WithName

func (d *AxisBuilder) WithName(name string) *AxisBuilder

WithName .

func (*AxisBuilder) WithPosition

func (d *AxisBuilder) WithPosition(position Position) *AxisBuilder

WithPosition .

func (*AxisBuilder) WithType

func (d *AxisBuilder) WithType(typ Type) *AxisBuilder

WithType .

type CustomData

type CustomData interface {
	CustomDataPtr() interface{}
	EncodeFromCustomData(customDataPtr interface{}, stdDataPtr *Data)
	DecodeToCustomData(stdDataPtr *Data, customDataPtr interface{})
}

CustomData is custom data handler of complex graph.

type CustomInParams

type CustomInParams interface {
	CustomInParamsPtr() interface{}
	EncodeFromCustomInParams(customInParamsPtr interface{}, stdInParamsPtr *cptype.ExtraMap)
	DecodeToCustomInParams(stdInParamsPtr *cptype.ExtraMap, customInParamsPtr interface{})
}

CustomInParams is custom inParams handler of complex graph.

type CustomState

type CustomState interface {
	CustomStatePtr() interface{}
	EncodeFromCustomState(customStatePtr interface{}, stdStatePtr *cptype.ExtraMap)
	DecodeToCustomState(stdStatePtr *cptype.ExtraMap, customStatePtr interface{})
}

CustomState is custom state handler of complex graph.

type Data

type Data struct {
	Title      string   `json:"title"`
	Dimensions []string `json:"dimensions"`
	XAxis      []*Axis  `json:"xAxis"`
	YAxis      []*Axis  `json:"yAxis"`
	Series     []*Sere  `json:"series"`
	Inverse    bool     `json:"inverse"`
}

Data includes List.

type DataBuilder

type DataBuilder struct {
	// contains filtered or unexported fields
}

DataBuilder .

func NewDataBuilder

func NewDataBuilder() *DataBuilder

NewDataBuilder .

func (*DataBuilder) Build

func (d *DataBuilder) Build() *Data

Build .

func (*DataBuilder) EnableInverse

func (d *DataBuilder) EnableInverse() *DataBuilder

EnableInverse .

func (*DataBuilder) WithDimensions

func (d *DataBuilder) WithDimensions(dimensions ...string) *DataBuilder

WithDimensions .

func (*DataBuilder) WithSeries

func (d *DataBuilder) WithSeries(series ...*Sere) *DataBuilder

WithSeries .

func (*DataBuilder) WithTitle

func (d *DataBuilder) WithTitle(title string) *DataBuilder

WithTitle .

func (*DataBuilder) WithXAxis

func (d *DataBuilder) WithXAxis(xAxis ...*Axis) *DataBuilder

WithXAxis .

func (*DataBuilder) WithYAxis

func (d *DataBuilder) WithYAxis(yAxis ...*Axis) *DataBuilder

WithYAxis .

type IComplexGraph

type IComplexGraph interface {
	cptype.IComponent
	IComplexGraphStdOps
}

IComplexGraph complex graph interface

type IComplexGraphStdOps

type IComplexGraphStdOps interface{}

IComplexGraphStdOps .

type Position

type Position string

Position defined axis position

const (
	Right Position = "right"
	Left  Position = "left"
)

Y axis positions

const (
	Top    Position = "top"
	Bottom Position = "bottom"
)

X axis positions

type Sere

type Sere struct {
	Name      string        `json:"name"`
	Dimension string        `json:"dimension"`
	Type      Type          `json:"type"`
	Data      []interface{} `json:"data"`
}

Sere .

type SereBuilder

type SereBuilder struct {
	// contains filtered or unexported fields
}

SereBuilder .

func NewSereBuilder

func NewSereBuilder() *SereBuilder

NewSereBuilder .

func (*SereBuilder) Build

func (d *SereBuilder) Build() *Sere

Build .

func (*SereBuilder) WithData

func (d *SereBuilder) WithData(data ...interface{}) *SereBuilder

WithData .

func (*SereBuilder) WithDimension

func (d *SereBuilder) WithDimension(dimension string) *SereBuilder

WithDimension .

func (*SereBuilder) WithName

func (d *SereBuilder) WithName(name string) *SereBuilder

WithName .

func (*SereBuilder) WithType

func (d *SereBuilder) WithType(typ Type) *SereBuilder

WithType .

type Type

type Type string

Type defined graph type

const (
	Value    Type = "value"
	Category Type = "category"
	Bar      Type = "bar"
	Line     Type = "line"
)

Define type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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