Skip to content

Commit

Permalink
fix: fix issue of invalid autoResize (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonneyx authored Jun 27, 2024
1 parent dd4e5c7 commit c988bbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/graphin/public/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const Demo: React.FC = () => {
className="graphin-container"
style={{ width: '100%', height: '100%' }}
options={{
autoResize: true,
data,
layout,
behaviors: ['zoom-canvas', 'drag-canvas'],
Expand Down
2 changes: 1 addition & 1 deletion packages/graphin/src/hooks/useGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function useGraph<P extends GraphinProps>(props: P) {
useEffect(() => {
if (graphRef.current || !containerRef.current) return;

const graph = new Graph({ container: containerRef.current! });
const graph = new Graph({ container: containerRef.current!, ...options });
graphRef.current = graph;

setIsReady(true);
Expand Down

0 comments on commit c988bbf

Please sign in to comment.