-
Notifications
You must be signed in to change notification settings - Fork 113
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
Feature/slicing pipeline #1980
Feature/slicing pipeline #1980
Conversation
src/components/flowchart/components/slice-pipeline-action/slice-pipeline-action.js
Outdated
Show resolved
Hide resolved
src/components/flowchart/draw.js
Outdated
@@ -136,6 +150,16 @@ export const drawNodes = function (changed) { | |||
focusMode, | |||
hoveredFocusMode, | |||
} = this.props; | |||
const { filteredPipelineState } = this.state; | |||
|
|||
const fromToFilteredPipeline = createNodeStateMap(nodes, [ |
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.
these names are a bit confusing. I cannot come up with better names but below is the best I could.
I am also ok if we stick to these names but lets leave a comment on top to define what they do
// Map the state of nodes selected by the user (from and to nodes)
const selectedNodesState = createNodeStateMap(nodes, [
filteredPipelineState.from,
filteredPipelineState.to,
]);
// Map the state of nodes that fall within the range between the selected nodes
const nodesInRangeState = createNodeStateMap(
nodes,
filteredPipelineState.range
);
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.
let me have a think, I'll come back to you on this
src/components/flowchart/draw.js
Outdated
* @param {Array} values - Array of values to check against node IDs. | ||
* @returns {Object} An object mapping node IDs to booleans. | ||
*/ | ||
function createNodeStateMap(nodes, values) { |
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.
nice!
@@ -90,6 +102,34 @@ export class FlowChart extends Component { | |||
|
|||
componentDidUpdate(prevProps) { | |||
this.update(prevProps); | |||
|
|||
const isFilteredPipelineChanged = |
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 this code logic to update(prevProps = {}) in line 138?
and then do if changed(filteredPipeline) { } like the rest
src/components/flowchart/components/sliced-pipeline-action-bar/sliced-pipeline-action-bar.js
Outdated
Show resolved
Hide resolved
@Huongg I observed few things when testing locally.
|
Hi @jitu5 this is expected, it's the same behaviour from framework side. I've checked with @noklam and he confirmed it. So when user slices 2 nodes not linked to each other, this is what will be shown on the chart |
Hi @Huongg , This looks great. I have few questions, which I am not sure if it is by design -
Thank you |
src/actions/slice.js
Outdated
|
||
export const RESET_SLICE_PIPELINE = 'RESET_SLICE_PIPELINE'; | ||
|
||
export const resetSlicePipeline = () => ({ |
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.
[Nit] - just to have an opposite for applySlice
export const resetSlice = () => ({
type: RESET_SLICE,
slice: { from: null, to: null },
});
src/components/flowchart/components/sliced-pipeline-action-bar/sliced-pipeline-action-bar.js
Outdated
Show resolved
Hide resolved
src/selectors/disabled.js
Outdated
) => | ||
arrayToObject(nodeIDs, (id) => { | ||
let isDisabledViaModularPipeline = | ||
disabledModularPipeline[nodeModularPipelines[id]]; | ||
|
||
let isDisabledViaFilters = false; | ||
if (slicedPipeline.length > 0 && isSliceApplied) { |
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 (slicedPipeline.length > 0 && isSliceApplied) { | |
if (isSliceApplied && slicedPipeline.length > 0) { |
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.
could you please let me know what happens if getNodeDisabled returns True/False and how can a node be disabled via a slice ? Is this used for a sliced view ?
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.
hey i dont think getNodeDisabled
would return true or false, it will return an object with IDs and its value, eg:
{
1e3cc50a :false
3b199c6b: false
3fb71518: true
}
so if its false, the node/element on the chart will be faded out. So any nodes in slicedPipeline will have the value of true, and the rest will be false. Does it make sense?
hey @ravi-kumar-pilla, first point is covered in this user story 1973, we're going to explore changing the order in the command line and let the user selects the bottom node to top node. for second point, currently it's only working with node and dataset in the MVP 1 i think, we can certainly explore the modular_pipeline but will need to check with the framework team to see if this is something would work in framework too |
@@ -0,0 +1,27 @@ | |||
import React from 'react'; |
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 feel like this should be in components
folder not flowchart folder.
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.
Awesome feature for Viz and looking forward to the release. Thank you @Huongg .... looks great !! 💯 |
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.
Some point we discussed during the review process like click on action bar event and slicing during embedded mode. May be we can improvise on it later but for this PR Great work @Huongg !!
3b8e628
to
13f1d95
Compare
Description
Fixes #1974,
User Story: As a Kedro user, I want to preview which nodes are included in my selection for slicing so that I can understand what my slice will be before creating a new slice
Development notes
This is a feature branch, and won't merge to main until all the other functionalities are merged and ready.
Architecture diagram as below:
QA notes
When testing on your machine locally, or through gitpod, please note that this PR only covers the functionalities below:
Pending design tasks that are waiting for @stephkaiser . Please ignore them when you review the PR
Checklist
RELEASE.md
file