Source
395
395
py = coord[1][1];
396
396
pv = point.getAttribute('label');
397
397
pp = (coord[2][0] - coord[0][0]) / 2;
398
398
ps = point.getAttribute('data-px');
399
399
}
400
400
break;
401
401
402
402
case 'staircase':
403
403
case 'line':
404
404
var direction_string = '',
405
-
label = [],
405
+
labels = [],
406
406
data_set = nodes[i].getAttribute('data-set'),
407
407
data_nodes = nodes[i].childNodes,
408
408
elmnt_label,
409
409
cx,
410
410
cy;
411
411
412
412
for (var index = 0, len = data_nodes.length; index < len; index++) {
413
413
elmnt_label = data_nodes[index].getAttribute('label');
414
+
414
415
if (elmnt_label) {
415
-
label.push(elmnt_label);
416
+
labels.push(elmnt_label);
416
417
417
418
if (data_nodes[index].tagName.toLowerCase() === 'circle') {
418
419
cx = data_nodes[index].getAttribute('cx');
419
420
cy = data_nodes[index].getAttribute('cy');
420
421
direction_string += ' _' + cx + ',' + cy;
421
422
}
422
423
else {
423
424
direction_string += ' ' + data_nodes[index].getAttribute('d');
424
425
}
425
426
}
426
427
}
427
428
428
-
label = label.join(',').split(',');
429
+
labels = labels.join(',').split(',');
429
430
430
431
var direction = ED // Edge transforms 'd' attribute.
431
432
? direction_string.substr(1).replace(/([ML])\s(\d+)\s(\d+)/g, '$1$2\,$3').split(' ')
432
433
: direction_string.substr(1).split(' '),
433
434
index = direction.length,
434
435
point,
435
436
point_label;
436
437
437
438
while (index) {
438
439
index--;
439
440
point = direction[index].substr(1).split(',');
440
-
point_label = label[data_set === 'line' ? index : Math.ceil(index / 2)];
441
+
point_label = labels[data_set === 'line' ? index : Math.ceil(index / 2)];
441
442
442
443
if (x >= parseInt(point[0]) && point_label !== '') {
443
444
px = point[0];
444
445
py = point[1];
445
446
pv = point_label;
446
447
break;
447
448
}
448
449
}
449
450
break;
450
451
}