Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add text point rotate function #572

Merged
merged 1 commit into from
Dec 4, 2020
Merged

feat: add text point rotate function #572

merged 1 commit into from
Dec 4, 2020

Conversation

small-tou
Copy link

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Description of change

增加文本旋转的功能,支持 rotate 配置方法

        const pointLayer = new PointLayer({})
        .source(data.list, {
          parser: {
            type: 'json',
            x: 'j',
            y: 'w'
          }
        })
        .shape('m', 'text')
        .size(12)
        // .rotate("j",()=>{
        //   return  Math.random()*3*(Math.random()>0.5?1:-1)
        // })
        .color('w', [ '#0e0030', '#0e0030', '#0e0030' ])
        .style({
          textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left
          textOffset: [ 0, 0 ], // 文本相对锚点的偏移量 [水平, 垂直]
          spacing: 2, // 字符间距
          padding: [ 1, 1 ], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近
          stroke: '#ffffff', // 描边颜色
          strokeWidth: 0.3, // 描边宽度
          strokeOpacity: 1.0
        });

      scene.addLayer(pointLayer);

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2020

🎊 PR Preview e8fbad5 has been successfully built and deployed to https://antvis-L7-preview-pr-572.surge.sh

🕐 Build time: 616.705s

🤖 By surge-preview

@lzxue lzxue merged commit e8fbad5 into antvis:master Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants