空的crossfilter维度

时间:2018-01-17 22:30:37

标签: javascript crossfilter

运行以下代码时,第一个console.log返回crossfilter实例的内容,但第二个console.log返回空括号。

为什么没有数据进入我的交叉滤波器维度?

var cf = require('./crossfilter.js');

var payments = cf([
  {date: "2011-11-14T16:17:54Z", quantity: 2, total: 190, tip: 100, type: "tab", productIDs:["001"]},
  {date: "2011-11-14T16:20:19Z", quantity: 2, total: 190, tip: 100, type: "tab", productIDs:["001", "005"]},
  {date: "2011-11-14T16:28:54Z", quantity: 1, total: 300, tip: 200, type: "visa", productIDs:["004" ,"005"]}
]);
var paymentsByTotal = payments.dimension(function(d) { return d.total; });

console.log(JSON.stringify(payments.all()))
console.log(JSON.stringify(paymentsByTotal.filterAll()))

0 个答案:

没有答案