Visualize Dataform table dependencies as interactive SVG diagrams
Project description
Dataform Dependency Visualizer
Generate beautiful, interactive SVG diagrams showing dependencies between Dataform tables.
Features
- 📊 Interactive SVG Diagrams - One diagram per table showing all dependencies
- 🎨 Color-Coded by Type - Tables, views, and operations visually distinct
- 🔍 Master Index - Browse all tables in a single HTML interface
- 📁 Schema Organization - Automatically organized by database schema
- ⚡ Pure Python - No Graphviz required, pure SVG generation
- 🎯 Smart Layout - Clean orthogonal routing for professional diagrams
- 📝 Text Wrapping - Long table names automatically wrapped
- 🧹 Cleanup Utilities - Built-in tools to fix common Dataform issues
Installation
pip install dataform-dependency-visualizer
Prerequisites
You need Dataform CLI installed:
# Install globally
npm install -g @dataform/cli
# Or in your project
npm install @dataform/core
Quick Start
- Generate dependency report from your Dataform project:
cd your-dataform-project
dataform compile --json > dependencies_report.txt
- Convert to text format for visualization:
poetry run python -m dataform_viz.dataform_check > dependencies_text_report.txt
- Generate diagrams:
# For all schemas
dataform-deps --report dependencies_text_report.txt generate-all
# For specific schema
dataform-deps --report dependencies_text_report.txt generate dashboard
# Generate browsable index
dataform-deps --report dependencies_text_report.txt index
- View results: Open
output/dependencies_master_index.htmlin your browser
Command Reference
# Generate for specific schema
dataform-deps --report FILE generate SCHEMA_NAME
# Generate all schemas
dataform-deps --report FILE generate-all
# Generate master index
dataform-deps --report FILE index
# Open index in browser
dataform-deps --report FILE index --open
# Custom output directory
dataform-deps --report FILE --output my_output generate-all
# Cleanup Dataform issues
python -m dataform_viz.dataform_check --cleanup
Python API
from dataform_viz import DependencyVisualizer
# Initialize with report
viz = DependencyVisualizer('dependencies_text_report.txt')
viz.load_report()
# Generate for specific schema
count = viz.generate_schema_svgs('dashboard', output_dir='output')
# Generate for all schemas
total = viz.generate_all_svgs(output_dir='output')
# Generate master index
viz.generate_master_index('output')
Output Structure
output/
├── dependencies_master_index.html # Interactive browser interface
├── analytics/
│ └── analytics_customer_summary.svg
├── dashboard_wwim/
│ ├── dashboard_wwim_table1.svg
│ └── ...
└── datamart_wwim/
└── ...
Understanding the Diagrams
Each SVG shows:
- Center (Yellow): The table being viewed
- Left (Blue): Dependencies - tables this reads FROM
- Right (Green): Dependents - tables that read FROM this
- Schema Labels: Shows schema for each table
- Type Badges: table, view, incremental, operation
Cleanup Utilities
Fix common Dataform compilation issues:
python -m dataform_viz.dataform_check --cleanup
This removes:
database:lines from config blocksdatabase:fromref()calls- Replaces constant references with actual values
- Cleans up dependencies.js files
Common Issues
"wwim_utils is not defined"
Run the cleanup utility:
python -m dataform_viz.dataform_check --cleanup
Empty SVG output
Use text format report, not JSON:
python -m dataform_viz.dataform_check > dependencies_text_report.txt
Requirements
- Python 3.10+
- Dataform CLI
- Node.js (to run Dataform)
Links
- GitHub: https://github.com/OshigeAkito/dataform-dependency-visualizer
- Documentation: GitHub README
- Issues: GitHub Issues
License
MIT License - See LICENSE file for details.
Changelog
v0.2.0 (2026-01-13)
- Added cleanup utility for database references
- Added constant replacement functionality
- Improved error handling
- Enhanced documentation
v0.1.0
- Initial release
- Basic SVG generation
- Master index generator
- Command-line interface
- Color coding - Tables (blue), views (green), operations (orange)
Master Index
The master index organizes all tables by schema with:
- Clickable table names that open their SVG
- Expandable/collapsible schemas
- Type badges (table/view/incremental)
- Search functionality
Requirements
- Python 3.8+
- Dataform project with compiled dependencies
How It Works
- Parse
dependencies_report.txtgenerated by Dataform - Extract table dependencies and metadata
- Generate SVG diagrams with orthogonal routing
- Create master index HTML for easy navigation
Project Structure
output/
├── dependencies_master_index.html # Main entry point
└── dependencies/
├── schema1_table1.svg
├── schema1_table2.svg
└── ...
License
MIT License - see LICENSE file for details.
Contributing
Contributions welcome! Please open an issue or PR on GitHub.
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataform_dependency_visualizer-0.2.2.tar.gz.
File metadata
- Download URL: dataform_dependency_visualizer-0.2.2.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
666b7d1ecd454d92621c509193b800cfca8a514730d6aa5f26cee56ac9c63eaf
|
|
| MD5 |
2b751bb656ec74c6de9712c8c2f66f52
|
|
| BLAKE2b-256 |
e35cf7d68a29c085f96a4360219dc362bfc7b65682b8a3230256ff677874e6b2
|
File details
Details for the file dataform_dependency_visualizer-0.2.2-py3-none-any.whl.
File metadata
- Download URL: dataform_dependency_visualizer-0.2.2-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3ba3822a3a6de0bc6ee910e89bde8fde94e61d2eca2934131dd304cef447231
|
|
| MD5 |
86f7d476b7681b4344b9e443a475e77b
|
|
| BLAKE2b-256 |
ac245cba88ff29c7c2e13e0b1bb487e6c75c492d5ed0e2dabff343443a23394d
|