Skip to content

✨ Xircuits Workflow Viewer#462

Open
MFA-X-AI wants to merge 5 commits intomasterfrom
fahreza/xircuits-viewer
Open

✨ Xircuits Workflow Viewer#462
MFA-X-AI wants to merge 5 commits intomasterfrom
fahreza/xircuits-viewer

Conversation

@MFA-X-AI
Copy link
Copy Markdown
Member

@MFA-X-AI MFA-X-AI commented Apr 7, 2026

Description

This PR adds xircuits-graph-viewer, a standalone, pure SVG renderer for .xircuits workflow files. It parses the .xircuits JSON format and produces self-contained SVG that visually matches the Xircuits editor, including title bar gradients (oklch), port symbols, flow/data bezier edges, comment nodes, and the actual Xircuits node icons.

Published to npm as:

Includes:

  • Core package: parser, layout engine, SVG renderer, pan/zoom interaction, dark/light theme support
  • React package: <XircuitsGraph> (interactive) and <XircuitsGraphStatic> (SSR-safe) components
  • Upload demo: standalone Vite app — drag-and-drop any .xircuits file to view it
  • Docusaurus docs site: workflow documentation pages with interactive viewer, floating zoom controls, loading states, and theme sync
  • 24 tests covering parser and renderer
  • Publish script (publish.sh) for npm releases

References

N/A — new feature, no prior issues.

Pull Request Type

  • Xircuits Core (Jupyterlab Related changes)
  • Xircuits Canvas (Custom RD Related changes)
  • Xircuits Component Library
  • Xircuits Project Template
  • Testing Automation
  • Documentation
  • Others (Please Specify) - New standalone package: xircuits-graph-viewer, pure SVG renderer for embedding .xircuits workflows in docs, demos, and web apps.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Tests

24 unit tests covering parser and renderer.

1. Parser tests (11)

1. cd xircuits-graph-viewer
2. node_modules/.bin/vitest run
3. Validates .xircuits files, parses nodes/ports/edges, classifies node kinds (start, finish, literal, component, comment)

2. Render tests (13)

1. Verifies SVG output contains correct elements, gradients, styles, node names, port symbols, edge types
2. Tests dark and light theme rendering
3. Tests node metrics computation for component, comment, and literal nodes

3. Manual testing

1. Upload demo: drag-and-drop HelloXircuits.xircuits, ControlflowExample.xircuits - verify rendering, pan/zoom, theme toggle
2. Docusaurus site: npm start, verify workflow pages render with interactive viewer

Tested on? Specify Version.

  • Windows
  • Linux
  • Mac
  • Others (State here -> xxx )

Notes

  • The viewer renders from stored port coordinates in the .xircuits file — it does not re-layout nodes
  • SVG uses modern CSS (oklch, rgba) — PNG export requires Chrome headless, not ImageMagick
  • A Docusaurus plugin (docusaurus-plugin-xircuits) is planned as a follow-up to simplify docs integration

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Binder 👈 Launch a binder notebook on branch XpressAI/xircuits/fahreza/xircuits-viewer

@MFA-X-AI MFA-X-AI changed the title Fahreza/xircuits viewer ✨ Xircuits Workflow Viewer Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant