Visualizations
347 / 500

347 · Astronomy

Solar Surface

Granulation, sunspots and flaring magnetic loops at the Sun's limb, in three wavelengths.

Every pixel of the disk is mapped back to longitude and latitude on a sphere, so features foreshorten toward the limb and limb darkening follows the viewing angle. Granulation is weighted cellular noise: drifting feature points that brighten and fade, shaded from narrow dark lanes (lit by magnetic bright points) into domed granules, while sunspots swap convection for a dark umbra and a penumbra of filaments streaming outward. Active regions are magnetic monopoles buried below the surface, and their field lines are traced through the summed field and projected onto the sphere, so the hydrogen-alpha prominence and the EUV coronal loops take the shape of the same field. Hydrogen-alpha adds spicules, a superpenumbra of fibrils and a dark filament; EUV shows the optically thin corona, brightening at the limb with a dark coronal hole. Shearing a region's footpoints skews its arcade until it reconnects in a flare with bright ribbons and an eruption.

Try it. Drag back and forth across an active region (the limb arcade or the sunspot group) to shear its magnetic field until it flares. Click the chips or press 1, 2, 3 (or W or Space to step through them) to switch between white light, hydrogen-alpha and extreme ultraviolet, and F to set off a flare at the limb. Left alone, it cycles wavelengths and builds up its own flares.

  • Weighted cellular noise
  • Field line tracing
  • Sphere reprojection
  • Progressive per-pixel baking

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build a close-up of the Sun's surface with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), and resizes with the window. Render per pixel into a smaller offscreen canvas (about half resolution) with ImageData, then drawImage it scaled up.
- Draw solar granulation with cellular (Worley) noise: put one jittered feature point in each grid cell, and for each pixel find the nearest (F1) and second nearest (F2) points in the 3x3 neighboring cells. Pixels where F2 - F1 is small are the dark lanes between cells; brightness rising with F2 - F1 makes each cell a rounded bright granule.
- Animate it: move each feature point in a small slow circle and let each cell's brightness rise and fall on its own timer.
- Color it with a lookup table from dark brown through orange to pale yellow.

Once that works, make it beautiful:
- Add a sunspot: inside a radius, replace the granulation with a dark umbra, and in a ring around it draw radial penumbral filaments from noise sampled by angle.
- Make the Sun a sphere: put its center below the bottom of the screen so the edge arcs across the top. For each pixel compute the viewing angle, darken toward the edge (limb darkening), and use longitude and latitude as the texture coordinates so features squash near the edge.
- Trace a few magnetic field lines from two buried magnetic charges (B = sum of q (P - S) / |P - S|^3), project them onto the screen, and draw them as glowing arches above the limb.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as switching to a hydrogen-alpha or extreme ultraviolet look, shearing the field lines until they flare, or adding spicules along the limb.
PreviousThrough Other EyesA fruit market, a metro map and test plates as dichromats see them. NextSailing RegattaA watercolour yacht race where boats tack upwind because their polars say so.

Related visualizations

  • TotalityAstronomy A total solar eclipse from a lakeshore, driven by the real shadow geometry.
  • Sky MachinePhysics Drag the sun and watch real Rayleigh and Mie scattering paint the sky.
  • Magnetic BottlePhysics Particles gyrate, bounce and drift in Earth's dipole, filling the radiation belts.
  • PlanetAstronomy A procedurally generated world with oceans, clouds and a glowing atmosphere.
  • Stellar VampireAstronomy A star overflows its Roche lobe and feeds a white dwarf's disk until it ignites a nova.
  • AuroraNature Curtains of oxygen and nitrogen light on tilted field lines, mirrored in a lake.
  • TwinkleAstronomy Turbulent air boils a star into speckles until adaptive optics snaps it sharp.
  • Lens FlareType and image Drag the sun over the dunes; ghosts traced through a real lens follow it.
  • Star TrailsAstronomy A long exposure builds over a mountain camp as the sky wheels around the celestial pole.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs