Skip to content

Instantly share code, notes, and snippets.

@walkerke
Created September 8, 2025 18:28
Show Gist options
  • Save walkerke/48007a4539dedb3bc8b9cf540bc760f2 to your computer and use it in GitHub Desktop.
Save walkerke/48007a4539dedb3bc8b9cf540bc760f2 to your computer and use it in GitHub Desktop.
library(mapgl)
library(tigris)
library(dplyr)
library(sf)
texas <- states(cb = TRUE) |>
filter(NAME == "Texas")
points <- st_sample(texas, 5000) |>
st_sfc() |>
st_sf() |>
mutate(id = 1:5000)
mapboxgl(bounds = texas, style = mapbox_style("dark")) |>
# Layer 1: Outer glow (largest, most diffused)
add_circle_layer(
id = "glow-outer",
source = points,
circle_color = "#00cc99", # Cyan-green
circle_blur = 1,
circle_opacity = 0.2,
circle_radius = 20
) |>
# Layer 2: Mid glow
add_circle_layer(
id = "glow-mid",
source = points,
circle_color = "#00ff88", # Brighter green
circle_blur = 0.8,
circle_opacity = 0.4,
circle_radius = 10
) |>
# Layer 3: Inner glow
add_circle_layer(
id = "glow-inner",
source = points,
circle_color = "#40ffaa", # Lighter cyan
circle_blur = 0.5,
circle_opacity = 0.7,
circle_radius = 5
) |>
# Layer 4: Bright core
add_circle_layer(
id = "core",
source = points,
circle_color = "#ffffff", # White hot center
circle_blur = 0.1,
circle_opacity = 1,
circle_radius = 2
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment