Diagramming component - Implementation complexities #24269
Replies: 1 comment
-
I think I understand your problem, but I do recommend creating a minimal functional example that to make it easier to help you. Anyway, if this is Blazor Server, and you want the server part (C#) to drive the updates, you will always have the speed of light as a hard limited, which you have to design to, not against. If you have a 200 ms network round trip between client browser and server, there is going to be delays in the move events/updates on screen like you show in your YouTube video, and nothing can fix that - speed of light is the limit here. I imagine this would work pretty smooth in Blazor Wasm though. In this case though, if you want a component that works in both Blazor Server and Blazor Wasm, you will probably have to design it such that the drag events are handled in JavaScript explicitly, and maybe only the mouseup events are being passed to Blazor, to update the state in Blazor to match what the user is seeing. |
Beta Was this translation helpful? Give feedback.
-
We have planned to create the diagramming component. Our requirements are below.
We have prepared a component like below.
[FullNative.razor]
When using the above approach the initial load time and interaction were good. But when I host this sample in other server machines it takes some time on rendering and also the interaction was very slow. (Dragging was very slow even if I render only one rect element and dragging the rect)
http://23.92.60.125:8123/
So we thought that rendering more elements in C# side causes more performance issues and also in drag. So we have moved to another approach, We completely disable a UI rendering and updates in the C# side using the ShouldRender lifecycle and add JS codes to rendering and updating the UI like below-highlighted code.
[UseofJS.razor]
[Sample.JS]
In the second approach also we are facing more problem
http://23.92.60.125:8123/UseofJS
Sample for the above approaches: Sample
Please find the video for better understanding: https://youtu.be/rYRapzTA7k4
Could you please suggest a better approach to create a diagramming component with better than above?
Beta Was this translation helpful? Give feedback.
All reactions