ui

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ui provides a reusable web UI for quadtree visualization

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FS

func FS() fs.FS

FS returns the embedded filesystem for static assets

func Handler

func Handler(cfg Config) http.Handler

Handler returns an http.Handler that serves the UI with the given config

func Render

func Render(w io.Writer, cfg Config) error

Render writes the UI HTML to the given writer with the specified config

Types

type Config

type Config struct {
	Title           string // Page title
	APIBase         string // Base URL for API calls (e.g., "/api")
	PointsEndpoint  string // Endpoint for points CRUD (e.g., "/points")
	SearchEndpoint  string // Endpoint for search (e.g., "/search")
	ShowAddPoint    bool   // Whether to show add point controls
	ShowSearch      bool   // Whether to show search controls
	ShowDelete      bool   // Whether to show delete buttons
	ReadOnly        bool   // If true, hide all mutation controls
	PointLabel      string // Label for points (e.g., "Point", "Agent")
	AutoRefresh     bool   // Whether to auto-refresh the view
	RefreshInterval int    // Refresh interval in milliseconds (default 2000)
	ExtraCSS        string // Additional CSS to inject
	ExtraJS         string // Additional JS to inject
}

Config contains configuration for the quadtree UI

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a sensible default configuration

func NetworkConfig

func NetworkConfig() Config

NetworkConfig returns configuration suitable for network visualization

Jump to

Keyboard shortcuts

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