Skip to content

Commit

Permalink
Remove deprecated function of faker
Browse files Browse the repository at this point in the history
  • Loading branch information
sim51 committed Apr 4, 2024
1 parent 4a56061 commit 0b9f2c8
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 37 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ A set of react components to display graphs with Sigma v3.

See the [CHANGELOG file](packages/website/docs/changelog.md).

IMPORTANT: package has been renamed to `@react-sigma`

## Contributing

See the [CONTRIBUTING file](CONTRIBUTING.md).

## Support

Please **do not** use GitHub issues for support, but instead post your questions on [StackOverflow](https://stackoverflow.com/) using the [`sigma` tag](https://stackoverflow.com/questions/tagged/sigma).
Please **do not** use GitHub issue for support, instead post your question on [StackOverflow](https://stackoverflow.com/) using the [`sigma` tag](https://stackoverflow.com/questions/tagged/sigma).

## License

Expand Down
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const config: StorybookConfig = {
async viteFinal(config) {
return mergeConfig(config, {
resolve: {
preserveSymlinks: true,
preserveSymlinks: false,
},
});
},
Expand Down
4 changes: 4 additions & 0 deletions packages/storybook/stories/DragNdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export const DragNdrop: FC<{ style: CSSProperties }> = ({ style }) => {
<SigmaContainer style={style} settings={sigmaSettings}>
<SampleGraph disableHoverEffect />
<GraphEvents />
<ControlsContainer position={"bottom-right"}>

Check failure on line 59 in packages/storybook/stories/DragNdrop.tsx

View workflow job for this annotation

GitHub Actions / test

'ControlsContainer' is not defined
<ZoomControl />

Check failure on line 60 in packages/storybook/stories/DragNdrop.tsx

View workflow job for this annotation

GitHub Actions / test

'ZoomControl' is not defined
<FullScreenControl />

Check failure on line 61 in packages/storybook/stories/DragNdrop.tsx

View workflow job for this annotation

GitHub Actions / test

'FullScreenControl' is not defined
</ControlsContainer>
</SigmaContainer>
);
};
6 changes: 3 additions & 3 deletions packages/storybook/stories/LayoutCircular.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const RandomCircleGraph: FC = () => {
const graph = new Graph();
for (let i = 0; i < order; i++) {
graph.addNode(i, {
label: faker.name.fullName(),
size: faker.datatype.number({ min: 4, max: 20, precision: 1 }),
label: faker.person.fullName(),
size: faker.number.int({ min: 4, max: 20 }),
color: randomColor(),
x: 0,
y: 0,
Expand All @@ -41,7 +41,7 @@ const RandomCircleGraph: FC = () => {
assign();
// Display in the console the node's position for the layout
console.log(positions());
}, [assign, loadGraph, faker.datatype, faker.name, randomColor]);
}, [assign, loadGraph, faker.datatype, faker, randomColor]);

return null;
};
Expand Down
4 changes: 2 additions & 2 deletions packages/storybook/stories/common/SampleGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useLayoutCircular } from "@react-sigma/layout-circular";
import { useRandom, NodeType, EdgeType } from "./useRandom";

export const SampleGraph: FC<{ disableHoverEffect?: boolean }> = ({ disableHoverEffect }) => {
const { faker, randomColor, randomGraph } = useRandom();
const { randomGraph } = useRandom();
const sigma = useSigma<NodeType, EdgeType>();
const registerEvents = useRegisterEvents<NodeType, EdgeType>();
const setSettings = useSetSettings<NodeType, EdgeType>();
Expand All @@ -29,7 +29,7 @@ export const SampleGraph: FC<{ disableHoverEffect?: boolean }> = ({ disableHover
enterNode: (event) => setHoveredNode(event.node),
leaveNode: () => setHoveredNode(null),
});
}, [assignCircular, loadGraph, registerEvents, faker.datatype, faker.name, randomColor]);
}, [assignCircular, loadGraph, registerEvents, randomGraph]);

/**
* When component mount or hovered node change
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/common/useRandom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const useRandom = () => {
y: Math.random(),
// for node-border
borderColor: randomColor(),
borderSize: faker.number.float({ min: 0, max: 1, precision: 0.1 }),
borderSize: faker.number.float({ min: 0, max: 1, multipleOf: 0.1 }),
// for node-image
pictoColor: randomColor(),
image: faker.image.urlLoremFlickr(),
Expand Down

0 comments on commit 0b9f2c8

Please sign in to comment.