I was hoping to use reductio to compute averages within my crossfilter groups. My dataset includes missing values (represented by null ) that I'd like to exclude when calculating the average. However, I don't see a way to tell reductio to exclude certain values, and it treats the null values as 0. I wrote a custom reduce function to accomplish this without using reductio: function re
我希望用reductio来计算我的交叉过滤器组内的平均值。 我的数据集包含我在计算平均值时要排除的缺失值(由null表示)。 但是,我没有看到一种方法来告诉reductio排除某些值,并将null值视为0。 我写了一个自定义的reduce函数来完成这个,而不使用reductio: function reduceAvg(attr) { return { init: function() { return { count: 0, sum: 0, a
I have a pair of requirejs plugins, that I'd like to replace with a webpack loader. define('firstLoader', { load: function (name, parentRequire, onload, config) { var xhr = new XMLHttpRequest(); xhr.addEventListener('load', function () {onload(this.responseText);}); xhr.addEventListener('error', onload.error); xhr.addEventListener('abort', onload.error); var url = '..
我有一对requirejs插件,我想用webpack加载器替换。 define('firstLoader', { load: function (name, parentRequire, onload, config) { var xhr = new XMLHttpRequest(); xhr.addEventListener('load', function () {onload(this.responseText);}); xhr.addEventListener('error', onload.error); xhr.addEventListener('abort', onload.error); var url = '...' + name; xhr.open('GET', url);
I asked a question here about calculating percent change using crossfilter with dc.js but stumbled across another more basic question. If I wanted to get (and use) the first my_quantity value grouped for each country ordered by received_day to use in a calculation, how can I do that? eg Assuming the below data contains the earliest and lastest samples: country_id,received_day,product_type,my
我在这里问了一个关于用dc.js使用交叉过滤器来计算百分比变化的问题,但偶然发现了另一个更基本的问题。 如果我想获得(并使用)由received_day订购的每个国家的第一个my_quantity值以用于计算,那么我该怎么做? 例如假设以下数据包含最早和最新的样本: country_id,received_day,product_type,my_quantity US, 2017-04-16, Media, 100 US, 2017-04-17, Media, 120 US, 2017-04-19, Media, 40 US, 2017-04-22, Media, 60 GB
I'm trying to calculate and plot percentage (%) in one of my dc charts. I have read the API and multiple examples regarding reduce functions (add, remove & init etc) I referred to 1st & 2nd for my codes. I want to calculate decay percentage ( sum(decay_data)/sum(all_data) ; decay_data is defined in data by "decay_ind==1" ) I'm still not getting anything in the grap
我试图在我的一个直方图中计算并绘制百分比(%)。 我已经阅读了关于reduce函数的API和多个示例(添加,删除和初始化等),我将其称为1st和2nd代码。 我想计算衰减百分比(sum(decay_data)/ sum(all_data); decay_data在数据中由“decay_ind == 1”定义) 由于某些问题,我仍然没有收到图中的任何内容,但也使用了值存取器,但可能存在一些问题。 在代码中,请仅查看“percentgroup”和“datedimension”,其他则用于单独
Quite an oddly specific question here but something I've been having a lot of trouble with over the past day or so. Broadly, I'm trying to calculate the maximum of an array using crossfilter and then use this value to find a maximum. For example, I have a series of Timestamps with an associated X Value and a Y Value. I want to aggregate the Timestamps by day and find the maximum X Val
这里有一个奇怪的具体问题,但在过去一天左右我一直有很多麻烦。 一般来说,我正在尝试使用交叉过滤器计算数组的最大值,然后使用此值来查找最大值。 例如,我有一系列带有关联X值和Y值的时间戳。 我想按天汇总时间戳并找到最大的X值,然后报告与此时间戳相关联的Y值。 从本质上讲,这是双重维度,据我所知。 我能够做第一阶段只是为了找到最大值。 但是,我们很难获得第二个价值。 第一个工作代码(使用Crossfilter和
我试图计算总和(查询时间)的平均查询时间,然后将它们除以一个计数。我怎样才能得到计数? var querytimeByMonthGroup = moveMonths.group().reduceSum(function (d) { return d.querytime; }); var querytimeByMonthGroup = moveMonths.group().reduceSum(function (d) { return d.querytime / d.count; ??? }); I am not familiar with crossfilter, only just started playing with it. There may be a better way
我试图计算总和(查询时间)的平均查询时间,然后将它们除以一个计数。我怎样才能得到计数? var querytimeByMonthGroup = moveMonths.group().reduceSum(function (d) { return d.querytime; }); var querytimeByMonthGroup = moveMonths.group().reduceSum(function (d) { return d.querytime / d.count; ??? }); 我对crossfilter不熟悉,只是刚开始玩。 可能有更好的方法,但是这提供了一种方法来计算用于分组的维
I have the same question with it When use the same value in yAxis ,the plots line at the bottom this is my code: var data = [{ "creat_time" : "2013-03-19 10:28:30", "roundTripTime" : "32" }, { "creat_time" : "2013-03-19 09:07:12", "roundTripTime" : "45" }, { "creat_time" : "2013-03-19 08:57:09", "r
我对它有同样的问题 在yAxis中使用相同的值时,绘图线在底部 这是我的代码: var data = [{ "creat_time" : "2013-03-19 10:28:30", "roundTripTime" : "32" }, { "creat_time" : "2013-03-19 09:07:12", "roundTripTime" : "45" }, { "creat_time" : "2013-03-19 08:57:09", "roundTripTime" : "26" }, {
I am trying to understand the "fake group" filtering method as described in the dc.js FAQ How do I filter the data before it's charted? Please see my example here: dc.js jsfiddle I want to filter my data by TYPE before the charts are drawn (the TYPE to filter on will come from another part of my application). Basically it should have the same effect as clicking on one of the fo
我想了解dc.js常见问题解答中描述的“假组”过滤方法如何在数据绘制之前过滤数据? 请看我的例子:dc.js jsfiddle 我想在绘制图表之前按TYPE过滤我的数据(要过滤的TYPE将来自我的应用程序的另一部分)。 基本上它应该与点击行图中四个条(A,B,C,D)中的一个具有相同的效果,但我希望能够从我的代码中的其他地方控制它,并且它应该在图表绘制。 我想我需要使用谓词函数在我的组名为“type”的值方法上使用Filter过滤器,例
I am writing a web app that allows users to dynamically create one or more charts using dc.js. The user can specify some filter parameters, and the resulting JSON is retrieved and loaded into a new dc.js bar chart each time. What I want though is for all the charts to be linked, so that if they filter on a chart it does the same on others, and if they zoom/scroll on a chart this also happens o
我正在编写一个Web应用程序,允许用户使用dc.js动态创建一个或多个图表。 用户可以指定一些过滤器参数,并且每次检索得到的JSON并将其加载到新的dc.js条形图中。 我想要的是所有的图表都需要链接,所以如果他们在图表上过滤,它们在其他图表上也是如此,如果他们在图表上缩放/滚动,这也会发生在其他图表上。 它们在x轴(日期)上共享相同的数据范围。 我的理解是,这正是dc.js的用途。 我有一个单一的数据数组,所有的数
I'm using the great dc.js/d3.js/crossfilter combination - mostly to great success. However, I have the need to keep the unfiltered dimension data at the same time of the filtered data. I could possibly set up the means to hold the unfiltered dimension data in an object, then access it, but that seems weak when using such a powerful combo. Specifically, I'm trying to have a stacked bar
我正在使用伟大的dc.js / d3.js / crossfilter组合 - 主要取得巨大成功。 但是,我需要在过滤的数据的同时保留未过滤的维度数据。 我可能会设置一种方法将未过滤的尺寸数据保存在一个对象中,然后访问它,但使用这种强大的组合时,这看起来很弱。 具体来说,我试图将条形图的底部=未过滤的数字,条形的顶部=过滤器的结果堆叠起来。 如果我过滤,我没有找到检索起始组计数的方法。 <input type="text" id = "keywordTxt"&