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

@xchart/wafer-map

v1.0.6

Published

Wafer map chart

Downloads

7

Readme

@xchart/wafer-map

WaferMap chart.

WaferMap 图表组件,支持 define map 、 wafer 和 heat map 三种模式

Usage

pnpm add @xchart/wafer-map
# or
yarn add @xchart/wafer-map
// 1. prepare dataset
const points = [
    {
        id: '1',
        x: 1,
        y: 1,
        bin: 1,
    },
];

// 2. new wafermap
const map = new NormalMap({
    container: container.value!,
    data: points,
    type: isHeatMap.value ? IWaferMapType.HEATMAP : IWaferMapType.NORMAL,
    config: {
        style: {
            fill: fillColor,
            strokeWidth: stroke_width,
            stroke: stroke_color,
            dieSize: {
                width: default_dieSize.w,
                height: default_dieSize.h,
            },
        },
        showColorMap: isHeatMap.value && !props.binCode,
    },
});

// 3. rerender it when needed
map.rerender({
    data: newPoints,
});

API

DIFINITION

import { DefinitionMap } from '@xchart/wafer-map'

DefinitionMap({ container, type , config = {} }: IWaferMap)

Attributes

| 属性 | 描述 | 类型 | 是否必填 | 默认值 | | --------- | -------- | --------------- | -------- | ---------------------- | | container | 图表容器 | HTMLElement | ✅ | - | | type | 图表宽度 | IWaferMapType | ✅ | IWaferMapType.Normal | | config | 图表配置 | IWaferConfig | - | - |

IWaferMapType

| 值 | 描述 | | ------------ | ------------ | | NORMAL | wafer | | HEATMAP | 热力图 wafer | | DIFINITION | 定义图 wafer |

IWaferConfig

| 属性 | 描述 | 默认值 | 是否可选 | | ---------------------- | ---------------------- | --------------- | -------- | | width | 图表宽度 | 100% | ✔️ | | height | 图表高度 | 100% | ✔️ | | rotate | 旋转角度 | 0 | ✔️ | | coordinate | coordinate 位置 | "top-left" | ✔️ | | flip | 水平、垂直是否镜像反转 | [false,false] | ✔️ | | dieRows | die rows | 100 | ✔️ | | dieCols | die columns | 100 | ✔️ | | dieOriginX | die origin x | 0 | ✔️ | | dieOriginY | die origin y | 0 | ✔️ | | reticle | die reticle | false | ✔️ | | reticleX | die reticle x | 2 | ✔️ | | reticleY | die reticle y | 2 | ✔️ | | reticleOriginX | die reticle origin x | 0 | ✔️ | | reticleOriginY | die reticle origin y | 0 | ✔️ | | notch | notch | "down" | ✔️ | | style.circleFill | circle fill | | ✔️ | | style.fill | die fill | | ✔️ | | style.stroke | die stroke | | ✔️ | | style.strokeWidth | die stroke width | | ✔️ | | style.dieSize.width | die size width | | ✔️ | | style.dieSize.height | die size height | | ✔️ |

NORMAL | HEATMAP

import { NormalMap } from '@xchart/wafer-map'

NormalMap({ container, type , config = {} }: IWaferMap)

Attributes

| 属性 | 描述 | 类型 | 是否必填 | 默认值 | | --------- | -------- | ------------------------------- | -------- | ---------------------- | | container | 图表容器 | HTMLElement | ✅ | - | | data | 图表宽度 | IDieWithBin | IDieWithHeat | ✅ | - | | type | 图表宽度 | IWaferMapType | ✅ | IWaferMapType.Normal | | config | 图表配置 | IWaferConfig | - | - |

IWaferMapType

| 值 | 描述 | | ------------ | ------------ | | NORMAL | wafer | | HEATMAP | 热力图 wafer | | DIFINITION | 定义图 wafer |

Data

interface IDieWithBin {
    x: number;
    y: number;
    hard_bin: number | string;
    soft_bin: number | string;
}
interface IDieWithHeat {
    x: number;
    y: number;
    average: number;
    max: number;
    median: number;
    min: number;
}

IWaferConfigNormal

interface IWaferConfigNormal extends IWaferConfig {
    /**
     * 是否显示Notch
     */
    showNotch?: boolean;
    /**
     * 是否要显示热力图
     */
    showColorMap?: boolean;
    /**
     * 热力图的key
     */
    heatMapKey?: keyof HeatMapKeyTypes;
}

interface HeatMapKeyTypes {
    average: number;
    max: number;
    median: number;
    min: number;
}

IWaferConfig

| 属性 | 描述 | 默认值 | 是否可选 | | ---------------------- | ---------------------- | --------------- | -------- | | width | 图表宽度 | 100% | ✔️ | | height | 图表高度 | 100% | ✔️ | | rotate | 旋转角度 | 0 | ✔️ | | coordinate | coordinate 位置 | "top-left" | ✔️ | | flip | 水平、垂直是否镜像反转 | [false,false] | ✔️ | | dieRows | die rows | 100 | ✔️ | | dieCols | die columns | 100 | ✔️ | | dieOriginX | die origin x | 0 | ✔️ | | dieOriginY | die origin y | 0 | ✔️ | | reticle | die reticle | false | ✔️ | | reticleX | die reticle x | 2 | ✔️ | | reticleY | die reticle y | 2 | ✔️ | | reticleOriginX | die reticle origin x | 0 | ✔️ | | reticleOriginY | die reticle origin y | 0 | ✔️ | | notch | notch | "down" | ✔️ | | style.circleFill | circle fill | | ✔️ | | style.fill | die fill | | ✔️ | | style.stroke | die stroke | | ✔️ | | style.strokeWidth | die stroke width | | ✔️ | | style.dieSize.width | die size width | | ✔️ | | style.dieSize.height | die size height | | ✔️ |

Event

公共方法

| 方法名 | 描述 | 参数说明 | | ----------------- | ------------------------------------ | ----------------------- | | rotate(angle) | 以给定角度旋转元素。 | angle 旋转角度 number | | flip(direction) | 水平或垂直翻转元素。 h: 水平 v: 垂直 | direction string | | translate(x, y) | 沿着 x 和 y 轴平移元素一定距离。 | x: number, y: number | | reset() | 将所有变换重置为默认值。 | - |

NORMAL方法

| 方法名 | 描述 | 参数说明 | | ------------ | ------------ | -------- | | brushed | 开启选区数据 | - | | clearBrush | 清空选区数据 | - |