1.0.6 • Published 7 months ago

@xchart/wafer-map v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@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图表宽度IWaferMapTypeIWaferMapType.Normal
config图表配置IWaferConfig--

IWaferMapType

描述
NORMALwafer
HEATMAP热力图 wafer
DIFINITION定义图 wafer

IWaferConfig

属性描述默认值是否可选
width图表宽度100%✔️
height图表高度100%✔️
rotate旋转角度0✔️
coordinatecoordinate 位置"top-left"✔️
flip水平、垂直是否镜像反转[false,false]✔️
dieRowsdie rows100✔️
dieColsdie columns100✔️
dieOriginXdie origin x0✔️
dieOriginYdie origin y0✔️
reticledie reticlefalse✔️
reticleXdie reticle x2✔️
reticleYdie reticle y2✔️
reticleOriginXdie reticle origin x0✔️
reticleOriginYdie reticle origin y0✔️
notchnotch"down"✔️
style.circleFillcircle fill✔️
style.filldie fill✔️
style.strokedie stroke✔️
style.strokeWidthdie stroke width✔️
style.dieSize.widthdie size width✔️
style.dieSize.heightdie size height✔️

NORMAL | HEATMAP

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

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

Attributes

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

IWaferMapType

描述
NORMALwafer
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✔️
coordinatecoordinate 位置"top-left"✔️
flip水平、垂直是否镜像反转[false,false]✔️
dieRowsdie rows100✔️
dieColsdie columns100✔️
dieOriginXdie origin x0✔️
dieOriginYdie origin y0✔️
reticledie reticlefalse✔️
reticleXdie reticle x2✔️
reticleYdie reticle y2✔️
reticleOriginXdie reticle origin x0✔️
reticleOriginYdie reticle origin y0✔️
notchnotch"down"✔️
style.circleFillcircle fill✔️
style.filldie fill✔️
style.strokedie stroke✔️
style.strokeWidthdie stroke width✔️
style.dieSize.widthdie size width✔️
style.dieSize.heightdie 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清空选区数据-
1.0.2

11 months ago

1.0.6

7 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.1

11 months ago