我发现Crossfilter的所有示例都使用如下这样的平面结构:
- [
- { name: “Rusty”,type: “human”,legs: 2 },{ name: “Alex”,...
- { name: “Fiona”,type: “plant”,legs: 0 }
- ]
要么
“日期”,“开放”,“高”,“低”,“关闭”,“卷”,“oi”11/01 / 1985,115.48,116.78,116.28,900900,0 11/04/1985,117.07,115.82,116.04,753400,0
11月5日/ 1985,116.57,115.88,116.44,876800,0
我有数百MB的平面文件,我处理以产生一个1-2MB的JSON对象,结构大致如下:
- {
- "Meta": {"stuff": "here"},"data": {
- "accountName": {
- // rolled up by week
- "2013-05-20": {
- // any of several "dimensions"
- "byDay": {
- "2013-05-26": {
- "values": {
- "thing1": 1,"thing2": 2,"etc": 3
- }
- },"2013-05-27": {
- "values": {
- "thing1": 4,"thing2": 5,"etc": 6
- }
- }
- // and so on for day
- },"bySource": {
- "sourceA": {
- "values": {
- "thing1": 2,"thing2": 6,"etc": 7
- }
- },"sourceB": {
- "values": {
- "thing1": 3,"thing2": 1,"etc": 2
- }
- }
- }
- }
- }
- }
- }
我想显示的表格如下:
- Group: byDay* || bySource || byWhatever
- | thing1 | thing2 | etc
- 2013-05-26 | 1 | 2 | 2
- 2013-05-27 | 4 | 5 | 7
要么:
- Group: byDay || bySource* || byWhatever
- | thing1 | thing2 | etc
- sourceA | 2 | 6 | 6
- sourceB | 3 | 1 | 3
展开这个JSON结构将是困难的,并产生一个非常大的对象.
我很乐意利用Crossfilter的精彩功能,但我不确定是否有可能.
我可以定义/解释我目前的结构到Crossfilter吗?也许还有另一种方法可以解决这个问题?我很容易承认,我对尺寸和许多其他重要的Crossfilter概念没有很好的把握.