go Graphics Libary inspired by pygal
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-07 23:46:49 +01:00
.claude Adding setttings 2026-04-06 08:05:30 +01:00
docs Update README.md for v0.1.3 2026-04-07 23:46:49 +01:00
examples Improve documentation: branded HTML, fixed nav, lofigui examples, url2svg captures 2026-04-07 23:30:00 +01:00
.gitignore updating .gitignore 2026-04-06 08:12:36 +01:00
CHANGELOG.md Update CHANGELOG for v0.1.3 2026-04-07 23:46:49 +01:00
CLAUDE.md Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00
go.mod Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00
gogal.go Add examples 01-09 with irregular data, fix Time→X mapping in Add() 2026-04-06 07:59:41 +01:00
layout.go Fix ordinal axis, add temporal scale, interactive WASM demos, axis format example 2026-04-07 19:36:11 +01:00
layout_test.go Fix ordinal axis, add temporal scale, interactive WASM demos, axis format example 2026-04-07 19:36:11 +01:00
LICENSE Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00
option.go Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00
README.md Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00
render.go Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00
RESEARCH.md Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00
ROADMAP.md Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00
scale.go Fix ordinal axis, add temporal scale, interactive WASM demos, axis format example 2026-04-07 19:36:11 +01:00
scale_test.go Fix ordinal axis, add temporal scale, interactive WASM demos, axis format example 2026-04-07 19:36:11 +01:00
series.go Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00
svg.go Fix ordinal axis, add temporal scale, interactive WASM demos, axis format example 2026-04-07 19:36:11 +01:00
task-plus.yml Add examples 01-09 with irregular data, fix Time→X mapping in Add() 2026-04-06 07:59:41 +01:00
Taskfile.yml Improve documentation: branded HTML, fixed nav, lofigui examples, url2svg captures 2026-04-07 23:30:00 +01:00
theme.go Initial commit: core SVG chart library with sparkline 2026-04-04 17:20:43 +01:00

gogal

Pure Go SVG chart library with CSS-only interactivity and HTMX integration.

Go Version License: MIT

Overview

gogal generates pure SVG charts server-side with zero JavaScript. Interactivity is provided through CSS (hover tooltips, transitions) and HTMX (legend toggling, axis switching, live updates).

Designed for use with lofigui and server-rendered web applications.

Key Features

  • Pure Go: Zero dependencies, no cgo, gokrazy compatible
  • Pure SVG: Server-side rendered, clean markup, responsive viewBox
  • CSS interactivity: Hover tooltips, transitions, animations — no JavaScript
  • HTMX integration: Legend toggling, axis switching, zoom controls, SSE live updates
  • Dual axis modes: Time-proportional and event-proportional X axes
  • Four variants: Sparkline, Static, Interactive, Live
  • Accessible: ARIA labels, <title>, <desc> by default
  • Testable: Layout computation separated from SVG rendering

Quick Start

package main

import (
    "os"
    "codeberg.org/hum3/gogal"
)

func main() {
    chart := gogal.NewLineChart(
        gogal.WithTitle("Temperature"),
        gogal.WithSize(800, 400),
    )
    chart.Add("Sensor A", []gogal.DataPoint{
        {X: 0, Y: 20.1},
        {X: 1, Y: 21.3},
        {X: 2, Y: 19.8},
        {X: 3, Y: 22.5},
    })
    chart.Render(os.Stdout)
}

Chart Types

Type Sparkline Static Interactive Live
Line Yes Yes Yes Yes
Bar Yes Yes Yes Yes
Scatter Yes Yes Yes Yes

Examples

See the examples/ directory for progressively complex demos.

Documentation https://h3-gogal.statichost.page/
Source (Codeberg) https://codeberg.org/hum3/gogal
Mirror (GitHub) https://github.com/drummonds/gogal