MCPcopy Index your code
hub / github.com/BinaryMuse/planetary.js

github.com/BinaryMuse/planetary.js @v1.1.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.3 ↗ · + Follow
473 symbols 1,145 edges 18 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Planetary.js

Planetary.js is a JavaScript library for building awesome interactive globes, like this one:

Planetary.js Screenshot

Planetary.js is based on D3.js and TopoJSON. It has built-in support for zoom, rotation, mouse interaction, and displaying animated "pings" at any coordinate. Via plugins, Planetary.js can be extended to do whatever you want!

Examples, documentation, and more can be found at planetaryjs.com.

Requirements

Download

Download Planetary.js from the Planetary.js web site.

Quick Start

You'll need to run this page from a web server of some kind so that Planetary.js can load the TopoJSON data via Ajax.

HTML:

<html>
<head>
  <script type='text/javascript' src='http://d3js.org/d3.v3.min.js'></script>
  <script type='text/javascript' src='http://d3js.org/topojson.v1.min.js'></script>
  <script type='text/javascript' src='planetaryjs.min.js'></script>
</head>
<body>
  <canvas id='globe' width='500' height='500'></canvas>
  <script type='text/javascript' src='yourApp.js'></script>
</body>
</html>

JavaScript (yourApp.js):

var planet = planetaryjs.planet();
// You can remove this statement if `world-110m.json`
// is in the same path as the HTML page:
planet.loadPlugin(planetaryjs.plugins.earth({
  topojson: { file: 'http/path/to/world-110m.json' }
}));
// Make the planet fit well in its canvas
planet.projection.scale(250).translate([250, 250]);
var canvas = document.getElementById('globe');
planet.draw(canvas);

Congratulations! You've rendered your first globe.

Documentation

In-depth documentation can be found at planetaryjs.com.

Building

Building the project requires Node.js. Once you've installed the project's dependencies with npm install, you can build the JavaScript to the dist directory with npm run build.

License

Planetary.js is licensed under the MIT license. See the LICENSE file for more information.

Core symbols most depended-on inside this repo

build
called by 4
gulpfile.js
doDrawLoop
called by 2
src/body.js
doNext
called by 2
src/body.js
updateDate
called by 2
site/public/examples/quake/quake.js
drawPings
called by 1
src/plugins.js
drawPing
called by 1
src/plugins.js
initPlugins
called by 1
src/body.js
runOnInitHooks
called by 1
src/body.js

Shape

Function 473

Languages

TypeScript100%

Modules by API surface

site/public/js/lib/d3.v3.min.js376 symbols
site/public/js/lib/moment.min.js55 symbols
site/public/js/lib/topojson.v1.min.js15 symbols
site/public/js/lib/planetaryjs.min.js7 symbols
src/body.js6 symbols
site/public/examples/quake/quake.js5 symbols
src/plugins.js4 symbols
site/public/js/homepage.js2 symbols
site/public/examples/rotating.js2 symbols
gulpfile.js1 symbols

For agents

$ claude mcp add planetary.js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact