Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var d3 = require("d3");
- //var jsdom = require("jsdom");
- //htmlStub = '<html><body><div id="chart"></div></body></html>';
- console.log(d3.version);
- var xy = d3.geo.mercator().translate([-600, 4800]).scale(25000), path = d3.geo.path().projection(xy);
- //jsdom.env(htmlStub, function(errors, window) {
- // var fs = require("fs");
- /*d3.select("#body")
- .append("svg:svg")
- .append("svg:g")
- .attr("id", "regions");
- */
- // fs.readFile('22.json', 'utf8', function (err,data) {
- // if (err) {
- // params.errors = err;
- //}
- var l = d3.select("body").append("div")
- .attr("id", "chart")
- .append("svg")
- .attr("id", "background")
- .attr("width", 750)
- .attr("height", 750);
- /*
- d3.select("#regions")
- .selectAll("path")
- .data(data.features)
- .enter().append("svg:path")
- .attr("d", path);*/
- //htmlStub = window.document.innerHTML;
- console.log(l);
- // });
- // });
- this.respond({params: params, svg: l});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement