excalidraw / excalidraw

Virtual whiteboard for sketching hand-drawn like diagrams
https://excalidraw.com
MIT License
82.67k stars 7.74k forks source link

Ability to add custom ID to a shape or Group or can reuse the IDs for a shape or group when it is saved into the library. #3163

Open valiyaveedan opened 3 years ago

valiyaveedan commented 3 years ago

When I try to save an shape or group into the library and then try to reuse it in a sketch I am not able to search the ExcalidrawElements array for the shape based on the ID. The ID seems to be a random string every time its used. Is there a way to set a permanent ID for a shape when saving into the library?

dwelle commented 3 years ago

Are you talking of each element a given library item is composed of? Is so, why do you need to refer to each shape (such as individual lines)?

On a related note, I've proposed a version 2 of the library that will allow naming each item (but not elements the item is composed of). Lemme know if that makes sense and would suffice for your use case: https://github.com/excalidraw/excalidraw/issues/2653#issuecomment-757915618

valiyaveedan commented 3 years ago

No I am talking about giving each item in the library an id. So it i created a custom shape I can find it from the drawElements based on the customshape id or group id.

I am talking about the same feature you have proposed. I did try changing the groupId in the custom shape I created but when I used it in the sketch the groupId changed. Glad that this is in the pipeline.