Skip to content
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

[Experiment] Distinctive MemoryDataset view on flowchart #1706

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/flowchart/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const drawNodes = function (changed) {
nodes,
focusMode,
hoveredFocusMode,
flags,
} = this.props;

const isInputOutputNode = (nodeID) =>
Expand Down Expand Up @@ -171,6 +172,10 @@ export const drawNodes = function (changed) {
)
.classed('pipeline-node--data', (node) => node.type === 'data')
.classed('pipeline-node--task', (node) => node.type === 'task')
.classed(
'pipeline-node--memory-data',
(node) => flags?.diffMemoryDatasets && node?.dataset?.includes('memory')
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good. Can we have a DatasetType check instead of string matching ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, i think we will eventually refactor and do it properly. for now this is just a quick dirty experiment

)
.on('click', this.handleNodeClick)
.on('mouseover', this.handleNodeMouseOver)
.on('mouseout', this.handleNodeMouseOut)
Expand Down
1 change: 1 addition & 0 deletions src/components/flowchart/flowchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ export const mapStateToProps = (state, ownProps) => ({
visibleSidebar: state.visible.sidebar,
visibleCode: state.visible.code,
visibleMetaSidebar: getVisibleMetaSidebar(state),
flags: state.flags,
...ownProps,
});

Expand Down
4 changes: 4 additions & 0 deletions src/components/flowchart/styles/_node.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@
.pipeline-node__text {
transition: opacity 0.15s ease;
}

.pipeline-node--memory-data {
opacity: 0.3;
}
7 changes: 7 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ export const flags = {
default: false,
icon: '🔛',
},
diffMemoryDatasets: {
name: 'Distinctive Memory Dataset flowchart view',
description:
'Fades non-persistent i.e. MemoryDatasets to distinguish them from persistent datasets in the flowchart',
default: false,
icon: '🔛',
},
};

export const settings = {
Expand Down
1 change: 1 addition & 0 deletions src/selectors/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ export const getVisibleNodes = createSelector(
name: nodeLabel[id],
fullName: nodeFullName[id],
icon: getShortType(nodeDatasetType[id], nodeType[id]),
dataset: nodeDatasetType[id],
type: nodeType[id],
layer: nodeLayer[id],
rank: nodeRank[id],
Expand Down
Loading