我正在尝试使用过滤器转换数据集。如何调试表达式语言中的输入?
var spec = {
signals: [
{
"name": "crosshair_vertical",
"init": null,
"streams": [
{
"type": "mousemove",
"expr": "clamp(eventX(), 0, eventGroup('root').width)",
"scale": {"name": "xscale", "invert": true}
},
{
"type": "mouseout",
"expr": "null",
}
]
}
],
data: [
{
"name": "highlight_crosshair",
"source": "summary",
"transform": [
{
"type": "filter",
"test": "crosshair_vertical != null && utc(crosshair_vertical) - 6000 <= utc(datum.timestamp) && utc(datum.timestamp) <= utc(crosshair_vertical) + 6000"
}
]
}
]
}
在数据转换的“测试”属性中,想做这样的事情
"test": "console.log(crosshair_vertical, datum);crosshair_vertical != null && utc(crosshair_vertical) - 6000 <= utc(datum.timestamp) && utc(datum.timestamp) <= utc(crosshair_vertical) + 6000"
我怎样才能做到这一点?