zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
3.67k stars 202 forks source link

FR: Option to "embed Link | Area | Group" as "png | svg" file in the notes OR make hover preview as "view mode". #1832

Open vikrant123pundir opened 2 weeks ago

vikrant123pundir commented 2 weeks ago

feature request I want to see the png or svg file in the hover preview, and not the editable excalidraw file.

My solution After clicking "copy markdown link for selected element" in the right click menu, My solution is to have option to save the png or svg file with the "drawing name+element alias name" written by user and export the image to a folder named same as that of the drawing. and copy "newly exported png" link to clipboard, ready to be pasted in markdown notes. It should open .png or .svg file in hover preview and option to "edit excalidraw drawing" in right click menu.

Alternatives I considered As for alternatives, i tinkered with settings in order to understand and find if there is any way. i found settings like "auto export svg and png" and other related settings.

  1. i selected the elements i wanted png of,
  2. went to the left hand side tray, pressed the hamburger icon and used "Export image..." option
  3. in there i found and option to "Export entire scene or just selected elements?"
  4. i used that and it exported png of "selected elements" in same folder with same name as of drawing.
  5. i dragged that png file in my notes. and "link" (with no ! sign), was there

Everything was fine and I was happy.

But issue started here

  1. as soon as i updated the drawing and saw png in hover preview, it did get updated, but now it had all the elements of drawing, not just the selected ones, as if I "exported the entire scene"
  2. beucause excalidraw had no way to remember which portion or "desired elements" are to be shown in the "updated png file" of "updated drawing file"

Additional context Actually i am a long time draw.io plugin user and now since that has broken with the new obsidian updates, i am trying out settings and workflow of excalidraw plugin. i have no hopes of draw.io plugin to be updated since it has not seen any changes from past 3 years. there are some user who fixed the issue, but they are all temporary and every fix has some pros and cons when tested thoroughly.

That's why i want to switch to excalidraw. might take time to get used to it. Till now, i have been able to find all the hidden and cool features which i thought it lacks at first glance. but i am satisfied by 95%.

long live excalidraw

vikrant123pundir commented 2 weeks ago

I read some other related "FR"s and got to know that it might be very time consuming.

I just hoped that since there is an option to "export selected elements as png", along with option to add "link|area|group" in notes, it will be easy to combine both.

I just went bonkers in the main post. But still would like to have your solution for my specific problem. Maybe, just option to show excalidraw drawing in "view mode" in hover preview (since it has no ui elements), instead of getting into issue of making dedicated folders for pngs of my desired elements and updating them.

Why I wanted pngs at first place Pngs are safe in a way I don't accidentally ruin something. They open image of desired elements much faster. Excalidraw sometimes fail to focus on elements in hover preview. Will be better if it can confirm whether selected elements are at centre of hover preview or not. As of now I press zoom to fit selected elements script if excalidraw fails to focus by itself and ui elements makes it feel cluttered when I don't need them and they come in my way of analyzing my drawing.