Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kolibril13 committed Aug 6, 2024
1 parent 1386795 commit db90e25
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import "tldraw/tldraw.css";
export default function App() {
const handleMount = (editor) => {
const shapes = [
{ id: createShapeId("rectangle1"), type: "geo", x: 22, y: -47, props: { align: "middle", color: "black", dash: "draw", fill: "none", font: "draw", geo: "rectangle", w: 149, h: 90, labelColor: "black", scale: 1, size: "l", text: "Color" } },
{ id: createShapeId("rectangle2"), type: "geo", x: 124, y: 127, props: { align: "middle", color: "violet", dash: "draw", fill: "solid", font: "draw", geo: "rectangle", growY: 0, h: 75, labelColor: "black", scale: 1, size: "xl", text: "", url: "", verticalAlign: "middle", w: 100 } },
{ id: createShapeId("rectangle3"), type: "geo", x: 211, y: 88, props: { align: "middle", color: "orange", dash: "draw", fill: "solid", font: "draw", geo: "rectangle", growY: 0, h: 136, labelColor: "black", scale: 1, size: "xl", text: "", url: "", verticalAlign: "middle", w: 114 } },
{ id: createShapeId("arrow"), type: "arrow", x: 100, y: 100 }
{ id: createShapeId("rectangle1"), type: "geo", x: 22, y: -47, props: { h: 90, w: 149, color: "black", dash: "draw", fill: "none", font: "draw", geo: "rectangle", size: "l", text: "Color" } },
{ id: createShapeId("rectangle2"), type: "geo", x: 124, y: 127, props: { h: 75, w: 100, color: "violet", dash: "draw", fill: "solid", font: "draw", geo: "rectangle", size: "xl" } },
{ id: createShapeId("rectangle3"), type: "geo", x: 211, y: 88, props: { h: 136, w: 114, color: "orange", dash: "draw", fill: "solid", font: "draw", geo: "rectangle", size: "xl" } },
{ id: createShapeId("rectangle4"), type: "geo", x: 265, y: 32, props: { h: 136, w: 114, color: "blue", dash: "draw", fill: "solid", font: "draw", geo: "rectangle", size: "xl" } },
{ id: createShapeId("arrow"), type: "arrow", x: 100, y: 100 }
];

const bindings = [
{ fromId: shapes[3].id, toId: shapes[0].id, type: "arrow", props: { terminal: "start", normalizedAnchor: { x: 0.5, y: 0.5 } } },
{ fromId: shapes[3].id, toId: shapes[1].id, type: "arrow", props: { terminal: "end", normalizedAnchor: { x: 0.5, y: 0.5 } } }
{ fromId: shapes[4].id, toId: shapes[0].id, type: "arrow", props: { terminal: "start", normalizedAnchor: { x: 0.5, y: 0.5 } } },
{ fromId: shapes[4].id, toId: shapes[1].id, type: "arrow", props: { terminal: "end", normalizedAnchor: { x: 0.5, y: 0.5 } } }
];

editor.createShapes(shapes);
Expand Down

0 comments on commit db90e25

Please sign in to comment.