-
Notifications
You must be signed in to change notification settings - Fork 604
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 #1599 #1605
feat: 增加显示目标值label #1599 #1605
Conversation
arcsin1
commented
Sep 20, 2020
- 增加目标值label显示,增加一个api(targetLabel)
- 新版本子弹图目标值是否能显示 #1599
为啥 target label 要单独一个配置,而不是直接和 label 配置统一一起的? |
|
感觉只能这样增加一个配置了。@me-momo 有空一起帮忙看看加这样的一个配置项是否 ok?是否有其他更好的办法。 |
其实我还有个想法的,就是通用label给measure; 用另外一种做一个包含 ,原来有个bulletStyle那个api
|
src/plots/bullet/types.ts
Outdated
readonly label?: GeometryLabelCfg; | ||
|
||
/** target 的 label 设置 */ | ||
readonly targetLabel?: GeometryLabelCfg; | ||
|
||
/** bulletStyle 包含了 measure,target,range */ | ||
readonly bulletStyle?: { | ||
measure?: BasicStyle; |
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.
顺便提一嘴,为什么 style 中不是直接 StyleAttr 类型,(color、size 在 style 中都是可以配置出来的)
bulletStyle: {
measure?: StyleAttr;
target?: StyleAttr;
range?: StyleAttr;
}
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.
@arcsin1 这里应该要改掉。
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.
遗留问题,这是我在公用styleAttr改版之前写的,我改下
-- 不对 StyleAttr 没有color和size属性
export type StyleAttr = ShapeStyle | ((datum: Datum) => ShapeStyle);
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.
type BasicStyle = { color?: ColorAttr; style?: StyleAttr; size?: SizeAttr; label?: GeometryLabelCfg; }
color、size 不仅仅是 style,不应该属于 BasicStyle
我看了export type StyleAttr = ShapeStyle | ((datum: Datum) => ShapeStyle); 没有color和size
src/plots/bullet/types.ts
Outdated
readonly label?: GeometryLabelCfg; | ||
|
||
/** target 的 label 设置 */ | ||
readonly targetLabel?: GeometryLabelCfg; |
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.
我早上在车上想到的是:
label: {
measure?: GeometryLabelCfg;
target?: GeomeryLabelCfg;
}
子弹图与之不同的是,measure、target、range 都是必须的;label 上支持 measure、target 的配置,style 上支持 measure、target、range 的配置
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.
@arcsin1 恩恩这样相对来说统一一些。
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.
这种也可以,但是图表component自带有个label呢
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.
什么意思?子弹图除了这两个 label,还有其他的么?
确实 label 也可以作为 geometry 的一个基础属性。 |
color、size 不仅仅是 style,不应该属于 BasicStyle |
c7ea671
to
03d4da4
Compare
目前有几种配置的方式,有确定下来嘛?确定一个之后执行掉吧 ^_^! |
已经确定了这种实现 @me-momo 知道这个 |