我想在一些dc.js图表(条形图和线条图)中进行初始范围选择.
所以我添加这个例子:
.filter([7,10])
Run Code Online (Sandbox Code Playgroud)
并且该范围在图表上显示良好,但显然选择了0个观察值.
我预计会选择几千个观测值.就像我用画笔手动选择范围[7,10]时那样.
我在这里缺少的任何暗示?
我的部分代码:
var chart_globalscore = dc.barChart('#chart_globalscore');
(...)
var ndx = crossfilter(data_movies)
,all = ndx.groupAll()
(...)
,GlobalScoreDimension = ndx.dimension(function(d) { if ( !isNaN(d.GlobalScore) ) {return Math.round(d.GlobalScore*10)/10 ;} else {return -1;} })
,GlobalScoreGroup = GlobalScoreDimension.group()
(...)
;
(...)
chart_globalscore
.width(width001)
.height(height001)
.margins(margins)
.dimension(GlobalScoreDimension)
.group(GlobalScoreGroup)
.round(function(val){return Math.round(val*10)/10;})
.x(d3.scale.linear().domain([0, 10.1]))
.filter([7,10])
.centerBar(false)
.transitionDuration(transitionDuration)
.elasticY(true)
.gap(1)
.xUnits(function(){return 100;})
.renderHorizontalGridLines(true)
.yAxis().ticks(2)
;
Run Code Online (Sandbox Code Playgroud) 我想获得arduino-esp8266(https://github.com/esp8266/Arduino)的时间戳.
但我不知道如何做到这一点.
我想我们必须从互联网上得到时间,因为ESP8266没有时钟.我们是否只需要一次或每次需要时间戳时都这样做?
我已经通过wifi连接到互联网.
我想对存储在 firebase 存储上的 csv 文件启用 gzip 压缩。
目的是能够从 ajax 中的 javascript Web 应用程序更快地下载它们。
我有一个像这样的下载链接:https://firebasestorage.googleapis.com/v0/b/xxxx.appspot.com/o/xxxxxxxx.csv?alt=media&token=xxxxxx-xxxx-xxxx-xxxx-xxxxxxx
我能够在 JavaScript 中正确加载和解析:
Papa.parse('https://firebasestorage.googleapis.com/v0/b/xxxx.appspot.com/o/xxxxxxxx.csv?alt=media&token=xxxxxx-xxxx-xxxx-xxxx-xxxxxxx', {
download: true,
header: true,
worker: true,
dynamicTyping: true,
complete: function(results) {
// (...)
}
});
Run Code Online (Sandbox Code Playgroud)
但它没有被 gzip 压缩。
我不知道该怎么做。
这可以通过 gsutil 工具来完成吗?
还有其他方法可以实现这一目标吗?
crossfilter ×1
d3.js ×1
dc.js ×1
esp8266 ×1
filter ×1
firebase ×1
javascript ×1
ntp ×1
timestamp ×1