d3 naming convention

This commit is contained in:
John Firebaugh
2012-12-01 08:19:24 -08:00
parent 96af626bd7
commit 45270b55d2
4 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ var iD = function(container) {
});
window.onresize = function() {
map.setSize(m.size());
map.size(m.size());
};
d3.select(document).on('keydown', function() {
+2 -2
View File
@@ -256,7 +256,7 @@ iD.Map = function(elem, connection) {
.selectAll('#clip-rect')
.size(dimensions);
tileclient.setSize(dimensions);
tileclient.size(dimensions);
return map;
}
@@ -523,7 +523,7 @@ iD.Map = function(elem, connection) {
map.zoomOut = zoomOut;
map.projection = projection;
map.setSize = setSize;
map.size = setSize;
map.surface = surface;
+3 -4
View File
@@ -48,11 +48,11 @@ iD.Tiles = function(selection, projection) {
.attr("y", function(d) { return d[1]; });
}
function setSize(x) {
tile.size(x);
t.size = function(size) {
tile.size(size);
redraw();
return t;
}
};
t.template = function(x) {
if (!arguments.length) return template;
@@ -61,7 +61,6 @@ iD.Tiles = function(selection, projection) {
return t;
};
t.setSize = setSize;
t.redraw = redraw;
return t;
+1 -1
View File
@@ -30,7 +30,7 @@ describe('Map', function() {
describe('#getExtent', function() {
it('reports extent', function() {
expect(map.setSize([100, 100])).toEqual(map);
expect(map.size([100, 100])).toEqual(map);
expect(map.center([0, 0])).toEqual(map);
expect(map.getExtent()[0][0]).toBeCloseTo(-36);
expect(map.getExtent()[1][0]).toBeCloseTo(36);