npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

heatmap-c

v1.0.16

Published

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

Downloads

1

Readme

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: 初始化的时候自适应页面