shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Show what the wind does to a farm's output, with this wind farm map for React with Base UI. Gustfield, a wind developer, runs twelve turbines in three rows on the open hills of the Altamont Pass in California, on a live Map that follows your theme. The Angle Slider, a compass dial floating over the map, sets the direction the wind comes from, N at the top, turned with the pointer or the arrow keys in steps of 5 degrees. A turbine loses output to every other turbine that stands upwind of it, close enough and near enough to the wind's line, so turning the dial changes which turbines are shaded: dashed lines join each turbine to the ones it shades, heavier as the loss grows, a shaded turbine's ring turns dashed with its loss under it, and the chosen turbine draws its own wake as a fan. The dial's card gives the farm's output, the share lost to wakes and how many turbines are shaded, and the cards under the map, in step with the markers, give each turbine's output with a bar and its loss. Losses are worst when the wind runs down the rows. Built from Map, Angle Slider and Guides. For wind developers, grid operators and energy dashboards.
FAQ
How is the wake loss worked out?
Turbine A shades turbine B when A is within RANGE (2,400 metres) of B and within CONE degrees (20) of the bearing the wind comes from. The loss is up to MAX_LOSS percent (35), less the farther away and the more off the line A stands, rounded, and a turbine adds up the losses it takes, capped at 50 percent. It is a simplified rule, not an engineering model: it ignores terrain, turbulence and wind speed, and the caption says so.
Why does the loss jump at some directions?
The turbines stand about 560 metres apart in rows that run a little south of east. When the wind blows along a row, from about 285 or 105 degrees, each turbine sits in the wake of its neighbour and the farm loses close to a third; across the rows almost nothing is lost. Turn the dial slowly through those bearings to see it.
Where does the data come from, and what stays local?
The hills are real and the turbines are typed in LINES at invented places on them, each with an invented clear-wind output; the distances come from those coordinates in metres. Only the map tiles are loaded, CARTO's free basemaps over OpenStreetMap data with their credit kept, and nothing is measured or sent.
How do I use the dial without a mouse?
Focus the dial with Tab and use the arrow keys: each press turns it 5 degrees. It has a hidden input and a name, "Wind from, in degrees", and the words under it give the direction and its bearing ("Wind from North-west, 300°"). The compass letters are decoration.
Can I use the map without a mouse?
Yes. The turbine cards are buttons with a pressed state that give each turbine's output and loss in words, and pressing one draws its wake on the map; the markers are a pointer shortcut to the same choice and bring the matching card into view. A polite message gives the farm's output and the chosen turbine's loss once the dial settles.





