• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

haidaraM / ansible-playbook-grapher / 15097748826 / 6
95%
main: 95%

Build:
DEFAULT BRANCH: main
Ran 18 May 2025 04:13PM UTC
Files 11
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 May 2025 04:11PM UTC coverage: 95.557% (+0.01%) from 95.544%
15097748826.6

push

github

web-flow
feat(svg): Add collapsible nodes for roles, plays, and blocks in SVG output (#247)

## Summary

This PR implements collapsible nodes in the SVG output for the Ansible
Playbook Grapher, addressing [issue
#77](https://github.com/haidaraM/ansible-playbook-grapher/issues/77).

## Feature Details
- Adds a collapse/expand button to all role, play, and block nodes in
the SVG output.
- Clicking the button hides or shows all descendant nodes and edges
recursively, making large graphs easier to navigate.
- The button is always visible for the current node, so users can always
expand collapsed nodes.
- The implementation uses the existing `<link>` structure in the SVG to
determine which nodes and edges to hide/show, with no extra attributes
required.
- The code is generalized for all node types (role, play, block).
- Added a new CLI flag `--collapsible-nodes` to make this feature
optional (disabled by default).

## Usage
- Generate an SVG with the `--collapsible-nodes` flag:
`ansibleplaybookgrapher my_playbook.yml --collapsible-nodes`
- Open it in a browser and use the +/- buttons on plays, roles, and
blocks to expand/collapse sections of the graph.

## Screenshots
- When using the flag, each play, block, and role node has a
collapse/expand button.
- Clicking the button toggles visibility of all descendant nodes and
edges recursively.
- The button's text changes from "-" to "+" when collapsed and back to
"-" when expanded.


![node-collapsing](https://github.com/user-attachments/assets/8fc83d89-7e6b-4e93-85f2-47476a783e75)

1140 of 1193 relevant lines covered (95.56%)

0.96 hits per line

Source Files on job py3.12-ansible2.18.* - 15097748826.6
  • Tree
  • List 11
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 15097748826
  • 119bb928 on github
  • Prev Job for on main (#15089500575.1)
  • Next Job for on main (#15173509935.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc