Published
Edited
Mar 9, 2020
4 stars
交互语法之鼠标高亮图形元素
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
G2 = require('https://unpkg.com/@antv/g2');
Insert cell
DataSet = require('@antv/data-set')
Insert cell
G2.registerInteraction('elements-highlight', {
start: [
{
trigger: 'element:mouseenter',
action: 'element-highlight:highlight'
}
],
rollback: [
{
trigger: 'dblclick',
action: 'element-highlight:clear'
}
]
})
Insert cell
G2.registerInteraction('element-link', {
start: [
{ trigger: 'interval:mouseenter', action: 'element-link-by-color:link' }
],
end: [
{ trigger: 'interval:mouseleave', action: 'element-link-by-color:unlink' }
]
})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more