Skip to content

Commit

Permalink
[werbsite] fix documentation on using layout
Browse files Browse the repository at this point in the history
Adding the import, see #73
  • Loading branch information
sim51 committed Oct 29, 2024
1 parent cf6232b commit eaaa453
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/website/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,19 @@ For those layouts, in the corresponding module we export a **hook** that you can
npm install @react-sigma/layout-circular graphology-layout
```

2. Initialize the hook in your component (that must be a child of `SigmaContainer`)
2. Import the `useLayoutCircular` hook

```typescript
import { useLayoutCircular } from "@react-sigma/layout-circular";
```

3. Initialize the hook in your component (that must be a child of `SigmaContainer`)

```typescript
const {positions, assign} = useLayoutCircular(...);
```

3. Use the `positions` function
4. Use the `positions` function

```typescript
import { animateNodes } from "sigma/utils/animate";
Expand All @@ -52,7 +58,7 @@ useEffect(() => {
}, [positions, sigma]);
```

4. Or use the `assign` function
5. Or use the `assign` function

```typescript
useEffect(() => {
Expand Down

0 comments on commit eaaa453

Please sign in to comment.