-
Notifications
You must be signed in to change notification settings - Fork 159
APP-560: Dag viewer #8326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APP-560: Dag viewer #8326
Conversation
File Organization FeedbackFirst off, this is excellent work! The graph visualization is well-architected with solid algorithms, comprehensive tests, and thoughtful error handling. However, I'd like to discuss the file organization before merging. Current StructureThe resource-graph/
├── build-resource-graph.ts
├── cache-manager.ts
├── graph-config.ts
├── graph-error-handling.ts
├── graph-traversal.ts
├── GraphErrorBoundary.svelte
├── GraphOverlay.svelte
├── navigation-utils.ts
├── resource-graph-quick-view-store.ts
├── resource-id.ts
├── ResourceGraph.svelte
├── ResourceGraphCanvas.svelte
├── ResourceGraphContainer.svelte
├── ResourceGraphOverlay.svelte
├── ResourceGraphQuickView.svelte
├── ResourceNode.svelte
├── seed-utils.ts
├── SummaryCountNode.svelte
├── SummaryCountsGraph.svelte
├── types.ts
└── use-graph-url-sync.tsInconsistency with Codebase PatternsThis is inconsistent with how we organize other features. For comparison:
models/
├── error-utils.ts
├── index.ts
├── selectors.ts
├── incremental/
├── inspector/
├── navigation/
├── partitions/
├── utils/
└── workspace/
chat/
├── core/
│ ├── messages/
│ ├── input/
│ └── [core logic]
└── layouts/
└── sidebar/
dashboards/
├── config.ts
├── pivot/
├── stores/
├── time-controls/
├── filters/
└── dimension-table/Proposed ReorganizationI recommend organizing by semantic sub-features (user flows) rather than file types: resource-graph/
├── quick-view/ # "View Dependencies" menu action
│ ├── QuickView.svelte
│ ├── quick-view-store.ts
│ └── README.md
│
├── graph-canvas/ # Core visualization engine
│ ├── GraphCanvas.svelte
│ ├── ResourceNode.svelte
│ ├── graph-builder.ts
│ ├── graph-builder.spec.ts
│ └── README.md
│
├── navigation/ # URL deep-linking (/graph?seed=...)
│ ├── GraphContainer.svelte
│ ├── url-sync.ts
│ ├── url-sync.spec.ts
│ ├── seed-parser.ts
│ ├── seed-parser.spec.ts
│ └── README.md
│
├── embedding/ # Embeddable graph widgets
│ ├── ResourceGraph.svelte
│ ├── GraphOverlay.svelte
│ ├── ResourceGraphOverlay.svelte
│ └── README.md
│
├── summary/ # Simplified aggregate views
│ ├── SummaryGraph.svelte
│ ├── SummaryNode.svelte
│ └── README.md
│
└── shared/ # Cross-cutting concerns
├── cache/
│ └── position-cache.ts
├── traversal/
│ ├── graph-traversal.ts
│ └── graph-traversal.spec.ts
├── partitioning/
│ ├── partition-by-seeds.ts
│ └── partition-by-metrics.ts
├── errors/
│ ├── error-handling.ts
│ └── ErrorBoundary.svelte
└── config.tsResult: 3-6 files per directory (vs. 21 in a flat list) Benefits
Additional CleanupI also noticed
Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Miller, overall this looks good! I did a first pass through the code, and the first thing I noticed was that the resource-graph directory could be better structured. As a rough heuristic, we should try to avoid frontend feature directories that have more than ~8 top-level files. See the comment above (which I generated via a discussion with Claude Code) for more detail.
URL API Feedback: Ambiguity & TerminologyDeveloped in collaboration with Claude Code I've reviewed the URL API design and identified two issues that should be addressed before merging: Problem 1: Ambiguity with Kind Token ExpansionThe current implementation checks if a bare seed matches a kind token ( Example scenario: # metrics.yaml - a MetricsView literally named "metrics"
type: metricsview
table: ordersCurrent behavior:
The same issue affects any resource named Code reference: Problem 2: "Seed" is Developer JargonThe term "seed" is computer science terminology (graph seeding, traversal start points) that won't be intuitive to business users who see these URLs in their browser or shared links. Current URLs:
User-facing touchpoints:
Proposed SolutionReplace the Benefits:
Implementation notes:
Migration path: |
localStorage Key ConventionDeveloped in collaboration with Claude Code The current implementation uses a versioned key with dot notation: CACHE_NAMESPACE = `rill.resourceGraph.v${CACHE_VERSION}` // "rill.resourceGraph.v2"Issues with Current Approach
Proposed ConventionUse a simple namespaced key without versioning: CACHE_NAMESPACE = "rill:resource-graph"Benefits:
Why the Since Rill Developer runs on
Without the prefix, keys like Versioning rationale: If cache invalidation is needed due to layout changes, users have clear paths:
Establishing a ConventionWhile the codebase currently lacks a consistent localStorage key convention, this PR is an opportunity to establish one. I propose: Standard pattern for new features: Examples:
This creates clear namespacing under the |
ericpgreen2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the code re-org. Looks much better!
Now:
- See the two comments above about the URL and LocalStorage APIs.
- See my UXQA findings from playing with the feature.
UXQA:
- I don't see the "View dependency graph" on the menu items for Explores or Canvases. Can we add it?
- Can we remove the animation that kicks-in when a DAG is first rendered? IMO it's distracting.
- When I click on each node of the master DAG, I'd expect it to filter the below individual DAGs to match the number presented in the master node. So, in the picture below, because there are 0 sources in my project, I wouldn't expect to see any sub-DAGs.

- When I "expand" a DAG on the master page, I'd expect it to be more of a "selection" and it'd be the only DAG I see on the screen. Here I've expanded the "Adbids" DAG and it spills out of my viewport.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is empty, can we delete?
Minor: Unused Cache FieldDeveloped in collaboration with Claude Code The cache includes a Writing refs: // web-common/src/features/resource-graph/graph-canvas/graph-builder.ts:252
graphCache.addRef(dependentId, sourceId);Reading refs: Recommendation: Since the cache is persisted to localStorage and counts toward the 4MB quota, consider either:
This keeps the cache lean and prevents storing unused data in users' browsers. |
ericpgreen2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is looking great!
From my end, here are a couple last UXQA items:
- There still seems to be something wrong with the
kindfiltering. In the project-level DAG, I see 3 metrics views, but when I filter for metrics view DAGs, I see 6.

- I'm still not a fan of how the "expand" action works. When I click it, the target DAG still spills off-screen. IMO, rather than considering it an expansion, I'd consider it a selection where the URL is
/graph?name=<selected-resource>and the entire workspace is dedicated to the DAG (i.e. we don't additionally show the project-level DAG).

I've also tagged @Di7design for a final review from the Product team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UXQA from Design:
- Functionally, the main thing I noticed is the order in the DAG overview. I think it should be: resources → models → metrics → dashboards.
-
As noted in Eric G’s second point, keeping the DAG overview at the top causes an expanded chart to display only partially and hide the remaining DAGs. After syncing with Eric, we propose using the same overlay pattern for opening a single chart in the project graph page instead of expanding the window.
-
Clicking a box and having the entire chart highlight is confusing. Can we highlight only the clicked box instead of the entire chart? Also, the link icon for opening the source is hard to notice especially when the whole chart is highlighted, we can use an icon+text button and add “open” next to the icon to make the action clearer.
Di7design
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally looks good to me! Just a small bug : the close button on popup modal window is not working when I open it from side bar - dropdown menu - view dependency graph.
ericpgreen2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Let's merge!
* initialize multi-graph setup with dagre * branch highlighting * expanding graphs * added routing for graph page * sidebar button to route to graph * scrolling graphs * refactor for readability and simplicity * restructure for clarity * added breadcrumb view and overlay, added overview graph * new entry points, updated composition of components * Addressed Erics second comments, seed term changed, url clarity * fix typescript non-used error * last set of comments, fixed overview graph, expanded graph * fix overlay not closing
Add Resource Graph (DAG) Visualization System
This PR introduces the Resource Graph system for visualizing project dependencies across Sources → Models → Metrics Views → Dashboards. The system is built on SvelteFlow with Dagre layout and supports deep-linking, grouping, overlays, and multiple embedding modes.
Key Additions
Branded modal for “View Dependencies” from any resource. Handles anchor resource, loading, and errors.
Full graph component with seed filtering, grouping, and optional URL sync via
expandedquery params.Low-level visualization wrapper around SvelteFlow. Exposes layout primitives and flow control.
Generic expansion component supporting inline, modal, and fullscreen modes for embedded graphs.
/graph?seed=<kind>:<name>loads targeted graphs. Supports multiple seeds, kind aliases, and kind expansion.Functionality Overview
partitionResourcesBySeedsto generate multiple independent graph groups on a single page.Integrations Included