Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
perf(routing): avoid temporary arrays when counting crossings
cyanseekab9c2e5b54f9
diff --git a/archify.zip b/archify.zipindex 59b52548..d0576161 100644Binary files a/archify.zip and b/archify.zip differdiff --git a/archify/renderers/architecture/routing.mjs b/archify/renderers/architecture/routing.mjsindex 3f4a2792..97e2e605 100644--- a/archify/renderers/architecture/routing.mjs+++ b/archify/renderers/architecture/routing.mjs@@ -983,12 +983,22 @@ export function createRouter(components, connections = [], {}function crossingCount(conn, points, resolvedRoutes) {- return resolvedRoutes.reduce((total, entry) => total + Number(- !(relationshipsShareEndpoint(conn, entry.conn)- && (!distinctAutomaticPorts || hasAuthoredRouteGeometry(entry.conn) || entry.conn.labelAt || conn.labelAt))- && points.slice(1).some((end, index) => entry.points.slice(1).some((otherEnd, otherIndex) =>- properSegmentIntersection(points[index], end, entry.points[otherIndex], otherEnd))),- ), 0);+ let count = 0;+ for (const entry of resolvedRoutes) {+ if (relationshipsShareEndpoint(conn, entry.conn)+ && (!distinctAutomaticPorts || hasAuthoredRouteGeometry(entry.conn) || entry.conn.labelAt || conn.labelAt)) continue;+ let crosses = false;+ for (let index = 1; index < points.length && !crosses; index += 1) {+ for (let otherIndex = 1; otherIndex < entry.points.length; otherIndex += 1) {+ if (properSegmentIntersection(points[index - 1], points[index], entry.points[otherIndex - 1], entry.points[otherIndex])) {+ crosses = true;+ break;+ }+ }+ }+ if (crosses) count += 1;+ }+ return count;}function readabilityCost(conn, routed, resolvedRoutes) {