diff options
author | silverwind <me@silverwind.io> | 2022-12-18 14:18:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-18 15:18:07 +0200 |
commit | e88218f4be42f0490c1ddbbbcfa0da938841fc20 (patch) | |
tree | 1c6f8dd732ee03c74d44c8be16499ae4c3645bfb /web_src/js | |
parent | 4297aced9360c3ce6f10764ea7f16286e66319bc (diff) | |
download | gitea-e88218f4be42f0490c1ddbbbcfa0da938841fc20.tar.gz gitea-e88218f4be42f0490c1ddbbbcfa0da938841fc20.zip |
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.
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/components/ActivityHeatmap.vue | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web_src/js/components/ActivityHeatmap.vue b/web_src/js/components/ActivityHeatmap.vue index b5c5c65bbf..896eb81258 100644 --- a/web_src/js/components/ActivityHeatmap.vue +++ b/web_src/js/components/ActivityHeatmap.vue @@ -29,6 +29,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)', 'var(--color-primary)', @@ -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 |