render

package
v0.0.0-...-265ede9 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTML               = "html"
	FileProtocol       = "file://"
	EchartsInstanceDom = "div[_echarts_instance_]"
	CanvasJs           = "echarts.getInstanceByDom(document.querySelector('div[_echarts_instance_]'))" +
		".getDataURL({type: '%s', pixelRatio: 1, excludeComponents: ['toolbox']})"
	SvgJs = "echarts.getInstanceByDom(document.querySelector('div[_echarts_instance_]')).renderToSVGString()"
)

Variables

This section is empty.

Functions

func MakeChartSnapshotJpg

func MakeChartSnapshotJpg(content []byte) ([]byte, error)

func MakeChartSnapshotPng

func MakeChartSnapshotPng(content []byte) ([]byte, error)

func MakeChartSnapshotSvg

func MakeChartSnapshotSvg(content []byte) ([]byte, error)

Types

type SnapshotConfig

type SnapshotConfig struct {
	// RenderContent the content bytes of charts after rendered
	RenderContent []byte
	// KeepHtml whether keep the generated html also, default false
	KeepHtml bool
	// Timeout  the timeout config
	Timeout time.Duration
	ExtName string
}

func NewSnapshotConfig

func NewSnapshotConfig(content []byte, opts ...SnapshotConfigOption) *SnapshotConfig

type SnapshotConfigOption

type SnapshotConfigOption func(config *SnapshotConfig)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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