1.0.16 • Published 8 months ago

heatmap-c v1.0.16

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

heatmap-c

云实验室项目孔板可视化组件

Build Setup

安装 heatmap-c 组件,npm i heatmap-c

Using Setup

该组件输入的数据格式

{
  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>

What's Changed

1.0.16: 初始化的时候自适应页面
1.0.16

8 months ago

1.0.15

8 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.13

8 months ago

1.0.12

9 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

11 months ago

0.0.17

11 months ago

0.0.16

11 months ago

0.0.15

11 months ago

0.0.14

11 months ago

0.0.13

11 months ago

0.0.12

11 months ago

0.0.11

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago