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

crossfilter2 and d3 #1362

Closed
a13531a opened this issue Feb 15, 2018 · 8 comments
Closed

crossfilter2 and d3 #1362

a13531a opened this issue Feb 15, 2018 · 8 comments

Comments

@a13531a
Copy link

a13531a commented Feb 15, 2018

Hello,

I have a question about the roadmap.

There are some examples here: http://dc-js.github.io/dc.js/examples/
All of them reference the following versions:

And the same things I can see in the npm-shrinkwrap.json file (which is good):

"dc": {
      "version": "2.1.8",
      "resolved": "https://registry.npmjs.org/dc/-/dc-2.1.8.tgz",
      "integrity": "sha1-Rgsi/erbJW7ZUVv5gQEEvnPTySA=",
      "dev": true,
      "requires": {
        "crossfilter2": "1.3.14",
        "d3": "3.5.17"
      }
    },

"dc": {
      "version": "2.1.9",
      "resolved": "https://registry.npmjs.org/dc/-/dc-2.1.9.tgz",
      "integrity": "sha512-nSkbdSiJrSqgp4thpA57i/JAEqFwYuJkncTjZRjA8NFlEdHTYCod8yh5NaImvw0VizrxPXVTUghqIqtYB12uKg==",
      "dev": true,
      "requires": {
        "crossfilter2": "1.3.14",
        "d3": "3.5.17"
      }
    },

The latest versions that are available today in npm:

  • dc v2.1.9
  • crossfilter2 v1.4.3 and v2.0.0-alpha.4
  • d3 v4.13.0 and v5.0.0-rc.3

Questions:

  1. What are the latest versions of crossfilter2 and d3 that dc v2.1.9 is compatible with?
  2. Are there any plans to upgrade to the latest versions of crossfilter2 and d3 in some near feature by any chance? If so then could you please say when this could happen?

Thank you.

@gordonwoodhull
Copy link
Contributor

dc.js is compatible with the latest crossfilter2, which is 1.4.*.

I think we decided that crossfilter 2.0 was a mistake and it was dropped, but in any case dc.js should be forever compatible with any version of crossfilter, because dc.js uses such a tiny part of the API.

dc.js is not compatible with d3v4 or d3v5 and this probably won't change soon. So the latest compatible version is d3 3.5.17.

I am still hoping to find time for the port in #1173 but it it seriously weeks of effort, especially if we undertake splitting dc.js into multiple libraries like d3 did (which would be very helpful). Since I have a day job I can't say when this will happen.

@a13531a
Copy link
Author

a13531a commented Feb 15, 2018

Thank you for the prompt response.
Basically, I just started to work on the project at work that should become a rewritten version of the existing project. And I saw that the old one actively uses dc+d3+crossfilter. I'm relatively free to choose the JS libraries for the charts that need to be ported, and I was very interested in your answer which was:

I think we decided that crossfilter 2.0 was a mistake and it was dropped, but in any case dc.js should be forever compatible with any version of crossfilter, because dc.js uses such a tiny part of the API.

I mean my acquaintance with these libraries (dc, d3, crossfilter) has just begun and I don't have much knowledge/understanding of them. And one of the things I would like to do is to follow the best practices that you are telling on how to use dc.js. So, I'll need to learn crossfilter at least a little to be able to understand what is going on in the old project, but would it be possible to do without crossfilter2.js in the new project and achieve the same things with DC.js using some other technics? (forgive me my ignorance)

@gordonwoodhull
Copy link
Contributor

It's possible, but I wouldn't recommend it. Crossfilter is "deceptively simple" - it just does binning and aggregation, but it does these things very well and very efficiently.

You could provide other objects to dc.js that support the interface it expects, which is mostly just group.all() and dimension.filter*(), but I'd never recommend this just to remove a dependency, since crossfilter does subtle things and it is battle-tested. The best reason I know to do this is if your data is too large for crossfilter (>500k rows).

The two big reasons Crossfilter is so fast are

  1. it uses TypedArray everywhere it can, for compact, fast access
  2. it makes the minimal number of updates when filters change, especially with range-based filters

It's a steep but short learning curve to understand what crossfilter does, and you'll still need to learn what it does even if you decide you want to replace it. By the time you learn, you'll probably appreciate why you don't want to do that. 😸

@a13531a
Copy link
Author

a13531a commented Feb 20, 2018

Yes, I think you are 100% right. Crossfilter2 should definitely survive in my project.

By any chance, do you plan in the near future to release a new dc package which would point to the latest compatible version of crossfilter2?

Currently, dc@2.1.9 requires: "dependencies": { "crossfilter2": "~1.3", "d3": "^3" } (I took it from the package.json)

Today the dependencies resolve to:

  • crossfilter2@1.3.14
  • d3@3.5.17

But dc could well work with a newer version with which it is compatible, namely crossfilter2@1.4.5
Maybe, the package.json could be updated to: "dependencies": { "crossfilter2": "~1.4", "d3": "^3" }

Thanks a lot.

@gordonwoodhull
Copy link
Contributor

Yes. I have already updated it on develop and it will go out in the next point release.

I don't like to do releases just to update dependencies, so I usually wait until there is something substantial. But I can do this soon.

I had held off on this update because there is a slight performance regression in crossfilter due to the support for more dimensions. But it is small and I don't think it's anything to worry about.

@a13531a
Copy link
Author

a13531a commented Feb 20, 2018

Yes, I should have took a look at the code in repository first 😭 where I would see that this was already done 😭😭😭
Thanks for keeping this project alive.

@gordonwoodhull
Copy link
Contributor

Release 2.1.10 updates the dependencies.

@a13531a
Copy link
Author

a13531a commented Mar 13, 2018

🙏😌 that's so good! thx!

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