Skip to content

Arc

Read as Markdown

import { Arc } from "@pibbl/core";

Arc draws an open circular sweep. Its props are ArcProps; its local style is ArcStyle, which requires radius, startAngle, and endAngle in radians. It is stroke-only and rejects children. Invalid or indefinite geometry reports a contextual layout diagnostic.

<Arc
style={{
cx: 80,
cy: 80,
radius: 48,
startAngle: 0,
endAngle: Math.PI,
stroke: "#2563eb",
strokeWidth: 8,
}}
/>

See the Arc live example.

Describes an open circular arc primitive for JSX or createElement authoring.

Arc: PibblPrimitiveComponent<ArcProps, PrimitiveInput<ArcProps, ArcStyle>>

Related API: Arc, PibblPrimitiveComponent, ArcProps, PrimitiveInput, ArcStyle.

  • props — Authored component inputs, supplied through JSX or createElement. See the linked props and style types.

When called directly; Pibbl mounts this component through JSX or createElement.

ArcProps

ArcStyle

View source — packages/core/src/lib/components/arc.ts:141

Read the Drawing, layout, and effects companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

Compile this TSX module with jsx: "react-jsx" and jsxImportSource: "@pibbl/core", then load it from a browser entry point after the document body exists. It creates and mounts one canvas; dispose the controller before removing or replacing that canvas. The interactive study linked below adds controls beyond this minimal use case.

Download source

/** @jsxImportSource @pibbl/core */
import { pibbl, Arc } from '@pibbl/core';
const canvas = document.createElement('canvas');
canvas.width = 320;
canvas.height = 240;
document.body.append(canvas);
const controller = pibbl(canvas, (
<Arc
style={{
cx: 80,
cy: 80,
radius: 48,
startAngle: 0,
endAngle: Math.PI,
stroke: "#2563eb",
strokeWidth: 8,
}}
/>
));
window.addEventListener('pagehide', () => controller.dispose(), { once: true });

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.