-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
refactor(tooltip): enhance tooltip #4691
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pearmini
force-pushed
the
refactor/spec-tooltip
branch
from
February 24, 2023 10:57
03dbf02
to
6eddc23
Compare
pearmini
changed the title
[WIP] refactor(tooltip): enhance tooltip
refactor(tooltip): enhance tooltip
Feb 24, 2023
Aarebecca
reviewed
Feb 24, 2023
pearmini
force-pushed
the
refactor/spec-tooltip
branch
from
February 25, 2023 12:15
3e922e3
to
158a79b
Compare
pearmini
force-pushed
the
refactor/spec-tooltip
branch
from
February 25, 2023 12:40
158a79b
to
d0b3ac9
Compare
const after = {
tooltip: {
title: 'c',
items: ['a', 'b']
}
}; 中 items 是指的映射字段而不是 GUI 里的数据对吧 |
嗯嗯,不是,是 G2 消费的格式。不过最后会转换成 GUI 里面的格式。 |
Aarebecca
reviewed
Feb 27, 2023
回调形式为啥要用数组包裹呢 // 指定为字段 a
const mark = {
tooltip: [(d) => ({ value: d.a, color: 'red' })],
};
// 指定为通道 y
const mark = {
tooltip: [(d, i, data, value) => ({ value: value.y.value[i], color: 'red' })],
}; |
其实是否是回调形式都不需要数组包裹,只不过例子写的数组。 // 也是可以的
const mark = {
tooltip: (d) => ({ value: d.a, color: 'red' }),
}; |
Aarebecca
approved these changes
Feb 27, 2023
Aarebecca
pushed a commit
that referenced
this pull request
Feb 27, 2023
* refactor(tooltip): enhance tooltip * feat(tooltip): add mark.tooltip
Aarebecca
pushed a commit
that referenced
this pull request
Mar 1, 2023
* refactor(tooltip): enhance tooltip * feat(tooltip): add mark.tooltip
hustcc
pushed a commit
that referenced
this pull request
May 16, 2023
* refactor(tooltip): enhance tooltip * feat(tooltip): add mark.tooltip
hustcc
pushed a commit
that referenced
this pull request
May 16, 2023
* refactor(tooltip): enhance tooltip * feat(tooltip): add mark.tooltip
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tooltip
修改了配置 Tooltip Items 和 Title 的方式,参考这个 #4491 (comment) 中的讨论。
开始使用
结构
tooltip 完整的结构如下:
有以下两种语法糖:
title 和 item
title 和每一个 item 除了上述的字符串形式之外,还支持如下形式: