0

I'm trying to display a D3 contour graph on our Drupal 7 website, using the geom.contour d3 library and it works fine on IE and Chrome, but not in firefox, the javascript error says "isoline is not defined" here is where isoline is defined:

svg.selectAll(".isoline")
  .data(color.domain().map(isoline))
  .enter().append("path")
  .datum(function(d) { return d3.geom.contour(d).map(transform); })
  .attr("class", "isoline")
  .attr("d", function(d) { return "M" + d.join("L") + "Z"; })
  .style("fill", function(d, i) { return color.range()[i]; });

It almost looks like magic here because the variable isoline really doesn't exist anywhere above the code I'm showing above... any ideas? When I try this same code outside drupal in firefox, it seems to work fine!

here's my sloppy working example: http://jsfiddle.net/csebranek/6F9H5/6/

I was too lazy to figure out how to import the json data externally so I pasted it in there, so you'll have to scroll down to see the javascript.

I figured it out... I had to remove my try,catch blocks in order for firefox to render it correctly.

4

0 に答える 0