Skip to content

Commit

Permalink
fix #65
Browse files Browse the repository at this point in the history
  • Loading branch information
sim51 committed Apr 7, 2024
1 parent 2b080de commit 7f38070
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog


## Version 4.0.2

### Fixes

- [65](https://github.com/sim51/react-sigma/issues/65): Sigma: could not find a suitable program for node type "circle"!


## Version 4.0.1

### Fixes
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/components/SigmaContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const SigmaContainerComponent = <
E extends Attributes = Attributes,
G extends Attributes = Attributes,
>(
{ graph, id, className, style, settings, children }: PropsWithChildren<SigmaContainerProps<N, E, G>>,
{ graph, id, className, style, settings = {}, children }: PropsWithChildren<SigmaContainerProps<N, E, G>>,
ref: Ref<Sigma<N, E, G> | null>,
) => {
// Root HTML element
Expand All @@ -74,9 +74,9 @@ const SigmaContainerComponent = <
// Sigma instance
const [sigma, setSigma] = useState<Sigma<N, E, G> | null>(null);
// Sigma settings
const [sigmaSettings, setSigmaSettings] = useState<Partial<Settings<N, E, G>>>(settings || {});
const [sigmaSettings, setSigmaSettings] = useState<Partial<Settings<N, E, G>>>(settings);
useEffect(() => {
if (!isEqual(sigmaSettings, settings)) setSigmaSettings(settings || {});
if (!isEqual(sigmaSettings, settings)) setSigmaSettings(settings);
}, [settings]);

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/LoadGraphWithHook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MyGraph: FC = () => {

export const LoadGraphWithHook: FC<{ style?: CSSProperties }> = ({ style }) => {
return (
<SigmaContainer style={style} settings={{ allowInvalidContainer: true }}>
<SigmaContainer style={style}>
<MyGraph />
</SigmaContainer>
);
Expand Down

0 comments on commit 7f38070

Please sign in to comment.