Advertisement
Guest User

Untitled

a guest
Jul 5th, 2013
644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. var d3 = require("d3");
  2. //var jsdom = require("jsdom");
  3. //htmlStub = '<html><body><div id="chart"></div></body></html>';
  4. console.log(d3.version);
  5. var xy = d3.geo.mercator().translate([-600, 4800]).scale(25000), path = d3.geo.path().projection(xy);
  6. //jsdom.env(htmlStub, function(errors, window) {
  7. // var fs = require("fs");
  8. /*d3.select("#body")
  9. .append("svg:svg")
  10. .append("svg:g")
  11. .attr("id", "regions");
  12. */
  13. // fs.readFile('22.json', 'utf8', function (err,data) {
  14. // if (err) {
  15. // params.errors = err;
  16. //}
  17.  
  18. var l = d3.select("body").append("div")
  19. .attr("id", "chart")
  20. .append("svg")
  21. .attr("id", "background")
  22. .attr("width", 750)
  23. .attr("height", 750);
  24. /*
  25. d3.select("#regions")
  26. .selectAll("path")
  27. .data(data.features)
  28. .enter().append("svg:path")
  29. .attr("d", path);*/
  30. //htmlStub = window.document.innerHTML;
  31. console.log(l);
  32. // });
  33. // });
  34. this.respond({params: params, svg: l});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement