-
Notifications
You must be signed in to change notification settings - Fork 201
Visualizing Graphs for Rules and Groups
Visualizing rules, groups and their edges through a graph is a great way to understand how Piranha Polyglot works.
We use Graphviz to generate a .dot file and a .svg image generated by visualize_rules_graph.py
.
Please follow the instructions to install Graphviz at https://graphviz.org/download/.
Moreover, the script also needs the toml
and graphviz
python packages.
The script takes as first argument a path for the generated .dot file.
The following arguments are paths for directories containing rules.toml
and edges.toml
files.
Optionally, you can provide a --title
argument to give a title to the generated graph.
To generate the .dot file and the .svg image used in this README (assuming a Python venv and a valid Graphviz installation):
pip install toml
pip install graphviz
python visualize_rules_graph.py ./java_prebuilt_rules.dot piranha/src/cleanup_rules/java --title "Java pre-built cleanup rules"
To generate an image for java-ff_system1 in our tests:
python visualize_rules_graph.py ./java-ff_system1.dot piranha/src/cleanup_rules/java test-resources/java/feature_flag_system_1/control/configurations --title "Java Test Feature Flag Cleanup System 1"
- Home
- API
- Stale feature flag related cleanup
- Piranha in-depth
- Piranha's Core Framework
- Piranha Rules
- Rule Graph
- Piranha Arguments
- [Advanced] Other use-cases
- Custom Refactoring
- Code Search
- Onboarding a new language