Documentation
¶
Overview ¶
Package isoicons provides reusable isometric icon packs for the github.com/go-widgets/toolkit isometric-diagram widget.
Two packs are shipped, each vendored from a permissively licensed upstream and registered into a toolkit.IsoIconRegistry as billboarded sprite icons (toolkit.IsoSpriteIcon):
- "cloudnative": ~45 cloud-native concepts (Kubernetes control-plane and resources, servers, networking, storage, pipelines, …) decoded from embedded 128px PNG art. Two concepts ("container", "package") ship theme-aware light/dark variants selected by the Theme argument.
- "aws": the nine isometric AWS/cloud SVGs, rasterized at load time with the pure-Go github.com/srwiley/oksvg + github.com/srwiley/rasterx rasterizer (CGO-free, wasm-clean).
Every id is namespaced by its pack ("cloudnative/pod", "aws/aws-lambda") so the two packs never collide with each other or with the toolkit's built-in icons. All code in this repository is BSD-3-Clause; the vendored assets keep their upstream licenses (assets/cloudnative is Apache-2.0, assets/aws is CC0-1.0) — see the NOTICE file and each assets/*/LICENSE.
The package is pure Go (CGO_ENABLED=0) and compiles for GOOS=js GOARCH=wasm: the PNG decoder is image/png from the standard library and the SVG rasterizer is pure Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AWSIDs ¶
func AWSIDs() []string
AWSIDs returns the registered ids of the "aws" pack, in a stable order.
func CloudNativeIDs ¶
func CloudNativeIDs() []string
CloudNativeIDs returns the registered ids of the "cloudnative" pack, in a stable order — for building a palette or listing the installed library.
func RegisterAWS ¶
func RegisterAWS(reg *toolkit.IsoIconRegistry) error
RegisterAWS registers the "aws" pack into reg, rasterizing each vendored SVG at load time. It returns an error only if a vendored asset fails to parse.
func RegisterAll ¶
func RegisterAll(reg *toolkit.IsoIconRegistry, theme ...Theme) error
RegisterAll registers both packs into reg. The optional theme is forwarded to the "cloudnative" pack (the "aws" pack is fixed-colour).
func RegisterCloudNative ¶
func RegisterCloudNative(reg *toolkit.IsoIconRegistry, theme ...Theme) error
RegisterCloudNative registers the "cloudnative" pack into reg. The optional theme (default ThemeLight) selects the variant for the theme-aware concepts; every other concept ships a single neutral variant. It returns an error only if a vendored asset fails to decode.