Skip to content

Commit 8b3221c

Browse files
committed
Feat: Implement DevRank Heatmap CSS Transitions (#9078)
1 parent 432f919 commit 8b3221c

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

apps/devrank/view/GridContainer.mjs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,19 @@ class GridContainer extends BaseGridContainer {
200200
cellAlign: 'center',
201201
renderer : ({value}) => value || '',
202202
cellCls : ({value}) => {
203-
if (!value) return 'heatmap-cell-0';
204-
if (value < 100) return 'heatmap-cell-1';
205-
if (value < 1000) return 'heatmap-cell-2';
206-
return 'heatmap-cell-3';
203+
let cls = ['neo-heatmap'];
204+
205+
if (!value) {
206+
cls.push('heatmap-cell-0')
207+
} else if (value < 100) {
208+
cls.push('heatmap-cell-1')
209+
} else if (value < 1000) {
210+
cls.push('heatmap-cell-2')
211+
} else {
212+
cls.push('heatmap-cell-3')
213+
}
214+
215+
return cls
207216
}
208217
});
209218
}

resources/scss/src/apps/devrank/GridContainer.scss

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@
22
border-radius: 8px;
33

44
.devrank-sparkline-wrapper {
5-
height: 100%;
5+
height : 100%;
66
position: relative;
7-
width: 100%;
7+
width : 100%;
88

99
.devrank-sparkline-canvas {
10-
height: 100%;
11-
left: 0;
10+
height : 100%;
11+
left : 0;
1212
position: absolute;
13-
top: 0;
14-
width: 100%;
13+
top : 0;
14+
width : 100%;
1515
}
1616
}
1717

18+
// Only animate heatmap transitions when NOT scrolling to prevent ghosting and repaint costs
19+
.neo-grid-body:not(.neo-is-scrolling) .neo-grid-row .neo-grid-cell.neo-heatmap {
20+
transition: background-color 150ms ease-out, color 150ms ease-out;
21+
}
22+
1823
.neo-grid-body .neo-grid-row {
1924
// Selection state overrides heatmap
2025
&.neo-selected {
@@ -62,4 +67,4 @@
6267
}
6368
}
6469
}
65-
}
70+
}

0 commit comments

Comments
 (0)