summaryrefslogtreecommitdiffstats
path: root/script.js
diff options
context:
space:
mode:
authorJames Nylen <jnylen@gmail.com>2014-09-16 07:40:24 -0500
committerJames Nylen <jnylen@gmail.com>2014-09-16 07:40:24 -0500
commit9cc4ab7abfb0a3a9c921d51570903fc2640044df (patch)
tree7f4578e9b1ee8ce5e112240ab299e79b16115916 /script.js
parent11da1623d8ae40dc435c3a3098342beb1ffb2a59 (diff)
downloadd3-process-map-origin/fix-ie-markers.zip
d3-process-map-origin/fix-ie-markers.tar.gz
d3-process-map-origin/fix-ie-markers.tar.bz2
Work around IE bug regarding paths with markersorigin/fix-ie-markers
Fixes #6.
Diffstat (limited to 'script.js')
-rw-r--r--script.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/script.js b/script.js
index 0c04ea5..930f594 100644
--- a/script.js
+++ b/script.js
@@ -1,10 +1,13 @@
var graph = {},
selected = {},
- highlighted = null;
+ highlighted = null,
+ isIE = false;
$(function() {
resize();
+ isIE = $.browser.msie;
+
d3.json(config.jsonUrl, function(data) {
if (data.errors.length) {
alert('Data error(s):\n\n' + data.errors.join('\n'));
@@ -497,6 +500,12 @@ function tick(e) {
return d.source.y;
})
.each(function(d) {
+ if (isIE) {
+ // Work around IE bug regarding paths with markers
+ // Credit: #6 and http://stackoverflow.com/a/18475039/106302
+ this.parentNode.insertBefore(this, this);
+ }
+
var x = d.target.x,
y = d.target.y,
line = new geo.LineSegment(d.source.x, d.source.y, x, y);