我正在尝试使用过滤器转换数据集。如何在表达式语言中调试输入?
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”属性中,想要做这样的事情
"test": "console.log(crosshair_vertical, datum);crosshair_vertical != null && utc(crosshair_vertical) - 6000 <= utc(datum.timestamp) && utc(datum.timestamp) <= utc(crosshair_vertical) + 6000"
我该怎么做?