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);
+1 -3
View File
@@ -5825,9 +5825,7 @@ h5.ua-type-title { font-size: var(--ua-font-size-md); }
.ua-heat-cell {
display: block;
width: var(--ua-space-3);
height: var(--ua-space-3);
border-radius: var(--ua-radius-sm);
border-radius: var(--ua-radius-sm); /* 尺寸由调用方内联给(网格与图例同一来源),样式表不写第二份 */
}
/* 五档色阶:0 档是凹陷底(无活动),1-4 档 accent 浓度递增 */