adawang1210 opened a new pull request, #805:
URL: https://github.com/apache/burr/pull/805

   ## Summary
   When visualizing a graph with `include_state=True`, the action name, 
`reads`, and `writes` were all rendered on a single line (`name(read_1, 
read_2): write_1`), which rapidly widens the figure and hurts readability. Node 
labels now display `reads:` and `writes:` as separate, left-justified sections 
with one state field per line, following the format proposed in the issue.
   
   Rendered result for an action with reads `count, user_input` and writes 
`count`:
   
   ![rendered node](https://github.com/user-attachments/assets/placeholder)
   
   ```
   counter
   reads:
     count
     user_input
   writes:
     count
   ```
   
   ## Related issue
   Closes #402
   
   ## Changes made
   - `burr/core/graph.py`: added a `_get_state_label()` helper that builds the 
multi-line label (using graphviz's `\l` escape for left justification, so 
indentation stays visible); `Graph.visualize()` now uses it when 
`include_state=True`. Actions with no reads and no writes keep a plain name 
label.
   - `tests/core/test_graphviz_display.py`: parametrized test covering all four 
cases from the issue spec (no reads/writes, only reads, only writes, both).
   
   ## How to test
   ```bash
   pytest tests/core/test_graphviz_display.py
   ```
   
   ## Checklist
   - [x] Tests added or updated
   - [x] All tests pass locally (`pytest tests/ 
--ignore=tests/integration_tests`: 577 passed, 5 skipped)
   - [x] Commits are signed off (`git commit -s`)
   - [x] Pre-commit hooks pass (black, isort, flake8)
   - [x] CONTRIBUTING.md guidelines followed


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to