Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataCount issues improper warning #1854

Open
onelesd opened this issue Jan 6, 2022 · 3 comments
Open

DataCount issues improper warning #1854

onelesd opened this issue Jan 6, 2022 · 3 comments

Comments

@onelesd
Copy link

onelesd commented Jan 6, 2022

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

@kum-deepak
Copy link
Collaborator

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

@onelesd
Copy link
Author

onelesd commented Jan 13, 2022

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

@kum-deepak
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants