Chart API Design #4553
Closed
pepper-nice
started this conversation in
Ideas
Replies: 5 comments 1 reply
-
其它的,我再想想 |
Beta Was this translation helpful? Give feedback.
1 reply
-
应该是 chart.getScale(channel: string): scale |
Beta Was this translation helpful? Give feedback.
0 replies
-
这个先不加 |
Beta Was this translation helpful? Give feedback.
0 replies
-
先不加 |
Beta Was this translation helpful? Give feedback.
0 replies
-
tooltip 相关的等交互自定义直接出来再加 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
缺少的 API
getScale()
获取实例信息。
getCoordinate()
、getComponents()
、getTheme()
、getMarks()
同理,暂不一一列举使用方法。使用
实现
需要考虑获取实例要统一放在 Chart 中还是 Node 中
方案一
在 Node 中透出获取实例的方法。
runtime/plot.ts
渲染图表中获取图表views
信息,放入 context 中。绑定每个 Node 和 view:api/node.ts
向上查找得到 Chart 实例后获取 context 属性。根据 node 查找得到当前view,得到所有的信息。方案二
在 Chart 中透出,通过指定 node 来获得指定的 node 的实例信息。
Node.getXY(datum){}
获取当前数据对应的坐标点。(如果是面积类Mark:Interval、Plogen。则返回起始坐标)
使用
实现
Node.changeVisible()
使用
实现
tooltip 相关 API
等待交互 ready 后再开发。
Beta Was this translation helpful? Give feedback.
All reactions