-
Notifications
You must be signed in to change notification settings - Fork 319
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
UI: add full graph toggle #2569
UI: add full graph toggle #2569
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2569 +/- ##
=========================================
Coverage 83.26% 83.26%
Complexity 1286 1286
=========================================
Files 243 243
Lines 5934 5934
Branches 279 279
=========================================
Hits 4941 4941
Misses 846 846
Partials 147 147 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
de90eae
to
c858987
Compare
Yeah looks good - only suggestion I would make is to change the background colour of the toggle to Marquez Green when its on so its a little easier to determine state. |
That’s a good point, that may make more sense since the full graph has always been the default and this is something new users can enable. I’m having trouble thinking of a label for the switch that would make sense that isn’t too wordy though. Perhaps “Simple Graph” or something like that? Agree it would be great to get some wider feedback. |
What about “Show Critical Path”? |
Yeah I think we can just reverse the logic and it should work fine I've added the sections that can be reversed on your branch (could be wrong as this the first time I have ever looked at typescript/react/node) |
} | ||
|
||
const initialState: ILineageState = { | ||
lineage: { graph: [] }, | ||
selectedNode: null, | ||
bottomBarHeight: (window.innerHeight - HEADER_HEIGHT) / 3, | ||
depth: 5 | ||
depth: 5, | ||
showFullGraph: true |
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.
showFullGraph: false
web/src/i18n/config.ts
Outdated
@@ -57,7 +57,8 @@ i18next | |||
lineage: { | |||
empty_title: 'No node selected', | |||
empty_body: 'Try selecting a node through search or the jobs or datasets page.', | |||
graph_depth_title: 'Graph Depth' | |||
graph_depth_title: 'Graph Depth', | |||
full_graph_label: 'Full Graph' |
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.
full_graph_label: 'Show Critical Path'
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.
Eh, this just starts to feel like a lot of words to express something relatively simple. I tend to err on the side of "less is more" with these things. I really like the ArgoCD version of this where the text labels show up as a tooltip when you hover over the options. I think that helps preserve the real-estate the configs take up. Maybe we want to think about something like that if we plan to add more configs to this part of the screen.
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.
Yeah I’m in two minds about that. Like the idea of having a pop up on hover to display basic ( maybe even facets like data quality?) info about the node. Maybe we need an additional menu on the header for global type variables like display and depth?
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.
I love the discussion here! My hot take is I would agree with @jlukenoff on the wordiness of the lineage graph options (they'll be more added in the future). We know we are interacting with the lineage graph, so I think we can go one step further to address the wordiness of the options:
Full
- toggle between critical path and the full graph overlaid on top of critical path graph (default:false
)Depth
- full graph traversal depth
I added shortening "Graph Depth", but that can be a follow up PR.
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.
As a follow up, the lineage API should support the different graph options (Full
, Critical
) to avoid filtering on the UI. But, in the UI is a great first step!
|
||
// Always rebuild the graph if the selected node changes and we aren't showing the full graph | ||
// Since there may be more or less nodes to change | ||
if (this.props.selectedNode !== prevProps.selectedNode && !this.props.showFullGraph) { |
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.
if (this.props.selectedNode !== prevProps.selectedNode && this.props.showFullGraph) {
this.buildGraphAll(this.props.lineage.graph)
}
@@ -215,6 +240,11 @@ export class Lineage extends React.Component<LineageProps, LineageState> { | |||
g.setEdge(graph[i].inEdges[j].origin, graph[i].id) | |||
} | |||
} | |||
|
|||
if (!this.props.showFullGraph) { |
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.
if (this.props.showFullGraph) {
this.removeUnselectedNodes()
}
I'm not sure I understand, doesn't the fact that they are connected by the selected path mean they are on the critical path? Could you point out which nodes in your screenshot you think shouldn't be displayed? |
fcd53a7
to
b6d5c2f
Compare
Had to do a pretty big refactor to account for #2563 but the functionality is still the same. Plus it's worth it to inherit the react upgrade 😄 |
I think I see your point but as a user I would prefer to see edges that exist in this view if the relevant nodes are being displayed. I think not doing so obfuscates potentially useful information from the user without drastically simplifying the experience compared to displaying the relationship between nodes along the critical path even if those relationships aren't part of the critical path. |
@davidsharp7 I wanted to add to @jlukenoff response. In the |
@@ -85,7 +90,7 @@ describe('Lineage Component', () => { | |||
|
|||
beforeEach(() => { | |||
g = initGraph() | |||
buildGraphAll(g, mockGraphWithCycle, (gResult: graphlib.Graph<MqNode>) => { | |||
buildGraphAll(g, mockGraphWithCycle, false, selectedNode, (gResult: graphlib.Graph<MqNode>) => { |
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.
Can we add a test case here for the node count on the fullGraph
option?
Yeah I don't think its even a binary choice as each of those views is legitimate i.e
|
@davidsharp7 I think you make good points, and agree a more broad discussion on the graph view can be had, but I would move the discussion to an issue. Mind opening an issue to elaborate on the graph view in the UI and ways to improve the user expereince? As for this PR, being able to toggle between a "Full" and "Critical Path" view is the main feature added, so I would merge as is with pending feedback from @phixMe. It's a start and we can follow up with improvements! |
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.
I left some minor feedback on labeling the graph options, but otherwise 👍
Signed-off-by: John Lukenoff <[email protected]>
Signed-off-by: John Lukenoff <[email protected]>
Signed-off-by: John Lukenoff <[email protected]>
Signed-off-by: John Lukenoff <[email protected]>
Signed-off-by: John Lukenoff <[email protected]>
a1e8b73
to
98fc0a8
Compare
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 adding the unit test. Looks great!
Signed-off-by: John Lukenoff <[email protected]>
for (let i = 0; i < predecessors.length; i++) { | ||
if (predecessors[i]) { | ||
paths.push([predecessors[i] as unknown as string, node]) | ||
getPredecessors(predecessors[i] as unknown as string) | ||
paths.push([(predecessors[i] as unknown) as string, node]) | ||
getPredecessors((predecessors[i] as unknown) as string) |
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.
Not sure how long we've been doing this but it looks like we've been iterating over the characters in the node id 😬 ? Update this to traverse the predecessors array and did the same for getSuccessors
Signed-off-by: John Lukenoff <[email protected]>
Just made a few styling tweaks that I found after adjusting to shorter labels for these configs. This should be good to merge once tests pass (I don't have access to merge yet) |
Problem
There are some reasonable scenarios where users would want to view only the direct successors and predecessors of the current selected node in the lineage graph. This PR enables users to toggle a "Full Graph" view, when deselected, the graph will render only the nodes that are along the selected paths. When deselected and changing selected nodes, we expect that the graph should re-render with any new nodes that weren't along the selected path previously.
Closes: #2558
Solution
showFullGraph
property to the lineage state and enables a toggle on the UI.removeUnselectedNodes
method toLineage
that can remove any unselected nodes from the graph.One-line summary: add a toggle to the Lineage UI to let users switch between viewing the full graph and a view with only the selected paths.
Checklist
CHANGELOG.md
(Depending on the change, this may not be necessary)..sql
database schema migration according to Flyway's naming convention (if relevant)