Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Collections

  • QuestionCard
  • Table
  • Book3D
  • ProTable
  • PricingTable
  • JsonViewer
  • EditableTable
  • List
  • Descriptions
  • RowActions
  • Tree
  • Card
  • Carousel
  • Video
  • Audio
  • BentoGrid
  • Image
  • MagicCard
  • AnimatedList
  • Marquee
  • Sortable
  • Kanban
  • DesignCanvas
  • LayerTree
  • StageDraw
  • SlideDeck
  • PresenterView
  • ComponentPicker
  • EventStream
  • QueueLane
  • DocumentSheet
  • Novel reader
  • Scheduler
  • Org classroom
  • Danmaku
  • LiveChat
  • LivePlayer
  • LogViewer
  • FileTree
  • CodeReviewThread
  • VirtualList
  • InfiniteScroll
  • LogoLoop
  • BounceCards
  • CardSwap
  • ChromaGrid
  • CircularGallery
  • DomeGallery
  • FlyingPosters
  • InfiniteMenu
  • MagicBento
  • ScrollStack
  • ProfileCard
  • TiltedCard
  • PixelCard
  • DecayCard
  • ReflectiveCard
  • Folder

Charts and Diagrams

  • Flow
  • Diagram
  • Paper
  • SequenceDiagram
  • Sankey
  • Sparkline
  • Funnel
  • Treemap
  • Gantt
  • Heatmap
  • ContributionGraph
  • Legend
  • Chart
  • WorldMap

Information

  • ImageViewer
  • LiveProductCard
  • DiffStat
  • ScoreRing
  • ScoreScale
  • Badge
  • Dot
  • StatusDot
  • Chip
  • FilterChip
  • Coupon
  • Tag
  • Annotation
  • Avatar
  • AvatarCircles
  • User
  • QRCode
  • Comment
  • RelativeTime
  • GitCommit
  • DeployStatus
  • ShieldBadge
  • AwardBadge
  • CreditCard
  • IconTile

Metrics

  • Stat
  • Statistic
  • Meter
  • Timeline
  • NumberTicker

Placeholders

  • Empty
  • Skeleton
  • Watermark

WorldMap

world-map

Plots geographic points and animated routes on an interactive world map.

Usage

Single connection

Input the starting point/end point longitude and latitude, and the arc will be automatically drawn and looped.

tsx
<WorldMap
  dots={[{ start: { lat: 39.9, lng: 116.4 }, end: { lat: 40.7, lng: -74 } }]}
/>

Multi-point radiation

The same starting point connects to multiple cities, forming a radiation network.

tsx
<WorldMap
  dots={[
    { start: shanghai, end: london },
    { start: shanghai, end: singapore },
    { start: shanghai, end: sydney },
    { start: shanghai, end: sanFrancisco },
  ]}
/>

Color matching one by one

Each connection uses dot.color to cover the global color, and multiple colors coexist in the same picture.

tsx
<WorldMap
  dots={[
    { start: shanghai, end: london, color: "var(--color-chart-1)" },
    { start: shanghai, end: singapore, color: "var(--color-chart-2)" },
  ]}
/>

Node distribution

points is independent of fly lines, value drives node size, and showLabels displays labels.

ShanghaiSingaporeFrankfurtSan FranciscoSydney
tsx
<WorldMap
  points={[
    { id: "sh", lat: 31.2, lng: 121.5, label: "Shanghai", value: 92 },
    { id: "sg", lat: 1.35, lng: 103.8, label: "Singapore", value: 64 },
  ]}
  showLabels
/>

Flying line mark

flyingMarker Let the mark move circularly along the arc and fit the direction (plane / comet / arrow).

tsx
<WorldMap dots={radial} flyingMarker="plane" />

When to use

Use WorldMap for decorative geographic connections and node distributions such as global points of presence, routing, or traffic dashboards. It is not a precise choropleth; use a GeoJSON mapping library for administrative-area statistics. Use NumberTicker for numeric motion or Chart for standard charts.

Import

ts
import { WorldMap } from "@hulianui/ui"

Props

WorldMapDot is { start: WorldMapPoint; end: WorldMapPoint; color?: string }; WorldMapPoint is { lat; lng; label? }; and WorldMapNode is WorldMapPoint & { id?; value?; color? }.

NameTypeDefaultDescription
dotsWorldMapDot[]-Geographic connection pairs; omission renders only the dotted base map.
flyingMarker"plane" | "comet" | "arrow"-Repeating marker along every arc; planes and arrows rotate with direction.
pointsWorldMapNode[]-Independent nodes whose values map to radius within the current point range.
showLabelsbooleanfalseShows node labels.
lineColorstring"var(--color-chart-1)"Chart-token arc color, overridable per dot.
dotColorstring"var(--color-border)"Border-token base-map dot color.
durationnumber1Arc entrance duration in seconds.
classNamestring-Container class name.

Events

EventTypeDescription
onPointClick(node: WorldMapNode, index: number) => voidMakes nodes focusable and exposes them to assistive technology for drill-down.

Pitfalls

  • SVG colors must use full --color- tokens such as var(--color-chart-1); bare var(--chart-1) may resolve black or transparent in Tailwind v4. See [[hulian-token-color-var-needs-color-prefix]].
  • Arc and endpoint animations can be at their initial frame in headless screenshots. Use a real browser or reduced motion; see [[verify-sub-second-web-animation-via-headless-screenshot]] and [[recharts-headless-screenshot-blank-clippath-animation-starved]].
  • Without onPointClick, the SVG is decorative and aria-hidden. Supplying it makes nodes keyboard reachable. Unlabeled interactive nodes use the runtime fallback `\u8282\u70b9 ${index + 1}` ("Node N").

Related

Stat · Statistic · Chart · Meter · Timeline · NumberTicker

PreviousNumberTickerData DisplayNextEmpty

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Events
    • Pitfalls
    • Related