reductio

Avoid multiple sums in custom crossfilter reduce functions

回眸只為那壹抹淺笑 提交于 2019-12-22 12:48:33
问题 This question arise from some difficulties in creating a crossfilter dataset, in particular on how to group the different dimension and compute a derived values. The final aim is to have a number of dc.js graphs using the dimensions and groups. (Fiddle example https://jsfiddle.net/raino01r/0vjtqsjL/) Question Before going on with the explanation of the setting, the key question is the following: How to create custom add , remove , init , functions to pass in .reduce so that the first two do

How to make row chart for multilabel data in dc.js

╄→尐↘猪︶ㄣ 提交于 2019-12-13 01:05:55
问题 I have data with one column that is a list of labels for each data point. I would like to use dc.js to make a row chart that plots the number of occurrences of each label. Data looks like this: Date , Labels 1/1/2015 , "A, B, C" 1/2/2015 , "B" 1/3/2015 , "C, A" 1/4/2015 , "A" I would like a row chart that aggregates them like this: A: 3 B: 2 C: 2 My code so far: var labels = ["A", "B", "C"]; var labelBar = dc.rowChart("#label-bar"); d3.csv('data.csv', function (csv) { var data = crossfilter

crossfilter dimension on 2 fields

喜你入骨 提交于 2019-12-11 10:58:37
问题 My data looks like this field1,field2,value1,value2 a,b,1,1 b,a,2,2 c,a,3,5 b,c,6,7 d,a,6,7 I don't have a good way of rearranging that data so let's assume the data has to stay like this. I want to create a dimension on field1 and field2 combined : a single dimension that would take the union of all values in both field1 and field2 (in my example, the values should be [a,b,c,d] ) As a reduce function you can assume reduceSum on value2 for example (allowing double counting for now). (have

Avoid multiple sums in custom crossfilter reduce functions

痴心易碎 提交于 2019-12-06 09:45:26
This question arise from some difficulties in creating a crossfilter dataset, in particular on how to group the different dimension and compute a derived values. The final aim is to have a number of dc.js graphs using the dimensions and groups. (Fiddle example https://jsfiddle.net/raino01r/0vjtqsjL/ ) Question Before going on with the explanation of the setting, the key question is the following: How to create custom add , remove , init , functions to pass in .reduce so that the first two do not sum multiple times the same feature? Data Let's say I want to monitor the failure rate of a number