camera — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited camera (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Camera control, modes, centering, and viewport manipulation.
import { GraphCanvas, useCameraControls, useCenterGraph } from 'reagraph';Set via cameraMode on GraphCanvas:
| Mode | Description |
|---|---|
'pan' | Pan and zoom (default, best for 2D) |
'rotate' | Rotate and zoom |
'orbit' | Full orbit control (best for 3D) |
'orthographic' | Orthographic projection with pan/zoom |
| Prop | Type | Default | Description |
|---|---|---|---|
cameraMode | CameraMode | 'pan' | Camera interaction mode |
maxDistance | number | 50000 | Max camera distance (perspective) |
minDistance | number | 1000 | Min camera distance (perspective) |
minZoom | number | 1 | Min zoom level (orthographic) |
maxZoom | number | 100 | Max zoom level (orthographic) |
Access camera controls imperatively from inside the Three.js context:
const {
controls,
resetControls,
zoomIn,
zoomOut,
dollyIn,
dollyOut,
panLeft,
panRight,
panUp,
panDown,
freeze,
unFreeze,
} = useCameraControls();| Method | Description |
|---|---|
resetControls(animated?) | Reset camera to initial state |
zoomIn() / zoomOut() | Zoom camera |
dollyIn(distance?) / dollyOut(distance?) | Move camera closer/further (default: 1000) |
panLeft(delta?) / panRight(delta?) | Pan horizontally (default: 100) |
panUp(delta?) / panDown(delta?) | Pan vertically (default: 100) |
freeze() / unFreeze() | Freeze/unfreeze camera controls |
Center or fit nodes into the viewport:
const {
centerNodes,
centerNodesById,
fitNodesInViewById,
isCentered,
} = useCenterGraph({ animated: true, layoutType });| Method | Description |
|---|---|
centerNodes(nodes, opts?) | Center on node objects |
centerNodesById(ids, opts?) | Center on node IDs |
fitNodesInViewById(ids, opts?) | Fit nodes into viewport |
interface CenterNodesParams {
animated?: boolean;
centerOnlyIfNodesNotInView?: boolean;
}
interface FitNodesParams {
animated?: boolean;
fitOnlyIfNodesNotInView?: boolean;
}For camera control outside the canvas, use the GraphCanvasRef:
const ref = useRef<GraphCanvasRef>(null);
<GraphCanvas ref={ref} nodes={nodes} edges={edges} />
<button onClick={() => ref.current?.centerGraph()}>Center</button>
<button onClick={() => ref.current?.zoomIn()}>Zoom In</button>
<button onClick={() => ref.current?.fitNodesInView(['1', '2'])}>Fit Nodes</button><GraphCanvas
nodes={nodes}
edges={edges}
cameraMode="pan"
layoutType="forceDirected2d"
/><GraphCanvas
nodes={nodes}
edges={edges}
cameraMode="orbit"
layoutType="forceDirected3d"
/><GraphCanvas
nodes={nodes}
edges={edges}
cameraMode="orthographic"
minZoom={0.5}
maxZoom={50}
/>useCameraControls and useCenterGraph must be used inside the Three.js context (child of GraphCanvas)GraphCanvasRef methods insteadcameraMode="orbit" is recommended for 3D layoutscameraMode="pan" is recommended for 2D layouts~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.