HomeLabHire Me
ml-ui111 components

Get started

IntroductionInstallation

UI

Dots

Dot AccordionDot CalendarDot CheckboxDot CodeDot CommandDot ContentsDot CountdownDot CrossingDot FuseDot GaugeDot InstallDot KnobDot LogosDot MenuDot PaginationDot PasswordDot Price RangeDot PricingDot ProgressDot QueueDot RatingDot Reading ProgressDot SelectDot SignupDot SliderDot StatusDot StepperDot SwitchDot TabsDot ToastDot TooltipFlip-Dot CounterLED Marquee

Dither

Dither AvatarDither BannerDither CompareDither GlobeDither PortraitDither SkeletonDither TrailDither UploadDot CookiesDot DialogDot KeysDot ReceiptDot VariantsLenticular Card

More

Pollen TrailSplit-FlapTheme Toggle

Text

Dither RotatorDot TypeEnigma TextInk Print

Data viz

Dots

Contribution FieldDot BarsDot ChartDot Waffle

Dither

Dither DensityDither MapDither Stack

Media

Dots

Dot EqualizerDot WaveformVoice Note

Dither

Dither Scrubber

AI

Agent StepsAnswer VersionsCitation ChipConfidence GlassContext MeterDiffusion ImageDiffusion TextDither MaskDoc ReaderDot DictationGenerate ButtonGhost TextModel PickerPrompt BarResponse ActionsRevising TextSpoken ReplyThinking OrbThinking TraceToken MeterToken StreamWord Alternatives

Useful

Arrival TimeBest ShotCareer LineForgiving SearchGesture PadHeard AsHonest PinImage PaletteLikeness GridNear Miss SearchRain DropsSoft CorrectSpending SortSticker LiftTaste Ledger

Backgrounds

ButterfliesDandelionsDuck PondFirefliesKoi PondLight WellMarigoldsTrain WindowWhite Blossom

ml-ui / Data viz

Dither Map

Each country is shaded by its value as a density of ink dots, from a light stipple for the least to solid for the most, on a log scale when the data spans decades; land without data is a faint stipple, the sea is the plain page, and neighbours are kept apart by a hairline gap. It develops in when it first comes into view, and a change of data eases each country to its new density. Point at a country, or focus the map and use the arrow keys (highest first), to read it; a hidden table gives screen readers the whole of the data.

Needs: None. Canvas 2D. Borders from Natural Earth 1:110m (public domain), built in at about 11 KB.

Customize

Props

PropTypeDefaultDescription
dataRecord<string, number>requiredA value for each country, keyed by ISO 3166 alpha-2 code.
format(value: number) => string–How a value reads.
labelstring"Value"What the values are, e.g. “Active users”.
onSelect(code: string, value: number) => void–Called when a country with data is clicked or chosen with Enter.
tonestring–The ink. The page's accent by default.
cellnumber3Size of one dither cell in px.
legendbooleantrueThe key below the map.
classNamestring–Class on the map. It fills its container's width.
styleCSSProperties–Style on the map.
← Dither DensityDither Stack →