chart

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Charts map[string]*DSL = map[string]*DSL{}

Charts the loaded chart widgets

Functions

func Export

func Export() error

Export process & api

func Guard

func Guard(c *gin.Context)

Guard form widget chart

func Load

func Load(cfg config.Config) error

Load load task

func LoadAndExport

func LoadAndExport(cfg config.Config) error

LoadAndExport load table

func LoadFile added in v0.10.3

func LoadFile(root string, file string) error

LoadFile load table dsl by file

Types

type ActionDSL

type ActionDSL struct {
	Setting    *action.Process `json:"setting,omitempty"`
	Component  *action.Process `json:"-"`
	Data       *action.Process `json:"data,omitempty"`
	BeforeData *hook.Before    `json:"before:data,omitempty"`
	AfterData  *hook.After     `json:"after:data,omitempty"`
}

ActionDSL the chart action DSL

func (*ActionDSL) SetDefaultProcess

func (act *ActionDSL) SetDefaultProcess()

SetDefaultProcess set the default value of action

type DSL

type DSL struct {
	ID     string                 `json:"id,omitempty"`
	Name   string                 `json:"name,omitempty"`
	Action *ActionDSL             `json:"action"`
	Layout *LayoutDSL             `json:"layout"`
	Fields *FieldsDSL             `json:"fields"`
	Config map[string]interface{} `json:"config,omitempty"`
	CProps field.CloudProps       `json:"-"`
	compute.Computable
	*mapping.Mapping
}

DSL the chart DSL

func Get

func Get(chart interface{}) (*DSL, error)

Get chart via process or id

func MustGet

func MustGet(chart interface{}) *DSL

MustGet Get chart via process or id thow error

func New

func New(id string) *DSL

New create a new DSL

func (*DSL) Actions added in v0.10.3

func (dsl *DSL) Actions() []component.ActionsExport

Actions get the chart actions

func (*DSL) Validate

func (dsl *DSL) Validate() error

Validate table

func (*DSL) Xgen

func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool) (map[string]interface{}, error)

Xgen trans to xgen setting

type FieldsDSL

type FieldsDSL struct {
	Filter field.Filters `json:"filter,omitempty"`
	Chart  field.Columns `json:"chart,omitempty"`
	// contains filtered or unexported fields
}

FieldsDSL the chart fields DSL

func (*FieldsDSL) Xgen

func (fields *FieldsDSL) Xgen(layout *LayoutDSL) (map[string]interface{}, error)

Xgen trans to xgen setting

type FilterLayoutDSL

type FilterLayoutDSL struct {
	Actions component.Actions   `json:"actions,omitempty"`
	Columns component.Instances `json:"columns,omitempty"`
}

FilterLayoutDSL layout.filter

type LayoutDSL

type LayoutDSL struct {
	Operation *OperationLayoutDSL `json:"operation,omitempty"`
	Chart     *ViewLayoutDSL      `json:"chart,omitempty"`
	Filter    *FilterLayoutDSL    `json:"filter,omitempty"`
}

LayoutDSL the chart layout DSL

func (*LayoutDSL) Clone added in v0.10.3

func (layout *LayoutDSL) Clone() (*LayoutDSL, error)

Clone layout for output

func (*LayoutDSL) Xgen

func (layout *LayoutDSL) Xgen(data map[string]interface{}, excludes map[string]bool, mapping *mapping.Mapping) (*LayoutDSL, error)

Xgen trans to Xgen setting

type OperationLayoutDSL

type OperationLayoutDSL struct {
	Actions component.Actions `json:"actions,omitempty"`
}

OperationLayoutDSL layout.operation

type ViewLayoutDSL

type ViewLayoutDSL struct {
	Columns component.Instances `json:"columns,omitempty"`
}

ViewLayoutDSL layout.form

Jump to

Keyboard shortcuts

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