iter(g278): 热力图图例与网格尺寸同源
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user