Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

[MLMD] Add support for many-to-many <EdgeCanvas> #44

Merged
merged 4 commits into from
Feb 19, 2020

Conversation

kwasi
Copy link
Contributor

@kwasi kwasi commented Feb 18, 2020

/area front-end
/priority p0
/assign @kwasi
/cc @avdaredevil

Fixes: #39

Background

As mentioned in #39, we currently fetch artifacts for all executions in the output executions column and connect them to the top-most execution.

https://screenshot.googleplex.com/ey9TJBUYbS1

This is wrong for 2 reasons.

  1. Not every artifact should be connected to the top-most execution. The artifacts for executions like Transform are not connected to it.
  2. The artifacts are laid out so that the correct connections will create crossing lines

If we really want to show the connections for the top-most execution and have the other executions be unconnected we should show just the first artifacts:

https://screenshot.googleplex.com/MwEwBi5tWw6

We can alternatively support targeting executions or connect the executions to the output artifacts. Since we don't have UX for targeting executions and want to present enough information to explore Lineage, this PR takes the approach of connecting the executions.

Description

This PR adds EdgeCanvas logic to support many-to-many connections between Output Artifacts and Output Executions. This allows us to show all executions connected to the correct artifacts, without having logic for execution selection, which may be added in the future.

https://screenshot.googleplex.com/AyQWkDHo6xp

https://screenshot.googleplex.com/0fNPiR4Upv9

It introduces a new Component <ControlledEdgeCanvas/> which is built by the <LineageCardColumn> and given offsets to position the <EdgeLine>.

Right now this component is coupled to the idea of OutputExecution to OutputArtifact edge lines, but it may either go away in the long-term (if we support execution targeting) or stay as a generic way of representing many-to-many edge connections.

Changes

  • Removes EdgeCanvas logic coupled to sleep timer and performs measurement of LineageView in componentDidMount().
  • Adds a resize event handler to re-measure the LineageView width.
  • Sort Artifacts so they are laid out in Execution order.
  • Draw multiple EdgeCanvas elements to connect executions to Artifacts.
  • Adds <ControlledEdgeCanvas> for control of positioning relative to the card column and starting offset.
  • Fix some tslint errors
  • (unrelated) Fixes overflow on LineageActionBar where breadcrumbs could push the reset button off-screen.

Verification

In Pipelines: https://6d1629804d56a867-dot-us-central2.pipelines.googleusercontent.com/#/artifact_types/Examples/artifacts/2


This change is Reviewable

* Remove EdgeCanvas logic coupled to sleep timer and perform measurement of
  LineageView.
* Sort Artifacts so they're laid out in Execution order.
* Draw multiple EdgeCanvas elements to connect executions to Artifacts.
* Adds <ControlledEdgeCanvas> for control of positioning relative to
  the card column and starting offset.
Copy link
Contributor

@avdaredevil avdaredevil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks amazing! Thanks for tackling this issue!!

axisVisible={false}
gridVisible={false}
labelsVisible={false}
pathColor={'#BDC1C6'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have the edgeColor be a css passed color.

Suggested change
pathColor={'#BDC1C6'}
pathColor={'currentColor'}

Now you can simply assign a color on the html node, and the edge color should automatically update, all through css!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't compute to the same color. https://screenshot.googleplex.com/qpLgGEoSFuB

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you also need to update the CSS for LineChart to now contain this color. Basically moving the coloring onus to CSS instead of JS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I get how that would work - can you explain which files to modify?

Also I'm not sure how readable it is to have this component take in props about everything except the color which would be coming from a different file (I assume). What's the optimization here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at this:
image

I personally feel that colors shouldn't be props, all aesthetic changes should be done within CSS. This essentially allows a user to CSS theme their component however they feel, rather than having to programmatically change the color props of individual components. With this change, you can simply do:

.edgeCanvas {color: red} /* that's it!* /
.edgeCanvas:nth-of-type(5) {color: darkRed}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't work though. The CSS class is edgeCanvas_fbvqlg9 and generated by typestyle.

* Extract constant for the EdgeLine control point
* Remove unnecessary usage of `!important`
Copy link
Contributor Author

@kwasi kwasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Responded to comments.

@avdaredevil
Copy link
Contributor

Awesome, took a look, just one more comment!

@avdaredevil
Copy link
Contributor

/lgtm
/approve
/hold

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: avdaredevil

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor Author

@kwasi kwasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented on your comment :)

@avdaredevil
Copy link
Contributor

/hold cancel

@k8s-ci-robot k8s-ci-robot merged commit dddc786 into kubeflow:master Feb 19, 2020
@kwasi kwasi deleted the fix-execution-arrows-pr branch February 19, 2020 01:16
@avdaredevil avdaredevil removed their assignment Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MLMD][BugBash] The execution -> artifact link in lineage graph is wrongly connected
3 participants