Blazor-Diagrams / Blazor.Diagrams

A fully customizable and extensible all-purpose diagrams library for Blazor
https://blazor-diagrams.zhaytam.com
MIT License
919 stars 176 forks source link

ServerSide - Links added in OnInitialized are not rendered until OnAfterRender #297

Open ashortland-eqix opened 1 year ago

ashortland-eqix commented 1 year ago

I'm using server side and adding links in OnInitialized, but what ends up happening is the page initially loads with the nodes laid out then shortly after the links are rendered. I checked the performance sample and do not see it happen in WASM, but it appears to be reproducible using that sample on ServerSide.

Any tips on how to get them rendered with the initial draw of the nodes?

zHaytam commented 1 year ago

Hello,

That is unfortunately normal if you're using nodes that don't have a known size, which means the links wait for the nodes to be rendered, retrieve their size, then render themselves with the positions received.

It doesn't show up in WASM because there is no latency so it's very fast, but I'm afraid in Server Side it will show unless you maybe use fixed-size nodes

ashortland-eqix commented 1 year ago

As a test I tried to set the sizes manually, but it doesn't appear to render them sooner, is there a way currently that it's possible to achieve this?

zHaytam commented 1 year ago

Sorry, I meant the nodes AND ports. Either you set all that information manually, or you can use the new anchors in 3.0 with only the node size set