spearmint icon indicating copy to clipboard operation
spearmint copied to clipboard

Uncaught ReferenceError: svg is not defined

Open cancan101 opened this issue 11 years ago • 1 comments

Here: https://github.com/JasperSnoek/spearmint/blob/4e9877dc00b821b467e2ce775b56892d85328f23/spearmint/spearmint/web/static/js/spearmint.js#L84

cancan101 avatar Oct 29 '14 22:10 cancan101

Try creating a svg element in your script, like this:

var svg = d3.select('body').append('svg').attr("width", "100%").attr("height", "500px"); svg.selectAll().data(data).enter().append("circle") .attr("cx", function(d) { return d.x; }) .attr("cy", function(d) { return d.y; }) .attr("r", 2.5) .attr("fill", "black");

Note that data is an array of {x: 0, y: 0} objects. You can use your creativity to set up the properties of your svg chart.

rrnovaesjr avatar Jan 16 '18 11:01 rrnovaesjr