Skip to main content

sdr-visualizer

PyPI Tests Lint Version Sync Python 3.11+ Coverage Ruff uv License: MIT

Static-output visual catalog generator for Adobe Customer Journey Analytics (CJA) and Adobe Analytics (AA) implementations. Consumes JSON snapshots from cja_auto_sdr and aa_auto_sdr and produces a single self-contained HTML file with:

  • A searchable, filterable component catalog (the primary view)
  • An interactive force-directed reference graph
  • Per-segment anatomy diagrams that make deeply-nested segments legible
  • Per-calculated-metric formula trees with click-through to referenced metrics
  • Snapshot-to-snapshot Changes and multi-snapshot Trend views

The catalog view: header stats strip, search and filters, and the component table

Live examples: CJA report · AA report

The output is one HTML file: no server, no consumer-side build step, and no CDN dependencies. Its JSON, CSS, JavaScript, and D3 runtime are embedded, so it opens in a modern browser without an internet connection and makes no network requests.

Offline does not mean cleared for distribution. A report can contain implementation and component names, descriptions, segment and calculated-metric logic, owners, identifiers, timestamps, and source paths. Treat it as derived from the source snapshot. Move, email, post, or attach it only in authorized locations and in accordance with your organization's confidentiality and data-handling policy.

Install

Install from PyPI with uv:

uv tool install sdr-visualizer

Or with pip:

pip install sdr-visualizer

For development, run from a clone:

git clone https://github.com/brian-a-au/sdr-visualizer
cd sdr-visualizer
uv sync
uv run sdr-visualizer --help

Quickstart with a saved snapshot

Saved snapshots are the simplest and most reproducible input. You do not need either upstream generator installed to visualize a JSON file you already have.

# From a snapshot file
sdr-visualizer path/to/snapshot.json

# From a directory of snapshots (uses the most recent)
sdr-visualizer path/to/snapshots/

# Compare against an earlier snapshot: adds a Changes view to the report
sdr-visualizer snapshot_new.json --compare-to snapshot_old.json

# Chart evolution across a directory of snapshots: adds a Trend view
sdr-visualizer ./snapshots/ --trend

The output lands at ./visualize-{instance_id}-{timestamp}.html by default. Open it in a browser — that's the whole experience.

Standard input is also supported when another process already emits a complete compatible snapshot:

some-snapshot-command | sdr-visualizer -

Live CJA

Live CJA mode requires the separate cja_auto_sdr executable. Follow that project's current installation, configuration, and authentication instructions, then confirm cja_auto_sdr is on your PATH. Its generator may require a newer Python version than sdr-visualizer's Python 3.11 minimum.

sdr-visualizer --dataview dv_prod_web

sdr-visualizer runs the generator with JSON output, a temporary output directory, and --include-all-inventory, then selects the generated snapshot. The temporary source data is removed after the report is built. This is not a stdin pipeline: CJA's complete inventory is directory-backed.

Live AA

Live AA mode likewise requires the separate aa_auto_sdr executable. Complete its current setup and authentication steps, and confirm aa_auto_sdr is on your PATH. The generator may require a newer Python version than sdr-visualizer.

sdr-visualizer --rsid prod_us

AA live mode reads the generator JSON snapshot from stdout and embeds the supported normalized component catalog in the report. Retain the original generator snapshot when you need platform-specific details that the visualizer does not embed. For both live modes, the upstream repository is authoritative for credentials, permissions, and generator compatibility.

Useful flags

Flag What it does
--output PATH Write HTML somewhere specific.
--json PATH Also emit the embedded payload as a separate JSON file (useful for downstream tooling).
--title TEXT Override the document title.
--exclude-orphans Default the catalog's references filter to "Referenced" — hides components nothing depends on.
--max-graph-nodes N Override the 1,000-node graph-rendering threshold.
--platform cja|aa Override platform auto-detection.
--at TIMESTAMP When path is a directory, pick the snapshot closest to (and not after) this timestamp.
--quiet Suppress informational stderr output.

What's in the output

Every report has two base top-level views:

  1. Catalog — a searchable, filterable, sortable table of every component. Click a row to slide out a detail panel with description, properties, references, and anatomy.
  2. Reference graph — a force-directed view of every component and the edges between them; small implementations (under 20 components) use a static radial layout instead. Hover dims unrelated nodes; click opens the same detail panel; drag pins; pan/zoom.

Segment anatomy and calculated-metric anatomy are contextual detail content, not separate navigation destinations. They open from the Catalog detail panel. Segment anatomy renders nested containers and references; calculated-metric anatomy renders operations, operands, and metric references.

At most one conditional top-level view is added. With --compare-to, a Changes view appears, listing components added, removed, and modified relative to a baseline snapshot, with field-level before/after detail.

With --trend on a snapshot directory, a Trend view appears: sparkline charts of descriptive aggregates (component counts, orphans, undocumented components, reference edges) across the directory's snapshots, plus a per-interval change log. The window is capped at the 60 most recent snapshots.

A trend directory must hold snapshots of a single implementation. If it mixes CJA and AA snapshots, pass --platform cja|aa to select one (or point at a single-platform directory); without it the run stops rather than guess. If it mixes data views or report suites, the run stops as well. This mirrors --compare-to, which refuses both a platform and an instance mismatch, so neither view ever diffs unrelated inventories. To compare or chart across different data views or report suites on purpose (for example staging versus prod drift), pass --allow-instance-mismatch; the run then proceeds with a warning. Platform mismatches are always rejected. The report shown alongside the trend is the newest usable snapshot in the directory.

  • Restorable report links — the catalog's filters, sort, view, and open detail panel are encoded in the URL hash. Within an authorized report location, copy the address bar to restore the same filtered view.

Performance budget

The output is CI-gated against the budgets in docs/PERFORMANCE.md. Build time and HTML size are enforced at every published tier (100 / 500 / 1,000 / 2,000 components). Browser-measured budgets are enforced at the 1,000-component tier (initial render < 1s, filter/search < 150ms) and the 2,000-component tier (< 2s, < 300ms), plus a 700ms cap on the graph view's main-thread block. These guarantees cover up to 8,000 reference edges; denser valid reports use an explicit graph opt-in and sit outside the published size/latency envelope. Functional browser tests cover Chromium and WebKit. A separate Chromium-only performance gate measures all four component tiers; this is not a timing guarantee for every branded browser.

Troubleshooting

Symptom What to do
cja_auto_sdr or aa_auto_sdr is not found Install the matching upstream generator and make sure its executable is on PATH, or use a saved snapshot instead.
The generator reports an authentication or access failure Follow its upstream configuration instructions and verify the account can read the requested data view or report suite. sdr-visualizer does not manage generator credentials.
Live generation reaches the 600-second timeout Run the generator directly to diagnose service or inventory latency, save a completed snapshot, then pass that file to sdr-visualizer.
A file is reported as an unknown or ambiguous platform Pass a known CJA or AA snapshot, or use --platform cja / --platform aa when the file is valid but detection is ambiguous.
A trend run rejects a mixed directory Separate CJA from AA and different implementation IDs. --platform can select one platform; --allow-instance-mismatch is only for an intentional cross-instance comparison.
A large report withholds the graph Use the report's explicit graph opt-in after considering the browser cost, or set an intentional --max-graph-nodes threshold when generating it.
The HTML does not open automatically sdr-visualizer writes the file but does not launch a browser. Open the reported output path in a current browser.

Exit 0 means the report was generated. Exit 1 means a runtime failure such as an output-write error. Exit 3 means the input or invocation was invalid, including generator failures and timeouts. Exit 2 is not used.

Before sharing a snapshot, JSON sidecar, report, terminal output, or bug reproduction, redact customer names, component content, IDs, owners, source paths, credentials, and other organization-sensitive data. Prefer a minimal synthetic reproduction in a public issue.

Stability

From 1.0.0, semantic versioning covers the surface below. Anything not listed is internal and may change in any release.

CLI. The argument set: the positional path (snapshot file, snapshot directory, or - for stdin), --dataview, --rsid, --platform, --at, --compare-to, --trend, --allow-instance-mismatch, --output, --title, --exclude-orphans, --max-graph-nodes, --json, --quiet, --version. Removing or repurposing any of these is a major bump; adding flags is a minor one.

Exit codes. 0 success, 1 runtime error, 3 invalid input. 2 is never used.

The data payload. The JSON embedded in every report and the --json sidecar share one schema, published at docs/payload-schema.json (JSON Schema 2020-12) and validated in CI against every payload shape produced by the bundled fixtures. Removing or retyping a field is major; adding optional fields is minor. The segment_trees / formula_trees node internals are documented in the schema as loosely specified. Current-generator and private-corpus validation is a separate, recorded release gate; see docs/RELEASING.md.

Performance budgets. The tier table above is a guarantee, not a goal: loosening a budget is a breaking change; tightening one is minor.

Warnings (snapshot generator newer than the tested version; 5,000+ component reports) are informational and never make a valid snapshot fail.

Develop

Requires Python 3.11+ and uv.

uv sync                # Set up environment
uv run pytest          # Run tests (auto-generates the large fixture on first run)
uv run ruff check      # Lint
uv run ruff format     # Auto-format

uv run python scripts/generate_examples.py   # Regenerate examples/
uv run python scripts/perf_check.py          # Run the perf gate
uv run python scripts/check_markdown_links.py
uv run python scripts/check_workflow_policy.py
uv build --out-dir dist/packages
uv run python scripts/package_smoke_check.py dist/packages/

See also

Documentation

Community

Contributions are welcome within the project's intentionally narrow scope. Read CONTRIBUTING.md before opening a pull request. Report security issues privately as described in SECURITY.md; do not put vulnerabilities or customer snapshot data in a public issue. Participation is governed by the CODE_OF_CONDUCT.md.

License

MIT — see LICENSE. The output bundles D3 v7, vendored under the ISC license; see THIRD_PARTY_LICENSES for the full notice.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdr_visualizer-1.0.7.tar.gz (300.6 kB view details)

Uploaded Source

Built Distribution

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

sdr_visualizer-1.0.7-py3-none-any.whl (170.5 kB view details)

Uploaded Python 3

File details

Details for the file sdr_visualizer-1.0.7.tar.gz.

File metadata

  • Download URL: sdr_visualizer-1.0.7.tar.gz
  • Upload date:
  • Size: 300.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sdr_visualizer-1.0.7.tar.gz
Algorithm Hash digest
SHA256 7989e3afd3cc66596c08fca0c77ec8bbfd3fee0376c6feb152949b57b6d446dc
MD5 7ee65e44506453fef6948913eb8c2335
BLAKE2b-256 7a3a1ecf3fdc8bfadb4eeb594a8b450c12de7c9845e8f8b59549c800b39317ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdr_visualizer-1.0.7.tar.gz:

Publisher: release.yml on brian-a-au/sdr-visualizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdr_visualizer-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: sdr_visualizer-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 170.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sdr_visualizer-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5f594da46eb13156e11732ca1f5a0180d6f88f877dde2525dab7924d27d28331
MD5 33d63715774e0f0a6571cc12f1fe97fe
BLAKE2b-256 f11d2efae305e8c20f3d4f0f0b673112ecef33a7237c980f4d6177108b014c75

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdr_visualizer-1.0.7-py3-none-any.whl:

Publisher: release.yml on brian-a-au/sdr-visualizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.0.8

2 files

This release

1.0.7 This release

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.6.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page