mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-30 02:07:41 +01:00
Fix heatmap first color being unused (#22158)
Backport #22157. vue3-calendar-heatmap has the behaviour that the first and second colors are mapped to values null and 0, meaning the second color was not used as intended for values > 0. I think this is a behaviour change from previous vue2 version that was missed during the upgrade. This change makes first and second values the same, so the heatmap can now use one additional color for meaningful values.
This commit is contained in:
parent
4297aced93
commit
e88218f4be
1 changed files with 7 additions and 0 deletions
|
@ -28,6 +28,7 @@ export default {
|
|||
},
|
||||
data: () => ({
|
||||
colorRange: [
|
||||
'var(--color-secondary-alpha-70)',
|
||||
'var(--color-secondary-alpha-70)',
|
||||
'var(--color-primary-light-4)',
|
||||
'var(--color-primary-light-2)',
|
||||
|
@ -50,6 +51,12 @@ export default {
|
|||
return s;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// work around issue with first legend color being rendered twice and legend cut off
|
||||
const legend = document.querySelector('.vch__external-legend-wrapper');
|
||||
legend.setAttribute('viewBox', '12 0 80 10');
|
||||
legend.style.marginRight = '-12px';
|
||||
},
|
||||
methods: {
|
||||
handleDayClick(e) {
|
||||
// Reset filter if same date is clicked
|
||||
|
|
Loading…
Reference in a new issue