Help us shape the future of Go! Take the 2026 Go Developer Survey

render

package
v1.0.65 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package render implements a deterministic, network-free semantic SVG preview for DWS OpenNodes V1.

Index

Constants

View Source
const (
	Version        = "opennodes-svg-v1"
	DefaultPadding = 24.0
)

Variables

This section is empty.

Functions

func SortedWarningCodes

func SortedWarningCodes(warnings []Warning) []string

SortedWarningCodes is useful to callers that need a compact stable summary.

Types

type Bounds

type Bounds struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
}

type Result

type Result struct {
	SVG              []byte
	Bounds           Bounds
	Fidelity         string
	NodeCount        int
	RenderedCount    int
	ExactCount       int
	ApproximateCount int
	PlaceholderCount int
	Warnings         []Warning
}

func SVG

func SVG(source *opennodes.Source) (*Result, error)

type Warning

type Warning struct {
	Code     string `json:"code"`
	NodeID   string `json:"nodeId,omitempty"`
	NodeType string `json:"nodeType,omitempty"`
	Message  string `json:"message"`
	Fidelity string `json:"fidelity"`
}

Jump to

Keyboard shortcuts

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