{"action":"created","issue":{"url":"https://api.github.com/repos/mbostock/d3/issues/2364","labels_url":"https://api.github.com/repos/mbostock/d3/issues/2364/labels{/name}","comments_url":"https://api.github.com/repos/mbostock/d3/issues/2364/comments","events_url":"https://api.github.com/repos/mbostock/d3/issues/2364/events","html_url":"https://github.com/mbostock/d3/issues/2364","id":64898774,"number":2364,"title":"d3.min.js version 3 conflicted with jquery.1.10.2.js","user":{"login":"jiywang3","id":11690222,"avatar_url":"https://avatars.githubusercontent.com/u/11690222?v=3","gravatar_id":"","url":"https://api.github.com/users/jiywang3","html_url":"https://github.com/jiywang3","followers_url":"https://api.github.com/users/jiywang3/followers","following_url":"https://api.github.com/users/jiywang3/following{/other_user}","gists_url":"https://api.github.com/users/jiywang3/gists{/gist_id}","starred_url":"https://api.github.com/users/jiywang3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiywang3/subscriptions","organizations_url":"https://api.github.com/users/jiywang3/orgs","repos_url":"https://api.github.com/users/jiywang3/repos","events_url":"https://api.github.com/users/jiywang3/events{/privacy}","received_events_url":"https://api.github.com/users/jiywang3/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-28T04:57:02Z","updated_at":"2015-03-28T12:24:01Z","closed_at":"2015-03-28T11:15:49Z","body":"I used d3 and jquery to build a skill sunburst similar to the one at http://bl.ocks.org/wizicer/f662a0b04425fc0f7489. This worked fine at local. However, when I move the files to dev, I got the errors below. I think it's due to some eval calls. BUt I can't find where it is used in d3.js. If I removed d3.js, the error went away.\r\n\r\nJavascript file:\r\n// ref: http://bl.ocks.org/wizicer/f662a0b04425fc0f7489\r\nfunction mouseover(data) {\r\n    var c = getcrumbpath(data);\r\n\r\n    sunburst\r\n        .selectAll(\"path\")\r\n        .style(\"opacity\", .4);\r\n\r\n    sunburst\r\n        .selectAll(\"path\")\r\n        .filter(function (a) { return c.indexOf(a) >= 0 })\r\n        .style(\"opacity\", 1);\r\n}\r\nfunction mouseleave() {\r\n    sunburst\r\n        .selectAll(\"path\")\r\n        .style(\"opacity\", 1);\r\n\r\n}\r\nfunction getcrumbpath(a) {\r\n    for (var temp = [], c = a; c.parent;) temp.unshift(c), c = c.parent;\r\n    return temp\r\n}\r\n\r\nfunction getcolor(color) {\r\n    return .299 * color.r + .587 * color.g + .114 * color.b\r\n}\r\nfunction k(a) {\r\n    var c = [\"#E44146\", \"#A8B529\", \"#E9666B\", \"#FBA047\", \"#00B0D9\", \"#E76F33\", \"#57B7DD\", \"#74B84B\"],\r\n        d = [-.1, -.05, 0];\r\n    if (a.depth == 0) { // center circle\r\n        return \"#FFFFFF\";\r\n    }\r\n    else if (a.depth == 1) { // first layer\r\n        var e = c[coloralternative % 8];\r\n        return coloralternative++, e\r\n    }\r\n    else if (a.depth > 1) { // second layer\r\n        var f = d[a.value % 3];\r\n        return d3.rgb(a.parent._color).brighter(.2 * a.depth + f * a.depth)\r\n    }\r\n}\r\n\r\n//https://gist.github.com/biovisualize/1016860#file-index-html\r\nvar tooltip = d3.select(\"#skills\")\r\n\t.append(\"div\")\r\n\t.style(\"background-color\", \"white\")\r\n\t.style(\"position\", \"absolute\")\r\n\t.style(\"z-index\", \"10\")\r\n\t.style(\"visibility\", \"hidden\")\r\n\t.text(\"a simple tooltip\");\r\n\r\nvar width = 800,\r\n    height = 800,\r\n    rad = 0.5*Math.min(width, height) / Math.PI - 25,\r\n    q = k,\r\n\r\n    sunburst = d3\r\n        .select(\".skills-sunburst\")\r\n        .append(\"svg:svg\")\r\n        .attr(\"width\", width)\r\n        .attr(\"height\", height)\r\n        .append(\"svg:g\")\r\n        .attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")\");\r\n\r\nvar t = function (a, b) {\r\n        var c = [],\r\n            d = a.length;\r\n        if (a.length !== b.length) c = a.length > b.length ? a : b;\r\n        else for (var e = 0; d > e; e++) {\r\n            var f = Math.max(a[e], b[e]) - Math.abs(a[e] - b[e]) / 8;\r\n            c.push(f)\r\n        }\r\n        return c\r\n    },\r\n\r\n    u = function (a) {\r\n        if (a instanceof Array) return a;\r\n        var b = [];\r\n        return $.each(a, function (a, c) {\r\n            b = t(u(c), b)\r\n        }), b\r\n    },\r\n\r\n    proficiencydata = d3\r\n        .layout\r\n        .partition()\r\n        .sort(null)\r\n        .size([2 * Math.PI, rad])\r\n        .children(function (a) {\r\n            return a.value instanceof Array\r\n                ? (a._proficiency = a.value, d3.entries([a.value[a.value.length - 1]]))\r\n                : (a._proficiency = u(a.value), isNaN(a.value) ? d3.entries(a.value) : null)\r\n        })\r\n        .value(function (a) { return a.value }),\r\n\r\n    arc = d3.svg\r\n        .arc()\r\n        .startAngle(function (a) { return a.x })\r\n        .endAngle(function (a) { return a.x + a.dx - .01 / (a.depth + .5) })\r\n        .innerRadius(function (a) {\r\n\t\t\tif(a.depth == 0) {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\telse if(a.depth == 1) {\r\n\t\t\t\treturn rad / Math.PI;\r\n\t\t\t}\r\n\t\t\telse if(a.depth == 2) {\r\n\t\t\t    return 4*rad / Math.PI;\r\n\t\t    }\r\n\t\t})\r\n        .outerRadius(function (a) {\r\n\t\t\t//console.log(\"depth: \" + a.depth + \" value: \" + a.value);\r\n\t\t\t// depth: 0 means center circle, 1 means 1st layer, etc\r\n\t\t\t// value: number of children in the 2nd layer\r\n\t\t\tif(a.depth == 0) {\r\n\t\t\t\treturn rad / Math.PI - 1;\r\n\t\t\t}\r\n\t\t\telse if(a.depth == 1) {\r\n\t\t\t\treturn 4*rad / Math.PI - 1;\r\n\t\t\t}\r\n\t\t\telse if(a.depth == 2) {\r\n\t\t\t    return 12*rad / Math.PI - 1;\r\n\t\t    }\r\n\t\t});\r\n\r\nvar coloralternative = 0\r\n\r\nvar path = sunburst\r\n    .data(d3.entries(skillsdata))\r\n    .selectAll(\"g\")\r\n    .data(proficiencydata)\r\n    .enter()\r\n    .append(\"svg:g\")\r\n    //.attr(\"display\", function (a) { return a.depth ? null : \"none\" });\r\n    .attr(\"display\", null);\r\n\r\npath\r\n    .append(\"svg:path\")\r\n    .attr(\"d\", arc)\r\n    .attr(\"stroke\", \"#fff\")\r\n    .attr(\"fill\", function (a) { return a._color = q(a), a._color })\r\n    .attr(\"fill-rule\", \"evenodd\")\r\n    .attr(\"display\", function (a) { return a.children ? null : \"none\" })\r\n    .on(\"mouseover\", mouseover);\r\n\r\npath\r\n    .append(\"svg:text\")\r\n    .attr(\"transform\", function (a) {\r\n\t\tif(a.depth == 0) {\r\n\t\t\treturn \"rotate(0)\"\r\n\t\t}\r\n\t\telse if(a.depth == 1) {\r\n\t\t\tvar r = 180 * ((a.x + a.dx / 2 - Math.PI / 2) / Math.PI);\r\n\t\t\tif(r > 90) r -= 180;\r\n\t\t\treturn \"rotate(\" + r + \")\"\r\n\t\t}\r\n\t\telse if(a.depth == 2) {\r\n\t\t\tvar r = 180 * ((a.x + a.dx / 2 - Math.PI / 2) / Math.PI);\r\n\t\t\tif(r > 90) r -= 180;\r\n\t\t\treturn \"rotate(\" + r + \")\"\r\n\t\t}\r\n    })\r\n    .attr(\"x\", function (a) {\r\n\t\tif(a.depth == 0) {\r\n\t\t\treturn - rad / Math.PI;\r\n\t\t}\r\n\t\telse if(a.depth == 1) {\r\n\t\t\tvar r = 180 * ((a.x + a.dx / 2 - Math.PI / 2) / Math.PI);\r\n\t\t\tif(r > 90) {\r\n\t\t        return -4*rad / Math.PI;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn rad / Math.PI;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(a.depth == 2) {\r\n\t\t\tvar textwidth = 35;\r\n\r\n\t\t\tvar adjustX;\r\n\t\t\tif(a.key.length > textwidth) {\r\n\t\t\t\tadjustX = 0;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tadjustX = (1 - 0.9 * a.key.length / textwidth) * (12*rad - 4*rad);\r\n\t\t\t}\r\n\r\n\t\t\tvar r = 180 * ((a.x + a.dx / 2 - Math.PI / 2) / Math.PI);\r\n\t\t\tif(r > 90) {\r\n\t\t        return -12*rad / Math.PI;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn (4*rad + adjustX) / Math.PI;\r\n\t\t\t}\r\n\t\t}\r\n\t})\r\n    .attr(\"dx\", \"6\")\r\n    .attr(\"dy\", \".1em\")\r\n    .text(function (a) {\r\n\t\tvar text,textwidth;\r\n\t\tif(a.depth == 0) {\r\n\t\t\ttextwidth = 7;\r\n\t\t\ttext = a.key;\r\n\t\t\tif(text.length > textwidth) {\r\n\t\t\t    text = text.substr(0, textwidth-3) + '...';\r\n\t\t    }\r\n\t\t}\r\n\t\telse if(a.depth == 1) {\r\n\t\t\ttextwidth = 15;\r\n\t\t\ttext = a.key;\r\n\t\t\tif(text.length > textwidth) {\r\n\t\t\t    text = text.substr(0, textwidth-3) + '...';\r\n\t\t    }\r\n\t\t}\r\n\t\telse if(a.depth == 2) {\r\n\t\t\ttextwidth = 40;\r\n\t\t\ttext = a.key;\r\n\t\t\tif(text.length > textwidth) {\r\n\t\t\t    text = text.substr(0, textwidth-3) + '...';\r\n\t\t    }\r\n\t\t}\r\n\r\n\t\treturn text;\r\n\t})\r\n    .attr(\"display\", function (a) { return a.children ? null : \"none\" })\r\n    //.on(\"mouseover\", mouseover);\r\n\t.on(\"mouseover\", function(a){\r\n\t\tif(a.depth == 0 || a.depth == 1) {\r\n\t\t\t$(this).css('cursor', 'pointer');\r\n\t\t}\r\n\r\n\t\ttooltip.text(a.key);\r\n\r\n\t\treturn tooltip.style(\"visibility\", \"visible\");\r\n\t})\r\n\t.on(\"mousemove\", function(a){\r\n\t\ttooltip.text(a.key);\r\n\r\n\t\tvar top = 0, left = 0;\r\n\t\tif($(\"#dialogDiv2\").length) {\r\n\t\t  var position = $(\"#dialogDiv2\").offset();\r\n\t\t  top = position.top;\r\n\t\t  left = position.left;\r\n\t    }\r\n\r\n\t\treturn tooltip.style(\"top\", (event.screenY+window.pageYOffset-top-10)+\"px\").style(\"left\",(event.screenX+window.pageXOffset-left+10)+\"px\");\r\n\t})\r\n\t.on(\"mouseout\", function(a){return tooltip.style(\"visibility\", \"hidden\");})\r\n\t.on(\"click\", function(a){\r\n\t\tif(a.depth == 0 || a.depth == 1) {\r\n\t\t\twindow.location.href='http://google.com';\r\n\t\t}\r\n\t})\r\n\t;\r\n\r\nd3\r\n    .select(\".skills-sunburst\")\r\n    .on(\"mouseleave\", mouseleave);\r\n\r\n\r\nError:\r\nUncaught SyntaxError: Unexpected token !\r\njquery-1.10.2.min.js:4 (anonymous function)\r\njquery-1.10.2.min.js:4 x.extend.globalEval\r\njquery-1.10.2.min.js:6 x.ajaxSetup.converters.text script\r\njquery-1.10.2.min.js:6 Onjquery-1.10.2.min.js:6 k\r\njquery-1.10.2.min.js:6 x.ajaxTransport.send.r\r\njquery-1.10.2.min.js:6 x.ajaxTransport.send\r\njquery-1.10.2.min.js:6 x.extend.ajax\r\njquery-1.10.2.min.js:6 x.extend._evalUrl\r\njquery-1.10.2.min.js:5 x.fn.extend.domManip\r\njquery-1.10.2.min.js:5 x.fn.extend.append\r\njquery-1.10.2.min.js:5 (anonymous function)\r\njquery-1.10.2.min.js:4 x.extend.access\r\njquery-1.10.2.min.js:5 x.fn.extend.html\r\njquery-1.10.2.min.js:6 (anonymous function)\r\njquery-1.10.2.min.js:4 x.Callbacks.c\r\njquery-1.10.2.min.js:4 x.Callbacks.p.fireWith\r\njquery-1.10.2.min.js:6 k\r\njquery-1.10.2.min.js:6 x.ajaxTransport.send.r"},"comment":{"url":"https://api.github.com/repos/mbostock/d3/issues/comments/87217951","html_url":"https://github.com/mbostock/d3/issues/2364#issuecomment-87217951","issue_url":"https://api.github.com/repos/mbostock/d3/issues/2364","id":87217951,"user":{"login":"jiywang3","id":11690222,"avatar_url":"https://avatars.githubusercontent.com/u/11690222?v=3","gravatar_id":"","url":"https://api.github.com/users/jiywang3","html_url":"https://github.com/jiywang3","followers_url":"https://api.github.com/users/jiywang3/followers","following_url":"https://api.github.com/users/jiywang3/following{/other_user}","gists_url":"https://api.github.com/users/jiywang3/gists{/gist_id}","starred_url":"https://api.github.com/users/jiywang3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiywang3/subscriptions","organizations_url":"https://api.github.com/users/jiywang3/orgs","repos_url":"https://api.github.com/users/jiywang3/repos","events_url":"https://api.github.com/users/jiywang3/events{/privacy}","received_events_url":"https://api.github.com/users/jiywang3/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T12:24:00Z","updated_at":"2015-03-28T12:24:00Z","body":"Ok"}}