Cobejs globe

From bidewio/better-openclaw · View interactive version

Cobejs globe is an AI agent skill from the GitHub repository bidewio/better-openclaw. Implement a lightweight interactive WebGL globe with cobe.js — responsive canvas setup, markers, rotation, onRender callbacks, and React/Next.js integration patterns.

How to use this skill

Skill file

cobe.js — Lightweight WebGL Globe Skill

When to use

Quick recipe

import createGlobe from "cobe";

let phi = 0;
const globe = createGlobe(canvas, {
  devicePixelRatio: 2,
  width: 600 * 2,
  height: 600 * 2,
  phi: 0,
  theta: 0,
  dark: 1,
  diffuse: 1.2,
  mapSamples: 16000,
  mapBrightness: 6,
  baseColor: [0.3, 0.3, 0.3],
  markerColor: [0.1, 0.8, 1],
  glowColor: [1, 1, 1],
  markers: [
    { location: [37.7749, -122.4194], size: 0.03 },
    { location: [40.7128, -74.0060], size: 0.05 },
  ],
  onRender: (state) => {
    state.phi = phi;
    phi += 0.003;
  },
});

Canvas sizing and DPR

React/Next.js pattern

useEffect(() => {
  let phi = 0;
  const globe = createGlobe(canvasRef.current!, {
    // ... options
    onRender: (state) => { state.phi = phi; phi += 0.003; },
  });
  return () => globe.destroy();
}, []);

Resize handling

Tips for AI Agents

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.