react-vega 和 react-vega 工具提示 [英] react-vega and react-vega tooltips
问题描述
我正在使用 react-vega-lite
.
在官方示例中:
https://vega.github.io/vega-lite/>
https://vega.github.io/react-vega-lite/一个>
https://vega.github.io/react-vega/>
vega-lite
(没有反应)默认有一个工具提示react-vega
允许处理 onSignalTooltip 事件.
所以,我有两个问题:1) 是否可以使用 react-vega
(react-vega-lite
) 打开工具提示?2) react-vega-lite
是否支持 onSignalTooltip
或者我需要切换到 Vega?
添加 vega-tooltip
包作为依赖,然后从中导入 Handler
类并传递一个通过 VegaLite
组件的 tooltip
参数实例:
import { Handler } from 'vega-tooltip';...<VegaLite spec={spec} data={barData} tooltip={new Handler().call}/>
I'm using react-vega-lite
.
In official examples:
https://vega.github.io/vega-lite/
https://vega.github.io/react-vega-lite/
https://vega.github.io/react-vega/
vega-lite
(without react) has a tooltip by default
react-vega
allows to handle onSignalTooltip event.
So, I have 2 questions:
1) Is it possible to turn on tooltip with react-vega
(react-vega-lite
)?
2) Does react-vega-lite
support onSignalTooltip
or I need to switch to Vega?
Add vega-tooltip
package as a dependency, then import the Handler
class from it and pass an instance through the tooltip
parameter of the VegaLite
component:
import { Handler } from 'vega-tooltip';
...
<VegaLite spec={spec} data={barData} tooltip={new Handler().call} />
这篇关于react-vega 和 react-vega 工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!