node-link-and-diagram-layout

작성자: openai

노드-링크 다이어그램과 연결된 노드 시각 자료에 대한 자동 레이아웃 전략을 선택하고 적용합니다. 사용자가 노드를 자동 정렬하거나 선을 줄이는 방법을 물을 때 사용하세요.

npx skills add https://github.com/openai/plugins --skill node-link-and-diagram-layout

Node-Link and Diagram Layout

Overview

Use this skill when the main problem is not which notation to use, but how to place connected nodes so the diagram stays readable. The job is to classify the graph family, choose a layout algorithm that matches the reading task, separate node placement from edge routing and overlap removal, and recommend a stack that can preserve those constraints in production.

Default assumption: the best automatic layout is the one that reinforces the intended reading path with the fewest crossings, bends, overlaps, and surprise placements. Do not treat force-directed layout as a generic answer for all diagrams. Trees, DAGs, port-constrained block diagrams, ERDs, and undirected exploration graphs usually need different algorithms.

For browser-facing node-link views, mobile layout is a graph-reading constraint, not only a CSS breakpoint. Use ../../references/foundations/mobile-first-responsive-visualization.md when choosing portrait focus views, optional landscape inspection, touch/pan/zoom ownership, and settings placement.

For operational graph workspaces, use ../../references/foundations/operational-visualization-workspaces.md so layout decisions account for outlines, inspectors, command bars, selected neighborhoods, URL state, mobile panels, and repeated navigation.

Core Workflow

  1. Classify the graph structure before choosing a renderer:
    • rooted tree or forest
    • directed acyclic graph
    • cyclic directed graph with a dominant flow
    • general undirected graph
    • radial or hub-and-spoke structure
    • clustered or compound graph
    • port-constrained block diagram
    • table-like schema or ERD
    • nearly planar topology where crossing count dominates readability
  2. Identify the primary reading task:
    • parent-child depth
    • top-to-bottom or left-to-right flow
    • reachability and dependency tracing
    • cluster discovery
    • cycle inspection
    • shortest path or neighborhood exploration
    • table relationship tracing
    • stable editing with minimal layout drift
  3. Record geometry constraints up front:
    • real node widths and heights, not point nodes
    • labels that must fit without scaling below readability
    • ports, handles, side constraints, or fixed connection order
    • nested groups, lanes, clusters, or compounds
    • whether some nodes are pinned or semi-pinned
  4. Choose the layout family that matches the structure:
    • tidy tree layout for rooted ordered trees and decision trees
    • layered or Sugiyama-style layout for directional processes, state machines, dependency maps, class hierarchies, ERDs, and most UML-like flow diagrams
    • stress majorization or force-directed layout for undirected relational exploration where cluster shape matters more than global direction
    • radial or concentric layout when distance from a root is the main story
    • circular layout when cycle structure is the evidence
    • planarization-driven layout when the graph is non-planar but low crossing count is the main objective
  5. Choose edge routing separately from node placement:
    • straight or polyline when the graph is sparse and directional flow is already clear
    • orthogonal when tables, ports, block diagrams, lanes, or circuit-like reading dominate
    • spline routing when static aesthetics matter more than precise traceability and there is enough whitespace
  6. Treat overlap removal, label placement, and packing as explicit phases:
    • remove node overlap after layout if the engine starts from point nodes
    • reserve gutters for connector-dense tables and schemas
    • keep edge labels out of node bodies and above selected paths
    • pack connected components only after the component layouts are individually legible
  7. Prefer stability when users will edit, compare revisions, or recognize repeated diagrams:
    • preserve node order when the source model has meaningful order
    • preserve port order when connectors are semantically ordered
    • use interactive or constraint-aware layered modes instead of re-randomizing
  8. Validate the result with readability criteria instead of trusting the engine:
    • crossings are low enough for the task
    • bends are limited and meaningful
    • nodes and labels do not overlap
    • directionality is obvious
    • edge tracing is possible without visual hunting
    • the layout stays readable on narrow widths or falls back to scrolling, filtering, or faceting
    • mobile portrait starts on the most important region instead of shrinking the entire graph
    • mobile landscape is offered when a wide graph, timeline, or schema materially improves tracing
    • operational shells keep filters, outline trees, selected nodes, and inspectors synchronized without stealing space from the graph

Algorithm Defaults

  • Rooted ordered trees and decision trees:
    • Prefer Reingold-Tilford style tidy trees and Buchheim's linear-time refinement.
    • Use radial tree variants only when depth from a root matters more than label density.
    • Do not use generic force layout for decision trees unless the tree metaphor itself is intentionally abandoned.
  • State machines, dependency graphs, workflow diagrams, class hierarchies, ERDs, and most UML-like directional diagrams:
    • Prefer layered layout derived from Sugiyama.
    • Use cycle breaking, layer assignment, crossing minimization, node placement, and edge routing as separate concerns.
    • For table schemas, state diagrams, and block diagrams with connector semantics, prefer port-aware layered layout with orthogonal routing.
  • General undirected networks:
    • Prefer stress majorization or force-directed placement when cluster shape, neighborhood, or approximate graph distance is the point.
    • Prefer multilevel force methods for larger graphs.
    • Avoid force layout when users need strict rank order, deterministic business flow, or table-like schemas.
  • Large topology where the graph is dense and not meaningfully hierarchical:
    • Use multilevel force approaches, filtering, clustering, matrix fallbacks, or multiple coordinated views before cramming everything into one node-link view.
  • Nearly planar but non-planar graphs:
    • Consider planarization pipelines when crossing count matters more than preserving a strict hierarchy.
    • Treat this as an advanced fallback, not a default for ordinary UML-like diagrams.

Stack Defaults

  • Graphviz dot: best default for static layered layouts in documentation or build-time generation.
  • Graphviz neato: good default for modest undirected graphs when stress majorization is appropriate.
  • Graphviz fdp and sfdp: good for force-directed and multilevel force layouts, especially for larger undirected networks.
  • Graphviz twopi and circo: use when radial or circular structure is truly the reading model.
  • ELK Layered: best default for interactive products that need layered layout with ports, compounds, labels, orthogonal routing, or layout constraints.
  • React Flow plus ELK or Dagre: good for node editors when React owns the interaction layer and the actual layout engine remains external.
  • Cytoscape.js: good when graph analysis, graph algorithms, and multiple layout modes matter as much as the rendering.
  • Bespoke SVG, Canvas, or WebGL: use only when the visual composition or scale requires it after the algorithm family is already decided.

Anti-Patterns

  • Using force-directed layout for ERDs, state machines, or business workflows that have a clear direction.
  • Treating overlap removal as a substitute for choosing the right layout family.
  • Ignoring real node dimensions and then trying to fix collisions at the end.
  • Letting connectors run under schema tables, lane headers, or large node labels.
  • Relying on a single dense node-link view when a matrix, tree, outline, focus view, or filtered subgraph would explain the structure better.
  • Re-running unstable layout from scratch after every small edit in an interactive tool.
  • Shrinking text below readable size instead of using an intrinsic canvas and scrollable viewport.
  • Letting mobile controls or legends appear before the graph while the actual topology starts below the fold.
  • Requiring pixel-perfect taps on dense nodes without search, step-through, or enlarged hit regions.

Reference Guide

  • Read references/algorithm-selection.md first for graph-family to algorithm-family mapping.
  • Read references/layered-tree-force-and-radial-layouts.md when choosing among tree, layered, force, radial, circular, and multilevel approaches.
  • Read references/routing-overlap-and-quality.md for orthogonal routing, planarization, overlap removal, port constraints, and readability criteria.

Output Expectations

  • State the graph family and why it was classified that way.
  • State the recommended layout family and one fallback.
  • State the routing style, overlap strategy, and stability strategy.
  • Call out whether ports, order constraints, fixed nodes, or compounds require a layout engine with stronger constraint support.
  • For product work, recommend a concrete stack and make clear which part owns semantics, layout, and rendering.
  • If the graph is too dense for a clean node-link view, say so and recommend filtering, faceting, clustering, matrix views, or overview-plus-detail.
  • For mobile, state the portrait focus strategy, landscape need if any, touch target/hit-area policy, search or step-through path, and pan/zoom/browser gesture ownership.
  • For operational graph workspaces, state the shell, default selected or focused neighborhood, outline/inspector synchronization, URL state, and empty-surface clear-selection behavior.
  • If the problem is really notation selection, route to the UML or strategy skill instead of over-solving layout alone.

Adjacent Skills

  • ../data-visualization/SKILL.md
  • ../uml-and-software-architecture-visualization/SKILL.md
  • ../typescript-data-visualization-engineering/SKILL.md
  • ../react-and-nextjs-data-visualization/SKILL.md
  • ../d3-data-visualization/SKILL.md
  • ../canvas2d-data-visualization/SKILL.md
  • ../threejs-data-visualization/SKILL.md
  • ../testing-data-visualizations/SKILL.md
  • ../../references/foundations/mobile-first-responsive-visualization.md
  • ../../references/foundations/operational-visualization-workspaces.md

Representative Prompts

  • "How should I auto-arrange this network diagram so the lines stop crossing so much?"
  • "What layout algorithm should I use for a database schema diagram?"
  • "Choose between ELK, Graphviz, Dagre, force layout, and a custom approach for this state machine."
  • "Make this dependency graph readable without overlapping boxes and labels."
  • "How do I route edges for an ERD so foreign keys do not run under the tables?"
  • "What should I use for a decision tree, a DAG, and an undirected network?"
  • "We need stable auto-layout in a React node editor."

openai의 다른 스킬

user-context
openai
데이터 분석 플러그인의 지속적인 소스 라우팅 기본 설정, 온보딩 로직, 설정 진행 상황 및 의미 계층 레지스트리를 로드하거나 관리합니다.
official
notion-research-documentation
openai
Notion 콘텐츠를 조사하고 인용문과 함께 구조화된 브리핑, 보고서 또는 비교 자료로 종합합니다. 대상 질의를 사용해 Notion 페이지를 검색하고 가져온 후, 인라인 출처 인용과 참고 문헌 섹션을 포함해 주제별로 결과를 정리합니다. 범위와 사용자 목표에 따라 네 가지 출력 형식(빠른 브리핑, 연구 요약, 비교, 종합 보고서) 중에서 선택합니다. 내장 템플릿을 사용해 Notion 페이지를 생성 및 업데이트하고, 새 정보가 도착하면 출처를 직접 연결하고 변경 사항을 추적합니다...
official
rcsb-pdb-skill
openai
핵심 메타데이터, Search API 쿼리 및 FASTA 다운로드를 위한 간결한 RCSB PDB 요청을 제출합니다. 사용자가 간결한 RCSB 요약을 원할 때 사용하며, 원시 JSON 또는…을 저장합니다.
official
pdf
openai
PDF 읽기, 생성 및 검증 기능을 제공하며, 시각적 렌더링과 프로그래매틱 생성을 지원합니다. Poppler(pdftoppm)를 사용하여 PDF 페이지를 PNG로 렌더링하여 레이아웃, 간격, 타이포그래피를 시각적으로 검사할 수 있습니다. reportlab을 사용하여 프로그래매틱 방식으로 PDF를 생성하여 안정적인 포맷을 보장하며, pdfplumber 또는 pypdf를 통해 텍스트와 메타데이터를 추출합니다. 품질 기준을 준수합니다: 잘린 텍스트, 겹치는 요소, 깨진 표, 렌더링 아티팩트가 없어야 하며, ASCII 하이픈만 사용하고 사람이 읽을 수 있는 인용을 사용합니다.
official
test-coverage-improver
openai
Improve test coverage in the OpenAI Agents JS monorepo: run `pnpm test:coverage`, inspect coverage artifacts, identify low-coverage files and branches, propose…
official
playwright
openai
터미널 기반 브라우저 자동화로 요소 스냅샷 및 대화형 UI 워크플로우 지원. playwright-cli 래퍼 스크립트를 통해 작동하며(npx 필요), 헤드리스 및 헤드 모드 모두 지원하여 시각적 디버깅 가능. 핵심 워크플로우: 페이지 열기, 안정적인 요소 참조를 위한 스냅샷 생성, 참조를 사용한 상호작용, 탐색 또는 DOM 변경 후 재스냅샷. 양식 작성, 클릭, 타이핑, 다중 탭 관리, 스크린샷/PDF 캡처, 흐름 디버깅을 위한 트레이스 기록 포함. 요소 참조(예: e3, e15)...
official
ukb-topmed-phewas-skill
openai
단일 변이에 대한 간결한 UKB-TOPMed PheWAS 요약을 가져오며, rsID, GRCh37 또는 GRCh38 입력을 받아 필요한 GRCh38 쿼리로 변환합니다. 다음과 같은 경우에 사용하세요…
official
code-review-context
openai
모델 가시 컨텍스트
official