RunKit + npm: d3-voronoi

node v7.10.1
version: master
endpointsharetweet
var d3 = require("d3") var width = 400; var height = 400; // change width and height to 100 works well // var width = 100; // var height = 100; var x = d3.scaleLinear(); var y = d3.scaleLinear(); x.domain([0, 1]).range([0, width]).nice(); y.domain([0, 1]).range([height, 0]).nice(); var voronoi = d3.voronoi() .extent([[-1, -1], [width + 1, height + 1]]) .x((pt) => x(pt.x)) .y((pt) => y(pt.y)); // TypeError: Cannot read property 'circle' of null voronoi.polygons([ {x: 0.9999994485078688, y: 0}, {x: 0.9999994512180275, y: 0} ]);
Created from: https://npm.runkit.com/d3-voronoi
Loading…

no comments

    sign in to comment