Skip to content
commit-766c8d6756a1

Interactive geo

Named coordinates and values over national or regional geography.

Purpose
Plot named coordinates and values over geographic geometry.
Use when
Location and spatial distribution provide important context.
Avoid when
Precise coordinates, values, or geographic detail must be compared.
Equivalent data
Every variant includes a table with series, point, coordinate, value, and class.
Exact coordinate values
SeriesKindPointLongitudeLatitudeValueClass
Brazil capitalseffect-scatterManaus-60.02-3.1281text-on-surface-strong dark:text-on-surface-dark-strong
Brazil capitalseffect-scatterRecife-34.88-8.0527
Brazil capitalseffect-scatterBrasília-47.88-15.7947
Brazil capitalseffect-scatterRio de Janeiro-43.17-22.9159
Brazil capitalseffect-scatterSão Paulo-46.63-23.5518
Brazil capitalseffect-scatterPorto Alegre-51.23-30.0363
Exact coordinate values
SeriesKindPointLongitudeLatitudeValueClass
São Paulo citiesSão Paulo-46.63-23.5512
São Paulo citiesCampinas-47.06-22.9176
São Paulo citiesRibeirão Preto-47.81-21.1841text-on-surface-strong dark:text-on-surface-dark-strong
Usage Example
@interactive.Geo(interactive.GeoConfig{
  Label: "São Paulo cities",
  Geometry: interactive.GeoGeometrySaoPaulo,
  VisualRange: &interactive.GeoVisualRange{Min: 0, Max: 100},
  Series: []interactive.GeoSeries{{
    Name: "São Paulo cities",
    Kind: interactive.GeoSeriesScatter,
    Points: []interactive.GeoPoint{
      {Name: "São Paulo", Longitude: -46.63, Latitude: -23.55, Value: 12},
      {Name: "Campinas", Longitude: -47.06, Latitude: -22.91, Value: 76},
      {Name: "Ribeirão Preto", Longitude: -47.81, Latitude: -21.18, Value: 41},
    },
  }},
  Width: "100%", Height: "500px",
  Options: interactive.ChartOptions{
    Export: &chartcontrol.ExportOptions{Filename: "são-paulo-cities"},
  },
})

Choose a map type

Use Geo for positioned points. Use Map when values belong to geographic regions.

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

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