
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
云实验室项目孔板可视化组件
安装 heatmap-c 组件,npm i heatmap-c
该组件输入的数据格式
{
data: {
data: heatmapData,
config: {
commonConfig: {
size: [8, 12],
legend: {
show: true
},
selected: [true, true, true, false]
},
classConfig: [
{
data:[],
name:"",
scatter:{
formatter: '',
rich: {
rich:{},
emphasisRich:{}
},
itemStyle: {}
}
},
...
]
}
}
1.在项目的 main.ts 文件中引入组件
// 导入热力图组件
import HeatmapC from 'heatmap-c'
app.use(HeatmapC)
2.在页面中使用组件
<template>
<heatmap-c :datasource="data" />
</template>
<script setup>
// 【X轴,Y轴,状态对应的值(1是合格、2是不合格等)】
var heatmapData = [
[0, 0, 1, {id: 1}],
[0, 1, 1, {id: 2}],
[0, 2, 4, {id: 3}],
]
// 孔板中默认的孔位效果
let wmsRich = {
width: 18,
height: 18,
align: 'center',
verticalAlign: 'top',
borderColor: 'black',
opacity: 1,
lineHeight: 20,
backgroundColor: {
image: ''
}
}
// 孔板状态数组
let wmsLabelArray = ['DNA', '感受态', '引物', '大肠杆菌', '培养液', '引物-1']
// 孔板每个状态对应选中和默认的颜色
let wmsColor = [
{ selected: '#52C41A', default: '#95DE64' },
{ selected: '#FF9D00', default: '#FFC15E' },
{ selected: '#005AEA', default: '#5898FF' },
{ selected: '#E90909', default: '#FF4D4F' },
{ selected: '#680DB6', default: '#8E58DA' },
{ selected: '#005AEA', default: '#5898FF' }
]
// 孔板中每个状态对应的样式配置
let wmsClassConfigArray = []
wmsLabelArray.map((item, index) => {
let configItem = {
name: item, // 状态名称
data: heatmapData.filter(val => {
return val[2] === index + 1
}),
scatter: {
formatter: 'wms',
rich: {
rich: {
...wmsRich,
backgroundColor: {
image: dna_icon.image // 默认时的孔板图标
}
}
},
itemStyle: {
selected: wmsColor[index].selected,
default: wmsColor[index].default
}
}
}
wmsClassConfigArray.push(configItem)
})
let wmsConfig = {
commonConfig: {
size: [7, 12],
legend: {
disabled: true
}
},
classConfig: wmsClassConfigArray
}
let data = ref({
data: heatmapData,
config: wmsConfig
})
</script>
1.0.16: 初始化的时候自适应页面
FAQs
> 云实验室项目孔板可视化组件
The npm package heatmap-c receives a total of 4 weekly downloads. As such, heatmap-c popularity was classified as not popular.
We found that heatmap-c demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.