Skip to content

Commit

Permalink
feat: better layout
Browse files Browse the repository at this point in the history
  • Loading branch information
alswl committed May 4, 2024
1 parent f4cffb2 commit 3df86a8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GridLayout } from '@antv/layout';
import { DagreLayout, GridLayout } from '@antv/layout';
import { Graph, Model } from '@antv/x6';
import { Parser } from '@dbml/core';
import { Col, Row, theme } from 'antd';
Expand Down Expand Up @@ -43,13 +43,22 @@ Ref: posts.user_id > users.id // many-to-one
const [models, setModels] = useState<Model.FromJSONData>({});
const containerRef = useRef(null);
const parser = new Parser();
const layout = new GridLayout({
new GridLayout({
type: 'grid',
width: 600,
height: 400,
rows: 6,
cols: 4,
});
const dagreLayout = new DagreLayout({
type: 'dagre',
rankdir: 'LR',
align: 'UL',
ranksep: 80,
nodesep: 60,
controlPoints: true,
});
const layout = dagreLayout;

useEffect(() => {
if (containerRef.current) {
Expand Down

0 comments on commit 3df86a8

Please sign in to comment.