svg

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderValue

func RenderValue(v interface{}) string

RenderValue coerces to json.Number and tries to avoid adding decimal points to integers

Types

type Edge

type Edge struct {
	Path [][2]int
}

Edge is polylines of straight lines going through all points.

func (Edge) Render

func (e Edge) Render() string

type Graph

type Graph struct {
	ID    string
	Nodes map[uint64]Node
	Edges map[[2]uint64]Edge
}

Graph is rendered graph.

func (Graph) Render

func (g Graph) Render() string

Render creates root svg element

type Node

type Node struct {
	ID       string // used to make DOM IDs
	XY       [2]int // lowest X and Y coordinate of node box
	Title    string
	NodeData map[string]interface{}
}

Node is rendered point. Can render contents as table.

func (Node) Height

func (n Node) Height() int

func (Node) Render

func (n Node) Render() string

func (Node) TitleID

func (n Node) TitleID() string

func (Node) Width

func (n Node) Width() int

type NodeDataTable

type NodeDataTable struct {
	NodeData map[string]interface{}
	FontSize int
}

NodeDataTable renders key-value data of node. It will render table.

func (NodeDataTable) Height

func (n NodeDataTable) Height() int

func (NodeDataTable) Render

func (n NodeDataTable) Render() string

func (NodeDataTable) Width

func (n NodeDataTable) Width() int

type NodeTitle

type NodeTitle struct {
	ID       string
	Title    string
	FontSize int
}

func (NodeTitle) Render

func (n NodeTitle) Render() string

type Renderable

type Renderable interface {
	Render() string
}

type SVG

type SVG struct {
	ID          string
	Definitions []Renderable
	Body        Renderable
}

func (SVG) Render

func (s SVG) Render() string

Jump to

Keyboard shortcuts

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