Published
Edited
Sep 26, 2022
1 star
Insert cell
# Two js arc clone bug
Insert cell
{
const two = new Two({
width: width,
height: 300,
type: Two.Types.canvas
})

const group = two.makeGroup()
group.translation.set(two.width/2, two.height/2)
let arc = two.makeArcSegment(0, 0, 80, 120, 0, (Math.PI * 0.5))
arc.fill = 'red'

let clone = arc.clone()
clone.fill = 'green'
clone.opacity = 0.5

group.add(arc, clone)

two.update()
return two.renderer.domElement;
}
Insert cell
Two = (await import("https://cdn.skypack.dev/two.js@0.7")).default
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