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);
|
||||
|
||||
@@ -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 浓度递增 */
|
||||
|
||||
Reference in New Issue
Block a user