Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Typo in example code #57

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions project/packages/examples/src/common/SampleGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const SampleGraph: FC = () => {
const registerEvents = useRegisterEvents();
const setSettings = useSetSettings();
const loadGraph = useLoadGraph();
const { assign: assingCircular } = useLayoutCircular();
const { assign: assignCircular } = useLayoutCircular();
const [hoveredNode, setHoveredNode] = useState<string | null>(null);

/**
Expand All @@ -34,14 +34,14 @@ export const SampleGraph: FC = () => {
});
});
loadGraph(graph);
assingCircular();
assignCircular();

// Register the events
registerEvents({
enterNode: (event) => setHoveredNode(event.node),
leaveNode: () => setHoveredNode(null),
});
}, [assingCircular, loadGraph, registerEvents, faker.datatype, faker.name, randomColor]);
}, [assignCircular, loadGraph, registerEvents, faker.datatype, faker.name, randomColor]);

/**
* When component mount or hovered node change
Expand Down
6 changes: 3 additions & 3 deletions website/src/components/GraphDefault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface GraphDefaultProps {
export const GraphDefault: React.FC<GraphDefaultProps> = ({ order, probability }) => {
const { faker, randomColor } = useSeedRandom();
const sigma = useSigma();
const { assign: assingCircular } = useLayoutCircular();
const { assign: assignCircular } = useLayoutCircular();
const registerEvents = useRegisterEvents();
const loadGraph = useLoadGraph();
const setSettings = useSetSettings();
Expand All @@ -47,14 +47,14 @@ export const GraphDefault: React.FC<GraphDefaultProps> = ({ order, probability }
}

loadGraph(graph);
assingCircular();
assignCircular();

// Register the events
registerEvents({
enterNode: (event) => setHoveredNode(event.node),
leaveNode: () => setHoveredNode(null),
});
}, [assingCircular, loadGraph, registerEvents, faker.datatype, faker.name, randomColor, order, probability]);
}, [assignCircular, loadGraph, registerEvents, faker.datatype, faker.name, randomColor, order, probability]);

useEffect(() => {
setSettings({
Expand Down
Loading