TopoJSON Plugin
===============

The `topojson` plugin parses [TopoJSON data](https://github.com/mbostock/topojson) and publishes it on `planet.plugins.topojson.world` for other plugins to use (particularly for rendering geographical data using D3).

The plugin can load data from a file using Ajax, or can be provided an object that has come from some other source.

API
---

**`planetaryjs.plugins.topojson([config])`**

Valid keys for `config` are:

* `world`: a JavaScript object representing TopoJSON data (not JSON data); defaults to no value, which will cause the plugin to load data from the `file` configuration option
* `file`: the path to a TopoJSON data file to be loaded via Ajax; defaults to `"world-110m.json"`, which can be downloaded with the Planetary.js library from the [download page](https://github.com/BinaryMuse/planetary.js/releases).

If you plan on creating more than one planet from the same TopoJSON data, you can load the data once before loading the plugin and pass the parsed data to the plugin via the `world` property rather than letting the plugin load the data via Ajax each time a new planet is created.

<div class='ui raise segment'>
<div class='ui red ribbon label'>JavaScript</div>

```javascript
planetaryjs.plugins.topojson({
  file: '/data/world-110m.json'
});
```
</div>

<div class='ui raise segment'>
<div class='ui red ribbon label'>JavaScript</div>

```javascript
d3.json('/data/world-110m.json', function(err, data) {
  planetaryjs.plugins.topojson({
    world: data
  });
  // Create planets inside this callback
});
```
</div>

* [Land Plugin](/documentation/builtin_land.html)
* [Borders Plugin](/documentation/builtin_borders.html)
