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(label): add label transform feature exceedAdjust #6209
Conversation
单测报错了! |
怪了,我本地跑test是通过的,不知道为啥CI的test没过 |
Pull Request Test Coverage Report for Build 8986952550Details
💛 - Coveralls |
src/label-transform/exceedAdjust.ts
Outdated
export type ExceedAdjustOptions = Omit<ExceedAdjustLabel, 'type'>; | ||
|
||
/** | ||
* Hide the label when overlap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释改一下。
], | ||
[ | ||
[0, 0], | ||
[width, height], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方的 0,0 不太对,coordinate 的区域是有 x y width height 的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我看下
等这个 PR #6222 合并之后,合并进来,然后把那个碰撞的位置还是改成画布大小吧,刚想起来,coordinate 有可能是圆形的,如果用 coordinate 可能出 bug。 export const OverlapHide: LLC<OverlapHideOptions> = (options) => {
const { priority } = options;
return (labels: DisplayObject[], { canvas }) => {
const x = 0;
const y = 0;
const { width, height } = canvas.getConfig(); // 这里
// ...
}
} |
明白 |
src/label-transform/exceedAdjust.ts
Outdated
[xMax, yMax], | ||
], | ||
[ | ||
[x, y], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 0 可以直接写这里,没问题的。
Checklist
npm test
passesDescription of change
close: #6173