dc.js
dc.js copied to clipboard
DataCount issues improper warning
The following code triggers a warning to the console even though dataCount.dimension()
is never directly called.
const chart = document.querySelector('#data-count')
const group = ndx.groupAll()
dc.dataCount(chart).crossfilter(ndx).groupAll(group).html({
some: '%filter-count of %total-count',
all: '%total-count',
})
dcChart.render()

Tested this snippet with dc@4, was unable to reproduce this issue. Which version of dc are you using?
The warning seems to be triggered by a call to dc.filterAll()
.
"node_modules/dc": {
"version": "4.2.7",
"resolved": "https://registry.npmjs.org/dc/-/dc-4.2.7.tgz",
"integrity": "sha512-83vzVpBmXFCW7V2uVhBolcPX22d19k4GV7zJWu8jkyNhMstAb/XYl2Eld3Kp71eLD8YM9RsIRgtrmLViQeZTuQ==",
"dependencies": {
"d3": "^6.6.2"
}
},
Many thanks for the added details. This indeed is the case. The dashboard on http://dc-js.github.io/dc.js/ displays this behavior.
The BaseMixin
code snippet that calls .dimension()
is:
applyFilters (filters) {
if (this.dimension() && this.dimension().filter) {
const fs = this._filterHandler(this.dimension(), filters);
if (fs) {
filters = fs;
}
}
return filters;
}
It will definitely be fixed in the dc-v5, we need to investigate if we can fix it in v4 easily.