npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@plexusui/earth

v0.0.2

Published

Primitive-based Earth visualization component for aerospace applications

Downloads

10

Readme

@plexus/earth

Primitive-based Earth visualization component for React Three Fiber. Build stunning 3D Earth visualizations with composable primitives.

Installation

npm install @plexus/earth

Peer Dependencies

npm install @react-three/fiber @react-three/drei react react-dom three

Quick Start

import { Earth } from '@plexus/earth';

function App() {
  return (
    <Earth
      dayMapUrl="/textures/earth-day.jpg"
      cloudsMapUrl="/textures/earth-clouds.jpg"
      enableRotation={true}
    />
  );
}

API

Earth (Composed Component)

The main pre-configured component with sensible defaults.

Props:

  • dayMapUrl?: string - Earth day texture (default: /day.jpg)
  • bumpMapUrl?: string - Bump map for surface detail (default: /bump.jpg)
  • cloudsMapUrl?: string - Cloud layer texture (default: /clouds.jpg)
  • normalMapUrl?: string - Normal map for advanced lighting
  • brightness?: number - Overall scene brightness (default: 1.2)
  • enableRotation?: boolean - Auto-rotate the Earth (default: false)
  • cameraPosition?: [number, number, number] - Camera position (default: [0, 0, 15000])
  • cameraFov?: number - Camera field of view (default: 45)
  • minDistance?: number - Min zoom distance (default: 7000)
  • maxDistance?: number - Max zoom distance (default: 50000)
  • children?: React.ReactNode - Custom content to render in the scene

Example:

<Earth
  dayMapUrl="/earth.jpg"
  enableRotation={true}
  brightness={1.5}
  cameraPosition={[0, 0, 20000]}
/>

EarthScene (Scene Primitive)

Canvas with lights and controls - use when you want to customize what's rendered.

Props:

  • cameraPosition?: [number, number, number]
  • cameraFov?: number
  • minDistance?: number
  • maxDistance?: number
  • brightness?: number
  • children?: React.ReactNode

Example:

import { EarthScene, EarthSphereRoot } from '@plexus/earth';

function CustomEarth() {
  return (
    <EarthScene brightness={1.5}>
      <EarthSphereRoot textureUrl="/custom.jpg" />
      {/* Add satellites, markers, etc. */}
      <mesh position={[8000, 0, 0]}>
        <sphereGeometry args={[200, 32, 32]} />
        <meshStandardMaterial color="red" />
      </mesh>
    </EarthScene>
  );
}

EarthSphereRoot (Root Primitive)

Just the Earth sphere - use when you want complete control over the scene.

Props:

  • radius?: number - Sphere radius (default: EARTH_RADIUS = 6371)
  • textureUrl?: string - Main texture
  • bumpMapUrl?: string - Bump map
  • cloudsMapUrl?: string - Clouds texture
  • normalMapUrl?: string - Normal map
  • brightness?: number
  • enableRotation?: boolean
  • emissiveColor?: string - Emissive color (default: "#111111")
  • shininess?: number - Material shininess (default: 5)
  • bumpScale?: number - Bump map intensity (default: 0.05)

Example:

import { Canvas } from '@react-three/fiber';
import { EarthSphereRoot, EARTH_RADIUS } from '@plexus/earth';

function App() {
  return (
    <Canvas>
      <ambientLight />
      <EarthSphereRoot
        radius={EARTH_RADIUS}
        textureUrl="/earth.jpg"
        enableRotation={true}
      />
    </Canvas>
  );
}

Constants

import {
  EARTH_RADIUS,           // 6371 (scene units)
  EARTH_REAL_RADIUS_KM,   // 6371 km
  EARTH_ROTATION_PERIOD,  // 1 Earth day
  EARTH_ORBITAL_PERIOD,   // 365.25 Earth days
  EARTH_DIAMETER_KM       // 12742 km
} from '@plexus/earth';

Textures

You'll need Earth textures. High-quality free textures are available from:

Recommended texture sizes:

  • Day map: 4096x2048 or 8192x4096
  • Clouds: 2048x1024
  • Bump map: 2048x1024

Examples

Rotating Earth with Clouds

<Earth
  dayMapUrl="/textures/earth-day.jpg"
  cloudsMapUrl="/textures/earth-clouds.jpg"
  enableRotation={true}
  brightness={1.3}
/>

Earth with Custom Markers

import { EarthScene, EarthSphereRoot } from '@plexus/earth';

function EarthWithMarkers() {
  return (
    <EarthScene>
      <EarthSphereRoot />
      {/* Marker over New York */}
      <mesh position={[4000, 3000, 2000]}>
        <sphereGeometry args={[100, 16, 16]} />
        <meshStandardMaterial color="red" emissive="red" />
      </mesh>
    </EarthScene>
  );
}

Multiple Earths

import { Canvas } from '@react-three/fiber';
import { EarthSphereRoot } from '@plexus/earth';

function MultipleEarths() {
  return (
    <Canvas>
      <ambientLight />
      <EarthSphereRoot radius={3000} position={[-5000, 0, 0]} />
      <EarthSphereRoot radius={3000} position={[5000, 0, 0]} />
    </Canvas>
  );
}

TypeScript

Fully typed with TypeScript. All props and exports are typed.

import type { EarthProps, EarthSceneProps, EarthSphereRootProps } from '@plexus/earth';

License

MIT


Part of @plexus/ui-aerospace - Primitive-based aerospace components