Published
Edited
Mar 12, 2021
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const svg = d3.create("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.left + margin.right)
const g = svg.append("g")
.attr("transform", `translate(${margin.left}, ${margin.top})`);
const line = g.append('line')
.attr("transform", `rotate(${angle}, ${pointX} ${pointY})`)
.attr("x1", width / 2)
.attr("x2", width / 2)
.attr("y1", 0)
.attr("y2", height)
.style("stroke", "steelblue")
.style("stroke-width", 10)
const point = g.append("circle")
.attr("cx", pointX)
.attr("cy", pointY)
.attr("r", 10)
.style("fill", "orange")
.style("stroke", "#fff")
.style("stroke-width", 2)
return svg.node()
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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