dc.js icon indicating copy to clipboard operation
dc.js copied to clipboard

DataCount issues improper warning

Open onelesd opened this issue 3 years ago • 3 comments

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()
Screen Shot 2022-01-05 at 7 06 44 PM

onelesd avatar Jan 06 '22 03:01 onelesd

Tested this snippet with dc@4, was unable to reproduce this issue. Which version of dc are you using?

kum-deepak avatar Jan 12 '22 04:01 kum-deepak

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"
  }
},

onelesd avatar Jan 13 '22 04:01 onelesd

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.

kum-deepak avatar Jan 13 '22 10:01 kum-deepak