Vega Lite希望在记录表中提供数据(请参见下文)。
Vega Lite还提供了高级聚合功能,并且可以即时进行这些聚合。这意味着将根据潜在的巨大源数据计算聚合,其中包含成千上万条记录。
[
{ temperature: 30, humidity: 10, precipitation: 0, city: 'New Yourk', date: '2012-01-01' },
{ temperature: 29, humidity: 10, precipitation: 0, city: 'New Yourk', date: '2012-01-02' },
...
]
问题1
记录表格式的效率如何?
V8 JS引擎是否进行了一些优化,并实际上将数据以压缩形式存储在幕后?也许它知道所有记录都相同,并且可以通过数字而不是字符串名称来访问每个字段?
问题2
Vega Lite可以使用压缩吗?就像使用索引而不是字段名称一样,数据集将是
{
temperature: 0, humidity: 1, precipitation: 2, city: 3, date: 4
}
[
[30, 10, 0, 'New Yourk', '2012-01-01'],
[29, 10, 0, 'New Yourk', '2012-01-02'],
...
]
而且,我们也可能会编码一些值,数据集将是:
indexes: { temperature: 0, humidity: 1, precipitation: 2, city: 3, date: 4 }
cities: { 0: 'New Yourk', 1: 'California' }
dates: { 0: '2012-01-01', 1: '2012-01-02'}
[
[30, 10, 0, 0, 0],
[29, 10, 0, 0, 1],
...
]
使用这种方法可能会将更大的数据集放入内存中,想知道Vega Lite是否支持吗?