@o-lang/olang-graph-renderer
v1.0.1
Published
Full-featured SVG renderer for O-Lang workflow execution
Maintainers
Readme
@o-lang/olang-graph-renderer
Full-featured SVG renderer for O-Lang workflows
This resolver generates visual representations of O-Lang workflows, including step numbers, types, conditional blocks, parallel branches, and save-as variables. Ideal for auditing, demonstrations, and collaborator onboarding.
Features
Step Visualization – Each workflow step is displayed with its type and step number.
Conditional Blocks – if statements are shown with conditions.
Parallel Execution – Visualizes parallel branches with clear indentation.
Save-As Variables – Shows which variables are saved after each step.
SVG Output – Produces scalable vector graphics for embedding or presentation.
JSON Fallback – Optionally outputs workflow structure as JSON.
Installation npm install @o-lang/olang-graph-renderer
Usage In an O-Lang Workflow Use "OlangGraphRenderer" Save as execution_graph Constraint: format="svg"
Save as execution_graph – The generated SVG will be stored in this variable.
Constraint: format="svg" – Optional. Defaults to SVG; use "json" for JSON output.
In Node.js const renderer = require('@o-lang/olang-graph-renderer');
const svg = await renderer('Use "OlangGraphRenderer"', { workflow: myWorkflow }); console.log(svg);
Example Output
Steps displayed in boxes
Nested if conditions
Indented parallel branches
Save-as variables labeled
(placeholder for demonstration)
Contributing
This resolver is open-source. Collaborators can:
Add advanced visualizations (arrows, side-by-side parallel steps)
Customize colors for conditional/parallel blocks
Integrate with auditing dashboards
Please fork the repository, add your improvements, and submit a pull request.
License
MIT License – O-Lang Team
