travel3dglobe
v0.1.3
Published
Reusable 3D globe component with visual config editor workflow
Downloads
52
Readme
Travel3DGlobe
A reusable 3D globe component with a visual config editor that can export/import globe-config.json.
Editor App
Hosted editor (Vercel): travel-3d-globe.vercel.app
This app lets you tune globe settings visually and export a config JSON for use in your own project.
Install
From npm:
npm install travel3dglobeFrom GitHub:
npm install github:fabienstrauss/travel-3d-globe#mainComponent Usage
import { createGlobe } from 'travel3dglobe';
const globe = await createGlobe({
container: document.getElementById('globe-root'),
config: {
highlightCodes: ['USA', 'CAN', 'MEX']
}
});
// optional runtime updates
await globe.setConfig({ showGrid: false, haloColor: '#33aaff' });
// optional: export current runtime config object
const cfg = globe.getConfig();
// required on unmount / cleanup
globe.destroy();Required:
container: DOM element where the globe is mounted
Optional:
config: partial globe config (missing fields use defaults)enableDebugPanel:true | false(defaulttruein editor host usage)
Notes:
- Globe size follows the container size.
- Use CSS for responsive or fixed dimensions of the container.
globeScalechanges globe size inside the canvas, not the canvas size itself.
Project Structure
src/index.js: package exportssrc/core/globeComponent.js: embeddable globe lifecycle/APIsrc/config/globeConfig.js: config defaults + migration/normalizationsrc/debug/controls.js: editor GUIsrc/main.js: editor/demo app entry
License
Contributing
Contributions are welcome via issues and pull requests.
