From eaaa453cd904625e02088ecb8bbdd8b0acb03126 Mon Sep 17 00:00:00 2001 From: Benoit Simard Date: Tue, 29 Oct 2024 10:58:59 +0100 Subject: [PATCH] [werbsite] fix documentation on using layout Adding the import, see #73 --- packages/website/docs/api.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/website/docs/api.md b/packages/website/docs/api.md index 9e05594d..4e835f46 100644 --- a/packages/website/docs/api.md +++ b/packages/website/docs/api.md @@ -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"; @@ -52,7 +58,7 @@ useEffect(() => { }, [positions, sigma]); ``` -4. Or use the `assign` function +5. Or use the `assign` function ```typescript useEffect(() => {