Skip to content

v4.0.0

Compare
Choose a tag to compare
@sim51 sim51 released this 03 Apr 15:39
· 22 commits to main since this release

Features

  • Upgrade to sigma v3
  • Upgrade all project dependencies
  • Refacto project structure
  • Replace example project by a storybook
  • Replace E2E framework by playwright, and run it on the storybook
  • Using stories in website example
  • Fully graph typed API (see #58). Component & hooks take generic types for node, edge & graph attributs. Exemple for the load graph hook :
const loadGraph = useLoadGraph<{label:string, x:number, y:number}, {label:string, size:number}>();

Breaking changes

  • React-sigma doesn't depends anymore to lodash. It was use to make a deep equal on the settings provided to the SigmaContainer. Now you have to handle that :
// Sigma settings are outside the react lifecycle to avoid the change of its ref at every render
// which triggers a full render of sigma. An other way is to use the `useMemo` hook inside the component.
const sigmaSettings = {
  allowInvalidContainer: true,
};

export const Example: FC = () => {
  return (
    <SigmaContainer settings={sigmaSettings}>
      <SampleGraph />
    </SigmaContainer>
  );
};
  • The sigma setting allowInvalidContainer is no more set per default. You have to pass it to the container (check above).

  • When you register events on edges, we don't set the correspondig settings anymore, like enableEdgeClickEvents (see #49)