Skip to main content
An interactive rotating globe component.

Installation

npm install cobe vue-use-spring

Usage

<script setup lang="ts">
import { Globe } from '@/components/visualization'
import type { COBEOptions } from 'cobe'

const config: COBEOptions = {
  width: 800,
  height: 800,
  phi: 0,
  theta: 0.3,
  dark: 1,
  diffuse: 0.4,
  mapSamples: 16000,
  mapBrightness: 1.2,
  baseColor: [1, 1, 1],
  markerColor: [251 / 255, 100 / 255, 21 / 255],
  glowColor: [1, 1, 1],
  markers: [
    { location: [14.5995, 120.9842], size: 0.03 },
    { location: [19.076, 72.8777], size: 0.1 },
  ],
}
</script>

<template>
  <Globe :config="config" />
</template>

Props

Prop NameTypeDefaultDescription
classstring""Additional CSS classes for custom styling.
configCOBEOptionsN/AConfiguration object for the globe, following COBE library options.
massnumber1Mass parameter for the spring animation controlling rotation inertia.
tensionnumber280Tension parameter for the spring animation, affecting responsiveness.
frictionnumber100Friction parameter for the spring animation, affecting damping.
precisionnumber0.001Precision parameter for the spring animation calculations.

Credits

  • Built using the cobe library for WebGL globe visualization
  • Ported from Magic UI

Build docs developers (and LLMs) love