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

How to zoom to fit automatically #305

Open jonhilt opened 1 year ago

jonhilt commented 1 year ago

Hey,

I'm exploring using Blazor.Diagrams for rendering a read-only tree view in my app.

I've seen the code (and demos) for using GraphShape to automatically arrange nodes, plus the ZoomToFit method, to get everything lined up and visible.

My question is, is there a way to do this without any user interaction.

Rather than have a user click a button to arrange and zoom the diagram, ideally I'd want that to happen automatically.

So my code would:

All without any user interaction.

Is that possible?

Thanks!

zHaytam commented 1 year ago

Hello,

jonhilt commented 1 year ago

Hey, thanks for the reply :)

So every node will be the same, fixed size (using a custom node type) and yep I'll know the size beforehand.

I was planning on using ports (as I prefer it aesthetically) and yes I would know their size and position ahead of time.

Thanks, Jon

PDilan321 commented 10 months ago

Hi, I have the same question, did you find a solution?

Thanks, Dilan

PDilan321 commented 9 months ago

Still having issues with this when trying to ZoomToFit with SVG nodes.