zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.23k stars 231 forks source link

Is it possible to add an arrow style to either end of the line? #830

Open Huary007 opened 2 years ago

Huary007 commented 2 years ago

The feature of automatic arrow binding in excalidraw helps a lot when drawing mind maps.

However, sometimes the arrow is just a basic graphical element in the drawing canvas, and that's when the automatic binding of the arrow can cause problems.

When I want to draw an axis, for example, I don't want it to be bound to other elements in the image.

In excalidraw, we can use the Ctrl key to unbind the effect of automatic binding, as you mentioned in issue #673.

You can hold down the control key when moving objects to avoid automatic binding. Originally posted by @zsviczian in issue #673

But the Ctrl key has other functions in the obsidian-excalidraw plugin, such as opening links, viewing images or modifying formulas.

Whenever I try to move the text containing the link by holding Ctrl and trying not to change the position of the arrow near the text, it always ends up with a jump to the corresponding link. When I try to move just the text, the already repositioned arrows change position again. Such situations always bother me a lot.

So I thought there is no way to draw a line with arrows in excalidraw. Add the style of arrows to the ends of the line. This way the drawn arrows are not automatically bound to anything but act as a drawing element.

zsviczian commented 2 years ago

I can think of two solution approaches 1) an enhancement to allow users to configure a different button instead of CTRL in plugin settings, because as you say, the CTRL has other functions in Obsidian 2) There is already an excalidraw script that allows you to change the element type of selected elements. Also there is another that lets you select only specific elements. When installed these scripts are also available via the command palette and you can assign hotkeys for them in Obsidian settings. Maybe with these scripts you can overcome the problem. You first draw a line, then you change the type to arrow - then it will not be bound.

The two scripts I mention above are: https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Select%20Elements%20of%20Type.md https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/ea-scripts/Change%20shape%20of%20selected%20elements.md