Skip to content

Commit e06a279

Browse files
committed
Remove unused d3.geo.streamListener.
1 parent 0dce022 commit e06a279

4 files changed

Lines changed: 76 additions & 23 deletions

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ d3.layout.js: \
181181
d3.geo.js: \
182182
src/geo/geo.js \
183183
src/geo/stream.js \
184-
src/geo/stream-listener.js \
184+
src/geo/stream-buffer.js \
185+
src/geo/stream-context.js \
185186
src/geo/spherical.js \
186187
src/geo/cartesian.js \
187188
src/geo/type.js \

d3.js

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5397,15 +5397,77 @@
53975397
while (++i < n) d3_geo_streamLine(coordinates[i], listener);
53985398
listener.polygonEnd();
53995399
}
5400-
var d3_geo_streamListener = d3.geo.streamListener = function() {};
5401-
d3_geo_streamListener.prototype = {
5402-
sphere: d3_noop,
5403-
point: d3_noop,
5404-
lineStart: d3_noop,
5405-
lineEnd: d3_noop,
5406-
polygonStart: d3_noop,
5407-
polygonEnd: d3_noop
5400+
function d3_geo_streamBuffer() {
5401+
this._buffer = [];
5402+
this._point = d3_geo_pathCircle(4.5);
5403+
}
5404+
var d3_geo_streamBufferPrototype = {
5405+
point: d3_geo_streamBufferPoint,
5406+
lineStart: function() {
5407+
this.point = d3_geo_streamBufferPointLineStart;
5408+
},
5409+
lineEnd: d3_geo_streamBufferLineEnd,
5410+
polygonStart: function() {
5411+
this.lineEnd = d3_geo_streamBufferLineEndPolygon;
5412+
},
5413+
polygonEnd: function() {
5414+
this.lineEnd = d3_geo_streamBufferLineEnd;
5415+
},
5416+
toString: function() {
5417+
var s = this._buffer.join("");
5418+
this._buffer = [];
5419+
return s;
5420+
}
5421+
};
5422+
function d3_geo_streamBufferPoint(x, y) {
5423+
this._buffer.push("M", x, ",", y, this._point);
5424+
}
5425+
function d3_geo_streamBufferPointLineStart(x, y) {
5426+
this._buffer.push("M", x, ",", y);
5427+
this.point = d3_geo_streamBufferPointLine;
5428+
}
5429+
function d3_geo_streamBufferPointLine(x, y) {
5430+
this._buffer.push("L", x, ",", y);
5431+
}
5432+
function d3_geo_streamBufferLineEnd() {
5433+
this.point = d3_geo_streamBufferPoint;
5434+
}
5435+
function d3_geo_streamBufferLineEndPolygon() {
5436+
this._buffer.push("Z");
5437+
}
5438+
function d3_geo_streamContext() {
5439+
this._pointRadius = 4.5;
5440+
}
5441+
var d3_geo_streamContextPrototype = {
5442+
point: d3_geo_streamContextPoint,
5443+
lineStart: function() {
5444+
this.point = d3_geo_streamContextPointLineStart;
5445+
},
5446+
lineEnd: d3_geo_streamContextLineEnd,
5447+
polygonStart: function() {
5448+
this.lineEnd = d3_geo_streamContextLineEndPolygon;
5449+
},
5450+
polygonEnd: function() {
5451+
this.lineEnd = d3_geo_streamContextLineEnd;
5452+
}
54085453
};
5454+
function d3_geo_streamContextPoint(x, y) {
5455+
this._context.moveTo(x, y);
5456+
this._context.arc(x, y, this._pointRadius, 0, 2 * π);
5457+
}
5458+
function d3_geo_streamContextPointLineStart(x, y) {
5459+
this._context.moveTo(x, y);
5460+
this.point = d3_geo_streamContextPointLine;
5461+
}
5462+
function d3_geo_streamContextPointLine(x, y) {
5463+
this._context.lineTo(x, y);
5464+
}
5465+
function d3_geo_streamContextLineEnd() {
5466+
this.point = d3_geo_streamContextPoint;
5467+
}
5468+
function d3_geo_streamContextLineEndPolygon() {
5469+
this._context.closePath();
5470+
}
54095471
function d3_geo_spherical(cartesian) {
54105472
return [ Math.atan2(cartesian[1], cartesian[0]), Math.asin(Math.max(-1, Math.min(1, cartesian[2]))) ];
54115473
}

d3.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/geo/stream-listener.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)