spearmint
spearmint copied to clipboard
Uncaught ReferenceError: svg is not defined
Here: https://github.com/JasperSnoek/spearmint/blob/4e9877dc00b821b467e2ce775b56892d85328f23/spearmint/spearmint/web/static/js/spearmint.js#L84
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.