0.1.3 • Published 3 years ago

view-mark v0.1.3

Weekly downloads
21
License
-
Repository
github
Last release
3 years ago

view-mark

介绍

​ 覆盖在图片上可以定义多个点并设置1-6个标记介绍线

安装

npm install view-mark -save

API

mes需要设置的标记数组,textArr每个标记的信息,text标记文本描述,num 1-6标记描述线的位置。dot标记位置值为百分比值

angle 标记描述线分部距离

distance 标记描述线离标记中心距离

dotColor 标记中心点颜色

lineColor 标记线颜色

textColor 标记文本颜色

fontSize 标记文本大小

textPadding 标记文本距离下划线两端距离

animation 是否开启动画(暂未完善 )

speed 动画速度

以下是默认值

config = {
  mes: [
    {
      textArr: [{txt: 'xxxx', num: 5}],
      dot: {x: 70, y: 40}
    },
    {
      textArr: [{txt: 'xxxx', num: 0}, {txt: 'xxx', num: 1}, {txt: 'xxx', num: 2}, {txt: 'xxx', num: 5}],
      dot: {x: 20, y: 50}
    }
  ],
  angle: 70,
  distance: 40,
  dotColor: '#00ff00',
  lineColor: '#00ff00',
  textColor: 'yellow',
  fontSize: '28',
  textPadding: 10,
  animation: true,
  speed: 3
}