HTML5 canvas Arc Tutorial
To create an arc shape with Konva
, we can instantiate a Konva.Arc()
object.
For full list of properties and methods, see the Arc API Reference.
- Vanilla
- React
- Vue
- Svelte
<script>
import { Stage, Layer, Arc } from 'svelte-konva';
const width = window.innerWidth;
const height = window.innerHeight;
</script>
<Stage config={{ width, height }}>
<Layer>
<Arc
config={{
x: width / 2,
y: height / 2,
innerRadius: 40,
outerRadius: 70,
angle: 60,
fill: 'yellow',
stroke: 'black',
strokeWidth: 4
}}
/>
</Layer>
</Stage>