jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.4k stars 713 forks source link

Is it possible to replace nodes with images? #167

Closed fwitte closed 3 years ago

fwitte commented 3 years ago

Hi, I am programming an open source thermal engineering simulator. In commercial software there is usually a GUI for flowsheeting, in my software people need to write code. While this might even be faster/flexible for very experienced users, it would be nice to have such a feature.

You library looks great and seems very promising for my issue. I have not yet dug deep into the code of Drawflow (as I am not experienced with .js anyway), therefore I have two questions, which I could not find respective issues for:

I do not want a solution, just a quick answer, if that is possible, so I can evaluate if I dig deeper into the code :). If this question was already answered, maybe you can give me a hint where to look.

Thanks a lot!

A plant might look like this:

refrigerator

jerosoler commented 3 years ago

Hi @fwitte

If an image or a svg could be loaded, since the code is html of the node.

And with css you could move the points. Correct here you can see how to move the inputs / outputs https://github.com/jerosoler/Drawflow/issues/20#issuecomment-679976512

Here's a quick test.

image

Jero

fwitte commented 3 years ago

Thanks a lot, will look into it then!