Name drawing functions so we can profile them

This commit is contained in:
Tom MacWright
2013-01-16 13:54:36 -05:00
parent 8151b48d34
commit 199584fbff
6 changed files with 14 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
iD.svg.Areas = function() {
return function(surface, graph, entities, filter, projection) {
return function drawAreas(surface, graph, entities, filter, projection) {
var areas = [];
for (var i = 0; i < entities.length; i++) {

View File

@@ -53,7 +53,7 @@ iD.svg.Lines = function() {
return paths;
}
return function(surface, graph, entities, filter, projection) {
return function drawLines(surface, graph, entities, filter, projection) {
if (!alength) {
var arrow = surface.append('text').text(arrowtext);

View File

@@ -1,5 +1,5 @@
iD.svg.Midpoints = function() {
return function(surface, graph, entities, filter, projection) {
return function drawMidpoints(surface, graph, entities, filter, projection) {
var midpoints = [];
for (var i = 0; i < entities.length; i++) {

View File

@@ -10,7 +10,7 @@ iD.svg.Points = function() {
return 'icons/unknown.png';
}
return function(surface, graph, entities, filter, projection) {
return function drawPoints(surface, graph, entities, filter, projection) {
var points = [];
for (var i = 0; i < entities.length; i++) {
@@ -20,6 +20,10 @@ iD.svg.Points = function() {
}
}
if (points.length > 100) {
return surface.select('.layer-hit').selectAll('g.point').remove();
}
var groups = surface.select('.layer-hit').selectAll('g.point')
.filter(filter)
.data(points, iD.Entity.key);

View File

@@ -1,5 +1,5 @@
iD.svg.Surface = function() {
return function(selection) {
return function drawSurface(selection) {
selection.append('defs')
.append('clipPath')
.attr('id', 'clip')

View File

@@ -1,5 +1,5 @@
iD.svg.Vertices = function() {
return function(surface, graph, entities, filter, projection) {
return function drawVertices(surface, graph, entities, filter, projection) {
var vertices = [];
for (var i = 0; i < entities.length; i++) {
@@ -9,6 +9,10 @@ iD.svg.Vertices = function() {
}
}
if (vertices.length > 2000) {
return surface.select('.layer-hit').selectAll('g.vertex').remove();
}
var groups = surface.select('.layer-hit').selectAll('g.vertex')
.filter(filter)
.data(vertices, iD.Entity.key);