Releases: MrMint/elkjs-libavoid
Releases · MrMint/elkjs-libavoid
Release list
v0.5.0
Minor Changes
- a8186b2: Replace center-pin connection strategy with boundary auto-pins (4 per side, 16 total) for more natural edge attachment positions. Add
Symbol.disposesupport toRoutingSessionfor TC39 explicit resource management.init()now warns when called again with a differentwasmPath.RoutingSession.addEdge()now validates port pin classes and rejects self-loop edges.writeRoutesToGraphthrows on missing owner node instead of silently skipping.getWasmPath()provides descriptive errors when libavoid-js is missing.
Patch Changes
- a8186b2: Fix
inferSideto handle zero-length edge segments (identical source and target points) by defaulting to east/west instead of falling through ambiguous comparison logic. - a8186b2: Fix WASM memory leaks: wrap
extractRoutesandcreateLibavoidSessionintry/finallyto ensure all Emscripten objects (displayRoute,Point,Rectangle,ConnEnd) are freed on error. ReplacefreeWasm(obj: any)withfreeWasm(obj: unknown)using runtime type narrowing. - a8186b2: Improve parser validation: detect duplicate node, edge, and port IDs; reject nodes with zero or negative dimensions. Support explicit
port.sideandelk.port.sideproperties on ports (case-insensitive), falling back to positional inference when not set.
v0.4.0
Minor Changes
- 5e5c5c1: Support hierarchical graphs with container/group nodes. Container nodes (nodes with children) are no longer registered as hard obstacles, allowing edges to route through group boundaries to reach child nodes inside. Container nodes that are direct edge endpoints still get a ShapeRef so connectors can attach to them.
v0.3.0
Minor Changes
- 6310054: Move
getWasmPath()from the main entry to a Node-only subpath export (@mr_mint/elkjs-libavoid/node). This prevents bundlers from statically analyzingnode:moduleandcreateRequirein browser builds. Also fixgetWasmPath()to resolve"libavoid-js"(an exported subpath) instead of"libavoid-js/dist/libavoid.wasm"(unexported), which broke in ESM strict mode and Turbopack. - b884fa9: Remove
routeEdgesFlat(),RouteNode,RouteEdge,OutputFormat, andoutputFormatoption. Output format is now always auto-detected from the edge format. UserouteEdges()with a graph directly instead ofrouteEdgesFlat(). - b884fa9: Split
LibavoidRoutingOptionsintoLibavoidRouterOptions(router config) andLibavoidRoutingOptions(addsedgeIds/selfLoopHandling).createRoutingSession()now accepts the narrowerLibavoidRouterOptions.
v0.2.0
Minor Changes
- 4bb5ca3: Add
sourceSideandtargetSide(north/south/east/west) toRouteResultfor connection direction metadata - 4bb5ca3: Add
edgeIdsoption to route only a subset of edges while still using all nodes as obstacles - 4bb5ca3: Add
routeEdgesFlat()convenience API that accepts plain arrays of nodes and edges without requiring a full ELK graph structure - 4bb5ca3: Add
createRoutingSession()for long-lived incremental routing withmoveNode(),addEdge(),removeEdge(), andprocessTransaction() - 4bb5ca3:
routeEdges()now returns aMap<string, RouteResult>without mutating the input graph. UserouteEdgesInPlace()for the previous in-place mutation behavior. - 4bb5ca3: Add
outputFormatoption torouteEdgesInPlace():"auto"(default) matches input format,"simple"forces sourcePoint/targetPoint/bendPoints,"extended"forces sections - 4bb5ca3: Add
selfLoopHandlingoption:"skip"(default) omits self-loops,"fallback"generates synthetic loop routes - 4bb5ca3: Export
getWasmPath()helper for resolving the libavoid WASM file path, useful for bundler copy plugins and framework configs