Sha256: fa114359fe96acac2fd470d81c52b0ce1acc9b9dc0e7628a761f7f378b7b512f

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

var vows = require("vows"),
    assert = require("./assert"),
    load = require("./load");

var suite = vows.describe("d3.geo.armadillo");

suite.addBatch({
  "armadillo": {
    topic: load("armadillo"),
    "default": {
      topic: function(geo) { return geo.armadillo(); },
      "projections and inverse projections": function(armadillo) {
        assert.equalInverse(armadillo, [   0,   0], [480,        250]);
        // TODO: needs D3 core support
        // assert.isNaN(armadillo([0, -90])[0]);
        assert.equalInverse(armadillo, [   0,  90], [480,         57.743085]);
        assert.equalInverse(armadillo, [   0, -45], [480,        334.643146]);
        assert.equalInverse(armadillo, [   0,  45], [480,        135.304239]);
        // TODO figure out why the inverse doesn't match exactly.
        // assert.equalInverse(armadillo, [-180,   0], [180, 147.393957]);
        // assert.equalInverse(armadillo, [ 180,   0], [780, 147.393957]);
        assert.equalInverse(armadillo, [-179,  15], [185.122354, 111.792545]);
        assert.equalInverse(armadillo, [   1,   1], [482.617761, 247.528295]);
        assert.equalInverse(armadillo, [  45,  87], [540.406730,  56.511657]);
      }
    }
  }
});

suite.export(module);

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
d3js-plugins-rails-0.0.8 vendor/assets/javascripts/d3/plugins/geo/projection/test/armadillo-test.js
d3js-plugins-rails-0.0.7 vendor/assets/javascripts/d3/plugins/geo/projection/test/armadillo-test.js
d3js-plugins-rails-0.0.6 vendor/assets/javascripts/d3/plugins/geo/projection/test/armadillo-test.js
d3js-plugins-rails-0.0.5 vendor/assets/javascripts/d3/plugins/geo/projection/test/armadillo-test.js