jerosoler / Drawflow

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

Minimap simple suggestion / performance idea - how to #698

Open converseKarl opened 1 year ago

converseKarl commented 1 year ago

The minimap can get slow when you have a busy UI tab.

What would your suggestion be to still keep the functionality to drag the mini map around but replace the minimized drawflow map to just a simple square block in the map that can be dragged around. This is how I've seen google do it in their applications. Can we modify the mini map script to just be a simple draggable block and not render objects, or connections into the map. The simple block in the map will keep everything very fast then.

jerosoler commented 1 year ago

Hello,

The minimap is an example of the possibilities.

You could modify the file: https://github.com/jerosoler/drawflow-minimap-example/blob/main/minimap-drawflow.js

The nodeCreated event function to create a div with a width and height based on the created node. And don't pass the html of the node.

That could solve your problem.