Skip to content

Commit a7714a0

Browse files
tangying1027xuying.xu
andauthored
feat: 增加showAnchor字段 (#2072)
Co-authored-by: xuying.xu <xuying.xu@alibaba-inc.com>
1 parent 1fa7bc0 commit a7714a0

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

packages/f2/src/components/pieLabel/pieLabeView.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default (props) => {
99
label2OffsetY,
1010
triggerRef,
1111
onClick,
12+
showAnchor,
1213
} = props;
1314

1415
return (
@@ -28,15 +29,17 @@ export default (props) => {
2829
}
2930
>
3031
{/* 锚点 */}
31-
<circle
32-
attrs={{
33-
r: '4px',
34-
cx: anchor.x,
35-
cy: anchor.y,
36-
fill: color,
37-
...anchorStyle,
38-
}}
39-
/>
32+
{showAnchor && (
33+
<circle
34+
attrs={{
35+
r: '4px',
36+
cx: anchor.x,
37+
cy: anchor.y,
38+
fill: color,
39+
...anchorStyle,
40+
}}
41+
/>
42+
)}
4043
{/* 线 */}
4144
<polyline
4245
attrs={{

packages/f2/src/components/pieLabel/withPieLabel.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ const DEFAULT_CONFIG = {
99
height: '64px', // 文本的行高
1010
adjustOffset: '30', // 发生调整时的偏移量
1111
triggerOn: 'click', // 点击行为触发的时间类型
12-
// activeShape: false, // 当有图形被选中的时候,是否激活图形
13-
// activeStyle: {
14-
// offset: '1px',
15-
// appendRadius: '8px',
16-
// fillOpacity: 0.5,
17-
// },
12+
activeShape: true, // 当有图形被选中的时候,是否激活图形
13+
activeStyle: {
14+
offset: '1px',
15+
appendRadius: '8px',
16+
fillOpacity: 0.5,
17+
},
1818
label1OffsetY: '-4px',
1919
label2OffsetY: '4px',
2020
type: 'default', // 标签布局类型:default 或 spider
2121
adjustRatio: 1 / 2, // 调整高度的阈值比例
22+
showAnchor: true,
2223
};
2324

2425
function getEndPoint(center: Point, angle: number, r: number) {

0 commit comments

Comments
 (0)