Pheatmap 画出的热图 看起来不好看,用什么代码可以调整顺序使图看起来像楼梯状
可以使用CSS的flexbox布局来实现楼梯状效果。具体代码如下所示:
HTML代码:
CSS代码:
.container {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
.box {
width: 100px;
height: 100px;
background-color: #ccc;
margin-right: 20px;
margin-bottom: 20px;
}
.box:nth-child(2n) {
transform: translateY(80px);
}
其中,.container为父容器,使用flex布局;.box为子容器,设置宽高和背景颜色,并且设置右边和下边的边距为20px。使用:nth-child(2n)选择器,将第二个和第四个子容器向下平移80px,从而实现楼梯状效果。
可以将输出的热力图进行一个平滑。