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

glob3d

v1.2.0

Published

A 3D globe visualization library based on Three.js

Readme

Glob3d

An npm package for creating interactive 3D globes. Built with TypeScript and Three.js, Glob3d lets you customize the globe appearance and visualize geographic data as bars on a rotating globe.

Technologies

Features

  • 3D globe with instanced land cells (H3 cells rendered as circles)
  • data-driven bars whose height and location come from the provided dataset
  • customizable globe and bar colors
  • rotate and pan the camera around the globe
  • click a bar or tooltip to smoothly focus the camera on it; click it again to restore the initial view
  • tooltips that scale with camera distance and stay limited to the nearest items; when a bar is selected, the selected bar and the tallest visible bars are prioritized
  • highlight on hover or click
  • destroy() to tear down the renderer, listeners, and tooltip DOM

Installation

npm install glob3d

Peer dependencies: three, h3-js, and world-map-geojson. three-conic-polygon-geometry is no longer required.

Usage

Import

ES6 usage:

import { BarGlob3d, Glob3d } from 'glob3d';
import { BarGlob3d, Glob3d } from 'glob3d';
import type { BarGlobeOptions, GlobeData, GlobeOptions } from 'glob3d';

1. Creating a globe

To create a globe with land cells and default options:

new Glob3d(container, options);
  • container: A DOM element where the globe will be rendered.
  • options: (optional) An object with the following properties:
    • globeColor: The color of the globe (water / surface). Default '#1a166e'.
    • globeRadius: The radius of the globe. Default 100.
    • landCellPadding: The land-cell padding, value between 0 and 1. Default 0.3.
    • landCellRes: The H3 resolution of land cells, integer between 1 and 5. Default 3.
    • autoRotate: Whether the camera auto-rotates. Default true.
    • halo: Whether to display the outline halo around the globe. Default false.

globeOpacity, landCellOpacity, barOpacity, and barActiveOpacity from earlier versions are gone. See the changelog for the land-cell option names.

2. Creating a globe with bars

To create a globe with data bars:

new BarGlob3d(container, data, options);
  • container: A DOM element where the globe will be rendered.
  • data: An array of objects, each representing a bar. Each object should have the following properties:
    • coordinates: An object with properties:
      • lon: The longitude.
      • lat: The latitude.
    • value: The value determining the height of the bar.
    • country: The name of the country belonging to the bar.
    • city: The name of the city belonging to the bar.
  • options: (optional) An object with the following properties:
    • ... the options for the Glob3d class
    • barColor: The color of bars closest to the camera (near color). Default '#dd176d'.
    • barActiveColor: The color of the hovered or clicked bar, and of the tooltip value. Default '#dd176d'.
    • highestBar: The height of the highest bar in relation to the globe diameter, value between 0 and 1. Default 0.5.
    • tooltipsLimit: The number of tooltips to display, starting from the ones closest to the camera. Default 15.
    • tooltipValueSuffix: The suffix added to the value displayed in the tooltip. Default ''.

3. Updating, loading, and cleanup

const globe = new BarGlob3d(container, [], options);

globe.onLoading();
globe.onUpdate(data);
globe.setGlobeColor('#1a166e');
globe.setBarColor('#dd176d');
globe.setBarActiveColor('#dd176d');
globe.setAutoRotate(true);

// when the globe is no longer needed
globe.destroy();
  • onLoading() / onError(): Show the loader or error state and hide the current bars.
  • onUpdate(data): Replace the bars and tooltips with a new dataset. Safe to call repeatedly.
  • setGlobeColor(color): Recolor the globe. On BarGlob3d, also updates the far-bar tint and inactive tooltip backgrounds.
  • setBarColor(color): Recolor bars closest to the camera (near color).
  • setBarActiveColor(color): Recolor the hovered/clicked bar and the tooltip value.
  • setAutoRotate(autoRotate): Toggle camera auto-rotation. Same as the autoRotate constructor option.
  • destroy(): Cancel the animation loop, remove listeners and tooltip DOM, and dispose GPU resources.

Click a bar or its tooltip to select it. The camera smoothly moves to a close view of the selected bar and temporarily disables orbit controls and auto-rotation. Click the same bar again to restore the initial camera view and previous auto-rotation setting.

What's new in 1.0.0

Compared with 0.9.1: land is instanced circular cells instead of per-cell polygon tiles, bars are one instanced mesh, tooltips are virtualized, and destroy() is available. Draw calls stay constant as the dataset grows. See the changelog for the full list, including option renames (setBarActiveColor), removed opacities, the autoRotate option, and exported TypeScript types (GlobeOptions, BarGlobeOptions, GlobeData).