Skip to content

Commit 02c4242

Browse files
committed
make metrics smaller when there is a lot of data
1 parent 996a147 commit 02c4242

File tree

2 files changed

+45
-13
lines changed

2 files changed

+45
-13
lines changed

spark-ui/src/components/SqlFlow/MetricDisplay.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ const MetricDisplayComponent: React.FC<MetricDisplayProps> = ({ metrics }) => {
2626
};
2727

2828
// Use different styles based on number of metrics
29-
const isCompact = metrics.length > 7;
29+
const isUltraCompact = metrics.length >= 8;
3030
const isMedium = metrics.length >= 5 && metrics.length <= 7;
3131

32-
const metricItemClass = isCompact
33-
? styles.metricItemCompact
32+
const metricItemClass = isUltraCompact
33+
? styles.metricItemUltraCompact
3434
: isMedium
3535
? styles.metricItemMedium
3636
: styles.metricItem;
3737

38-
const metricNameClass = isCompact
39-
? styles.metricNameCompact
38+
const metricNameClass = isUltraCompact
39+
? styles.metricNameUltraCompact
4040
: isMedium
4141
? styles.metricNameMedium
4242
: styles.metricName;
4343

44-
const metricValueClass = isCompact
45-
? styles.metricValueCompact
44+
const metricValueClass = isUltraCompact
45+
? styles.metricValueUltraCompact
4646
: isMedium
4747
? styles.metricValueMedium
4848
: styles.metricValue;

spark-ui/src/components/SqlFlow/node-style.module.css

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@
136136

137137
/* Medium metric styles for when there are 5-7 metrics */
138138
.metricItemMedium {
139-
margin-bottom: 3px;
140-
padding: 3px 5px;
139+
margin-bottom: 2.8px;
140+
padding: 2.8px 4.5px;
141141
border-radius: 4px;
142142
background: rgba(63, 81, 181, 0.08);
143143
border-left: 1.5px solid #3f51b5;
@@ -151,18 +151,20 @@
151151
.metricNameMedium {
152152
font-weight: 600 !important;
153153
color: #3f51b5 !important;
154-
font-size: 15.5px !important; /* Increased to better fill node */
154+
font-size: 15px !important; /* Middle ground between 15.5px and 14.5px */
155155
text-transform: capitalize;
156+
line-height: 1.15;
156157
}
157158

158159
.metricValueMedium {
159160
color: #424242 !important;
160-
font-size: 15.5px !important; /* Increased to better fill node */
161+
font-size: 15px !important; /* Middle ground between 15.5px and 14.5px */
161162
word-break: break-word;
162-
margin-left: 3px !important;
163+
margin-left: 2.8px !important;
164+
line-height: 1.15;
163165
}
164166

165-
/* Compact metric styles for when there are more than 7 metrics */
167+
/* Compact metric styles for when there are 7 metrics */
166168
.metricItemCompact {
167169
margin-bottom: 2px;
168170
padding: 2px 4px;
@@ -192,6 +194,36 @@
192194
line-height: 1.1;
193195
}
194196

197+
/* Ultra compact metric styles for when there are 8 or more metrics */
198+
.metricItemUltraCompact {
199+
margin-bottom: 2px;
200+
padding: 2px 4px;
201+
border-radius: 3px;
202+
background: rgba(63, 81, 181, 0.08);
203+
border-left: 1px solid #3f51b5;
204+
transition: background-color 0.2s ease;
205+
}
206+
207+
.metricItemUltraCompact:hover {
208+
background: rgba(63, 81, 181, 0.12);
209+
}
210+
211+
.metricNameUltraCompact {
212+
font-weight: 600 !important;
213+
color: #3f51b5 !important;
214+
font-size: 13px !important;
215+
text-transform: capitalize;
216+
line-height: 1.1;
217+
}
218+
219+
.metricValueUltraCompact {
220+
color: #424242 !important;
221+
font-size: 13px !important;
222+
word-break: break-word;
223+
margin-left: 2px !important;
224+
line-height: 1.1;
225+
}
226+
195227
/* Footer section for icons and controls */
196228
.nodeFooter {
197229
padding: 6px 12px;

0 commit comments

Comments
 (0)