[x] I agree to follow the Code of Conduct that this project adheres to.
[x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Is your feature request related to a problem? Please describe.
So far the zoom perfomance for the large diagrams (hundreds or even thousands of elements) is not perfect. This issue is just an attempt to analyze how this could be improved.
Describe the solution you'd like
The main blocker here is the re-painting of every element. Probably this could be improved by splitting the sync code to the async calls via the setTimeout/requestAnimationFrame or even changing the elements attributes instead of fully re-creating those elemtns but thiat is a long walk. Here are some points I see as hangings fruits so they're worth checking:
there is a recursive call in mxGraphView.prototype.validateCellState to a parent cell that looks redundant - the parent state gets validated before all the child states
Is your feature request related to a problem? Please describe. So far the zoom perfomance for the large diagrams (hundreds or even thousands of elements) is not perfect. This issue is just an attempt to analyze how this could be improved.
Describe the solution you'd like The main blocker here is the re-painting of every element. Probably this could be improved by splitting the sync code to the async calls via the
setTimeout/requestAnimationFrame
or even changing the elements attributes instead of fully re-creating those elemtns but thiat is a long walk. Here are some points I see as hangings fruits so they're worth checking:mxGraphView.prototype.invalidate
method gets called twice: first time from themxGraphView.prototype.viewStateChanged
method (via therevalidate
intermediate call) and the second one from thevalidate
method when it gets re-defined inEditorUi.prototype.initCanvas
methodmxCellState.prototype.updateCachedBounds
also gets called twice - fitst time frommxGraphView.prototype.validateCellState
and second frommxGraphView.prototype.updateCellState
. I might be wrong but it's not needed as between those calls the cached bounds don't seem to be used at allmxGraphView.prototype.validateCellState
to a parent cell that looks redundant - the parent state gets validated before all the child statesDescribe alternatives you've considered
Additional context