Skip to main content

Visualize Dataform table dependencies as interactive SVG diagrams

Project description

Dataform Dependency Visualizer

Generate beautiful, interactive SVG diagrams showing dependencies between Dataform tables.

Version Python License

Features

  • 📊 Interactive SVG Diagrams - Visualize dependencies for each table
  • 🎨 Color-Coded - Tables (blue), views (green), operations (orange)
  • JOIN Details - Shows JOIN types and ON conditions for each dependency
  • �🔍 Master Index - Browse all tables in one HTML interface
  • 📁 Schema Organization - Automatically organized by database schema
  • Pure Python - No Graphviz required

Installation

pip install dataform-dependency-visualizer

Prerequisites

  • Python 3.10+
  • Node.js
  • @dataform/core ^3.0.0
# Install in your Dataform project
cd your-dataform-project
npm install @dataform/core@^3.0.0

Usage

1. Generate Dependencies Report

python -m dataform_viz.dataform_check > dependencies_text_report.txt

2. Generate Visualizations

# For all schemas
dataform-deps --report dependencies_text_report.txt generate-all

# For specific schema
dataform-deps --report dependencies_text_report.txt generate dashboard

# For individual table
dataform-deps --report dependencies_text_report.txt generate schema_name table_name

3. View Results

Open output/dependencies_master_index.html in your browser

Additional Commands

# Generate master index and open in browser
dataform-deps --report dependencies_text_report.txt index --open

# Custom output directory
dataform-deps --report dependencies_text_report.txt --output my_diagrams generate-all

# Cleanup Dataform issues (removes database references, fixes constants)
python -m dataform_viz.dataform_check --cleanup

Python API

from dataform_viz import DependencyVisualizer

viz = DependencyVisualizer('dependencies_text_report.txt')
viz.load_report()

# Generate for specific schema
viz.generate_schema_svgs('dashboard', output_dir='output')

# Generate all schemas
viz.generate_all_svgs(output_dir='output')

# Generate master index
viz.generate_master_index('output')

Understanding the Diagrams

Each SVG diagram shows:

  • Center (Yellow): The table being viewed
  • Left (Blue): Dependencies - tables this reads FROM, with JOIN details shown below each
  • Right (Green): Dependents - tables that read FROM this
  • Schema Labels: Database schema for each table
  • Type Badges: table, view, incremental, operation
  • JOIN Information: Type (LEFT/INNER/RIGHT JOIN) and ON conditions displayed in red below dependency nodes

Output Structure

output/
├── dependencies_master_index.html    # Main browser interface
├── schema_name/
│   ├── table1.svg
│   ├── table2.svg
│   └── ...
└── ...

Common Issues

"wwim_utils is not defined" or compilation errors

Run the cleanup utility:

python -m dataform_viz.dataform_check --cleanup

This removes:

  • database: lines from config blocks
  • database: parameters from ref() calls
  • Undefined constant references

Empty diagrams

Ensure you're using the text format report:

python -m dataform_viz.dataform_check > dependencies_text_report.txt

Development

# Clone and install
git clone https://github.com/OshigeAkito/dataform-dependency-visualizer
cd dataform-dependency-visualizer
poetry install

# Run tests
poetry run pytest

# Type checking
poetry run mypy src/

License

MIT License - See LICENSE file

Links

Changelog

v0.2.3 (2026-01-21)

  • NEW: JOIN information extraction from SQL queries
  • Display JOIN types (LEFT, INNER, RIGHT, etc.) and ON conditions in SVG diagrams
  • JOIN count summary shown on center table
  • Detailed JOIN info displayed below each dependency node

v0.2.0 (2026-01-13)

  • Added cleanup utility for database references
  • Constant replacement functionality
  • Improved error handling
  • Enhanced documentation

v0.1.0

  • Initial release
  • SVG generation with color coding
  • Master index generator
  • Command-line interface

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

dataform_dependency_visualizer-0.2.4.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dataform_dependency_visualizer-0.2.4-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file dataform_dependency_visualizer-0.2.4.tar.gz.

File metadata

File hashes

Hashes for dataform_dependency_visualizer-0.2.4.tar.gz
Algorithm Hash digest
SHA256 69a091e54d16f8e6f4e1a9895e25ebabac7273705ecc2829eb4cec13670b634a
MD5 e5c7ec4aa46fc8d9ef26334f93fb8598
BLAKE2b-256 ec905a9fc39db69c835d984633cdefa200414899f67d3e1f66fe917c39d28a90

See more details on using hashes here.

File details

Details for the file dataform_dependency_visualizer-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for dataform_dependency_visualizer-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 af522eae48320d33f4e1453414dd4002811d73b930330f356e44d6e6a53b4692
MD5 53fe88c8abcccee548a0e7b6aae109f7
BLAKE2b-256 65c899050b24a67b301b83d2588b7bcd2ef3cce42bb721ed340c431840ff41e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page