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

Routers.Orthogonal and PathGenerators.Straight throws exception #270

Open jaimeatstariongroup opened 1 year ago

jaimeatstariongroup commented 1 year ago

I'm creating this diagram using Routers.Orthogonal and PathGenerators.Straight when I create the LinkModels between ports. However one of the links appears broken. Creating the same diagram using the default Router and PathGenerator works properly.

image

Also the console throws the next error:

Unhandled exception rendering component: The method or operation is not implemented. System.NotImplementedException: The method or operation is not implemented. at Blazor.Diagrams.Core.Routers.GetOriginSpot(Point p, PortAlignment alignment, Double shapeMargin) at Blazor.Diagrams.Core.Routers.Orthogonal(Diagram _, BaseLinkModel link) at Blazor.Diagrams.Components.LinkWidget.BuildRenderTree(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b6_0(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) window.Module.s.printErr @ blazor.webassembly.js:1 Fe._internal.dotNetCriticalError @ blazor.webassembly.js:1 St @ blazor.webassembly.js:1 _mono_wasm_invoke_js_blazor @ dotnet.6.0.9.6u68yuqaw1.js:1 $func219 @ 00971d1a:0x1a492 $func167 @ 00971d1a:0xce60 $func166 @ 00971d1a:0xbd73 $func2815 @ 00971d1a:0xabebf $func1619 @ 00971d1a:0x6fc80 $func1623 @ 00971d1a:0x702ed $mono_wasm_invoke_method @ 00971d1a:0x969f Module._mono_wasm_invoke_method @ dotnet.6.0.9.6u68yuqaw1.js:1 managedMicrosoft_AspNetCore_Components_WebAssemblyMicrosoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_EndInvokeJS @ managedMicrosoft_AspNetCore_Components_WebAssemblyMicrosoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_EndInvokeJS:16 endInvokeJSFromDotNet @ blazor.webassembly.js:1 (anonymous) @ blazor.webassembly.js:1 Promise.then (async) beginInvokeJSFromDotNet @ blazor.webassembly.js:1 St @ blazor.webassembly.js:1 _mono_wasm_invoke_js_blazor @ dotnet.6.0.9.6u68yuqaw1.js:1 $func219 @ 00971d1a:0x1a492 $func167 @ 00971d1a:0xce60 $func166 @ 00971d1a:0xbd73 $func2815 @ 00971d1a:0xabebf $func1619 @ 00971d1a:0x6fc80 $func1617 @ 00971d1a:0x6fbf2 $func970 @ 00971d1a:0x50643 $func219 @ 00971d1a:0x1a44b $func167 @ 00971d1a:0xce60 $func166 @ 00971d1a:0xbd73 $func2815 @ 00971d1a:0xabebf $func1619 @ 00971d1a:0x6fc80 $func1623 @ 00971d1a:0x702ed $mono_wasm_invoke_method @ 00971d1a:0x969f Module._mono_wasm_invoke_method @ dotnet.6.0.9.6u68yuqaw1.js:1 managedMicrosoft_AspNetCore_Components_WebAssemblyMicrosoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_BeginInvokeDotNet @ managedMicrosoft_AspNetCore_Components_WebAssemblyMicrosoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntimeBeginInvokeDotNet:19 beginInvokeDotNetFromJS @ blazor.webassembly.js:1 b @ blazor.webassembly.js:1 invokeMethodAsync @ blazor.webassembly.js:1 s.ro @ script.min.js:1 blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: The method or operation is not implemented. System.NotImplementedException: The method or operation is not implemented. at Blazor.Diagrams.Core.Routers.GetOriginSpot(Point p, PortAlignment alignment, Double shapeMargin) at Blazor.Diagrams.Core.Routers.Orthogonal(Diagram , BaseLinkModel link) at Blazor.Diagrams.Components.LinkWidget.BuildRenderTree(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b6_0(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) window.Module.s.printErr @ blazor.webassembly.js:1 Fe._internal.dotNetCriticalError @ blazor.webassembly.js:1 St @ blazor.webassembly.js:1 _mono_wasm_invoke_js_blazor @ dotnet.6.0.9.6u68yuqaw1.js:1 $func219 @ 00971d1a:0x1a492 $func167 @ 00971d1a:0xce60 $func166 @ 00971d1a:0xbd73 $func2815 @ 00971d1a:0xabebf $func1619 @ 00971d1a:0x6fc80 $func1623 @ 00971d1a:0x702ed $mono_wasm_invoke_method @ 00971d1a:0x969f Module._mono_wasm_invoke_method @ dotnet.6.0.9.6u68yuqaw1.js:1 managedMicrosoft_AspNetCore_Components_WebAssemblyMicrosoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_EndInvokeJS @ managedMicrosoft_AspNetCore_Components_WebAssemblyMicrosoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_EndInvokeJS:16 endInvokeJSFromDotNet @ blazor.webassembly.js:1 (anonymous) @ blazor.webassembly.js:1 Promise.then (async) beginInvokeJSFromDotNet @ blazor.webassembly.js:1 St @ blazor.webassembly.js:1 _mono_wasm_invoke_js_blazor @ dotnet.6.0.9.6u68yuqaw1.js:1 $func219 @ 00971d1a:0x1a492 $func167 @ 00971d1a:0xce60 $func166 @ 00971d1a:0xbd73 $func2815 @ 00971d1a:0xabebf $func1619 @ 00971d1a:0x6fc80 $func1617 @ 00971d1a:0x6fbf2 $func970 @ 00971d1a:0x50643 $func219 @ 00971d1a:0x1a44b $func167 @ 00971d1a:0xce60 $func166 @ 00971d1a:0xbd73 $func2815 @ 00971d1a:0xabebf $func1619 @ 00971d1a:0x6fc80 $func1623 @ 00971d1a:0x702ed $mono_wasm_invoke_method @ 00971d1a:0x969f Module._mono_wasm_invoke_method @ dotnet.6.0.9.6u68yuqaw1.js:1 managedMicrosoft_AspNetCore_Components_WebAssemblyMicrosoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_BeginInvokeDotNet @ managedMicrosoft_AspNetCore_Components_WebAssemblyMicrosoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_BeginInvokeDotNet:19 beginInvokeDotNetFromJS @ blazor.webassembly.js:1 b @ blazor.webassembly.js:1 invokeMethodAsync @ blazor.webassembly.js:1 s.ro @ script.min.js:1

zHaytam commented 1 year ago

I believe that's because the router only works with port alignments top, left, bottom and right for now.

jaimeatstariongroup commented 1 year ago

@zHaytam And are there plans to correct this in the short time? Because this should be usable with portless links, right?

zHaytam commented 1 year ago

Portless links arent links without ports, your error is related to links with ports but with unsupported alignments (e.g. topright)

zHaytam commented 1 year ago

OrthogonalRouter should be usable with portless links but it's a bit tricky to do, I'm still trying to figure out a clean way to do it.