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

[ui] Op / asset graph node styling polish #18546

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export const LegacyPalette = {
[ColorName.LineageGroupBackground]: LegacyColors.Gray10,
[ColorName.LineageNodeBackground]: LegacyColors.Blue50,
[ColorName.LineageNodeBackgroundHover]: LegacyColors.Blue50,
[ColorName.LineageNodeBorder]: LegacyColors.Olive500,
[ColorName.LineageNodeBorderHover]: LegacyColors.Olive500,
[ColorName.LineageNodeBorder]: LegacyColors.Blue200,
[ColorName.LineageNodeBorderHover]: LegacyColors.Blue500,
[ColorName.LineageNodeBorderSelected]: LegacyColors.Blue500,

// Dataviz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ const AssetNodeBox = styled.div<{$isSource: boolean; $selected: boolean}>`
&:hover {
${(p) => !p.$selected && `border: 2px solid ${colorLineageNodeBorderHover()};`};

box-shadow: rgba(0, 0, 0, 0.12) 0px 2px 12px 0px;
box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 4px 0px;
scale: 1.03;
${AssetNodeShowOnHover} {
display: initial;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ const AssetNodeWrapper = styled.div`
cursor: pointer;
width: 260px;
flex-shrink: 0;
position: relative;
`;
3 changes: 3 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/graph/OpIOBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ const OpIOContainer = styled.div<{$colorKey: string; $highlighted: boolean}>`
background: ${(p) => (p.$highlighted ? colorBackgroundDefault() : colorBackgroundDefault())};
font-size: 12px;

&:first-child {
border-top-left-radius: 8px;
}
&:last-child {
border-bottom-left-radius: 8px;
}
Expand Down
55 changes: 29 additions & 26 deletions js_modules/dagster-ui/packages/ui-core/src/graph/OpNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,18 @@ export class OpNode extends React.Component<IOpNodeProps> {
{minified ? 'C' : 'Config'}
</div>
)}

{definition.inputDefinitions.map((item, idx) => (
<OpIOBox
{...this.props}
{...metadataForIO(item, invocation)}
key={idx}
item={item}
layoutInfo={layout.inputs[item.name]}
colorKey="input"
/>
))}

<div>
{definition.inputDefinitions.map((item, idx) => (
<OpIOBox
{...this.props}
{...metadataForIO(item, invocation)}
key={idx}
item={item}
layoutInfo={layout.inputs[item.name]}
colorKey="input"
/>
))}
</div>
<div className="node-box" style={{...position(layout.op)}}>
<div className="name">
{!minified && <Icon name="op" size={16} />}
Expand All @@ -184,17 +184,18 @@ export class OpNode extends React.Component<IOpNodeProps> {
}}
/>
)}

{definition.outputDefinitions.map((item, idx) => (
<OpIOBox
{...this.props}
{...metadataForIO(item, invocation)}
key={idx}
item={item}
layoutInfo={layout.outputs[item.name]}
colorKey="output"
/>
))}
<div>
{definition.outputDefinitions.map((item, idx) => (
<OpIOBox
{...this.props}
{...metadataForIO(item, invocation)}
key={idx}
item={item}
layoutInfo={layout.outputs[item.name]}
colorKey="output"
/>
))}
</div>
</NodeContainer>
);
}
Expand Down Expand Up @@ -369,7 +370,7 @@ const NodeContainer = styled.div<{
.dynamic-marker {
transform: translate(-5px, -5px);
border: ${(p) => (p.$minified ? '3px' : '2px')} solid ${colorKeylineDefault()};
border-radius: 3px;
border-radius: 8px;
}
.config-marker {
position: absolute;
Expand Down Expand Up @@ -417,8 +418,10 @@ const NodeContainer = styled.div<{
text-overflow: ellipsis;
background: ${colorBackgroundLighter()};
border-top: ${colorKeylineDefault()} 1px solid;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;

/* 6px because it's inside a bordered box with a 2px line at our standard 8px radius */
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
font-size: 12px;
}
`;