iter(g278): 热力图图例与网格尺寸同源

This commit is contained in:
HIsheR
2026-10-26 23:04:19 +08:00
parent 414c61a002
commit c36b5078af
5 changed files with 17 additions and 8 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ export function heatmap(props: HeatmapProps): HTMLElement {
'div',
{ class: 'ua-heat-legend' },
h('span', { class: 'ua-heat-hint' }, props.legendText ?? '少'),
...[0, 1, 2, 3, 4].map((lv) => h('span', { class: `ua-heat-cell is-${lv}` })),
...[0, 1, 2, 3, 4].map((lv) => { const sw = h('span', { class: `ua-heat-cell is-${lv}` }); sw.style.width = `${cell}px`; sw.style.height = `${cell}px`; return sw; }), // 图例色块与网格同尺寸:两处各写一个尺寸会差出一号
h('span', { class: 'ua-heat-hint' }, '多'),
);
return h('div', { class: 'ua-heat' }, grid, legend);