Skip to content
commit-766c8d6756a1

Interactive scatter

Categorical or paired values with symbols, labels, axes, and optional ripple emphasis.

Purpose
Compare point values across named categories or reveal relationships between two quantitative measures.
Use when
Position, symbol shape, or restrained ripple emphasis helps readers compare observations, clusters, or exceptional points.
Avoid when
Heavy overlap, precise lookup, or a stable reading order dominates; use the exact-value table or another summary.
Equivalent data
Every example includes a keyboard-readable table with each category, series, and value; ripple motion adds no data.
Exact scatter values
PointSeriesValue
SwimmingCategory A81
SurfingCategory A87
ShootingCategory A47
SkatingCategory A59
WrestlingCategory A81
DivingCategory A18
SwimmingCategory B25
SurfingCategory B40
ShootingCategory B56
SkatingCategory B0
WrestlingCategory B94
DivingCategory B11

12 points across 2 series.

Usage Example
@interactivescatter.Scatter(interactivescatter.Config{
  Label: "Sports scores",
  XAxis: []string{"Swimming", "Surfing", "Shooting", "Skating", "Wrestling", "Diving"},
  Series: []interactivescatter.Series{{
    Name: "Category A",
    Data: []interactivescatter.Data{{Value: 81, Symbol: "roundRect", SymbolSize: 20, SymbolRotate: 10}},
  }},
  Width: "100%",
  Height: "420px",
})

Visible point labels

Right-positioned labels repeat every exact score while retaining the same round-rectangle symbol geometry.

Exact scatter values
PointSeriesValue
SwimmingCategory A62
SurfingCategory A89
ShootingCategory A28
SkatingCategory A74
WrestlingCategory A11
DivingCategory A45
SwimmingCategory B37
SurfingCategory B6
ShootingCategory B95
SkatingCategory B66
WrestlingCategory B28
DivingCategory B58

12 points across 2 series.

Visible point labels
SeriesOptions: chart.SeriesOptions{Label: &chart.LabelOptions{Show: chart.Bool(true), Position: "right"}}

Named axes and split lines

Sports and Score axis names plus split lines support aligned reading across the original six categories.

Exact scatter values
PointSeriesValue
SwimmingPlayer A47
SurfingPlayer A47
ShootingPlayer A87
SkatingPlayer A88
WrestlingPlayer A90
DivingPlayer A15
SwimmingPlayer B41
SurfingPlayer B8
ShootingPlayer B87
SkatingPlayer B31
WrestlingPlayer B29
DivingPlayer B56

12 points across 2 series.

Named axes and split lines
Options: chart.ChartOptions{XAxis: &chart.AxisOptions{Name: "Sports", ShowSplitLine: chart.Bool(true)}, YAxis: &chart.AxisOptions{Name: "Score", ShowSplitLine: chart.Bool(true)}}

Effect variant

The same Scatter component can add a default ripple to the six player dunk values; reduced-motion preference disables chart animation.

Exact scatter values
PointSeriesValue
KobeDunk37
JordanDunk31
IversonDunk85
LeBronDunk26
WadeDunk13
McGradyDunk90

6 points across 1 series.

Effect variant
Variant: interactivescatter.VariantEffect

Per-series ripple styles

Dunk uses period 4, scale 10, and stroke; Shoot uses period 3, scale 6, and fill. Both remain series in one Scatter component.

Exact scatter values
PointSeriesValue
KobeDunk94
JordanDunk63
IversonDunk33
LeBronDunk47
WadeDunk78
McGradyDunk24
KobeShoot59
JordanShoot53
IversonShoot57
LeBronShoot21
WadeShoot89
McGradyShoot99

12 points across 2 series.

Per-series ripple styles
Ripple: &chart.RippleOptions{Period: 4, Scale: 10, BrushType: "stroke"}

Motion and emphasis

Ripple can call attention to points, but it does not add data. Keep it restrained; reduced-motion users receive the same exact values without animation.

Go API

v0.0.1

The examples above cover behavior and composition. pkg.go.dev is the canonical reference for exported types, functions, methods, and Go documentation.

github.com/araihu/goshtoso-charts/components/interactive/scatter

Enabled, disabled, hidden, and omitted wrapper behavior, controls, export, and client transitions are shared by every chart. Review chart controls, then compare static/vector and interactive capabilities.

Open v0.0.1 API