Published
Edited
Jun 26, 2020
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
figureData.length
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("d3@5")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
/*drawGraph = {
const svg = d3.select(DOM.svg(width, height))
.style("width", width)
.style("height", height);
var mouseDown = 0;
var wait = 1;
var lineData = [];
svg.selectAll("path").data([lineData]).enter().append("path")
.attr("class","myLine")
.attr("d",line)
.style("stroke","black")
.style("fill","none")
.style("stroke-width","1px")
svg
.on("mousedown", function() { mouseDown = 1; })
.on("mouseup", function() { mouseDown = 0; })
.on("mousemove", function() {
if (mouseDown && wait) {
wait = 0;
var coordinates= d3.mouse(this);
var x = coordinates[0];
var y = coordinates[1];
lineData.push([x,y])
svg.selectAll("path.myLine").data([lineData])
.attr("d",line)
setTimeout(function(){ wait = 1;},delayValue)
}
})
figureData.push(lineData)
return svg.node();
}*/
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more