Files
obsidian-excalidraw-plugin/docs/Examples/connect_objects.md
Zsolt Viczian b4d9469b7d docs v1.0
2021-05-08 20:26:09 +02:00

650 B

Connect Objects

This Templater template demonstrates how to connect two objects using ExcalidrawAutomate.

Use CTRL+Shift+V to paste code into Obsidian!

<%*
  const ea = ExcalidrawAutomate;
  ea.reset();
  ea.addText(-130,-100,"Connecting two objects");
  const a = ea.addRect(-100,-100,100,100);
  const b = ea.addEllipse(200,200,100,100);
  ea.connectObjects(a,"bottom",b,"left",{numberOfPoints: 2}); //see how the line breaks differently when moving objects around
  ea.style.strokeColor = "red";
  ea.connectObjects(a,"right",b,"top",1);
  await ea.create();
%>